diff --git "a/main.11f67475b635b939fde7.js" "b/main.11f67475b635b939fde7.js" new file mode 100644--- /dev/null +++ "b/main.11f67475b635b939fde7.js" @@ -0,0 +1,30040 @@ +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8e2d0bcd-0399-4789-a050-6a8273cf9770",e._sentryDebugIdIdentifier="sentry-dbid-8e2d0bcd-0399-4789-a050-6a8273cf9770")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"5.21.0"},(self.webpackChunktaskcade=self.webpackChunktaskcade||[]).push([[179],{2352:(e,t,a)=>{var n={"./ar/strings.json":[39203,203],"./cs/strings.json":[10050,50],"./da/strings.json":[16028,28],"./de/strings.json":[75793,793],"./en-GB/strings.json":[93530,741],"./en-US/strings.json":[13518,518],"./es/strings.json":[92543,543],"./fa/strings.json":[25703,703],"./fi/strings.json":[94728,728],"./fr/strings.json":[11895,654],"./he/strings.json":[72375,375],"./hu/strings.json":[28338,338],"./id/strings.json":[20698,698],"./it/strings.json":[48681,681],"./ja/strings.json":[23992,992],"./ko/strings.json":[30994,994],"./nl/strings.json":[64516,516],"./no/strings.json":[85423,423],"./pl/strings.json":[69257,257],"./pt/strings.json":[77659,659],"./ro/strings.json":[27086,86],"./ru/strings.json":[57884,884],"./sk/strings.json":[81833,833],"./sv/strings.json":[53235,235],"./ta/strings.json":[35656,656],"./th/strings.json":[64024,24],"./tr/strings.json":[8430,430],"./uk/strings.json":[22045,45],"./vi/strings.json":[23197,197],"./zh-Hans/strings.json":[59193,193],"./zh-Hant/strings.json":[95015,468]};function l(e){if(!a.o(n,e))return Promise.resolve().then(()=>{var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],l=t[0];return a.e(t[1]).then(()=>a.t(l,19))}l.keys=()=>Object.keys(n),l.id=2352,e.exports=l},46700:(e,t,a)=>{var n={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function l(e){return a(r(e))}function r(e){if(!a.o(n,e)){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}l.keys=function(){return Object.keys(n)},l.resolve=r,e.exports=l,l.id=46700},1413:(e,t,a)=>{"use strict";let n,l;var r,o,i,s,d,c,m,u,p,g,f,h,y,b,v,k,E,x,_,w,N,C,M,S,I,D,T,$,P,F,A,R,j,O,U,Z,L,B,z,V,q,W,H,G,K,Y,Q,J,X,ee,et,ea=a(30990),en=a(27923),el=a(35212),er=a(64487),eo=a(54824),ei=a(61805),es=a(12902),ed=a(27361),ec=a.n(ed),em=a(14293),eu=a.n(em),ep=a(73935),eg=a(54441),ef=a(24975),eh=a(98601),ey=a(10810),eb=a(90071),ev=a(67294),ek=a(97779),eE=a(29804),ex=a(30797),e_=a(53894),ew=a(63992),eN=a(53768),eC=a(47791),eM=a(85945),eS=a(90041),eI=a(29730),eD=a(92363),eT=a(70405),e$=a(28216),eP=a(87558),eF=a(16550);let eA=":isInbox(lists)",eR=":isNewDocument(new)",ej=":isTemplate(template)",eO=":documentType(from)",eU=":documentType",eZ={index:"/",newTemplate:`/${eR}/${ej}`,newList:`/${eR}`,newTemplateFromDocumentID:`/${eR}/${ej}/${eO}/:documentID`,newListFromDocumentID:`/${eR}/${eO}/:documentID`,newTemplateWithDocumentType:`/${eR}/${ej}/${eU}`,newListWithDocumentType:`/${eR}/${eU}`,inboxNewTemplate:`/${eA}/${eR}/${ej}`,inboxNewList:`/${eA}/${eR}`,inboxNewTemplateFromDocumentID:`/${eA}/${eR}/${ej}/${eO}/:documentID`,inboxNewListFromDocumentID:`/${eA}/${eR}/${eO}/:documentID`,inboxNewTemplateWithDocumentType:`/${eA}/${eR}/${ej}/${eU}`,inboxNewListWithDocumentType:`/${eA}/${eR}/${eU}`,spaceNewTemplate:`/spaces/:spaceID/${eR}/${ej}`,spaceNewList:`/spaces/:spaceID/${eR}`,spaceNewTemplateFromDocumentID:`/spaces/:spaceID/${eR}/${ej}/${eO}/:documentID`,spaceNewListFromDocumentID:`/spaces/:spaceID/${eR}/${eO}/:documentID`,spaceNewTemplateWithDocumentType:`/spaces/:spaceID/${eR}/${ej}/${eU}`,spaceNewListWithDocumentType:`/spaces/:spaceID/${eR}/${eU}`,spaceIndex:"/:type(spaces|subspaces)/:spaceID/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents|flows)?/:subspaceID?/:documentType(tasks|roadmap|templates|archive|media|agents|flows)?",spaceSettings:"/:type(spaces|subspaces)/:spaceId/settings/:settingsType(members|folders)",subspaceJoin:"/spaces/:spaceID/subspaces/:subspaceID/join",spaceOnly:"/spaces",sharedSubspace:"/subspaces",recentIndex:"/recent",activityIndex:"/activity",calendarIndex:"/calendar",starredIndex:"/lists/starred",myTasks:"/my-tasks",shared:"/shared",editor:"/:documentPathType(v|e)/:documentViewOrEditID/:isEmbedded(embed)?",signUp:"/signup",signIn:"/login",mfaAuthenticate:"/mfa/authenticate",forgotPassword:"/forgot",resetPassword:"/reset/:passwordResetRequestID",search:"/search",verifyEmail:"/verify-email/:token",ssoDesktop:"/sso/desktop",ssoMobile:"/sso/mobile",print:"/print/:documentID",document:"/d/:documentID",embed:"/embed/:documentID",settings:"/settings",add:"/add",appSumoWelcome:"/appsumo/welcome",authFlowOAuth2Completing:"/auth/flow/oauth2/completing"};var eL=a(61233),eB=a(71641),ez=a(26007),eV=a(18156),eq=a(96486),eW=a.n(eq),eH=a(80008),eG=a.n(eH),eK=a(86896),eY=a(44012);function eQ(e,t){let[a,n]=ev.useState(()=>{if("undefined"==typeof window)return t;try{let a=window.localStorage.getItem(e);return a?JSON.parse(a):t}catch(e){return console.log(e),t}});return[a,ev.useCallback(t=>{n(a=>{let n=t instanceof Function?t(a):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(n))}catch(e){console.warn(e)}return n})},[e])]}var eJ=a(88306);let eX=a.n(eJ)()(function(e){return null!=e.match(/Electron/i)});function e0(){if("undefined"==typeof window)return null;let{IS_MAC_APP_STORE:e,IS_MICROSOFT_STORE:t,IS_ELECTRON:a,ELECTRON_INFO:n}=window;return"object"==typeof n?n.isMAS?"mac_app_store":n.isMicrosoftStore?"windows_app_store":"standalone":!0===e?"mac_app_store":!0===t?"windows_app_store":!0===a||eX(window.navigator.userAgent)?"standalone":null}var e1=a(8274);let e2=eL.default.a.withConfig({displayName:"styled__AlertWrapper",componentId:"sc-66b2583e-0"})` + display: inline-flex; + padding: 8px 16px; + margin: 20px; + margin-bottom: 0; + border-radius: 10px; + background: ${e=>e.$colorScheme?.alpha10??e.theme.backgroundColorHex}; + color: ${e=>e.$colorScheme?.base??e.theme.textColors.default}; + border: 1px solid ${e=>e.$colorScheme?.base??e.theme.borderColorHex}; + + &:hover { + color: ${e=>e.$colorScheme?.base??e.theme.textColors.default}; + } +`,e5=eL.default.div.withConfig({displayName:"styled__AlertAnchorWrapper",componentId:"sc-66b2583e-1"})` + margin-left: auto; + color: ${e=>e.$colorScheme?.base??e.theme.appColors.hex(40)}; + display: flex; + align-items: center; + + &:hover { + color: ${e=>e.$colorScheme?.alpha50??e.theme.appColors.hex(10)}; + } +`,e3=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__OverlineTitle",componentId:"sc-66b2583e-2"})` + padding-bottom: 12px; +`,e4=eL.default.div.withConfig({displayName:"styled__SelectMenuWrapper",componentId:"sc-66b2583e-3"})` + display: flex; + flex-direction: column; + margin: 20px; +`,e6=eL.default.div.withConfig({displayName:"styled__OptionsWrapper",componentId:"sc-66b2583e-4"})` + display: flex; + align-items: center; + padding-left: 20px; + + & svg { + color: ${e=>e.theme.appColors.hex(50)}; + flex-shrink: 0; + } +`,e8=(0,eL.default)(e6).withConfig({displayName:"styled__OptionsWrapperWithIcon",componentId:"sc-66b2583e-5"})` + & > div:first-child { + flex: 1 0 auto; + } +`,e7=eL.default.span.withConfig({displayName:"styled__OptionsLabel",componentId:"sc-66b2583e-6"})` + margin: 0 8px; + color: ${e=>e.theme.textColors.hex(10)}; +`,e9=eL.default.span.withConfig({displayName:"styled__TextEmptyState",componentId:"sc-66b2583e-7"})` + color: ${e=>e.theme.textColors.hex(50)}; +`;var te=a(50049);let tt={no_memberships_found:{messageDescriptor:(0,te.Em)({id:"general.quickadd_workspace_empty",defaultMessage:"No workspaces found"})},no_projects_fetch:{messageDescriptor:(0,te.Em)({id:"general.quickadd_no_projects_fetch",defaultMessage:"Unable to get projects"})},failed_to_add_tasks:{messageDescriptor:(0,te.Em)({id:"general.quickadd_failed_to_add_task",defaultMessage:"Failed to add task to project"})},selected_project_missing:{messageDescriptor:(0,te.Em)({id:"general.quickadd_project_not_selected",defaultMessage:"No projects selected"})},error_generic:{messageDescriptor:(0,te.Em)({id:"generic_error_occurred",defaultMessage:"An error occurred"})}},ta=function(e){let{errorType:t}=e,a=(0,eI.getColorScheme)(eI.ThemeColors.danger),n=(0,eK.Z)(),l=ev.useMemo(()=>{let e=tt.error_generic;return t in tt&&(e=tt[t]),n.formatMessage(e.messageDescriptor)},[t,n]);return ev.createElement(e2,{$colorScheme:a},l)};var tn=a(84948);let tl=function(e){let{projectId:t,nodeId:a}=e,n=(0,eI.getColorScheme)(eI.ThemeColors.success),l=ev.useMemo(()=>{let e=new URL(`/d/${t}`,"https://www.taskade.com");return null!=a&&(e.hash=`#node-${a}`),e.toString()},[a,t]);return ev.createElement(e2,{$colorScheme:n,onClick:e=>{e.stopPropagation()},href:l,target:"_blank",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.quickadd_success_message",defaultMessage:"Added to project! View task."}),ev.createElement(e5,{$colorScheme:n},ev.createElement(tn.Icon,{icon:"dd_external_link"})))};function tr(){return[{name:"offset",options:{offset:[-7,5]}},{name:"flip",options:{fallbackPlacements:["top","right"]}}]}var to=a(74221),ti=a(41609),ts=a.n(ti),td=a(75472),tc=a.n(td),tm=a(45578),tu=a.n(tm);let tp=eL.default.div.withConfig({displayName:"EmptyState",componentId:"sc-ba6a8e35-0"})` + padding: 0 1rem 1rem; + color: ${e=>e.theme.appColors.hex(50)}; +`,tg=eL.default.span.withConfig({displayName:"ErrorMessage__Container",componentId:"sc-f02f6e7a-0"})` + ${e1.UiTypography.sm}; + + color: ${eI.ThemeColors.danger}; +`,tf=function(){return ev.createElement(tg,null,ev.createElement(eY.Z,{id:"general.generic_error_occurred",defaultMessage:"An error occurred."}))},th=eL.default.span.withConfig({displayName:"InvalidRenderWarning__Warning",componentId:"sc-c41e116a-0"})` + display: block; + color: ${eI.ThemeColors.danger}; +`,ty=function(e){return ev.createElement(th,null,"Missing component for render string '",e.render,"'")},tb=eL.default.div.withConfig({displayName:"Item__Container",componentId:"sc-387aa1cc-0"})` + display: block; + padding: 0.5rem 1rem; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$focused&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,tv=function(e){let t=ev.useRef(null);return ev.useEffect(()=>{e.focused&&t.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[e.focused]),ev.createElement(tb,{ref:t,$focused:e.focused},e.label)},tk=eL.default.div.withConfig({displayName:"Loading__Container",componentId:"sc-506e1615-0"})` + display: flex; + align-items: center; +`,tE=function(){return ev.createElement(tk,null,ev.createElement(eI.Spinner,null))},tx=(0,eL.default)(e1.Overline).withConfig({displayName:"Section__StyledOverline",componentId:"sc-28dd40f1-0"})` + font-size: 0.7rem; + font-weight: 500; + padding: 0.5rem 1rem; +`,t_=function(e){return ev.createElement(tx,null,e.label)};var tw=a(23279),tN=a.n(tw);let tC=(e,t)=>{switch(t.type){case"loading":return{data:[],loading:!0,error:null};case"loaded":return{data:t.data,loading:!1,error:null};case"error":return{data:[],loading:!1,error:t.error}}},tM=(0,eL.css)` + scrollbar-width: thin; + scrollbar-color: transparent transparent; + &:hover { + scrollbar-color: ${e=>e.theme.isNightMode?"#333":"#f4f4f4"} transparent; + } + &::-webkit-scrollbar { + height: 10px; + width: 10px; + } + &::-webkit-scrollbar-track { + background: transparent; + } + &::-webkit-scrollbar-thumb { + border: 2px solid ${e=>e.theme.isNightMode?"#1C1C1C":"#fff"}; + background-color: ${e=>e.theme.isNightMode?"#333":"#f4f4f4"}; + border-radius: 10px; + visibility: visible; + } + ::-webkit-scrollbar-corner { + background: rgba(0, 0, 0, 0); + } +`,tS=(0,eL.css)` + ${tM} + &&::-webkit-scrollbar-thumb { + visibility: hidden; + } + &:hover::-webkit-scrollbar-thumb { + visibility: visible; + } +`,tI=eL.default.div.withConfig({displayName:"styled__ScrollbarWrapper",componentId:"sc-efc29d9e-0"})` + max-height: calc(100vh / 2.5); + overflow: auto; + scrollbar-gutter: auto; + padding: ${e=>!e.$hidePadding&&"0.25rem 0"}; + pointer-events: auto; + cursor: pointer; + ${tM} + + &::-webkit-scrollbar { + width: 7px; + } + + &::-webkit-scrollbar-thumb { + border: none; + background-color: ${e=>e.theme.isNightMode?"rgba(51, 51, 51, 0.5)":"rgba(244, 244, 244, 0.5)"}; + } +`,tD=eL.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-efc29d9e-1"})` + width: 100%; + background: ${e=>e.theme.appColors.hex(70)}; + height: 1px; + margin: 4.5px 0px; + margin: var(--menu-item-divider-margin); +`,tT=ev.forwardRef(function(e,t){let{term:a,data:n,renderMap:l,sectionRenderMap:r,search:o,generate:i,onActivate:s,renderEmptyState:d,renderLoading:c,renderError:m}=e,[u,p]=(0,ev.useState)(0),g=(0,ev.useRef)(0),f=(0,ev.useRef)(new Map),h=ev.useRef(null),{data:y,loading:b,error:v}=function(e,t){let[a,n]=ev.useReducer(tC,{data:[],loading:!1,error:null});return ev.useEffect(()=>{if(null==t)return;async function a(){if(null!=t){n({type:"loading"});try{let a=await t(e);n({type:"loaded",data:a})}catch(e){n({type:"error",error:e})}}}let l=tN()(a,200);return l(),()=>{l.cancel()}},[e,t]),a}(a,i);(0,ev.useImperativeHandle)(t,()=>({focusPrevItem(){p(e=>Math.max(0,e-1)),u<=1&&null!=h.current&&(h.current.scrollTop=0)},focusNextItem(){p(e=>Math.min(g.current,e+1))},activateCurrentItem(){let e=f.current.get(u);null!=e&&s(e)},getVisibleItemCount:()=>f.current.size}));let k=(0,ev.useMemo)(()=>{let e=[],t=0;for(let l of(f.current.clear(),n)){let n=[];for(let e of 0===a.length?l.items:o(a,l.items))n.push({...e,index:t}),f.current.set(t,e),t+=1;n.length>0&&e.push({...l,items:n})}if(a.length>0&&y.length>0)for(let a of y){let n=[];for(let e of a.items)n.push({...e,index:t}),f.current.set(t,e),t+=1;n.length>0&&e.push({...a,items:n})}return g.current=t-1,e},[n,y,o,a]);return(0,ev.useEffect)(()=>{p(0)},[a]),ev.createElement(tI,{ref:h,$hidePadding:0===k.length&&!b},null==v&&ev.createElement(ev.Fragment,null,k.map((e,t)=>{let a=t_;if(null!=e.render){if(null==r)return console.warn(`section '${e.label}' has 'render' field populated, but sectionRenderMap is not provided`),ev.createElement(ty,{render:e.render});if(!(e.render in r))return console.warn(`No matching component for '${e.render}', rendering nothing.`),ev.createElement(ty,{render:e.render});a=r[e.render]}return ev.createElement(ev.Fragment,{key:`${e.label}_${t}`},null!=a&&ev.createElement(a,{type:"section",label:e.label,itemCount:e.items.length}),e.items.map(e=>{let t=tv;if(null!=e.render){if(!(e.render in l))return console.warn(`No matching component for '${e.render}', rendering nothing.`),ev.createElement(ty,{render:e.render});t=l[e.render]}return ev.createElement(t,{key:e.index,type:"item",label:e.label,values:e.values,data:e.data,focused:u===e.index,focus:()=>p(e.index),activate:()=>{p(e.index),s(e)}})}),t!==k.length-1&&ev.createElement(tD,null))}),0===k.length&&!b&&(d??ev.createElement(tp,null,ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"})))),b&&(c??ev.createElement(tE,null)),null!=v&&(m??ev.createElement(tf,null)))}),t$=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-f7ffc9c0-0"})` + display: flex; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + width: ${eI.UiSpacing.getPx(64)}; + ${e=>null!=e.width&&(0,eL.css)` + width: ${e.width}; + `} + ${e=>null!=e.padding&&(0,eL.css)` + padding: ${e.padding}; + `} +`,tP=eL.default.button.attrs({type:"button"}).withConfig({displayName:"styled__PillButton",componentId:"sc-f7ffc9c0-1"})` + display: inline-flex; + align-items: center; + border: 0; + padding: 1px 8px; + background: transparent; + cursor: pointer; + white-space: nowrap; + margin-right: 5px; + border-radius: 30px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.$assigned?e.theme.isNightMode?"#e5e5e5":"#333333":e.theme.isNightMode?"#e5e5e5":"#333"}; + + & .meta-icon { + transform: scale(1); + & > path { + stroke: ${e=>e.$assigned?e.theme.isNightMode?"#e5e5e5":"#333333":e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } + + & .meta-avatar { + border 1px solid ${e=>e.theme.isNightMode?"#292929":"#f8f8f8"}; + } + + &:focus { + outline: none; + } + + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + color: ${e=>e.theme.textColors.hex(10)}; + + & .meta-icon { + & > path { + stroke: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; + } + } + & .meta-avatar { + border 1px solid ${e=>e.theme.isNightMode?"#333333":"#e5e5e5"}; + } + } +`,tF=eL.default.span.withConfig({displayName:"styled__PillButtonText",componentId:"sc-f7ffc9c0-2"})` + margin-left: 5px; + ${e1.UiTypography.xs}; + display: flex; +`,tA=eL.default.div.withConfig({displayName:"styled__MenuContainer",componentId:"sc-f7ffc9c0-3"})` + display: flex; + flex-direction: column; + padding: ${eI.UiSpacing.getPx(3.5)} 0; +`,tR=eL.default.div.withConfig({displayName:"styled__MenuItemContainer",componentId:"sc-f7ffc9c0-4"})` + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + overflow-wrap: break-word; + overflow: hidden; + white-space: normal; + margin-right: 10px; + width: 100%; +`,tj=eL.default.span.withConfig({displayName:"styled__MenuItemLabel",componentId:"sc-f7ffc9c0-5"})` + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + margin-right: 5px; + padding: 6.529px 0; + width: 80%; +`,tO=eL.default.span.withConfig({displayName:"styled__MenuHeader",componentId:"sc-f7ffc9c0-6"})` + margin: 4px 20px 4px ${eI.UiSpacing.getPx(3.5)}; + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.xs}; + text-transform: uppercase; +`;var tU=a(1469),tZ=a.n(tU),tL=a(17563),tB=a(22222),tz=a(35369),tV=a(82677);let tq={activeSubscription:null,avatars:{},id:"",defaultName:"",displayName:null,handle:"",email:"",pendingEmail:null,pendingEmailType:null,initials:"",referralCode:"",timezone:"",locale:"",preferences:{}},tW=new tV.fK.Entity("users");class tH extends(0,tz.Record)(tq){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new tH(e)}get avatar(){return ec()(this,["avatars","mdpi","url"],"https://taskade.com/images/no-avatar.png")}get smallAvatar(){return ec()(this,["avatars","small","hdpi","url"],this.avatar)}}function tG(e){try{return decodeURIComponent(e)}catch(e){return""}}function tK(e){return ec()(e,["router","location"],null)}function tY(e){return ec()(e,["router","location","pathname"],null)}function tQ(e){return ec()(e,["router","location","search"],null)}function tJ(e){let t=e?.auth?.user??null;return null==t?null:new tH(t)}function tX(e){return ec()(e,["auth","user"],null)}function t0(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(a){return tZ()(e)?ec()(a,["auth","user","preferences",...e],t):ec()(a,["auth","user","preferences",e],t)}}let t1=t0("onboardAddSpace0001"),t2=t0("onboardInvite0001"),t5=t0("seenTour001Step2"),t3=t0("seenTour001Step3"),t4=t0("seenTour001Step4"),t6=t0("seenTour001Step5"),t8=t0("hideGetStartedTemplate"),t7=(0,tB.P1)([tX],e=>eu()(e)?null:new tH(e)),t9=(0,tB.P1)([tX],e=>!eu()(e));function ae(e){return ec()(e,["auth","accounts","errors"],[])}(0,tB.P1)([tJ],e=>e?{email:e.email,displayname:e.displayName,username:e.handle,timezone:e.timezone,locale:e.locale}:{});let at=(0,tB.P1)([tQ],e=>{if(e){let t=tL.parse(e);return{email:tG(t?.email??""),list:tG(t?.list??""),copy:tG(t?.copy??""),redirect:tG(t?.redirect??""),referral:tG(t?.referral??"")}}return{}}),aa=(0,tB.P1)([tQ],e=>{if(e){let t=tL.parse(e);return{email:ec()(t,["email"],""),list:ec()(t,["list"],""),copy:ec()(t,["copy"],""),redirect:ec()(t,["redirect"],""),referral:ec()(t,["referral"],"")}}return{}}),an=eL.default.div.withConfig({displayName:"Avatar__AvatarContainer",componentId:"sc-11a3340d-0"})` + position: relative; + left: 2px; + ${e=>` + height: ${e.$size}px; + width: ${e.$size}px; + background: ${e.theme?.isNightMode?"#666666":"#e5e5e5"}; + border-radius: ${e.$radius??e.$size}px; + flex-shrink: 0; + `} +`,al=eL.default.img.withConfig({displayName:"Avatar__AvatarImg",componentId:"sc-11a3340d-1"})` + vertical-align: top; + width: 100%; + background: transparent; + border-radius: ${e=>e.$radius??e.$size}px; +`,ar=eL.default.div.withConfig({displayName:"Avatar__OnlineIndicator",componentId:"sc-11a3340d-2"})` + display: flex; + width: ${e=>e.$presenceSize??8}px; + height: ${e=>e.$presenceSize??8}px; + background: #43bc6a; + box-shadow: 0 0 0 2px rgba(67, 188, 106, 0.1); + border-radius: 8px; + position: absolute; + bottom: -1px; + left: 3px; +`,ao=function(e){let{avatars_v2:t,handle:a,size:n,radius:l,userID:r,hidePresence:o,presenceSize:i}=e,s=(0,e$.useSelector)(e=>(function(e,t){let a=t7(e);return a?.id===t||e.presence.users.has(t)})(e,r));return ev.createElement(an,{$size:n,$radius:l},ev.createElement(al,{src:t?.small?.ldpi?.url,alt:a.substr(0,2).toUpperCase(),$size:n,$radius:l}),!o&&s&&ev.createElement(ar,{$presenceSize:i}))},ai=eL.default.span.withConfig({displayName:"AssigneeMenuItem__SubLabel",componentId:"sc-22fabf6a-0"})` + color: ${e=>e.theme.appColors.hex(50)}; + padding-right: 10px; + ${e1.UiTypography.xs}; +`,as=eL.default.span.withConfig({displayName:"AssigneeMenuItem__AssigneeWrapper",componentId:"sc-22fabf6a-1"})` + color: ${e=>e.theme.appColors.hex(50)}; + display: -webkit-inline-box; + text-overflow: ellipsis; + white-space: pre-wrap; + overflow-wrap: break-word; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-height: 20px; +`,ad=eL.default.div.withConfig({displayName:"AssigneeMenuItem__Container",componentId:"sc-22fabf6a-2"})` + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + overflow-wrap: break-word; + overflow: hidden; + white-space: nowrap; + width: 100%; + opacity: ${e=>e.$disabled?.5:1}; + + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + + &:hover { + cursor: pointer; + } + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,ac=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"AssigneeMenuItem__CheckIcon",componentId:"sc-22fabf6a-3"})` + margin-left: auto; + color: ${e=>e.theme.primaryColorScheme?.base}; +`,am=function(e){let{morseChildProps:t}=e,{user:a,disabled:n,hidePresence:l,checked:r}=t.data,{handle:o,default_name:i}=a;return ev.createElement(ad,{$disabled:n??!1,$active:t.focused,onClick:t.activate,onMouseEnter:t.focus},ev.createElement(ao,{avatars_v2:a.avatars_v2,handle:a.handle,userID:parseInt(a.id,10),size:22,hidePresence:l}),ev.createElement(as,null,ev.createElement(tj,null,o),ev.createElement(ai,null,i)),r&&ev.createElement(ac,null))},au=eL.default.span.withConfig({displayName:"NonMemberAssigneeMenuItem__AssigneeWrapper",componentId:"sc-4d54417d-0"})` + color: ${e=>e.theme.appColors.hex(50)}; + display: -webkit-inline-box; + text-overflow: ellipsis; + white-space: pre-wrap; + overflow-wrap: break-word; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-height: 20px; +`,ap=eL.default.div.withConfig({displayName:"NonMemberAssigneeMenuItem__Container",componentId:"sc-4d54417d-1"})` + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + overflow-wrap: break-word; + overflow: hidden; + white-space: nowrap; + width: 100%; + opacity: ${e=>e.$disabled?.5:1}; + + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + + &:hover { + cursor: pointer; + } + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,ag=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"NonMemberAssigneeMenuItem__CheckIcon",componentId:"sc-4d54417d-2"})` + margin-left: auto; + color: ${e=>e.theme.primaryColorScheme?.base}; +`,af=function(e){let{morseChildProps:t}=e,{user:a,disabled:n,hidePresence:l,checked:r}=t.data,{handle:o}=a;return ev.createElement(ap,{$disabled:n??!1,$active:t.focused,onClick:t.activate,onMouseEnter:t.focus},ev.createElement(ao,{avatars_v2:a.avatars_v2,handle:a.handle,userID:a.id,size:22,hidePresence:l}),ev.createElement(au,null,ev.createElement(tj,null,o)),r&&ev.createElement(ag,null))},ah="AssigneeMenuItem",ay="NonMemberAssigneeMenuItem",ab={[ah]:e=>ev.createElement(am,{morseChildProps:e}),[ay]:e=>ev.createElement(af,{morseChildProps:e})},av=eL.default.div.withConfig({displayName:"styled__PopupWrapper",componentId:"sc-8288358f-0"})` + width: 280px; + height: auto; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: ${eI.UiSpacing.getPx(3.5)} 0; +`,ak=eL.default.div.withConfig({displayName:"styled__InputWrapper",componentId:"sc-8288358f-1"})` + display: flex; + align-items: center; + margin: 0 0.8rem 0.5rem; +`,aE=eL.default.input.withConfig({displayName:"styled__Input",componentId:"sc-8288358f-2"})` + flex-grow: 1; + background: none; + color: ${e=>e.theme.appColors.hex(10)}; + + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,ax=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),a_=function(e){let{assignees:t,nonMemberAssignees:a=[],members:n,currentUserId:l,hideUserPresence:r,onUserSelect:o,onPopupClose:i,onPopupBlur:s}=e,d=(0,eK.Z)(),[c,m]=ev.useState(""),[u,p]=ev.useState(null),g=ev.useCallback(e=>tc()(e,[e=>e.id===l,"handle"],["desc","asc"]),[l]),f=ev.useMemo(()=>d.formatMessage({id:"general.filter",defaultMessage:"Filter"}),[d]),[h]=ev.useState(()=>{let e=g(t),a=g(n);return tu()([...e,...a],"id")}),y=ev.useMemo(()=>new to.Z(h,{keys:["handle","display_name"]}),[h]),b=ev.useMemo(()=>ts()(c)?h:y.search(c).map(e=>e.item),[c,h,y]),v=ev.useMemo(()=>new Set(t.map(e=>e.id)),[t]),k=ev.useRef(null),E=ev.useMemo(()=>[{type:"section",label:d.formatMessage({id:"general.assign_to",defaultMessage:"Assign to"}),items:b.map(e=>{let t=[e.handle];return null!=e.display_name&&t.push(e.display_name),{label:e.handle,itemType:"assignee",values:t,data:{user:e,hidePresence:r,checked:v.has(e.id)},render:ah}})},{type:"section",label:d.formatMessage({id:"general.not_members",defaultMessage:"Not members"}),items:a.map(e=>{let t=[e.handle];return null!=e.display_name&&t.push(e.display_name),{label:e.handle,itemType:"non_member_assignee",values:t,data:{user:e,hidePresence:r,checked:!0},render:ay}})}],[v,r,d,a,b]),x=ev.useCallback(e=>{o(e.data.user)},[o]);return ev.useLayoutEffect(()=>{if(null==u)return;let e=requestAnimationFrame(()=>{u.focus()});return()=>{cancelAnimationFrame(e)}},[u]),ev.createElement(av,null,ev.createElement(ak,null,ev.createElement(aE,{ref:p,value:c,onChange:e=>{m(e.target.value)},onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:i(e);break;case eI.KeyboardKeys.Space:break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),k.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),k.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:k.current?.activateCurrentItem()}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onBlur:s,placeholder:f})),ev.createElement(tT,{ref:k,term:c,data:E,search:ax,renderMap:ab,onActivate:x}))},aw={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectMentionablesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectMembersLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"members"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"projectMembersLimit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]};function aN(e){let{projectId:t}=e,{data:a,loading:n}=(0,eB.a)(aw,null!=t?{variables:{projectId:t,projectMembersLimit:30}}:{skip:!0}),l=ev.useMemo(()=>{if(null==a||null==a.document)return[];let{space:e,members:t}=a.document,n=[],l=e?.memberships?.map(e=>e.user??null)??[],r=t?.edges?.map(e=>e?.node?.user??null)??[];for(let e of tu()([...l,...r],e=>e?.id))null!=e&&n.push(e);return n},[a]);return ev.useMemo(()=>n?{loading:!0,users:[]}:{loading:!1,users:l},[n,l])}let aC=function(e){let{selectedAssignees:t,projectId:a,userId:n,handleUserSelect:l}=e,{users:r,loading:o}=aN({projectId:a}),i=e=>null!=e&&"object"==typeof e&&"__typename"in e&&"User"===e.__typename;return o?ev.createElement(eI.Spinner,null):ev.createElement(a_,{assignees:t,members:r,currentUserId:n??null,hideUserPresence:!0,onUserSelect:e=>{i(e)&&l(e)},onPopupClose:()=>{},onPopupBlur:()=>{}})},aM=function(e){let{menuButtonProps:t,handleClick:a,selectedAssignees:n}=e;if(0===n.length)return ev.createElement(aS,{...t,onClick:a},ev.createElement(tn.Icon,{icon:"addon_assign"}),ev.createElement(eY.Z,{id:"general.assign",defaultMessage:"Assign"}));let l=n.map(e=>e.handle),r=n.map(e=>ev.createElement(aI,{key:e.id,src:e.avatars_v2?.small?.mdpi.url,alt:e.handle}));return ev.createElement(aS,{...t,onClick:a},r," ",ev.createElement(aD,null,l.join(", ")))},aS=eL.default.button.withConfig({displayName:"AssigneesButton__Button",componentId:"sc-d5310298-0"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + column-gap: 4px; + + padding: ${eI.UiSpacing.getPx(.5)} ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(.5)} + ${eI.UiSpacing.getPx(2)}; + + border-radius: 20px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(20)}; + + margin-left: ${eI.UiSpacing.getPx(1)}; +`,aI=(0,eL.default)(e1.UserAvatar).attrs({size:"xs",shape:"circle"}).withConfig({displayName:"AssigneesButton__Avatar",componentId:"sc-d5310298-1"})` + margin-left: -5px; + + &:first-child { + margin-left: 0; + } +`,aD=eL.default.span.withConfig({displayName:"AssigneesButton__Assignees",componentId:"sc-d5310298-2"})` + margin: 0 5px; + white-space: nowrap; +`,aT=function(e){let{selectedAssignees:t,projectId:a,userId:n,handleSelectedAssigneesChange:l}=e,r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:i,placement:"bottom",computeModifiersCallback:tr}),c=(0,eI.useMenuButton)({ref:r,state:i,dispatch:s});return ev.createElement(ev.Fragment,null,ev.createElement(aM,{selectedAssignees:t,menuButtonProps:c.props,handleClick:()=>{null!=a&&(i.expanded?s({type:"Collapse"}):s({type:"Expand"}))}}),i.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:s,modal:!0},ev.createElement(aC,{selectedAssignees:t,projectId:a,userId:n,handleUserSelect:l})))},a$=eL.default.span.withConfig({displayName:"Block",componentId:"sc-a75a3072-0"})` + color: ${e=>e.theme.textColors.hex(10)}; + padding-left: 20px; + + & svg { + margin-left: 8px; + color: ${e=>e.theme.textColors.hex(50)}; + } + + ${e=>e.$isUntitled&&(0,eL.css)` + color: ${e.theme.textColors.hex(60)}; + `} +`,aP=eL.default.span.withConfig({displayName:"Block__BlockEmptyState",componentId:"sc-a75a3072-1"})` + color: ${e=>e.theme.textColors.hex(50)}; + + & svg { + margin-left: 8px; + color: ${e=>e.theme.textColors.hex(50)}; + } +`,aF=function(e){let{block:t}=e;return null==t?ev.createElement(e6,null,ev.createElement(aP,null,ev.createElement(eY.Z,{id:"general.quickadd_not_selected",defaultMessage:"Not Selected"})),ev.createElement(tn.Icon,{icon:"default_caret_right"})):ev.createElement(e6,null,ev.createElement(a$,{$isUntitled:0===t.textString.length},t.textString||"Untitled"),ev.createElement(tn.Icon,{icon:"default_caret_right"}))};var aA=a(24350),aR=a.n(aA);let aj=[{messageDescriptor:(0,te.Em)({id:"general.quickadd_placement_top",defaultMessage:"Top"}),value:"TOP"},{messageDescriptor:(0,te.Em)({id:"general.quickadd_placement_bottom",defaultMessage:"Bottom"}),value:"BOTTOM"}],aO=aR()(aj,"value"),aU=function(e){let{placement:t}=e,a=(0,eK.Z)(),n=ev.useMemo(()=>{let e=aO.BOTTOM;return t in aO&&(e=aO[t]),a.formatMessage(e.messageDescriptor)},[a,t]);return ev.createElement(e6,null,ev.createElement(e7,null,n),ev.createElement(tn.Icon,{icon:"default_caret_right"}))},aZ=eL.default.a.withConfig({displayName:"Link__StyledAnchor",componentId:"sc-dce093fc-0"})` + margin-left: auto; + color: ${e=>e.theme.appColors.hex(40)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,aL=function(e){let{href:t}=e;return ev.createElement(aZ,{onClick:e=>{e.stopPropagation()},href:t,target:"_blank",rel:"noopener noreferrer"},ev.createElement(tn.Icon,{icon:"dd_external_link"}))},aB=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-450e79b0-0"})` + display: flex; + align-items: center; + padding: 5px 10px 5px; + border-radius: 10px; + margin-bottom: 3px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + } +`,az=eL.default.span.withConfig({displayName:"styled__Text",componentId:"sc-450e79b0-1"})` + color: ${e=>e.theme.textColors.hex(10)}; + + ${e=>e.$isUntitled&&(0,eL.css)` + color: ${e.theme.textColors.hex(60)}; + `} +`,aV=function(e){let{projectId:t,node:a,onSelect:n}=e,l=(0,ev.useMemo)(()=>{let e=new URL(`/d/${t}`,"https://www.taskade.com");return e.hash=`#node-${a.id}`,e.toString()},[t,a]);return ev.createElement(aB,{onClick:()=>{n(a.id)}},ev.createElement(az,{$isUntitled:0===a.textString.length},a.textString||"Untitled"),ev.createElement(aL,{href:l}))},aq=eL.default.span.withConfig({displayName:"BlockEmptyState__Text",componentId:"sc-6a62beb5-0"})` + color: ${e=>e.theme.textColors.hex(50)}; +`,aW=function(e){let{onSelect:t}=e;return ev.createElement(aB,{onClick:()=>{t(null)}},ev.createElement(aq,null,ev.createElement(eY.Z,{id:"general.quickadd_remove_selection",defaultMessage:"Remove Selection"})))},aH=new Set(["h1","h2"]),aG=function(e){let{projectId:t,contents:a,onSelect:n}=e,l=ev.useMemo(()=>null==a?(0,tz.List)([]):a.rootNode.children.map(e=>a.findNodeByID(e)).filter(e=>{if(e?.textString?.length===0)return!1;let t=e?.format?.node;return null!=t&&aH.has(t)}),[a]);return null==t?ev.createElement(e4,null,ev.createElement(e3,null,ev.createElement(eY.Z,{id:"general.block",defaultMessage:"Block"})),ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_project_not_selected",defaultMessage:"No projects selected"}))):ev.createElement(e4,null,ev.createElement(e3,null,ev.createElement(eY.Z,{id:"general.block",defaultMessage:"Block"})),ev.createElement(aW,{onSelect:n}),l.map(e=>ev.createElement(aV,{projectId:t,key:e.id,node:e,onSelect:n})))};var aK=a(96863);(function(e){e.Start="start",e.End="end"})(r||(r={})),function(e){e[e.OutsideMonth=0]="OutsideMonth",e[e.Singular=1]="Singular",e[e.Start=2]="Start",e[e.End=3]="End",e[e.Today=4]="Today",e[e.InRange=5]="InRange",e[e.ModeActive=6]="ModeActive"}(o||(o={})),function(e){e.MustHaveStart="must_have_start",e.MustHaveEnd="must_have_end",e.None="none"}(i||(i={})),function(e){e.StartDate="start_date",e.EndDate="end_date",e.None="none"}(s||(s={}));let aY=eL.default.div.withConfig({displayName:"styled__CalendarWrapper",componentId:"sc-8b3b8a90-0"})` + display: flex; + flex-direction: column; + margin: 0; +`,aQ=eL.default.div.withConfig({displayName:"styled__CalendarTable",componentId:"sc-8b3b8a90-1"})` + display: flex; + flex-direction: column; + align-items: stretch; + margin-top: ${eI.UiSpacing.getPx(1)}; +`,aJ=eL.default.div.withConfig({displayName:"styled__WeekdayRow",componentId:"sc-8b3b8a90-2"})` + display: flex; + justify-content: center; + padding-bottom: 4px; +`,aX=eL.default.div.withConfig({displayName:"styled__Weekday",componentId:"sc-8b3b8a90-3"})` + width: ${eI.UiSpacing.getPx(7)}; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(60)}; + text-align: center; + font-size: 12px; +`,a0=eL.default.div.withConfig({displayName:"styled__DaysGrid",componentId:"sc-8b3b8a90-4"})` + display: flex; + width: 100%; + flex-direction: column; + align-items: center; +`,a1=eL.default.div.withConfig({displayName:"styled__DaysRow",componentId:"sc-8b3b8a90-5"})` + display: flex; + width: 100%; + justify-content: center; +`,a2=eL.default.div.withConfig({displayName:"styled__MonthName",componentId:"sc-8b3b8a90-6"})` + ${e1.UiTypography.sm}; + display: flex; + align-items: center; + justify-content: space-between; + margin: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(3)} ${eI.UiSpacing.getPx(4)}; + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: 500; +`,a5=eL.default.span.withConfig({displayName:"styled__DayText",componentId:"sc-8b3b8a90-7"})` + display: inline-block; + width: 100%; + height: 100%; + line-height: ${eI.UiSpacing.getPx(7)}; + border-radius: 100%; +`,a3=eL.default.div.withConfig({displayName:"styled__DayWrapper",componentId:"sc-8b3b8a90-8"})` + ${e1.UiTypography.xs}; + + position: relative; + width: ${eI.UiSpacing.getPx(7)}; + height: ${eI.UiSpacing.getPx(7)}; + padding: 0; + cursor: pointer; + line-height: 15px; + text-align: center; + user-select: none; + color: ${e=>e.theme.appColors.hex(10)}; + + &:focus { + outline: 1px ${e=>e.theme.appColors.hex(30)} dashed; + + ${e=>!e.$types.has(o.InRange)&&!e.$types.has(o.Start)&&!e.$types.has(o.End)&&(0,eL.css)` + border-radius: 100%; + `} + } + + ${e=>e.$types.has(o.Today)&&(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + font-weight: 500; + `} + + ${e=>e.$types.has(o.OutsideMonth)&&(0,eL.css)` + color: ${e.theme.appColors.hex(50)}; + `} + + ${e=>!e.$types.has(o.InRange)&&!e.$types.has(o.Start)&&!e.$types.has(o.End)&&(0,eL.css)` + &:hover { + border-radius: 100%; + background-color: ${e.theme.primaryColorScheme?.alpha10}; + } + `} + + ${e=>(e.$types.has(o.InRange)||e.$types.has(o.Start)||e.$types.has(o.End))&&!e.$types.has(o.Singular)&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha10}; + color: ${e.theme.primaryColorScheme?.base}; + `} + + ${e=>e.$types.has(o.Start)&&(0,eL.css)` + ${a5} { + background-color: ${e.theme.primaryColorScheme?.base}; + font-weight: 500; + } + border-radius: 100% 0% 0% 100%; + color: #ffffff; + `} + + ${e=>e.$types.has(o.End)&&(0,eL.css)` + ${a5} { + background-color: ${e.theme.primaryColorScheme?.base}; + font-weight: 500; + } + border-radius: 0% 100% 100% 0%; + color: #ffffff; + `} + + ${e=>e.$types.has(o.Singular)&&(0,eL.css)` + ${a5} { + background-color: ${e.theme.primaryColorScheme?.base}; + font-weight: 500; + } + color: #ffffff; + `} + + ${e=>e.$types.has(o.ModeActive)&&(0,eL.css)` + ${a5} { + background-color: ${e.theme.primaryColorScheme?.base}; + } + color: #ffffff; + `} +`,a4=(0,eL.css)` + transform: var(--global-icon-scale); + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } +`,a6=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIconButton",componentId:"sc-8b3b8a90-9"})` + ${a4} + + path { + fill: ${e=>e.theme.primaryColorScheme?.base}; + } + + &:hover { + cursor: pointer; + + path { + fill: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,a8=function(e){let{date:t,onDateClick:a,types:n,onToggleMode:l,rowIndex:r,columnIndex:i}=e,s=(0,ev.useRef)(null),{props:d,dispatch:c}=(0,eI.useMenuItem)({stopRef:s,onClick:()=>{a(t)}});return(0,ev.useEffect)(()=>{n.has(o.Today)&&c({type:aK.ActionTypes.Navigate,payload:s})},[c]),ev.createElement(a3,{...d,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:{e.stopPropagation();let t=7;0===r&&(t=i+1,i<3.5&&(t+=1));for(let e=0;ene(a,r));ev.useEffect(()=>{m(ne(a,r))},[a,r]);let u=(e,t)=>{let a=e.value,i=[r,...l??a9,a7],s=eG()(a,i,!0);switch(t){case"replace":e.setCustomValidity(""),0!==a.length&&s.isValid()?(m(s.format(r)),n(s.format(a7))):(m(""),n(null));break;case"error":0===a.length||s.isValid()?e.setCustomValidity(""):(e.setCustomValidity(o??"Invalid date format"),e.reportValidity())}},[p,g]=ev.useState(!1),f=ev.useMemo(()=>p?s??i:i,[p,i,s]);return ev.createElement("input",{...d,onBlur:t=>{e.onBlur?.(t),u(t.currentTarget,"replace"),g(!1)},onFocus:t=>{e.onFocus?.(t),g(!0)},onChange:t=>{e.onChange?.(t),m(t.currentTarget.value),u(t.currentTarget,"error")},onKeyDown:t=>{e.onKeyDown?.(t),t.key===eI.KeyboardKeys.Enter&&u(t.currentTarget,"replace")},placeholder:f,ref:t,type:"text",value:c})}),na="HH:mm:ss",nn=["ha","h:mma","h a","h:mm a","H:mm","HHmm","H","HH",na];function nl(e,t){if(null==e)return"";let a=eG()(e,na,!0);return a.isValid()?a.format(t):""}let nr=ev.forwardRef(function(e,t){let{time:a,onTimeChange:n,parseFormats:l,displayFormat:r=na,errorMessage:o,placeholder:i,focusPlaceholder:s,...d}=e,[c,m]=ev.useState(()=>nl(a,r));ev.useEffect(()=>{m(nl(a,r))},[a,r]);let u=(e,t)=>{let a=e.value,i=[r,...l??nn,na],s=eG()(a,i,!0);switch(t){case"replace":e.setCustomValidity(""),0!==a.length&&s.isValid()?(m(s.format(r)),n(s.format(na))):(m(""),n(null));break;case"error":0===a.length||s.isValid()?e.setCustomValidity(""):(e.setCustomValidity(o??"Invalid time format"),e.reportValidity())}},[p,g]=(0,ev.useState)(!1),f=(0,ev.useMemo)(()=>p?s??i:i,[p,i,s]);return ev.createElement("input",{...d,onBlur:t=>{e.onBlur?.(t),u(t.currentTarget,"replace"),g(!1)},onFocus:t=>{e.onFocus?.(t),g(!0)},onChange:t=>{e.onChange?.(t),m(t.currentTarget.value),u(t.currentTarget,"error")},onKeyDown:t=>{e.onKeyDown?.(t),t.key===eI.KeyboardKeys.Enter&&u(t.currentTarget,"replace")},placeholder:f,ref:t,type:"text",value:c})}),no=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-9473724a-0"})` + display: flex; + flex-direction: column; +`,ni=eL.default.fieldset.withConfig({displayName:"styled__FieldGroup",componentId:"sc-9473724a-1"})` + display: flex; + + border: 0; + padding: 0; + margin-bottom: 4px; +`,ns=(0,eI.getColorScheme)(eI.ThemeColors.danger),nd=(0,eL.css)` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + + width: 100%; + flex-grow: 1; + + color: ${e=>e.theme.textColors.hex(10)}; + border: 1px solid + ${e=>e.$modeActive?e.theme.appColors.hex(70):e.theme.appColors.hex(80)}; + background: none; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + margin: 0; + position: relative; + + &:focus { + outline: 0; + z-index: 1; + } + + &:invalid { + border-color: ${ns?.base}; + background-color: ${ns?.alpha20}; + } + + &:first-child:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + &:last-child:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + + &:not(:first-child) { + margin-left: -1px; + } +`,nc=(0,eL.default)(nt).withConfig({displayName:"styled__StyledDateInput",componentId:"sc-9473724a-2"})` + ${nd} +`,nm=(0,eL.default)(nr).withConfig({displayName:"styled__StyledTimeInput",componentId:"sc-9473724a-3"})` + ${nd} +`,nu=function(e){let{state:t,dispatch:a,placeholderDateStart:n,placeholderDateEnd:l,placeholderTimeStart:o,placeholderTimeEnd:s,focusPlaceholderDateStart:d,focusPlaceholderDateEnd:c,focusPlaceholderTimeStart:m,focusPlaceholderTimeEnd:u,errorDateInput:p,errorTimeInput:g,formatDate:f,formatTime:h}=e,{quirks:y,startDate:b,startTime:v,endDate:k,endTime:E,pickerMode:x}=t,_=(0,ev.useMemo)(()=>null==b?null:b.format(a7),[b]),w=(0,ev.useMemo)(()=>null==k?null:k.format(a7),[k]),N=()=>{a({type:"set_picker_mode",mode:r.Start})},C=()=>{a({type:"set_picker_mode",mode:r.End})},M=y.dateDependencyMode!==i.MustHaveEnd||null!=k,S=y.dateDependencyMode!==i.MustHaveStart||null!=b;return ev.createElement(no,null,M&&ev.createElement(ni,null,ev.createElement(nc,{date:_,onDateChange:e=>{let t=null;null!=e&&(t=eG()(e,a7,!0)),a({type:"set_start_date",date:t})},placeholder:n??"Start date",displayFormat:f,onFocus:N,$modeActive:x===r.Start,errorMessage:p,focusPlaceholder:d}),b&&!y.disableTime&&ev.createElement(nm,{time:v,onTimeChange:e=>{a({type:"set_start_time",time:e})},placeholder:o??"Start time",displayFormat:h??"HH:mm",onFocus:N,$modeActive:x===r.Start,errorMessage:g,focusPlaceholder:m})),S&&ev.createElement(ni,null,ev.createElement(nc,{date:w,onDateChange:e=>{let t=null;null!=e&&(t=eG()(e,a7,!0)),a({type:"set_end_date",date:t})},placeholder:l??"End date",displayFormat:f,onFocus:C,$modeActive:x===r.End,errorMessage:p,focusPlaceholder:c}),k&&!y.disableTime&&ev.createElement(nm,{time:E,onTimeChange:e=>{a({type:"set_end_time",time:e})},placeholder:s??"End time",displayFormat:h??"HH:mm",onFocus:C,$modeActive:x===r.End,errorMessage:g,focusPlaceholder:u})))},np=eL.default.div.withConfig({displayName:"NextButton__Wrapper",componentId:"sc-c5033207-0"})` + display: flex; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,ng=function(e){let{className:t,onClick:a}=e,n=(0,ev.useRef)(null),{props:l,dispatch:r}=(0,eI.useMenuItem)({stopRef:n,onClick:a});return ev.createElement(np,{className:t,...l,onKeyDown:e=>{switch(e.stopPropagation(),e.key){case eI.KeyboardKeys.ArrowUp:break;case eI.KeyboardKeys.ArrowDown:for(let e=0;e<7;e++)r({type:aK.ActionTypes.Next});break;case eI.KeyboardKeys.ArrowLeft:r({type:aK.ActionTypes.Previous});break;case eI.KeyboardKeys.ArrowRight:break;default:l.onKeyDown(e)}}},ev.createElement(a6,{icon:"date_next"}))},nf=eL.default.div.withConfig({displayName:"PrevButton__Wrapper",componentId:"sc-f7bafc26-0"})` + display: flex; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,nh=function(e){let{className:t,onClick:a}=e,n=(0,ev.useRef)(null),{props:l,dispatch:r}=(0,eI.useMenuItem)({stopRef:n,onClick:a});return ev.createElement(nf,{className:t,...l,onKeyDown:e=>{switch(e.stopPropagation(),e.key){case eI.KeyboardKeys.ArrowUp:break;case eI.KeyboardKeys.ArrowDown:for(let e=0;e<2;e++)r({type:aK.ActionTypes.Next});break;case eI.KeyboardKeys.ArrowLeft:break;case eI.KeyboardKeys.ArrowRight:r({type:aK.ActionTypes.Next});break;default:l.onKeyDown(e)}}},ev.createElement(a6,{icon:"date_prev"}))},ny=function(e){let{pickerProps:t,...a}=e,{state:n,dispatch:l}=t,[i,s]=(0,ev.useState)(()=>null==n.endDate?eG()().startOf("month"):n.endDate.clone().startOf("month")),d=(0,ev.useMemo)(()=>i.clone().startOf("week"),[i]),c=e=>{l({type:"set_date",date:e})},m=(0,ev.useMemo)(()=>{let e=[];for(let t=0;t<7;t++)e.push(eG()().weekday(t).format("ddd"));return e},[]),u=(0,ev.useMemo)(()=>{let e=[],t=n.startDate,a=n.endDate,l=null!=t,s=null!=a,c=l&&s;for(let m=0;m<6;m++){let u=[];for(let e=0;e<7;e++){let p=d.clone().add(m,"weeks").add(e,"days"),g=new Set;p.month()!==i.month()&&g.add(o.OutsideMonth),p.isSame(eG()(),"day")&&g.add(o.Today);let f=l&&p.isSame(t,"day"),h=s&&p.isSame(a,"day"),y=c&&p.isAfter(t,"day")&&p.isBefore(a,"day");c&&!1===t.isSame(a,"day")?f?(g.add(o.Start),n.pickerMode===r.Start&&g.add(o.ModeActive)):h?(g.add(o.End),n.pickerMode===r.End&&g.add(o.ModeActive)):y&&g.add(o.InRange):(f||h)&&g.add(o.Singular);let b={date:p,types:g};u.push(b)}e[m]=u}return e},[d,i,n.endDate,n.startDate,n.pickerMode]),p=(0,ev.useCallback)(()=>{l({type:"toggle_mode"})},[l]);return ev.createElement(aY,null,ev.createElement(nu,{...a,state:n,dispatch:l}),ev.createElement(eI.Menu,null,ev.createElement(aQ,{role:"grid","aria-labelledby":"calendarheader"},ev.createElement(a2,null,ev.createElement(nh,{onClick:()=>{s(e=>{let t=e.clone();return t.subtract(1,"month"),t})}}),ev.createElement("span",null,i.format("MMMM YYYY")),ev.createElement(ng,{onClick:()=>{s(e=>{let t=e.clone();return t.add(1,"month"),t})}})),ev.createElement(aJ,{role:"rowgroup"},m.map(e=>ev.createElement(aX,{role:"columnheader",key:e},e))),ev.createElement(a0,null,u.map((e,t)=>ev.createElement(a1,{key:t},e.map((e,a)=>ev.createElement(a8,{key:a,date:e.date,types:e.types,onDateClick:c,onToggleMode:p,rowIndex:t,columnIndex:a}))))))))},nb=(e,t)=>{switch(t.type){case"set_start_date":break;case"set_date":if(e.pickerMode!==r.Start)return e;break;default:return e}let{date:a}=t,{quirks:n,startDate:l,endDate:o,startTime:d,endTime:c}=e;if(null==a)return n.dateDependencyMode===i.MustHaveStart?{...e,pickerMode:r.Start,startDate:null,startTime:null,endDate:null,endTime:null}:{...e,pickerMode:r.Start,startDate:null,startTime:null};if(null!=o&&a.isAfter(o,"day"))return{...e,pickerMode:r.End,startDate:o,endDate:a};if(null!=o&&a.isSame(o,"day")){if(null==d&&null==c)switch(n.sameDateNoTimeResolutionStrategy){case s.StartDate:return{...e,startDate:a,endDate:null};case s.EndDate:return{...e,startDate:null,endDate:a};case s.None:return{...e,startDate:a}}else{let t=eG()(d,na,!0),n=eG()(c,na,!0);if(t.isAfter(n))return{...e,startDate:a,startTime:c,endTime:d}}}else if("set_date"===t.type&&null!=l&&a.isSame(l,"day")){if(n.dateDependencyMode!==i.MustHaveStart)return{...e,startDate:null,startTime:null}}else if("set_date"===t.type&&null==o&&n.autoSwitchMode)return{...e,pickerMode:r.End,startDate:a};return{...e,pickerMode:r.Start,startDate:a}},nv=(e,t)=>{switch(t.type){case"set_end_date":break;case"set_date":if(e.pickerMode!==r.End)return e;break;default:return e}let{date:a}=t,{quirks:n,startDate:l,endDate:o,startTime:d,endTime:c}=e;if(null==a)return n.dateDependencyMode===i.MustHaveEnd?{...e,pickerMode:r.End,startDate:null,startTime:null,endDate:null,endTime:null}:{...e,pickerMode:r.End,endDate:null,endTime:null};if(null!=l&&a.isBefore(l,"day"))return{...e,pickerMode:r.Start,startDate:a,endDate:l};if(null!=l&&a.isSame(l,"day")){if(null==d&&null==c)switch(n.sameDateNoTimeResolutionStrategy){case s.StartDate:return{...e,startDate:a,endDate:null};case s.EndDate:return{...e,startDate:null,endDate:a};case s.None:return{...e,startDate:a}}else{let t=eG()(d,na,!0),n=eG()(c,na,!0);if(t.isAfter(n))return{...e,endDate:a,startTime:c,endTime:d}}}else if("set_date"===t.type&&null!=o&&a.isSame(o,"day")){if(n.dateDependencyMode!==i.MustHaveEnd)return{...e,endDate:null,endTime:null}}else if("set_date"===t.type&&null==l&&n.autoSwitchMode)return{...e,pickerMode:r.Start,endDate:a};return{...e,pickerMode:r.End,endDate:a}},nk=(e,t)=>{switch(t.type){case"set_picker_mode":{let{mode:a}=t,{quirks:n,startDate:l,endDate:o}=e;switch(n.dateDependencyMode){case i.MustHaveEnd:if(null==o&&a===r.Start)return e;break;case i.MustHaveStart:if(null==l&&a===r.End)return e}return{...e,pickerMode:a}}case"toggle_mode":{let t;let{quirks:a,startDate:n,endDate:l,pickerMode:o}=e;switch(o){case r.Start:t=r.End;break;case r.End:t=r.Start}switch(a.dateDependencyMode){case i.MustHaveEnd:if(null==l&&t===r.Start)return e;break;case i.MustHaveStart:if(null==n&&t===r.End)return e}return{...e,pickerMode:t}}case"set_start_date":return nb(e,t);case"set_end_date":return nv(e,t);case"set_date":{let{pickerMode:a}=e;switch(a){case r.Start:return nb(e,t);case r.End:return nv(e,t)}}case"set_start_time":{let{startDate:a,endDate:n,endTime:l}=e;if(null!=a&&null!=n&&null!=l&&a.isSame(n,"day")){let a=eG()(t.time,na,!0),n=eG()(l,na,!0);if(a.isAfter(n))return{...e,startTime:l,endTime:t.time}}return{...e,startTime:t.time}}case"set_end_time":{let{startDate:a,endDate:n,startTime:l}=e;if(null!=a&&null!=n&&null!=l&&a.isSame(n,"day")){let a=eG()(t.time,na,!0),n=eG()(l,na,!0);if(a.isBefore(n))return{...e,endTime:l,startTime:t.time}}return{...e,endTime:t.time}}case"update_state":{let a=e?.startDate?.format?.(a7)??null,n=e?.endDate?.format?.(a7)??null,{startDate:l,endDate:r,startTime:o,endTime:i}=t;if(a===l&&e.startTime===o&&n===r&&e.endTime===i)return e;let s=null!=l?eG()(l,a7,!0):null,d=null!=r?eG()(r,a7,!0):null;return{...e,startDate:s,startTime:o,endDate:d,endTime:i}}}},nE={pickerMode:r.End,startDate:null,endDate:null,startTime:null,endTime:null,quirks:{disableTime:!1,dateDependencyMode:i.None,sameDateNoTimeResolutionStrategy:s.None,autoSwitchMode:!0}};function nx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nE,[t,a]=ev.useReducer(nk,e);return ev.useMemo(()=>({pickerProps:{state:t,dispatch:a},dispatch:a,output:{...t,startDate:t.startDate?.format?.(a7)??null,endDate:t.endDate?.format?.(a7)??null}}),[t,a])}let n_=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-da0f3eb5-0"})` + display: flex; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + width: ${eI.UiSpacing.getPx(64)}; + ${e=>null!=e.width&&(0,eL.css)` + width: ${e.width}; + `} + ${e=>null!=e.padding&&(0,eL.css)` + padding: ${e.padding}; + `} +`,nw=eL.default.button.withConfig({displayName:"styled__DatePill",componentId:"sc-da0f3eb5-1"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + column-gap: 4px; + + padding: ${eI.UiSpacing.getPx(.5)} ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(.5)} + ${eI.UiSpacing.getPx(2)}; + + border-radius: 20px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(20)}; +`,nN=eL.default.div.withConfig({displayName:"styled__MenuContainer",componentId:"sc-da0f3eb5-2"})` + display: flex; + flex-direction: column; + padding: ${eI.UiSpacing.getPx(3.5)} 0; +`,nC=eL.default.div.withConfig({displayName:"styled__CalendarPickerWrapper",componentId:"sc-da0f3eb5-3"})` + margin: 0 ${eI.UiSpacing.getPx(3.5)} ${eI.UiSpacing.getPx(3)}; +`,nM=eL.default.div.withConfig({displayName:"styled__Footer",componentId:"sc-da0f3eb5-4"})` + display: flex; + padding: 10px ${eI.UiSpacing.getPx(3)} 0; + column-gap: ${eI.UiSpacing.getPx(2)}; +`,nS=eL.default.button.withConfig({displayName:"styled__ButtonBase",componentId:"sc-da0f3eb5-5"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(3)}; + + display: flex; + background: none; + width: 49%; + border: 0; + font-weight: 500; + margin: 0; + outline: 0; + cursor: pointer; + justify-content: center; + + &:focus { + outline: 0; + } +`,nI=(0,eL.default)(nS).withConfig({displayName:"styled__DeleteButton",componentId:"sc-da0f3eb5-6"})` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(30)}; + + &:hover { + color: ${e=>e.theme.textColors.hex(40)}; + } +`,nD=(0,eL.default)(nS).withConfig({displayName:"styled__CancelButton",componentId:"sc-da0f3eb5-7"})` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(50)}; + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,nT=(0,eL.default)(nS).withConfig({displayName:"styled__SetButton",componentId:"sc-da0f3eb5-8"})` + color: ${e=>e.disabled?e.theme.textColors.hex(60):"#FFF"}; + + background: ${e=>e.disabled?e.theme.primaryColorScheme?.alpha50:e.theme?.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.disabled?e.theme.primaryColorScheme?.alpha50:e.theme?.primaryColorScheme?.alpha80}; + } +`,n$=function(e){let{userTimezone:t,dateDuration:a,handleCancel:n,handleDelete:l,handleSave:o}=e,d=ev.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),{pickerProps:c,dispatch:m,output:u}=nx({pickerMode:r.End,startDate:a?.startMoment??null,startTime:a?.toDisplayState().startTime??null,endDate:a?.endMoment??null,endTime:a?.toDisplayState().endTime??null,quirks:{dateDependencyMode:i.MustHaveEnd,disableTime:!1,sameDateNoTimeResolutionStrategy:s.EndDate,autoSwitchMode:!1}});ev.useEffect(()=>{if(null==a){m({type:"update_state",startDate:null,startTime:null,endDate:null,endTime:null});return}let{startDate:e,startTime:t,endDate:n,endTime:l}=a.toDisplayState();m({type:"update_state",startDate:e,startTime:t,endDate:n,endTime:l})},[m,a]);let p=ev.useCallback(()=>{let{startDate:e,startTime:a,endDate:n,endTime:l}=u,r=ez.DateDuration.fromDisplayState({startDate:e,startTime:a,endDate:n,endTime:l,startTimezone:t,endTimezone:t});null!=r&&o(r)},[u,t,o]),g=ev.useCallback(()=>{l()},[l]),f=ev.useCallback(()=>{n()},[n]),h=ev.useMemo(()=>{let{endDate:e}=u;return null==e},[u]),y=ev.useCallback(e=>{e.key!==eI.KeyboardKeys.Escape&&e.nativeEvent.stopImmediatePropagation()},[]),b=eG().localeData().longDateFormat("L"),v=`e.g. ${eG()("2:30 AM","hh:mm A").format("LT")}`;return ev.createElement(nN,{onClick:d,onMouseDown:e=>{e.stopPropagation()},onKeyDown:y},ev.createElement(nC,null,ev.createElement(ny,{pickerProps:c,focusPlaceholderDateStart:b,focusPlaceholderDateEnd:b,focusPlaceholderTimeStart:v,focusPlaceholderTimeEnd:v,formatDate:b,formatTime:"LT"})),ev.createElement(nM,null,null!=a?ev.createElement(nI,{type:"button",onClick:g},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})):ev.createElement(nD,{type:"button",onClick:f},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(nT,{type:"button",onClick:p,disabled:h},null!=a?ev.createElement(eY.Z,{id:"general.change",defaultMessage:"Change"}):ev.createElement(eY.Z,{id:"general.set",defaultMessage:"Set"}))))},nP=function(e){let{userTimezone:t,onClick:a,menuButtonProps:n,dateDuration:l}=e,r=null!=l,o=(0,ev.useMemo)(()=>null==l?"":l.toReadableFormat({timezone:t}),[l,t]);return ev.createElement(nw,{...n,onClick:a},ev.createElement(tn.Icon,{icon:"addon_date"}),r?o:ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"}))},nF=function(e){let{userTimezone:t,handleDateDurationChange:a,dateDuration:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"bottom",computeModifiersCallback:tr}),d=(0,eI.useMenuButton)({ref:l,state:o,dispatch:i}),c=ev.useMemo(()=>()=>{o.expanded?i({type:"Collapse"}):i({type:"Expand",payload:"first"})},[o.expanded]),m=ev.useCallback(()=>{o.expanded&&i({type:"Collapse"})},[o.expanded]),u=ev.useCallback(()=>{o.expanded&&i({type:"Collapse"}),a(null)},[a,o.expanded]),p=ev.useCallback(e=>{o.expanded&&i({type:"Collapse"}),a(e)},[a,o.expanded]);return ev.createElement(ev.Fragment,null,ev.createElement(nP,{menuButtonProps:d.props,onClick:c,dateDuration:n,userTimezone:t}),o.expanded&&ev.createElement(eI.Popup,{...s.props,modal:!0,dispatch:i},ev.createElement(n_,{initialFocus:s.initialFocus,loop:!0},ev.createElement(n$,{dateDuration:n,userTimezone:t,handleCancel:m,handleDelete:u,handleSave:p}))))},nA=function(e){let{space:t,size:a,className:n}=e,l=(0,ev.useMemo)(()=>null==t.color?void 0:{primaryColor:t.color},[t.color]),r=ec()(t,["smallAvatar"],null)||ec()(t,["avatar"],null)||ec()(t,["preferences","avatars_v2","small","hdpi","url"],null),o=ec()(t,["preferences","avatars_v2","emoji"],null);return ev.createElement(eI.ThemeProvider,{theme:l},null!=r?ev.createElement(e1.SpaceAvatar,{size:a,src:r,alt:t.name,className:n}):ev.createElement(e1.SpaceAvatar,{size:a,name:o??t.name,className:n}))},nR=function(e){let{selectedSpace:t,selectedParentMembership:a}=e,n=(0,eK.Z)(),l=t?.id===a?.space.id,r=ev.useMemo(()=>null==t?null:l?n.formatMessage({id:"general.home",defaultMessage:"Home"}):t.name,[n,l,t]);return null==t?ev.createElement(e8,null,ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_folder_empty_label",defaultMessage:"No Folders"})),ev.createElement(tn.Icon,{icon:"default_caret_right"})):ev.createElement(e8,null,l?ev.createElement(tn.Icon,{icon:"home"}):ev.createElement(nA,{space:t,size:"sm"}),ev.createElement(e7,null,r),ev.createElement(tn.Icon,{icon:"default_caret_right"}))},nj=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-e83a1358-0"})` + display: flex; + align-items: center; + padding: 5px 20px 5px 10px; + border-radius: 10px; + margin-bottom: 3px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + } + + & > div { + flex-shink: 0; + } +`,nO=eL.default.span.withConfig({displayName:"styled__Name",componentId:"sc-e83a1358-1"})` + margin-left: 12px; + color: ${e=>e.theme.textColors.hex(10)}; + word-break: break-word; + padding-right: 20px; +`,nU=function(e){let{membership:t,onSelect:a}=e,n=ev.useMemo(()=>new URL(`/spaces/${t.space.id}`,"https://www.taskade.com").toString(),[t]);return ev.createElement(nj,{onClick:()=>{a(t)}},ev.createElement(nA,{space:t.space,size:"sm"}),ev.createElement(nO,null,t.space.name),ev.createElement(aL,{href:n}))},nZ=(0,eL.default)(tn.Icon).withConfig({displayName:"HomeItem__StyledIcon",componentId:"sc-4ee0da71-0"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,nL=function(e){let{membership:t,onSelect:a}=e,n=ev.useMemo(()=>new URL(`/spaces/${t.space.id}`,"https://www.taskade.com").toString(),[t]);return ev.createElement(nj,{onClick:()=>{a(t)}},ev.createElement(nZ,{icon:"home"}),ev.createElement(nO,null,ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"})),ev.createElement(aL,{href:n}))},nB=(0,eL.default)(e3).withConfig({displayName:"FolderSelectMenu__Title",componentId:"sc-5dce9763-0"})` + padding: 20px 0 12px; +`,nz=function(e){let{selectedParentMembership:t,childrenMemberships:a,onSelect:n}=e,l=(0,ev.useCallback)(e=>{n(e.space)},[n]);return null==t?ev.createElement(e4,null,ev.createElement(e3,null,ev.createElement(eY.Z,{id:"space.folders",defaultMessage:"Folders"})),ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_folder_empty",defaultMessage:"No folders"}))):ev.createElement(e4,null,ev.createElement(nL,{membership:t,onSelect:l}),null!=a&&a.length>0&&ev.createElement(ev.Fragment,null,ev.createElement(nB,null,ev.createElement(eY.Z,{id:"space.folders",defaultMessage:"Folders"})),a.map(e=>ev.createElement(nU,{key:e.id,membership:e,onSelect:l}))))},nV=eL.default.div.withConfig({displayName:"LocationItem__Wrapper",componentId:"sc-401b3960-0"})` + display: flex; + align-items: center; + padding: 5px 10px 5px; + border-radius: 10px; + margin-bottom: 3px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + } + + & svg { + flex-shrink: 0; + } +`,nq=eL.default.span.withConfig({displayName:"LocationItem__Name",componentId:"sc-401b3960-1"})` + margin-left: 12px; + color: ${e=>e.theme.textColors.hex(10)}; +`,nW=function(e){let{item:t,onSelect:a}=e,n=(0,eK.Z)();return ev.createElement(nV,{onClick:()=>a(t.value)},ev.createElement(nq,null,n.formatMessage(t.messageDescriptor)))},nH=function(e){let{onSelect:t}=e;return ev.createElement(e4,null,ev.createElement(e3,null,ev.createElement(eY.Z,{id:"general.location",defaultMessage:"Location"})),aj.map(e=>ev.createElement(nW,{key:e.value,item:e,onSelect:t})))},nG=eL.default.div.withConfig({displayName:"MenuToggle__Wrapper",componentId:"sc-27211c66-0"})` + display: flex; + justify-content: space-between; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: 10px 16px; + cursor: pointer; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(70)}; + } +`,nK=eL.default.span.withConfig({displayName:"MenuToggle__Label",componentId:"sc-27211c66-1"})` + color: ${e=>e.theme.textColors.hex(40)}; +`,nY=function(e){let{label:t,children:a,onClick:n}=e;return ev.createElement(nG,{onClick:n},ev.createElement(nK,null,t),a)};function nQ(e){let t=e.shared_preferences.avatar;return null==t?null:"emoji"===t.type?t.value:null}let nJ=(0,eL.default)(e7).withConfig({displayName:"Project__Name",componentId:"sc-adba56c5-0"})` + ${e=>e.$isUntitled&&(0,eL.css)` + color: ${e.theme.textColors.hex(50)}; + `} +`,nX=(0,eL.default)(tn.Icon).withConfig({displayName:"Project__StyledIcon",componentId:"sc-adba56c5-1"})` + color: ${e=>e.theme.textColors.hex(60)}; +`,n0=function(e){let{project:t}=e,a=(0,ev.useMemo)(()=>null==t?null:nQ(t),[t]);return null==t?ev.createElement(e6,null,ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_project_empty_label",defaultMessage:"No Projects"})),ev.createElement(tn.Icon,{icon:"default_caret_right"})):ev.createElement(e6,null,null!=a?ev.createElement("div",null,a):ev.createElement(nX,{icon:"dd_project"}),ev.createElement(nJ,{$isUntitled:t.info.title?.length===0},t.info.title||"Untitled Project"),ev.createElement(tn.Icon,{icon:"default_caret_right"}))},n1=eL.default.div.withConfig({displayName:"ProjectItem__Wrapper",componentId:"sc-6e177394-0"})` + display: flex; + align-items: center; + padding: 5px 10px 5px; + border-radius: 10px; + margin-bottom: 3px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + } + + & svg { + flex-shrink: 0; + } +`,n2=eL.default.span.withConfig({displayName:"ProjectItem__Name",componentId:"sc-6e177394-1"})` + margin-left: 12px; + color: ${e=>e.theme.textColors.hex(10)}; + + ${e=>e.$isUntitled&&(0,eL.css)` + color: ${e.theme.textColors.hex(60)}; + `} +`,n5=(0,eL.default)(tn.Icon).withConfig({displayName:"ProjectItem__StyledIcon",componentId:"sc-6e177394-2"})` + color: ${e=>e.theme.textColors.hex(60)}; +`,n3=function(e){let{project:t,onSelect:a}=e,n=(0,ev.useMemo)(()=>nQ(t),[t]),l=(0,ev.useMemo)(()=>new URL(`/d/${t.id}`,"https://www.taskade.com").toString(),[t]);return ev.createElement(n1,{onClick:()=>a(t)},null!=n?ev.createElement("div",null,n):ev.createElement(n5,{icon:"dd_project"}),ev.createElement(n2,{$isUntitled:t.info.title?.length===0},t.info.title||"Untitled Project"),ev.createElement(aL,{href:l}))},n4=function(e){let{projects:t,onSelect:a}=e;return ev.createElement(e4,null,ev.createElement(e3,null,ev.createElement(eY.Z,{id:"general.project",defaultMessage:"Project"})),t.length>0?t.map(e=>ev.createElement(n3,{key:e.id,project:e,onSelect:a})):ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_project_empty",defaultMessage:"No projects"})))},n6=function(e){let{membership:t}=e,a=t?.space;return null==a?ev.createElement(e8,null,ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_workspace_empty_label",defaultMessage:"No Workspace"})),ev.createElement(tn.Icon,{icon:"default_caret_right"})):ev.createElement(e8,null,ev.createElement(nA,{space:a,size:"sm"}),ev.createElement(e7,null,a.name),ev.createElement(tn.Icon,{icon:"default_caret_right"}))},n8=eL.default.div.withConfig({displayName:"SpaceItem__Wrapper",componentId:"sc-d23b4fe7-0"})` + display: flex; + align-items: center; + padding: 5px 20px 5px 10px; + border-radius: 10px; + margin-bottom: 3px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + } + + & > div { + flex-shink: 0; + } +`,n7=eL.default.span.withConfig({displayName:"SpaceItem__Name",componentId:"sc-d23b4fe7-1"})` + margin-left: 12px; + color: ${e=>e.theme.textColors.hex(10)}; + word-break: break-word; + padding-right: 20px; +`,n9=function(e){let{membership:t,onSelect:a}=e,n=(0,ev.useMemo)(()=>new URL(`/spaces/${t.space.id}`,"https://www.taskade.com").toString(),[t]);return ev.createElement(ev.Fragment,null,ev.createElement(n8,{onClick:()=>{a(t)}},ev.createElement(nA,{space:t.space,size:"sm"}),ev.createElement(n7,null,t.space.name),ev.createElement(aL,{href:n})))},le=function(e){let{parentMemberships:t,onSelect:a}=e,n=(0,ev.useCallback)(e=>{a(e)},[a]);return ev.createElement(e4,null,ev.createElement(e3,null,ev.createElement(eY.Z,{id:"general.workspaces",defaultMessage:"Workspaces"})),0===t.length?ev.createElement(e9,null,ev.createElement(eY.Z,{id:"general.quickadd_workspace_empty",defaultMessage:"No workspaces found"})):t.map(e=>ev.createElement(n9,{key:e.id,membership:e,onSelect:n})))},lt="QuickAddSettings";var la=a(24104);let ln=(0,la.ZP)` + query MeTimezoneQuery { + me { + id + timezone + } + } +`;var ll=a(66252),lr=a(76643),lo=a(85689),li=a(26827),ls=a(1338),ld=a(28721),lc=a(7049);function lm(e){let t=e.role,a=e.action;return null!=t&&(null!=t.project&&null!=a.project?lc.Y8.can(t.project,a.project,"project")??!1:null!=t.workspace&&null!=a.workspace&&(lc.Y8.can(t.workspace,a.workspace,"workspace")??!1))}let lu=(0,la.ZP)` + query Memberships($filterby: MembershipFiltering) { + memberships(filterby: $filterby) { + totalCount + edges { + node { + id + order + preferences { + orderby { + sort + direction + } + } + space { + id + name + color + is_subspace + is_unread + parent_id + visibility + taskadePlanType + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + } + } +`,lp={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectNodesDueDateUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectNodesDueDateUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectNodesDueDateUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}},{kind:"Field",name:{kind:"Name",value:"added"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}},{kind:"Field",name:{kind:"Name",value:"addonDate"}},{kind:"Field",name:{kind:"Name",value:"author"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"removed"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]};function lg(e,t){let a={filterby:{archived:e}};return e||(null==t?((0,ei.assert)(null!=a.filterby),a.filterby.membershipType=b.Space):((0,ei.assert)(null!=a.filterby),a.filterby.membershipType=b.Subspace,a.filterby.parentSpaceIds=[t])),a}(d||(d={})).NoAssignees="no_assignees",function(e){e.Disabled="disabled",e.Enabled="enabled"}(c||(c={})),function(e){e.Disabled="disabled",e.Enabled="enabled"}(m||(m={})),function(e){e.Background="background",e.Banner="banner",e.None="none"}(u||(u={})),(p||(p={})).CreatedByMe="created_by_me",function(e){e.ForEveryone="for_everyone",e.ForMe="for_me",e.ForOthers="for_others"}(g||(g={})),function(e){e.ForEveryone="for_everyone",e.ForMe="for_me",e.ForOthers="for_others"}(f||(f={})),function(e){e.DomainContact="domainContact",e.UserContact="userContact"}(h||(h={})),function(e){e.Collaborator="collaborator",e.Maintainer="maintainer",e.Outsider="outsider",e.Owner="owner",e.Participant="participant",e.Viewer="viewer"}(y||(y={})),function(e){e.Shared="shared",e.Space="space",e.Subspace="subspace"}(b||(b={})),function(e){e.Ongoing="ongoing",e.Paused="paused",e.Reset="reset",e.Terminated="terminated"}(v||(v={})),function(e){e.Cancel="cancel",e.Create="create",e.Pause="pause",e.QuickStart="quick_start",e.Remove="remove",e.Reset="reset",e.Resume="resume",e.Start="start"}(k||(k={})),function(e){e.Bottom="BOTTOM",e.Top="TOP",e.Afterbegin="afterbegin",e.Afterend="afterend",e.Beforebegin="beforebegin",e.Beforeend="beforeend"}(E||(E={})),function(e){e.NoDate="no_date",e.PastDue="past_due",e.Today="today",e.Upcoming="upcoming"}(x||(x={})),function(e){e.Checkbox="checkbox",e.Radio="radio"}(_||(_={})),(w||(w={})).Date="date",(N||(N={})).ExternalCollaborator="external_collaborator",function(e){e.Check="check",e.Edit="edit",e.View="view"}(C||(C={})),(M||(M={})).CreatedAt="created_at",function(e){e.ForEveryone="for_everyone",e.ForMe="for_me",e.ForOthers="for_others"}(S||(S={})),function(e){e.Document="document",e.Template="template"}(I||(I={}));let lf=(0,la.ZP)` + query BlocksQuery($projectId: ID!) { + document(id: $projectId) { + id + contents + } + } +`,lh=(0,la.ZP)` + mutation ProjectNodesImportMutation($input: ProjectNodesImportInput!) { + projectNodesImport(input: $input) { + clientMutationId + nodeID + document { + id + info + } + } + } +`,ly=(0,la.ZP)` + query ProjectsQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + space { + id + documents_v2(first: 50) { + edges { + node { + id + info + archived_at + templated_at + shared_preferences + role { + project + workspace + } + } + } + } + } + } + } +`;var lb=a(90629),lv=a(94679);function lk(e){return e.trim().length>0}let lE=(0,lb.C)({tsTypes:{},id:"addMachine",initial:"loading",context:{parentMemberships:[],childrenMemberships:[],projects:[],error:null,text:"",contents:null,newNodeImported:null,selectedParentMembership:null,selectedSpace:null,selectedProject:null,selectedBlock:null},schema:{context:{},events:{},services:{}},states:{loading:{id:"loading",initial:"workspace",states:{workspace:{invoke:{src:"loadParentsMemberships",onDone:{target:"folder",actions:"handleWorkspacesLoaded"},onError:{target:"#idle",actions:"handleError"}}},folder:{invoke:{src:"loadChildrenMemberships",onDone:{target:"projects",actions:"handleFolderLoaded"},onError:{target:"#idle",actions:"handleError"}}},projects:{invoke:{src:"loadProjects",onDone:{target:"blocks",actions:"handleProjectsLoaded"},onError:{target:"#idle",actions:"handleError"}}},blocks:{invoke:{src:"loadBlocks",onDone:{target:"#idle",actions:"handleBlocksLoaded"},onError:{target:"#idle",actions:"handleError"}}}}},idle:{id:"idle",initial:"idle",states:{idle:{on:{GOTO_SELECT_WORKSPACE:{target:"#selecting.workspace"},GOTO_SELECT_FOLDER:{target:"#selecting.folder"},GOTO_SELECT_PROJECT:{target:"#selecting.project"},GOTO_SELECT_BLOCK:{target:"#selecting.block"},GOTO_SELECT_BLOCK_PLACEMENT:{target:"#selecting.placement"},TYPE:{actions:"handleTyping"},SUBMIT:{target:"submitting",cond:"canSubmit"}}},submitting:{id:"submitting",invoke:{src:"importTaskastFragment",onDone:{target:"#idle",actions:"handleSubmitted"},onError:{target:"#idle",actions:"handleError"}}}}},selecting:{id:"selecting",states:{workspace:{on:{SELECT_WORKSPACE:{target:"#loading.folder",actions:"handleWorkspaceSelected"},GO_BACK:{target:"#idle"}}},folder:{on:{SELECT_FOLDER:{target:"#loading.projects",actions:"handleFolderSelected"},GO_BACK:{target:"#idle"}}},project:{on:{SELECT_PROJECT:{target:"#loading.blocks",actions:"handleProjectSelected"},GO_BACK:{target:"#idle"}}},block:{on:{SELECT_BLOCK:{target:"#idle",actions:"handleBlockSelected"},GO_BACK:{target:"#idle"}}},placement:{on:{SELECT_BLOCK_PLACEMENT:{target:"#idle"},GO_BACK:{target:"#idle"}}}}}}},{actions:{handleError:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleWorkspacesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.parentMemberships=t.data.parentMemberships,e.selectedParentMembership=t.data.selectedParentMembership,e))),handleFolderLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.selectedSpace=t.data.selectedSpace,e.childrenMemberships=t.data.childrenMemberships,e))),handleProjectsLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.projects=t.data.projects,e.selectedProject=t.data.selectedProject,e))),handleBlocksLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.contents=t.data.contents,e.selectedBlock=t.data.selectedBlock,e))),handleWorkspaceSelected:(0,lv.assign)((e,t)=>(0,es.ZP)(e,a=>{let{workspaceId:n}=t.payload,l=e.parentMemberships.find(e=>e.id===n);if(null==l)throw Error("invalid workspace ID");return a.selectedParentMembership=l,a})),handleFolderSelected:(0,lv.assign)((e,t)=>(0,es.ZP)(e,a=>{let{spaceId:n}=t.payload,l=[e.selectedParentMembership,...e.childrenMemberships].find(e=>e?.space.id===n);if(null==l)throw Error("invalid space ID");return a.selectedSpace=l.space,a})),handleProjectSelected:(0,lv.assign)((e,t)=>(0,es.ZP)(e,a=>{let{projectId:n}=t.payload,l=e.projects.find(e=>e.id===n);if(null!=l)a.selectedProject=l,a.selectedBlock=null;else throw Error("invalid project ID");return a})),handleBlockSelected:(0,lv.assign)((e,t)=>(0,es.ZP)(e,a=>{if(null==e.contents)return e;let n=t.payload.nodeId,l=null;return null!=n&&(l=e.contents.findNodeByID(n)??null),a.error=null,a.selectedBlock=l,a})),handleTyping:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>{e.text=t.payload.text,e.newNodeImported=null})),handleSubmitted:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.text="",e.newNodeImported=t.data,e.error=null,e)))},guards:{canSubmit:e=>null!=e.selectedProject||lk(e.text)}});function lx(e,t,a){return{filterby:{start:{date:e.clone().startOf("month").startOf("week").toISOString()},end:{date:e.clone().startOf("month").startOf("week").add(43,"day").toISOString()},spaceIds:t,type:a}}}var l_=a(42705),lw=a.n(l_);let lN=lw().string().valid(...["month","week","work_week","day","agenda"]),lC=lw().string().valid("for_me","for_others","for_everyone"),lM=lw().array().items(lw().string()).allow(null);function lS(e,t){return{view:function(e){let t=e.get("view"),a=lN.validate(t);return null==a.error?a.value:null}(e)??t?.view??"month",filter:function(e){let t=e.get("type"),a=lC.validate(t);return null==a.error?a.value:null}(e)??t?.filter??"for_me",spaceIds:function(e){let t=e.getAll("spaceIds[]");return 0===t.length?null:t}(e)??t?.spaceIds??null}}lw().object({filter:lC.optional().default("for_me"),spaceIds:lM.optional().default(null)});let lI=(0,la.ZP)` + query EventsQuery($filterby: EventFiltering!) { + events(filterby: $filterby) { + edges { + cursor + node { + id + document_id + workspace { + type + id + } + type + metadata { + document_title + workspace_name + workspace_color + view_path + } + node + } + } + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + totalCount + } + } +`;var lD=a(92090),lT=a(96549);let l$=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-125d53c6-0"})` + height: 100%; + display: flex; + flex-direction: column; +`,lP=eL.default.div.withConfig({displayName:"styled__EmptyStateWrapper",componentId:"sc-125d53c6-1"})` + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +`,lF=(0,eL.default)(tn.Icon).attrs({icon:"header_back"}).withConfig({displayName:"styled__BackIcon",componentId:"sc-125d53c6-2"})` + color: ${e=>e.theme.textColors.hex(60)}; +`,lA=(0,eL.css)` + display: flex; + align-center: center; + padding: 10px 20px; + align-items: center; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.textColors.hex(50)}; +`,lR=eL.default.div.withConfig({displayName:"styled__Header",componentId:"sc-125d53c6-3"})` + ${lA}; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(10)}; + + ${lF} { + color: ${e=>e.theme.textColors.hex(10)}; + } + } +`,lj=eL.default.a.withConfig({displayName:"styled__HeaderLink",componentId:"sc-125d53c6-4"})` + ${lA}; +`,lO=eL.default.h1.withConfig({displayName:"styled__ScreenName",componentId:"sc-125d53c6-5"})` + ${e1.UiTypography.md}; + margin: 10px 10px 10px; + font-weight: 400; +`,lU=(0,eL.css)` + width: 120px; + margin-right: 10px; +`,lZ=(0,eL.default)(lT.nV).withConfig({displayName:"styled__Logo",componentId:"sc-125d53c6-6"})` + ${lU} +`,lL=(0,eL.default)(lT.Ng).withConfig({displayName:"styled__LogoDark",componentId:"sc-125d53c6-7"})` + ${lU} +`,lB=eL.default.textarea.withConfig({displayName:"styled__Textarea",componentId:"sc-125d53c6-8"})` + resize: none; + ${e1.UiTypography.md}; + color: ${e=>e.theme.textColors.hex(10)}; + border: 0; + font-family: 'Helvetica Neue', Helvetica, arial, sans-serif; + width: 100%; + background-color: ${e=>e.theme.appColors.hex(90)}; + + ${tM}; +`,lz=eL.default.div.withConfig({displayName:"styled__CTAContainer",componentId:"sc-125d53c6-9"})` + display: flex; + flex-direction: row; + align-items: center; + padding: 0 20px; + margin-bottom: 20px; +`,lV=eL.default.button.withConfig({displayName:"styled__SubmitButton",componentId:"sc-125d53c6-10"})` + display: flex; + flex: 1 0 auto; + height: 42px; + align-items: center; + justify-content: center; + padding: 5px 20px; + border-radius: 10px; + transition: background-color 100ms ease-in-out, color 100ms ease-in-out; + + ${e=>e.$loading?(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `:(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha90}; + + &:hover { + background-color: ${e.theme.primaryColorScheme?.alpha80}; + } + + &:disabled { + background-color: ${e.theme.appColors.hex(80)}; + } + `}; + + &:disabled { + color: ${e=>e.theme.primaryColorScheme?.base}; + background-color: ${e=>e.theme.primaryColorScheme?.alpha50}; + cursor: default; + } + + color: #ffffff; + font-weight: 500; +`,lq=eL.default.div.withConfig({displayName:"styled__OptionsWrapper",componentId:"sc-125d53c6-11"})` + display: flex; + flex-direction: column; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(80)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + margin: 0 20px 20px; + overflow: hidden; + + & > div:last-child { + border-bottom: 0; + } +`,lW=eL.default.div.withConfig({displayName:"styled__TextAreaWrapper",componentId:"sc-125d53c6-12"})` + margin: 20px; + padding: 16px; + + background-color: ${e=>e.theme.appColors.hex(90)}; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; +`,lH=eL.default.div.withConfig({displayName:"styled__AddonsRow",componentId:"sc-125d53c6-13"})` + display: flex; +`,lG=(0,eV.ZP)("mod+enter"),lK=(0,eV.ZP)("enter"),lY=(0,eV.ZP)("shift+enter"),lQ=function(e){let[t,a]=ev.useState(null),[n,l]=ev.useState([]),{calendarState:r}=e,o=e.showHeader??!0,i=(0,eK.Z)(),s=(0,eI.useTheme)(),[d,c]=function(){let e=(0,ll.x)(),{search:t}=(0,eF.TH)(),[a]=eQ(lt,{parentMembershipId:null,spaceId:null,projectId:null,blockId:null,blockPlacement:"BOTTOM"});return(0,ls.e)(lE,{services:{loadParentsMemberships:async()=>{let t=lg(!1),n=await e.query({query:lu,fetchPolicy:"cache-first",variables:t}),l=n.errors?.[0];if(null!=l)throw l;let r=n.data?.memberships?.edges.map(e=>e.node)??[];if(0===r.length)throw Error("no_memberships_found");let o=a.parentMembershipId,i=-1;null!=o&&(i=r.findIndex(e=>o===e.id));let s=r[i=Math.max(i,0)];return{parentMemberships:r,selectedParentMembership:s}},loadChildrenMemberships:async t=>{let n=t.selectedParentMembership;if(null==n)return{childrenMemberships:[],selectedSpace:null};let l=lg(!1,n.space.id),r=await e.query({query:lu,fetchPolicy:"cache-first",variables:l}),o=r.errors?.[0];if(null!=o)throw o;let i=r.data?.memberships?.edges.map(e=>e.node)??[],s=a.spaceId,d=n.space;if(null!=s){let e=i.findIndex(e=>s===e.space.id);e>-1&&(d=i[e].space)}return{childrenMemberships:i,selectedSpace:d}},loadProjects:async t=>{if(null==t.selectedSpace)return{projects:[],selectedProject:null};let n=t.selectedSpace.id,l=await e.query({fetchPolicy:"cache-first",query:ly,variables:{spaceId:n}}),r=l.errors?.[0];if(null!=r)throw r;let o=l.data.membership?.space?.documents_v2?.edges?.map(e=>e.node)?.filter(e=>null!=e&&null==e.archived_at&&null==e.templated_at&&lm({role:{project:e.role?.project,workspace:e.role?.workspace},action:{project:"edit"}}));if(null==o)throw Error("no_projects_fetch");if(0===o.length)return{projects:[],selectedProject:null};let i=a.projectId,s=o.find(e=>e.id===i);return{projects:o,selectedProject:s??o[0]}},loadBlocks:async t=>{if(null==t.selectedProject)return{contents:null,selectedBlock:null};let n=t.selectedProject.id,l=await e.query({fetchPolicy:"network-only",query:lf,variables:{projectId:n}}),r=l.errors?.[0];if(null!=r)throw r;let o=l.data?.document?.contents;if(null==o)throw Error("fetch blocks failed");let i=li.Contents.deserialize(o);if(null==i)throw Error("failed to deserialize contents");let s=a.blockId??"",d=i.findNodeByID(s)??null;return s===i.rootID&&(d=null),{contents:i,selectedBlock:d}},importTaskastFragment:async(a,n)=>{(0,ei.assert)(null!=a.selectedProject,"selected_project_missing"),(0,ei.assert)(null!=a.selectedSpace,"selected_space_missing");let l=a.selectedProject.id,r=a.selectedBlock?.id??null,{placement:o,dateDuration:i,currentDay:s,assigneeIds:d}=n.payload,c=(0,lo.markdownTextToTaskastFragment)(a.text);if(null==c)throw Error("failed to generate fragment");let m={};for(let e of d)m[e]={type:"user",id:e};let u=(0,es.ZP)(c,e=>{e.children=e.children.map(e=>({...e,id:(0,ld.Z)(),attributes:{_assignees:m}}))}),{data:p,errors:g}=await e.mutate({mutation:lh,variables:{input:{clientMutationId:(0,ld.Z)(),documentID:l,nodeID:r,placement:o,type:lr.TASKAST_MIME_TYPE,content:u}}}),f=g?.[0];if(null!=f)throw f;if(null==p)throw Error("failed_to_add_tasks");let{projectNodesImport:{nodeID:h}}=p;if(null==h||null==i)return{documentId:l,nodeId:h};let{data:y}=await e.mutate({mutation:lp,variables:{input:{clientMutationId:(0,ld.Z)(),projectId:l,nodeIds:[h],dateAttachment:i.toDateRangeDesc()}}});return null==y||null==s||function(e,t,a,n,l,r){let o=lS(new URLSearchParams(n)),{currentDay:i,dateDuration:s}=a.payload;if(null==i||null==s||null==o.filter)return;let d=t.selectedSpace,c=t.selectedProject;if(null==d||null==c)return;let m=lx(i,o.spaceIds,o.filter),u=e.readQuery({query:lI,variables:m});null!=u&&e.writeQuery({query:lI,variables:m,data:(0,es.ZP)(u,e=>{let t=function(e,t,a,n,l){let r=function(e){let t=e.children[0];return null==t?{string:"",delta:{ops:[{insert:"\n",attributes:{paragraph:!0}}]}}:{string:(0,lD.textDeltaToString)(t.text),delta:t.text}}(n),o={type:"space",id:e.id},i=function(e){let t=e.startMoment.clone();return{start:{date:ez.MomentHelpers.toDateTimeDesc(t).date,at:t.valueOf().toString()}}}(l),s=function(e){let t=e.startMoment.clone(),a=ez.MomentHelpers.toDateTimeDesc(t),n=e.endMoment.clone();return{start:a,end:ez.MomentHelpers.toDateTimeDesc(n),started_at:t.valueOf().toString(),ended_at:n.valueOf().toString()}}(l);return{__typename:"Event",document_id:t.id,id:`urn:taskade:d/${t.id}/${a}`,metadata:{document_title:t.info.title||"",view_path:"",workspace_color:e.color,workspace_name:e.name,__typename:"EventMetadata"},node:{__typename:"IndexedDocumentNode",id:a,ancestors:[],indices:[0],revision:0,line_number:1,cleared:!1,completed:!1,text:r,event:s,due_date:i,hashtags:[],mentions:[],assignees:[],tags:[],archived_at:null,created_at:eG()().toISOString(),updated_at:eG()().toISOString()},type:"node",workspace:o}}(d,c,l,r,s);return e.events.edges.push({cursor:`${e.events.edges.length}`,node:t,__typename:"EventEdge"}),e.events.totalCount+=1,e})})}(e,a,n,t,h,c),{documentId:l,nodeId:h}}}})}(),{context:m}=d,u=ev.useRef(null),{data:p}=(0,eB.a)(ln),g=p?.me?.timezone??eG().tz.guess(),f=p?.me?.id,[h,y]=eQ(lt,{parentMembershipId:null,spaceId:null,projectId:null,blockId:null,blockPlacement:"BOTTOM"}),[b,v]=ev.useState(h.blockPlacement??"BOTTOM");ev.useEffect(()=>{if(!d.matches("idle"))return;let e={parentMembershipId:m.selectedParentMembership?.id??null,spaceId:m.selectedSpace?.id??null,projectId:m.selectedProject?.id??null,blockId:m.selectedBlock?.id??null,blockPlacement:b};(0,eq.isEqual)(e,h)||y(e)},[b,m.selectedBlock?.id,m.selectedProject?.id,m.selectedSpace,m.selectedParentMembership?.id,h,y,d]),ev.useEffect(()=>{d.matches("idle")&&null!=u.current&&u.current.focus()},[d,u]);let k=ev.useCallback(()=>{c({type:"GO_BACK"})},[c]),E=ev.useCallback(()=>{c({type:"GOTO_SELECT_WORKSPACE"})},[c]),x=ev.useCallback(()=>{c({type:"GOTO_SELECT_FOLDER"})},[c]),_=ev.useCallback(()=>{c({type:"GOTO_SELECT_PROJECT"})},[c]),w=ev.useCallback(()=>{c({type:"GOTO_SELECT_BLOCK"})},[c]),N=ev.useCallback(()=>{c({type:"GOTO_SELECT_BLOCK_PLACEMENT"})},[c]),C=ev.useCallback(e=>{c({type:"SELECT_WORKSPACE",payload:{workspaceId:e.id}}),n.length>0&&l([])},[n.length,c]),M=ev.useCallback(e=>{c({type:"SELECT_FOLDER",payload:{spaceId:e.id}})},[c]),S=ev.useCallback(e=>{c({type:"SELECT_PROJECT",payload:{projectId:e.id}}),n.length>0&&l([])},[n.length,c]),I=ev.useCallback(e=>{c({type:"SELECT_BLOCK",payload:{nodeId:e}})},[c]),D=ev.useCallback(e=>{c({type:"SELECT_BLOCK_PLACEMENT"}),v(e)},[c]);ev.useEffect(()=>{let e;if(null==r)return;let{date:t,time:n,type:l}=r;if(null==t||null==l)return;let o=ez.DateTimeDescHelpers.toMoment({date:t,time:n??void 0,timezone:g}),i=ez.MomentHelpers.toDateTimeDesc(o);switch(l){case"all_day":e=o.clone().add(1,"day");break;case"hourly":e=o.clone().add(1,"hour")}let s=ez.MomentHelpers.toDateTimeDesc(e);a(ez.DateDuration.fromDateRangeDesc({start:i,end:s}))},[r,g]);let T=ev.useMemo(()=>null==d.context.selectedProject||!lk(d.context.text),[d.context.selectedProject,d.context.text]),$=ev.useCallback(()=>{c({type:"SUBMIT",payload:{placement:b,assigneeIds:n.map(e=>e.id),dateDuration:t,currentDay:r?.currentDay}})},[b,r?.currentDay,t,n,c]),P=ev.useCallback(e=>{if(!T){if(lK(e.nativeEvent)||lY(e.nativeEvent)){e.preventDefault();return}lG(e.nativeEvent)&&$()}},[$,T]),F=ev.useCallback(e=>{a(e)},[]),A=ev.useCallback(e=>{if(n.find(t=>t.id===e.id)){l(n.filter(t=>t.id!==e.id));return}l([...n,e])},[n]),R=e0();return d.matches("loading")?ev.createElement(lP,null,ev.createElement(eI.Spinner,null)):ev.createElement(l$,{onKeyDown:P},d.matches("selecting")&&ev.createElement(lR,{onClick:k},ev.createElement(lF,null),ev.createElement(lO,null,d.matches("selecting")&&ev.createElement(eY.Z,{id:"general.quickadd_back",defaultMessage:"Back"}))),d.matches("idle")&&o&&ev.createElement(lj,{href:"https://www.taskade.com",target:"_blank",rel:"noopener noreferrer"},s.isNightMode?ev.createElement(lL,null):ev.createElement(lZ,null),null==R&&ev.createElement(aL,{href:"https://www.taskade.com"})),d.matches("idle")&&null!=d.context.newNodeImported&&ev.createElement(tl,{projectId:d.context.newNodeImported.documentId,nodeId:d.context.newNodeImported.nodeId}),d.matches("idle")&&null!=d.context.error&&ev.createElement(ta,{errorType:d.context.error.message}),d.matches("idle")&&ev.createElement(eI.ThemeProvider,{theme:{primaryColor:d.context.selectedSpace?.color}},ev.createElement(lW,null,ev.createElement(lB,{ref:u,placeholder:i.formatMessage({id:"general.quickadd_placeholder",defaultMessage:"Type anything, {modSymbol} + enter to add..."},{modSymbol:eI.ModifierKeys.ModSymbol}),value:d.context.text,onChange:e=>{c({type:"TYPE",payload:{text:e.target.value}})},rows:4}),ev.createElement(lH,null,ev.createElement(nF,{dateDuration:t,userTimezone:g,handleDateDurationChange:F}),ev.createElement(aT,{selectedAssignees:n,projectId:d.context.selectedProject?.id,userId:f,handleSelectedAssigneesChange:A}))),ev.createElement(lq,null,ev.createElement(nY,{label:i.formatMessage({id:"general.workspace",defaultMessage:"Workspace"}),onClick:E},ev.createElement(n6,{membership:d.context.selectedParentMembership})),ev.createElement(nY,{label:i.formatMessage({id:"space.folder",defaultMessage:"Folder"}),onClick:x},ev.createElement(nR,{selectedSpace:d.context.selectedSpace,selectedParentMembership:d.context.selectedParentMembership}))),ev.createElement(lq,null,ev.createElement(nY,{label:i.formatMessage({id:"general.project",defaultMessage:"Project"}),onClick:_},ev.createElement(n0,{project:d.context.selectedProject})),ev.createElement(nY,{label:i.formatMessage({id:"general.block",defaultMessage:"Block"}),onClick:w},ev.createElement(aF,{block:d.context.selectedBlock})),ev.createElement(nY,{label:i.formatMessage({id:"general.quickadd_block_location",defaultMessage:"Location"}),onClick:N},ev.createElement(aU,{placement:b}))),ev.createElement(lz,null,ev.createElement(lV,{onClick:$,disabled:T,$loading:d.matches({idle:"submitting"})},d.matches({idle:"idle"})&&ev.createElement(eY.Z,{id:"general.quickadd_add_to_project",defaultMessage:"Add to project"}),d.matches({idle:"submitting"})&&ev.createElement(eI.Spinner,null)))),d.matches({selecting:"workspace"})&&ev.createElement(le,{parentMemberships:m.parentMemberships,onSelect:C}),d.matches({selecting:"folder"})&&ev.createElement(nz,{selectedParentMembership:m.selectedParentMembership,childrenMemberships:m.childrenMemberships,onSelect:M}),d.matches({selecting:"project"})&&ev.createElement(n4,{projects:m.projects,onSelect:S}),d.matches({selecting:"block"})&&ev.createElement(aG,{projectId:d.context.selectedProject?.id??null,contents:d.context?.contents??null,onSelect:I}),d.matches({selecting:"placement"})&&ev.createElement(nH,{onSelect:D}))},lJ=eL.default.div.withConfig({displayName:"Add__Wrapper",componentId:"sc-3601990e-0"})` + min-height: 100vh; +`,lX=(0,eL.createGlobalStyle)` + body { + background-color: ${e=>e.theme.appColors.hex(90)}; + ${tM}; + } +`,l0=function(){return ev.createElement(lJ,null,ev.createElement(lX,null),ev.createElement(lQ,null))};function l1(e){let t=e.desktopRefocusTabId;if(null==t)return null;let a=new URL("taskade://focus");return a.searchParams.set("tabId",t),a.toString()}let l2=(0,lb.C)({predictableActionArguments:!0,initial:"waiting",schema:{context:{},events:{},services:{}},tsTypes:{},states:{waiting:{invoke:{src:e=>{let t=l1(e.completingSessionTokenPayload);return null!=t&&(window.location.href=t),e=>{let t=setInterval(()=>{e({type:"DECREMENT_COUNTDOWN"})},1e3);return()=>{clearInterval(t)}}}},on:{DECREMENT_COUNTDOWN:[{target:"finished",cond:e=>e.countdown-1==0},{actions:(0,lv.assign)({countdown:e=>e.countdown-1})}]}},finished:{type:"final",invoke:{src:"finish"}}}}),l5=(0,e$.connect)(function(e){return{completingSessionTokenPayload:e.flowOAuth2.completingSessionTokenPayload}})(function(e){let{completingSessionTokenPayload:t}=e,[a,n]=(0,ls.e)(l2,{context:{completingSessionTokenPayload:t,countdown:3},services:{finish:async e=>{null==e.completingSessionTokenPayload.desktopRefocusTabId&&window.close()}}});return null==t?ev.createElement(eF.l_,{to:"/404"}):ev.createElement("div",{className:"flex h-screen flex-col items-center justify-center bg-appcolor-0"},ev.createElement("span",{className:"text-sm font-bold"},ev.createElement(eY.Z,{id:"automation.oauth.all_done",defaultMessage:"All Done!"})),ev.createElement("span",{className:"mt-0.5 max-w-md text-center text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"automation.oauth.all_done_return",defaultMessage:"Return to the automation editor to continue setting up your automation."})),ev.createElement("div",{className:"mt-4 flex items-center gap-x-2"},null!=a.context.completingSessionTokenPayload.desktopRefocusTabId?ev.createElement("button",{className:"rounded-lg bg-primary px-4 py-1 text-xs font-bold transition-colors hover:bg-primary/80",onClick:()=>{let e=l1(a.context.completingSessionTokenPayload);null!=e&&(window.location.href=e)}},ev.createElement(eY.Z,{id:"automation.oauth.close_desktop",defaultMessage:"Return to Desktop"})):ev.createElement("button",{className:"rounded-lg bg-primary px-4 py-1 text-xs font-bold transition-colors hover:bg-primary/80",onClick:()=>{window.close()}},ev.createElement(eY.Z,{id:"automation.oauth.close_window",defaultMessage:"Close"}))),a.matches("waiting")&&null==a.context.completingSessionTokenPayload.desktopRefocusTabId&&ev.createElement("span",{className:"mt-3 text-xs text-textcolor-400"},ev.createElement(eY.Z,{id:"automation.oauth.countdown_closing",defaultMessage:"Automatically closing in {remainder} seconds",values:{remainder:a.context.countdown}})))});var l3=a(33008),l4=a.n(l3);let l6="@@taskade/growl/RESET_GROWL_STATE";var l8=a(45697),l7=a.n(l8);let l9="@@taskade/auth/SUBMIT_FORGOT_PASSWORD_FORM",re="@@taskade/auth/SUBMIT_RESET_PASSWORD_FORM",rt="@@taskade/auth/SUBMIT_SIGN_UP_FORM",ra="@@taskade/auth/SUBMIT_SIGN_IN_FORM";function rn(e,t,a){return{type:l9,payload:{values:e,form:t,callback:a}}}function rl(e,t,a){return{type:rt,payload:{values:e,form:t,callback:a}}}function rr(e,t,a){return{type:ra,payload:{values:e,form:t,callback:a}}}let ro="EDITOR_DID_MOUNT",ri="EDITOR_DID_UNMOUNT";function rs(e){return{type:ro,payload:{match:e}}}function rd(e){return{type:ri,payload:{match:e}}}let rc="@@taskade/modal/SET_LOGIN_SIGNUP_MODAL_STATE",rm="@@taskade/modal/TOGGLE_SPACE_LEAVE_MODAL",ru="@@taskade/modal/TOGGLE_SPACE_DELETE_MODAL",rp="@@taskade/modal/TOGGLE_SPACE_NOTIFICATION_MODAL",rg="@@taskade/modal/TOGGLE_DOCUMENT_NOTIFICATION_MODAL",rf="@@taskade/modal/TOGGLE_LOGIN_SIGNUP_MODAL";function rh(e){return{type:rc,payload:e}}function ry(){return{type:rm,payload:{}}}function rb(){return{type:ru,payload:{}}}function rv(){return{type:rp,payload:{}}}function rk(){return{type:rg,payload:{}}}function rE(){return{type:rf,payload:{}}}let rx="@@socket.io/CONNECT",r_="@@socket.io/EMIT",rw="@@socket.io/GET_SOCKET",rN="@@socket.io/RESET";function rC(){return{type:rx,payload:{}}}function rM(e){return{type:"@@socket.io/DISCONNECT",payload:{reason:e}}}function rS(e){for(var t=arguments.length,a=Array(t>1?t-1:0),n=1;ne.theme.appColors.hex(100)}; +`;let rP=eL.default.p.withConfig({displayName:"Styles__BodyText",componentId:"sc-c07fb368-3"})` + ${e1.ArticleTypography.body} + color: ${e=>e.theme.textColors.hex(30)}; +`,rF=eL.default.div.withConfig({displayName:"Styles__Actions",componentId:"sc-c07fb368-4"})` + display: flex; + flex-direction: row; + justify-content: flex-end; +`,rA=eL.default.button.withConfig({displayName:"Styles__Confirm",componentId:"sc-c07fb368-5"})` + ${e1.UiTypography.sm} + + display: flex; + align-items: center; + padding: 6px 12px; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #ffffff; + font-weight: 500; + border-radius: 5px; + cursor: pointer; + margin-right: 5px; +`;(0,eL.default)(rA).withConfig({displayName:"Styles__ConfirmDangerous",componentId:"sc-c07fb368-6"})` + background: ${eI.ThemeColors.danger}; +`;let rR=eL.default.button.withConfig({displayName:"Styles__Delete",componentId:"sc-c07fb368-7"})` + display: flex; + padding: 8px 16px; + background: ${eI.ThemeColors.danger}; + color: #fff; + border-radius: 10px; + cursor: pointer; + margin-right: 5px; + font-weight: 500; + border: 0; + + &:focus { + outline: 0; + } + + &:disabled { + background: ${e=>e.theme.appColors.hex(50)}; + } +`,rj=eL.default.button.withConfig({displayName:"Styles__Cancel",componentId:"sc-c07fb368-8"})` + ${e1.UiTypography.sm} + + display: flex; + align-items: center; + padding: 8px 16px; + background: none; + font-weight: 500; + border: 0; + color: ${e=>e.theme.textColors.hex(50)}; + cursor: pointer; + margin-right: 5px; + + &:focus { + outline: 0; + } + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,rO=eL.default.div.withConfig({displayName:"Styles__ErrorMessage",componentId:"sc-c07fb368-9"})` + display: flex; + /* todo (dionis@taskade.com) missing danger background color */ + background: ${e=>e.theme.isNightMode?"rgba(235, 100, 97, 0.10)":"#FAE5E5"}; + border: 1px solid ${eI.ThemeColors.danger}; + color: ${eI.ThemeColors.danger}; + padding: ${e=>e.padding||"8px 12px"}; + ${e1.UiTypography.sm} + border-radius: 10px; + margin: ${e=>e.margin||0}; + word-break: break-all; +`,rU=(0,eL.default)(e1.Notice).withConfig({displayName:"Styles__ErrorMessageNotice",componentId:"sc-c07fb368-10"})` + display: flex; + ${e1.UiTypography.md}; + line-height: 1.5; + margin-bottom: 8px; +`,rZ=eL.default.label.withConfig({displayName:"Styles__Label",componentId:"sc-c07fb368-11"})` + color: ${e=>e.theme.textColors.hex(50)}; + margin-bottom: 10px; + text-transform: uppercase; + ${e1.UiTypography.sm}; + font-weight: 500; +`,rL=eL.default.label.withConfig({displayName:"Styles__DeleteLabel",componentId:"sc-c07fb368-12"})` + color: ${e=>e.theme.textColors.hex(10)}; + margin-bottom: 5px; +`,rB=eL.default.div.withConfig({displayName:"Styles__InputContainer",componentId:"sc-c07fb368-13"})` + display: flex; + position: relative; + padding: 5px 8px; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + border-radius: 10px; + margin-bottom: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + + &:focus-within { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + } +`,rz=eL.default.input.withConfig({displayName:"Styles__Input",componentId:"sc-c07fb368-14"})` + width: 100%; + color: ${e=>e.theme.textColors.hex(10)}; + background: none; + border: 0; + + &::placeholder { + color: ${e=>e.theme.textColors.hex(70)}; + } +`;eL.default.a.withConfig({displayName:"Styles__Anchor",componentId:"sc-c07fb368-15"})` + color: ${e=>e.theme?.primaryColorScheme.base}; + + &:hover { + color: ${e=>e.theme?.primaryColorScheme.alpha80}; + } +`;let rV=(0,eV.TB)("esc"),rq="mod+c",rW=(0,eV.TB)(rq),rH="mod+x",rG=(0,eV.TB)(rH),rK="mod+v",rY=(0,eV.TB)(rK),rQ="mod+z",rJ=(0,eV.TB)(rQ),rX="mod+shift+z",r0=(0,eV.TB)(rX),r1="mod+y",r2=(0,eV.TB)(r1),r5=e=>r0(e)||r2(e),r3=(0,eV.TB)("tab"),r4="shift+tab",r6=(0,eV.TB)(r4),r8="mod+a",r7=(0,eV.TB)(r8),r9=(0,eV.TB)("mod+shift+down"),oe=(0,eV.TB)("mod+shift+up"),ot=(0,eV.TB)("shift+down"),oa=(0,eV.TB)("shift+up"),on=(0,eV.TB)("mod+b"),ol=(0,eV.TB)("mod+u"),or=(0,eV.TB)("mod+i"),oo=(0,eV.TB)("mod+e"),oi=(0,eV.TB)("enter"),os=(0,eV.TB)("down"),od=(0,eV.TB)("up"),oc=(0,eV.TB)("mod+k");function om(e){if(rW(e))return rq;if(rG(e))return rH;if(rY(e))return rK;if(rJ(e))return rQ;if(r0(e))return rX;if(r2(e))return r1;if(r7(e))return r8;else if(r3(e))return"tab";else if(r6(e))return r4;else return}let ou=eL.default.input.withConfig({displayName:"Input",componentId:"sc-15124812-0"})` + display: block; + width: 100%; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.textColors.hex(10)}; + border-radius: 0.625rem; + padding: 0.375rem 0.625rem; + ${e1.UiTypography.sm}; + font-weight: 400; + line-height: 1.5; + + // NOTE: (duncan@taskade.com) https://stackoverflow.com/a/40876164 + @media screen and (max-width: 480px) { + ${e1.UiTypography.md}; + } + + ${e=>e.invalid&&(0,eL.css)` + background-repeat: no-repeat; + background-size: calc(2.25rem / 2) calc(2.25rem / 2); + background-position: center right calc(2.25rem / 4); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E"); + border-color: ${eI.ThemeColors.danger}; + padding-right: 2.25rem; + `} + + ${e=>e.valid&&(0,eL.css)` + background-repeat: no-repeat; + background-size: calc(2.25rem / 2) calc(2.25rem / 2); + background-position: center right calc(2.25rem / 4); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"); + border-color: ${eI.ThemeColors.success}; + padding-right: 2.25rem; + `} + + &::-webkit-input-placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } + &:-moz-placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } + &:-ms-input-placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } + + &[type='hidden'] { + margin-bottom: 0; + } + + &:disabled { + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(50)}; + cursor: not-allowed; + } + + &:focus { + outline: none; + box-shadow: none; + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + } +`;var op=a(94184),og=a.n(op),of=a(47037),oh=a.n(of);let oy=eL.default.div.attrs({role:"alert"}).withConfig({displayName:"InputFeedback",componentId:"sc-2c081a45-0"})` + color: ${eI.ThemeColors.danger}; + ${e1.UiTypography.xs}; + line-height: 1.5; + margin: 0 0 0.625rem; +`;var ob=a(23560),ov=a.n(ob);let ok=eL.default.div.withConfig({displayName:"forms__FormGroup",componentId:"sc-c8307fc8-0"})` + margin-bottom: 5px; + margin-top: 5px; + + & label { + display: inline-block; + ${e1.UiTypography.xs}; + color: ${e=>e.theme.textColors.hex(50)}; + text-transform: uppercase; + margin-bottom: 5px; + } + + & .invalid-feedback { + margin-bottom: 10px; + margin-top: 0; + } + + &.has-error { + & .invalid-feedback { + display: block; + } + } + + & > input:placeholder-shown ~ .close-account { + opacity: 0.5; + pointer-events: none; + } +`,oE=e=>ev.createElement("br",{key:e}),ox=(e,t)=>oh()(e)?e:function(e,t){let a=t;return ov()(t)||(a=()=>t),e.reduce((e,t)=>e.concat(t,a(e.length+1)),[]).slice(0,-1)}(e,t),o_=e=>{let t=[...ec()(e,["meta","error"],[]),...ec()(e,["meta","submitError"],[])],{tag:a,formGroupClassName:n,label:l,input:r,submitting:o,...i}=e,s=!ts()(t)&&!o,d=!s&&void 0;return ev.createElement(ok,{className:og()({"has-error":s},n)},l&&ev.createElement("label",{htmlFor:i.id},l),ev.createElement(a,{...r,...i,valid:d,invalid:s}),s&&!o&&ev.createElement(oy,null,ox(t,oE)))};function ow(e){if("number"==typeof e.selectionStart)e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length;else if(void 0!==e.createTextRange){e.focus();let t=e.createTextRange();t.collapse(!1),t.select()}}function oN(e){return{start:e.selectionStart,end:e.selectionEnd}}let oC=eL.default.button.withConfig({displayName:"ForgotPasswordForm__SubmitButton",componentId:"sc-4980b4d2-0"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + border-radius: 10px; + background: #ff2d60; + color: #ffffff; + border: 0; + cursor: pointer; + margin-top: 15px; + + &:focus { + outline: 0; + } + + &:hover { + background: #ff5780; + } +`;function oM(e){function t(e){if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}}return ev.createElement(r$.l0,{onSubmit:(t,a,n)=>{t.email?e.handleSubmit(t,a,n):n({email:["Email is required."]})},render:e=>{let{handleSubmit:a,submitError:n,submitting:l}=e;return ev.createElement("form",{onSubmit:a,action:"/forgot",method:"post",noValidate:!0,autoComplete:"no"},!l&&null!=n&&ev.createElement(rU,{"on-success":!0,$type:"success"},n),ev.createElement(r$.gN,{component:o_,tag:ou,type:"email",id:"email",name:"email",placeholder:"Email Address",required:!0,autoComplete:"email",submitting:l,disabled:l,onKeyDown:t}),ev.createElement(oC,{type:"submit",disabled:l},l&&ev.createElement(eI.Spinner,{color:"#ffffff",delay:0}),!l&&"Reset Password"))}})}oM.propTypes={handleSubmit:l7().func.isRequired};let oS=eL.default.div.withConfig({displayName:"Logo__Container",componentId:"sc-6446dff8-0"})` + display: flex; + width: 100%; + height: 52px; + margin: 0px auto 20px; + justify-content: center; +`,oI=(0,eL.default)(lT.$V).withConfig({displayName:"Logo__LogoIcon",componentId:"sc-6446dff8-1"})` + width: 50px; + height: 50px; +`,oD=()=>ev.createElement(oS,null,ev.createElement(oI,null)),oT=eL.default.div.withConfig({displayName:"forgot__Body",componentId:"sc-f3bc79d6-0"})` + display: flex; + flex-direction: column; + padding: 30px 50px; + + box-sizing: border-box; +`,o$=eL.default.div.withConfig({displayName:"forgot__Footer",componentId:"sc-f3bc79d6-1"})` + display: flex; + flex-direction: column; +`,oP=eL.default.div.withConfig({displayName:"forgot__Heading",componentId:"sc-f3bc79d6-2"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,oF=eL.default.h1.withConfig({displayName:"forgot__Title",componentId:"sc-f3bc79d6-3"})` + font-size: 24px; + font-weight: bold; + color: #333; +`,oA=eL.default.h2.withConfig({displayName:"forgot__Subtitle",componentId:"sc-f3bc79d6-4"})` + font-size: 16px; + color: #999; + font-weight: normal; + margin-bottom: 0; +`,oR=eL.default.div.withConfig({displayName:"forgot__NoAccount",componentId:"sc-f3bc79d6-5"})` + display: flex; + font-size: 15px; + margin-top: 20px; + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + justify-content: center; + padding-bottom: 20px; + + & > button { + background: none; + border: 0; + padding: 0; + margin: 0 0 0 5px; + color: ${e=>e.theme.textColors.hex(10)}; + cursor: pointer; + border-bottom: 1px solid transparent; + + &:hover { + border-bottom: 1px solid #e5e5e5; + } + + &:active { + outline: 0; + } + } +`;class oj extends ev.Component{static propTypes={onResetPassword:l7().func.isRequired,setLoginSignupModalState:l7().func.isRequired};showSignup=()=>{this.props.setLoginSignupModalState({activeView:rI})};renderForgotPasswordForm=()=>{let{onResetPassword:e}=this.props;return ev.createElement(oM,{handleSubmit:e})};render(){return ev.createElement(ev.Fragment,null,ev.createElement(oT,null,ev.createElement(oD,null),ev.createElement(oP,null,ev.createElement(oF,null,"Forgot Password?"),ev.createElement(oA,null,"Enter your email below to reset your password.")),this.renderForgotPasswordForm()),ev.createElement(o$,null,ev.createElement(oR,null,"Don't have an account?",ev.createElement("button",{type:"button",onClick:this.showSignup},"Sign up"))))}}let oO=eL.default.button.withConfig({displayName:"login-form__SubmitButton",componentId:"sc-2ec20265-0"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 38px; + border-radius: 10px; + background: #ff2d60; + color: #ffffff; + border: 0; + cursor: pointer; + margin-top: 15px; + ${e1.UiTypography.sm} + + &:focus { + outline: 0; + } + + &:hover { + background: #ff5780; + } +`,oU=eL.default.div.withConfig({displayName:"login-form__ForgotPassword",componentId:"sc-2ec20265-1"})` + margin-top: 10px; + color: ${e=>e.theme.appColors.hex(50)}; + text-align: center; + ${e1.UiTypography.sm} + + & > a { + color: ${e=>e.theme.appColors.hex(50)}; + border-bottom: 1px solid transparent; + cursor: pointer; + + &:hover { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(50)}; + } + } +`,oZ=function(e){function t(e){if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}}return ev.createElement(r$.l0,{onSubmit:e.handleSubmit,initialValues:e.initialValues,render:a=>{let{handleSubmit:n,submitError:l,submitting:r}=a;return ev.createElement("form",{onSubmit:n,action:"/login",method:"post",noValidate:!0,autoComplete:"no"},!r&&l&&ev.createElement(rO,{padding:"8px 12px",margin:"10px 0",role:"alert"},l),ev.createElement(r$.gN,{component:o_,name:"list",tag:ou,type:"hidden",disabled:r}),ev.createElement(r$.gN,{component:o_,name:"copyAsTemplate",tag:ou,type:"hidden",disabled:r}),ev.createElement(r$.gN,{component:o_,name:"redirect",tag:ou,type:"hidden",disabled:r}),ev.createElement(r$.gN,{component:o_,name:"refresh",tag:ou,type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,type:"text",id:"username",name:"username",placeholder:e.usernameInputPlaceholder,required:!0,autoComplete:"username",autoFocus:!0,onKeyDown:t,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,type:"password",id:"password",name:"password",placeholder:e.passwordInputPlaceholder,required:!0,autoComplete:"email",onKeyDown:t,disabled:r}),ev.createElement(oU,null,ev.createElement("a",{href:"/forgot"},"Forgot password?")),ev.createElement(oO,{type:"submit",disabled:r},r&&ev.createElement(eI.Spinner,{color:"#ffffff",delay:"0"}),!r&&e.submitButtonText))}})};oZ.propTypes={usernameInputPlaceholder:l7().string,passwordInputPlaceholder:l7().string,handleSubmit:l7().func.isRequired,initialValues:l7().shape({copyAsTemplate:l7().bool,list:l7().string,redirect:l7().string}).isRequired,submitButtonText:l7().string},oZ.defaultProps={usernameInputPlaceholder:"Username or email",passwordInputPlaceholder:"Password",submitButtonText:"Log in"};var oL=a(22641),oB=a.n(oL);function oz(e){let t=Object.keys(e).reduce((t,a)=>{let n=ec()(e,[a],null);return n?{...t,[a]:n}:t},{});return ts()(t)?"":oB()({queryParams:t})}let oV=eL.default.a.withConfig({displayName:"SsoDropdown__GoogleSSO",componentId:"sc-ba92b637-0"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + transition: border-color ease-in-out 200ms; + margin-bottom: 4px; + ${e1.UiTypography.sm} + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,oq=(0,eL.default)(lT.vl).withConfig({displayName:"SsoDropdown__GoogleIconStyled",componentId:"sc-ba92b637-1"})` + transform: var(--menu-item-icon-scale); +`,oW=eL.default.a.withConfig({displayName:"SsoDropdown__AppleSSO",componentId:"sc-ba92b637-2"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: black; + color: white; + margin-top: 2px; + ${e1.UiTypography.sm} + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,oH=(0,eL.default)(lT.B0).withConfig({displayName:"SsoDropdown__AppleIconStyled",componentId:"sc-ba92b637-3"})` + margin-right: 8px; + transform: var(--menu-item-icon-scale); +`,oG=eL.default.a.withConfig({displayName:"SsoDropdown__SamlSso",componentId:"sc-ba92b637-4"})` + display: flex; + width: 100%; + margin-top: 2px; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: ${e=>e.theme.appColors.hex(80)}; + color: #fff; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + transition: border-color ease-in-out 200ms; + margin-bottom: 4px; + ${e1.UiTypography.sm}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,oK=function(e){let t=e.copyAsTemplate??!1,a=e.list??null,n=e.redirect??null,l=e.timezone??null,r=e.isSignin??!1,o=oz({copyAsTemplate:t,list:a,redirect:n,timezone:l});return ev.createElement(ev.Fragment,null,ev.createElement(oV,{href:`/auth/google${o}`},ev.createElement(oq,null),r?"Sign in with Google":"Sign up with Google"),ev.createElement(oG,{rel:"noopener noreferrer",href:`/saml/sso${o}`},r?"Sign in with Single Sign On":"Sign up with Single Sign On"),ev.createElement(oW,{rel:"noopener noreferrer",target:"_blank",href:`/auth/apple${o}`},ev.createElement(oH,null),r?"Sign in with Apple":"Sign up with Apple"))},oY=eL.default.div.withConfig({displayName:"login__Body",componentId:"sc-2f1601bc-0"})` + display: flex; + flex-direction: column; + border: 20px; + padding: 30px 50px; + box-sizing: border-box; + min-width: 480px; +`,oQ=eL.default.div.withConfig({displayName:"login__Footer",componentId:"sc-2f1601bc-1"})` + display: flex; + width: 100%; + flex-direction: column; + position: absolute; + bottom: -32px; +`,oJ=eL.default.div.withConfig({displayName:"login__Heading",componentId:"sc-2f1601bc-2"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,oX=eL.default.h1.withConfig({displayName:"login__Title",componentId:"sc-2f1601bc-3"})` + ${e1.ArticleTypography.heading3} + font-weight: bold; + color: ${e=>e.theme.appColors.hex(10)}; + margin: 0 0 5; +`,o0=eL.default.h2.withConfig({displayName:"login__Subtitle",componentId:"sc-2f1601bc-4"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + font-weight: normal; + margin-bottom: 0; +`,o1=eL.default.div.withConfig({displayName:"login__SSOWrapper",componentId:"sc-2f1601bc-5"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,o2=eL.default.div.withConfig({displayName:"login__NoAccount",componentId:"sc-2f1601bc-6"})` + display: flex; + width: 100%; + ${e1.UiTypography.sm}; + margin-top: 20px; + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + justify-content: center; + + & > button { + margin: 0 0 0 5px; + color: ${e=>e.theme.textColors.hex(10)}; + cursor: pointer; + border-bottom: 1px solid transparent; + + &:hover { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(10)}; + } + + &:active { + outline: 0; + } + } +`;class o5 extends ev.Component{static propTypes={claimList:l7().string,copyAsTemplate:l7().bool,onLogin:l7().func.isRequired,redirect:l7().string,setLoginSignupModalState:l7().func.isRequired,timezone:l7().string};static defaultProps={claimList:null,copyAsTemplate:!1,redirect:null,timezone:null};toggleDropDown=()=>{this.setState(e=>({dropdownOpen:!e.dropdownOpen}))};showForgotPassword=()=>{this.props.setLoginSignupModalState({activeView:rD})};showSignup=()=>{this.props.setLoginSignupModalState({activeView:rI})};renderLoginForm=()=>{let{copyAsTemplate:e,claimList:t,onLogin:a,redirect:n}=this.props;return ev.createElement(oZ,{initialValues:{copyAsTemplate:e,list:t,refresh:"true",redirect:n},handleSubmit:a})};render(){let{claimList:e,redirect:t,timezone:a}=this.props;return ev.createElement(ev.Fragment,null,ev.createElement(oY,null,ev.createElement(oD,null),ev.createElement(oJ,null,ev.createElement(oX,null,"Log in"),ev.createElement(o0,null,"Welcome back \uD83D\uDC4B")),ev.createElement(o1,null,ev.createElement(oK,{isSignin:!0,list:e,redirect:t,timezone:a})),this.renderLoginForm()),ev.createElement(oQ,null,ev.createElement(o2,null,"Don't have an account?",ev.createElement("button",{type:"button",onClick:this.showSignup},"Sign up"))))}}let o3=eL.default.button.withConfig({displayName:"signup-form__SubmitButton",componentId:"sc-ae6113e8-0"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 38px; + border-radius: 10px; + background: #ff2d60; + color: #ffffff; + border: 0; + cursor: pointer; + margin-top: 15px; + ${e1.UiTypography.sm} + + &:focus { + outline: 0; + } + + &:hover { + background: #ff5780; + } +`;function o4(e){function t(e){if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}}return ev.createElement(r$.l0,{onSubmit:e.handleSubmit,initialValues:e.initialValues,render:a=>{let{handleSubmit:n,submitError:l,submitting:r}=a;return ev.createElement("form",{onSubmit:n,action:"/signup",method:"post",noValidate:!0,autoComplete:"no"},!r&&l&&ev.createElement(rO,{padding:"10px",margin:"10px 0",role:"alert"},l),ev.createElement(r$.gN,{component:o_,tag:ou,name:"copy",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,name:"copyAsTemplate",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,name:"list",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,name:"redirect",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,name:"referral",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,name:"refresh",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,name:"timezone",type:"hidden",submitting:r,disabled:r}),ev.createElement(r$.gN,{component:o_,tag:ou,type:"email",id:"email",name:"email",placeholder:e.emailInputPlaceholder,required:!0,autoComplete:"email",submitting:r,disabled:r,autoFocus:!0,onKeyDown:t}),ev.createElement(r$.gN,{component:o_,tag:ou,type:"text",id:"username",name:"username",placeholder:e.usernameInputPlaceholder,required:!0,autoComplete:"username",submitting:r,disabled:r,className:"username",onKeyDown:t}),ev.createElement(r$.gN,{component:o_,tag:ou,type:"password",id:"password",name:"password",placeholder:e.passwordInputPlaceholder,required:!0,autoComplete:"email",submitting:r,disabled:r,className:"password",onKeyDown:t}),ev.createElement(o3,{type:"submit",disabled:r},r&&ev.createElement(eI.Spinner,{color:"#ffffff",delay:0}),!r&&e.submitButtonText))}})}o4.propTypes={emailInputPlaceholder:l7().string,usernameInputPlaceholder:l7().string,passwordInputPlaceholder:l7().string,handleSubmit:l7().func.isRequired,initialValues:l7().shape({copyAsTemplate:l7().string,list:l7().string,redirect:l7().string,referral:l7().string,timezone:l7().string}).isRequired,submitButtonText:l7().string},o4.defaultProps={emailInputPlaceholder:"Email",usernameInputPlaceholder:"Username",passwordInputPlaceholder:"Password",submitButtonText:"Sign up"},eL.default.button.withConfig({displayName:"signup__SignUpWithEmail",componentId:"sc-1a347745-0"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: #ff2d60; + color: white; + margin-top: 5px; + font-weight: 500; + border: none; + cursor: pointer; + ${e1.UiTypography.sm}; + + &:hover { + color: white; + background: #ff5780; + } + + &:active { + outline: 0; + } +`;let o6=eL.default.div.withConfig({displayName:"signup__Body",componentId:"sc-1a347745-1"})` + display: flex; + flex-direction: column; + border: 20px; + padding: 30px 50px; + min-width: 480px; + + box-sizing: border-box; +`,o8=eL.default.div.withConfig({displayName:"signup__Footer",componentId:"sc-1a347745-2"})` + display: flex; + width: 100%; + flex-direction: column; + position: absolute; + bottom: -32px; +`,o7=eL.default.div.withConfig({displayName:"signup__Heading",componentId:"sc-1a347745-3"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,o9=eL.default.h1.withConfig({displayName:"signup__Title",componentId:"sc-1a347745-4"})` + ${e1.ArticleTypography.heading3} + color: ${e=>e.theme.appColors.hex(10)}; + margin: 0 0 5px; +`,ie=eL.default.h2.withConfig({displayName:"signup__Subtitle",componentId:"sc-1a347745-5"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + font-weight: normal; + margin-bottom: 0; +`,it=eL.default.div.withConfig({displayName:"signup__SSOWrapper",componentId:"sc-1a347745-6"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`;eL.default.div.withConfig({displayName:"signup__Terms",componentId:"sc-1a347745-7"})` + margin: 10px 0; + color: #999; + text-align: center; + ${e1.UiTypography.sm}; + + & > a { + color: ${e=>e.theme.appColors.hex(10)}; + &:hover { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(10)}; + } + } +`;let ia=eL.default.div.withConfig({displayName:"signup__HaveAccount",componentId:"sc-1a347745-8"})` + display: flex; + width: 100%; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + justify-content: center; + + & > button { + background: none; + border: 0; + padding: 0; + margin: 0 0 0 5px; + color: ${e=>e.theme.textColors.hex(10)}; + cursor: pointer; + border-bottom: 1px solid transparent; + + &:hover { + border-bottom: 1px solid #e5e5e5; + } + + &:active { + outline: 0; + } + } +`;class il extends ev.Component{static propTypes={claimList:l7().string,copyAsTemplate:l7().bool,onSignup:l7().func.isRequired,redirect:l7().string,setLoginSignupModalState:l7().func.isRequired,timezone:l7().string};static defaultProps={claimList:null,copyAsTemplate:!1,redirect:null,timezone:null};state={hideSignUpWithEmail:!1};showLogin=()=>{this.props.setLoginSignupModalState({activeView:rT})};showSignUpWithEmail=()=>{let{hideSignUpWithEmail:e}=this.state;this.setState({hideSignUpWithEmail:!e})};renderSignupForm=()=>{let{claimList:e,copyAsTemplate:t,onSignup:a,redirect:n,timezone:l,toggle:r}=this.props,{hideSignUpWithEmail:o}=this.state;return ev.createElement("div",null,ev.createElement(o4,{initialValues:{copyAsTemplate:null!=t?"true":"false",list:e,refresh:"true",redirect:n,timezone:l},emailInputPlaceholder:"Enter your email",usernameInputPlaceholder:"Create a username",passwordInputPlaceholder:"Create a password",submitButtonText:"Sign up",handleSubmit:a}),ev.createElement("div",{className:"my-4 inline-flex w-full justify-center text-sm text-appcolor-500"},"By signing up you agree to our",ev.createElement("a",{className:"ml-1 border-b border-solid border-transparent text-appcolor-800 hover:border-appcolor-800",href:"/terms",target:"_blank",rel:"noopener noreferrer"},"Terms of Service.")))};render(){let{claimList:e,copyAsTemplate:t,redirect:a,timezone:n}=this.props,{hideSignUpWithEmail:l}=this.state;return ev.createElement(ev.Fragment,null,ev.createElement(o6,null,ev.createElement(oD,null),ev.createElement(o7,null,ev.createElement(o9,null,"Let's get started"),ev.createElement(ie,null,"Create your free account \uD83D\uDE0E")),ev.createElement(it,null,ev.createElement(oK,{copyAsTemplate:t,list:e,redirect:a,timezone:n})),this.renderSignupForm()),ev.createElement(o8,null,ev.createElement(ia,null,"Already a member?",ev.createElement("button",{type:"button",onClick:this.showLogin},"Log in"))))}}let ir=eL.default.div.withConfig({displayName:"main__Container",componentId:"sc-5e63dba8-0"})` + display: flex; + flex-direction: column; + min-width: auto !important; + max-width: 580px; + pointer-events: fill; + justify-content: flex-start; + align-items: stretch; + margin: 0 auto; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + position: relative; +`;class io extends ev.Component{static propTypes={claimList:l7().string,copyAsTemplate:l7().bool,isOpen:l7().bool,onLogin:l7().func.isRequired,onResetPassword:l7().func.isRequired,onSignup:l7().func.isRequired,redirect:l7().string,setLoginSignupModalState:l7().func.isRequired,activeView:l7().string,timezone:l7().string,toggle:l7().func};static defaultProps={claimList:null,copyAsTemplate:!1,isOpen:!1,onClosed:null,redirect:null,activeView:rI,timezone:null,toggle:()=>{}};constructor(e){super(e)}toggleModal=()=>{if(this.inTransition)return;let{toggle:e}=this.props;e()};renderView(){let{claimList:e,copyAsTemplate:t,onLogin:a,onResetPassword:n,onSignup:l,redirect:r,timezone:o}=this.props;switch(this.props.activeView){case rT:return ev.createElement(o5,{onLogin:a,claimList:e,copyAsTemplate:t,redirect:r,setLoginSignupModalState:this.props.setLoginSignupModalState,timezone:o});case rI:return ev.createElement(il,{onSignup:l,copyAsTemplate:t,claimList:e,redirect:r,setLoginSignupModalState:this.props.setLoginSignupModalState,timezone:o,toggle:this.toggleModal});case rD:return ev.createElement(oj,{onResetPassword:n,setLoginSignupModalState:this.props.setLoginSignupModalState});default:return null}}render(){let{isOpen:e,toggle:t}=this.props;return ev.createElement(eI.ModalDialog,{isOpen:e,close:t},()=>ev.createElement(ir,null,this.renderView()))}}let ii=new Set(["starter","lite","unlimited"]),is={id:"",user:null},id=new tV.fK.Entity("collaborators",{user:tW}),ic=new tV.fK.Array(id);class im extends(0,tz.Record)(is){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new im(e)}}function iu(e){return e.startsWith("#")}let ip=new tV.fK.Entity("spaces");ip.define({parent:ip});let ig=new tV.fK.Array(ip),ih={id:"",name:"",color:"",role:"",order:0,inviteURL:"",hasRemovePermissions:!1,memberCount:0,preferences:{},isArchived:!1,isUnread:!1,parent:ip,type:""};class iy extends(0,tz.Record)(ih){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new iy(e)}hasCustomColor(){return iu(this.color)}getColorClassNames(){var e,t;return e=this.id,iu(t=this.color)?["custom",`custom-${e}`]:[t]}get avatar(){return ec()(this,["preferences","avatars","default","hdpi","url"],null)}get smallAvatar(){return ec()(this,["preferences","avatars","small","hdpi","url"],null)}isOwner(){return"owner"===this.role}toEntity(){var e;return(e=[this.toJS()],(0,tV.Fv)(e,ig)).entities.spaces[this.id]}}let ib=new tV.fK.Entity("tags"),iv=new tV.fK.Array(ib),ik={id:0,key:"",rawKey:"",preferences:{}};class iE extends(0,tz.Record)(ik){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new iE(e)}toEntity(){var e;return(e=[this.toJS()],(0,tV.Fv)(e,iv)).entities.tags[this.id]}}let ix=new tV.fK.Entity("documents",{space:ip,creator:tW,collaborators:ic,tags:iv}),i_=new tV.fK.Array(ix),iw={id:"",assignments:[],collaborators:[],createdBy:"",creator:null,editPath:"",isOwner:!1,isSharedWithUser:!1,isStarred:!1,isCleared:!1,isArchived:!1,isCompleted:!1,isPinned:!1,isDummy:!1,isTemplate:!1,hasCommentDeletePermission:!1,hasFileDeletePermission:!1,hasEditPermission:!1,hasMovePermission:!1,path:"",percentCompleted:0,role:{},sharedPreferences:{},space:null,starPath:"",spaceType:"",tags:[],title:"",updatedFromNow:"",updatedBy:"",viewPath:"",isUnread:!1},iN="active",iC="archived",iM="templated";function iS(e){return(0,tV.Fv)(e,i_)}class iI extends(0,tz.Record)(iw){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new iI(e)}getStatus(){return this.isArchived?iC:this.isTemplate?iM:iN}toEntity(){return iS([this.toJS()]).entities.documents[this.id]}getAvatarEmoji(){let e=this.sharedPreferences.avatar;return null==e?null:"emoji"===e.type?e.value:null}}function iD(e,t){try{return e.marks.some(e=>e?.type===t)}catch(a){return er.$e(n=>{n.setExtra("value",JSON.stringify(e.toJSON(),null,2)),n.setExtra("selection",JSON.stringify(e.selection?.toJSON(),null,2)),n.setExtra("type",t),er.Tb(a)}),!1}}function iT(e,t,a,n){if(null==e||null==t||a||t.isBlurred||t.isCollapsed&&!n)return null;let{endOffset:l,startOffset:r}=t;return{nodeID:e,bold:iD(t,"bold"),italic:iD(t,"italic"),underline:iD(t,"underline"),highlight:function(e){try{let t=e.marks.toArray(),a=null;for(let e of t){if(e?.type!=="highlight")continue;let t=e?.data.get("colorName");if(null==a){a=t;continue}if(a!==t)return null}return a}catch(t){er.$e(a=>{a.setExtra("value",JSON.stringify(e.toJSON(),null,2)),a.setExtra("selection",JSON.stringify(e.selection?.toJSON(),null,2)),a.setExtra("type","highlight"),er.Tb(t)})}return null}(t),selection:{end:l,start:r}}}var i$=a(18721),iP=a.n(i$);function iF(e){return e?.attachments}function iA(e,t){return e?.attachments?.[t.nodeID]??null}function iR(e){return e.contents.rootID}function ij(e){return e.contents.rootNode}function iO(e){let t=iR(e);return e.slate.getIn([t,"text"],null)}function iU(e){return ec()(e,["meta","isOwner"],!iP()(e,["meta","id"]))}let iZ=(0,tB.P1)([iR],e=>[]);function iL(e){return e.contents}function iB(e,t){return t.nodeID}function iz(e){return e.search}function iV(e,t){let a=iB(e,t);return e.slate.getIn([a,"text"],null)}function iq(){return(0,tB.P1)([iL,iB],(e,t)=>e.findNodeByID(t))}function iW(e,t){let{ancestors:a}=t,n=iL(e),l=iB(e,t),r=n.findNodeByID(l),o=r?.format?.node;if(null!=o)return ec()(li.FORMAT_CLASS_NAMES,[o],li.CLASS_NAME_CHECKBOX);let i=a[a.length-1],s=n.findNodeByID(i);return s?.format?.children!=null?null:li.CLASS_NAME_CHECKBOX}function iH(e,t){let a=iL(e),n=iB(e,t),l=a.findNodeByID(n),r=l?.format?.children;return li.CHILDREN_FORMAT_CLASS_NAMES[r]}function iG(e){return e.documentPreferences}function iK(){return(0,tB.P1)([iL,iB],(e,t)=>e.findDescendantsForNode(t).every(t=>e.getIn(["nodes",t,"completed"])))}let iY=(0,tB.P1)([iL],e=>2===e.nodes.size),iQ=(0,tB.P1)([i6,iY],(e,t)=>!!e||!!t);function iJ(e,t){let a=iL(e),{ancestors:n,indexOfNode:l}=t;if(0===l)return null;let r=n[n.length-1],o=a.findNodeByID(r);if(null==o)return null;let i=o.children.get(l-1);if(null==i)return null;let s=a.findNodeByID(i);return s?.format?.node!=null?s.format.node:o?.format?.children!=null?o.format.children:null}function iX(e){return ec()(e,["entities","spaces","entities"],{})}function i0(e,t){return ec()(e,["entities","tags","entities"],{})}function i1(e,t){return ec()(e,["entities","users","entities"],{})}function i2(e,t,a,n,l,r){let o=ec()(t,[e],null);if(o){let e=ec()(a,[o.space],null),t=o.collaborators.map(e=>ec()(l,[e],null)).filter(e=>!eu()(e)).map(e=>{let t=new tH({...ec()(n,[e.user],null)});return new im({...e,user:t})}),i=o.tags?o.tags.map(e=>ec()(r,[e],null)).filter(e=>!eu()(e)).map(e=>new iE(e)):[],s=null;e&&(s=new iy(e));let d=new tH({...ec()(n,[o.creator],null)});return new iI({...o,space:s,collaborators:t,creator:d,tags:i})}return null}function i5(e){return ec()(e,["session","focusNodeID"],null)}function i3(e){let t=i5(e);if(eu()(t))return null;let{slate:a}=e;return a.getIn([t,"text"],null)}function i4(e){let t=i5(e);return!eu()(t)&&t===iL(e).rootID}function i6(e,t){return iB(e,t)===i5(e)}(0,tB.P1)([i5,iL],(e,t)=>{if(eu()(e)||eu()(t))return!1;let a=t.findNodeByID(e);return!eu()(a)&&a.completed});let i8=(0,tB.P1)([i5,i3,i4],(e,t,a)=>iT(e,t,a,!1));function i7(e,t){return ec()(e,["entities","documents","entities"],{})}function i9(e,t){return ec()(e,["entities","collaborators","entities"],{})}function se(e,t,a){let n=i7(e,t),l=iX(e,t);return i2(a,n,l,i1(e,t),i9(e,t),i0(e,t))}function st(e){return ec()(e,["session","formatMenuState"],null)}(0,tB.P1)([function(e,t){return ec()(e,["documents","shared","list"],[])},i7,iX,i1,i9,i0],function(e,t,a,n,l,r){return e.map(e=>i2(e,t,a,n,l,r)).filter(e=>!eu()(e))}),(0,tB.P1)([st,iL],(e,t)=>{if(eu()(e))return null;let{nodeID:a,ancestors:n}=e;return n.length>1?t.findNodeByID(n[n.length-1]):t.findNodeByID(a)}),(0,tB.P1)([st],e=>{if(eu()(e))return null;let{ancestors:t}=e;return t.length>1?li.FORMAT_TYPE_CHILDREN:li.FORMAT_TYPE_NODE});let sa=(0,tB.P1)([st,iL],(e,t)=>{if(eu()(e))return null;let{nodeID:a,ancestors:n}=e;if(n.length>1){let e=n[n.length-1],a=t.findNodeByID(e);return a?a.getIn(["format","children"],null):null}{let e=t.findNodeByID(a);return null!=e?e.getIn(["format","node"],null):null}});(0,tB.P1)([sa],e=>ec()(li.MENU_CLASS_NAMES,[e],li.CLASS_NAME_MENU_CHECKBOX));let sn=(0,tB.P1)([iL],e=>!eu()(e)&&e.isAllCollapsed),sl=(0,tB.P1)([iL],e=>!eu()(e)&&e.isCollapsible),sr=(0,tB.P1)([iL],e=>!eu()(e)&&e.isAllCompleted);function so(e){return ec()(e,["modal","spaceNotification","isOpen"],!1)}function si(e){return ec()(e,["modal","documentNotification","isOpen"],!1)}(0,tB.P1)([function(e){return ec()(e,["modal","documentInvite","documentID"],null)},i7,iX,i1,i9],i2);class ss extends ev.Component{static propTypes={activeView:l7().string,copyAsTemplate:l7().bool,documentIsOwner:l7().bool,enableCopyList:l7().bool,location:l7().shape({pathname:l7().string.isRequired,search:l7().string.isRequired,hash:l7().string.isRequired}),modalIsOpen:l7().bool,setLoginSignupModalState:l7().func.isRequired,submitForgotPasswordForm:l7().func.isRequired,submitSignInForm:l7().func.isRequired,submitSignUpForm:l7().func.isRequired,toggleLoginSignupModal:l7().func.isRequired,user:l7().shape()};static defaultProps={activeView:rI,copyAsTemplate:!1,documentIsOwner:!1,enableCopyList:!1,location:null,modalIsOpen:!1,user:null};getRedirectPath=()=>{let{location:e,user:t}=this.props,{pathname:a,search:n,hash:l}=e||{};return a&&((0,eF.LX)(a,{path:eZ.editor,exact:!0})||(0,eF.LX)(a,{path:eZ.document,exact:!0})||(0,eF.LX)(a,{path:eZ.embed,exact:!0}))?`${a}${n||""}${l||""}`:null};getClaimListPath=()=>{let{documentIsOwner:e,enableCopyList:t,user:a}=this.props;return eu()(a)&&(e||t)?this.getRedirectPath():null};handleOnLogin=(e,t,a)=>{this.props.submitSignInForm(e,t,a)};handleOnResetPassword=(e,t,a)=>{this.props.submitForgotPasswordForm(e,t,a)};handleOnSignup=(e,t,a)=>{this.props.submitSignUpForm(e,t,a)};render(){let{modalIsOpen:e,activeView:t,enableCopyList:a,setLoginSignupModalState:n,toggleLoginSignupModal:l}=this.props,r=this.getClaimListPath(),o=r&&(!r||a)?null:this.getRedirectPath(),i=eG().tz.guess();return ev.createElement(io,{isOpen:e,redirect:o,claimList:r,activeView:t,setLoginSignupModalState:n,timezone:i,toggle:l,onLogin:this.handleOnLogin,onResetPassword:this.handleOnResetPassword,onSignup:this.handleOnSignup})}}let sd=(0,e$.connect)(function(e){return{documentIsOwner:iU(e),enableCopyList:ec()(e,["modal","loginSignup","enableCopyList"],!1),modalIsOpen:ec()(e,["modal","loginSignup","isOpen"],!1),activeView:ec()(e,["modal","loginSignup","activeView"],!1),user:t7(e)}},function(e){return(0,ek.DE)({connect:rC,disconnect:rM,editorDidMount:rs,editorDidUnmount:rd,setLoginSignupModalState:rh,submitForgotPasswordForm:rn,submitSignUpForm:rl,submitSignInForm:rr,toggleLoginSignupModal:rE},e)})(ss),sc="OUT_OF_SYNC",sm="@@taskade/editor/UPDATE_FETCH",su="@@taskade/space/SET_SPACE_IS_NEW",sp="@@taskade/user/SET_USER_IS_NEW",sg="@@taskade/session/CLEAR_BACKEND_ERROR",sf="@@taskade/session/TOGGLE_SIDE_DRAWER",sh="@@taskade/session/TOGGLE_RIGHT_SIDEBAR",sy="@@taskade/session/CLOSE_SIDE_DRAWER",sb="@@taskade/session/SET_FIREBASE_NOTIFICATION_PERMISSION";function sv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:sm,payload:{status:e,result:t}}}function sk(){return{type:sg,payload:{}}}function sE(e){return{type:sf,payload:{open:e}}}function sx(){return{type:sy,payload:{}}}function s_(e){return{type:sb,payload:{permission:e}}}function sw(e){return{type:sh,payload:{open:e}}}let sN=(0,la.ZP)` + query MeQuery { + me { + id + email + handle + initials + default_name + display_name + locale + timezone + created_at + avatars_v2 { + default { + mdpi { + url + } + } + small { + ldpi { + url + } + mdpi { + url + } + } + } + preferences { + dayOfWeek + timeFormat + isNightMode + isSidebarClosed + emojiSkin + onboardSpaceTour + onboardEditorTour + } + } + } +`;var sC=a(73727);let sM=eL.default.div.withConfig({displayName:"ErrorBody__ScreenWrapper",componentId:"sc-eda706be-0"})` + max-width: 400px; + display: flex; + flex-direction: column; + margin: auto; + align-items: center; +`,sS=eL.default.div.withConfig({displayName:"ErrorBody__StyledIconContainer",componentId:"sc-eda706be-1"})` + width: 60px; + height: 60px; + background: ${e=>e.theme.appColors.hex(80)}; + display: flex; + border-radius: 6px; + margin-bottom: ${eI.UiSpacing.getPx(7)}; + align-items: center; + justify-content: center; +`,sI=(0,eL.default)(tn.Icon).attrs({icon:"share_password"}).withConfig({displayName:"ErrorBody__StyledIcon",componentId:"sc-eda706be-2"})` + path { + fill: ${e=>e.theme.appColors.hex(0)}; + } +`,sD=eL.default.div.withConfig({displayName:"ErrorBody__StyledTextBody",componentId:"sc-eda706be-3"})` + font-size: 18px; + font-weight: 400; + line-height: 24px; + color: ${e=>e.theme.appColors.hex(0)}; +`,sT=eL.default.div.withConfig({displayName:"ErrorBody__ButtonWrapper",componentId:"sc-eda706be-4"})` + margin-top: ${eI.UiSpacing.getPx(7)}; +`,s$=eL.default.button.withConfig({displayName:"ErrorBody__DashboardButton",componentId:"sc-eda706be-5"})` + background: #7b7ee3; + padding: 7px 16px 8px; + border-radius: 10px; + width: 300px; + font-weight: 500; + font-size: 14px; + line-height: 17px; + color: ${e=>e.theme.isNightMode?`${e.theme.appColors.hex(0)}`:`${e.theme.appColors.hex(100)}`}; +`,sP=eL.default.div.withConfig({displayName:"ErrorBody__Divider",componentId:"sc-eda706be-6"})` + border: 1px solid; + border-color: ${e=>e.theme.appColors.hex(80)}; + width: 234px; + margin-top: ${eI.UiSpacing.getPx(10)}; + margin-bottom: ${eI.UiSpacing.getPx(7)}; +`,sF=eL.default.div.withConfig({displayName:"ErrorBody__StyledErrorMessage",componentId:"sc-eda706be-7"})` + font-size: 15px; + font-weight: 400; + line-height: 18px; + color: ${e=>e.theme.appColors.hex(50)}; + span { + color: ${e=>e.theme.appColors.hex(0)}; + cursor: pointer; + } +`,sA=function(e){let{currentUser:t}=e,a=null!=t,n=t?.handle,l=(0,e$.useDispatch)(),r=()=>{l(rh({isOpen:!0,activeView:rT}))};return ev.createElement(sM,{className:"px-10 sm:px-0"},ev.createElement(sS,null,ev.createElement(sI,null)),ev.createElement(sD,null,e.children),a&&ev.createElement(sT,null,ev.createElement(sC.rU,{to:"/"},ev.createElement(s$,null,ev.createElement(eY.Z,{id:"general.user_dashboard",defaultMessage:"Back to Dashboard"})))),ev.createElement(sP,null),ev.createElement(sF,null,a?ev.createElement(eY.Z,{id:"general.user_login_status_and_actionables",defaultMessage:"You're currently logged in as {userHandle}. You may need to log in to another account or request access from a project admin.",values:{span:e=>ev.createElement("span",null,e),userHandle:n}}):ev.createElement(eY.Z,{id:"general.guest_login_status_and_actionables",defaultMessage:"You're currently not logged in. You may need to log in to view this project or request access from a project admin.",values:{span:e=>ev.createElement("span",{onClick:r},e)}})))},sR=eL.default.div.withConfig({displayName:"Header__Container",componentId:"sc-aa08de9-0"})` + display: flex; + justify-content: space-between; + background: ${e=>e.theme.isNightMode?"#1d1f22":`${e.theme.appColors.hex(100)}`}; + padding: 8px 20px; + box-shadow: 0px 1px 0px; + color: ${e=>e.theme.isNightMode?"#333333":`${e.theme.appColors.hex(80)}`}; +`,sj=eL.default.div.withConfig({displayName:"Header__ButtonsContainer",componentId:"sc-aa08de9-1"})` + display: flex; +`,sO=eL.default.button.withConfig({displayName:"Header__SignUpButton",componentId:"sc-aa08de9-2"})` + border-radius: 10px; + padding: 2px 12px; + font-size: 14px; + font-weight: 400; + line-height: 24px; + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(70)}; + margin-left: 4px; + &:hover { + background: ${e=>e.theme.appColors.hex(60)}; + } +`,sU=eL.default.button.withConfig({displayName:"Header__LoginButton",componentId:"sc-aa08de9-3"})` + color: ${e=>e.theme.appColors.hex(10)}; + font-size: 14px; + font-weight: 400; + line-height: 24px; + padding: 2px 4px; +`,sZ=function(e){let{isLoggedIn:t}=e,a=(0,e$.useDispatch)(),n=(0,eI.useTheme)();return ev.createElement(sR,null,ev.createElement(sC.rU,{to:"/"},n.isNightMode?ev.createElement(lT.Ng,{width:96,height:24}):ev.createElement(lT.nV,{width:96,height:24})),!t&&ev.createElement(sj,null,ev.createElement(sU,{type:"button",onClick:()=>{a(rh({isOpen:!0,activeView:rT}))}},ev.createElement(eY.Z,{id:"general.login",defaultMessage:"Log in"})),ev.createElement(sO,{type:"button",onClick:()=>{a(rh({isOpen:!0,activeView:rI}))}},ev.createElement(eY.Z,{id:"general.signup",defaultMessage:"Sign up"}))))},sL=eL.default.div.withConfig({displayName:"EditorError__Wrapper",componentId:"sc-efd6d99c-0"})` + display: flex; + flex-direction: column; + height: 100vh; + flex-wrap: wrap; + text-align: center; +`,sB=function(e){let{errorCode:t}=e,{data:a}=(0,eB.a)(sN),n=a?.me;return ev.createElement(sL,null,ev.createElement(sZ,{isLoggedIn:null!=n}),"PROJECT_UNAVAILABLE"===t?ev.createElement(sA,{currentUser:n},ev.createElement(eY.Z,{id:"general.no_access_error_message",defaultMessage:"You don't have permission to view this project. Please contact the project admin to grant you access."})):null)};var sz=a(87536);let sV=function(){let e=(0,eF.TH)(),{register:t,handleSubmit:a,setError:n,formState:{errors:l,isSubmitting:r}}=(0,sz.cI)({defaultValues:{password:""}}),o=a(async(t,a)=>{if(null==a)return;let l=new URLSearchParams;if(l.append("password",t.password),(await fetch(e.pathname,{method:"POST",body:l})).ok)throw a.target.submit(),await new Promise(e=>setTimeout(e,15e3)),new ei.HttpError({code:"BAD_REQUEST",message:"Timeout"});n("password",{type:"custom",message:"Wrong password"})});return ev.createElement("div",{className:"grid h-screen place-items-center"},ev.createElement("form",{method:"POST",onSubmit:o},ev.createElement("div",{className:"flex flex-col items-center justify-center"},ev.createElement("div",{className:"mb-6 flex h-16 w-16 items-center justify-center rounded bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"share_password"})),ev.createElement("span",{className:"py-2 text-lg font-bold"},"Enter Password"),ev.createElement("span",{className:"mb-2 py-2"},"Please enter your password to view this project."),ev.createElement("div",{className:og()("flex w-full cursor-text flex-row flex-wrap items-center gap-x-1.5 gap-y-1 rounded-lg border border-appcolor-300 px-3 py-1.5",{"border-danger":null!=l.password})},ev.createElement("input",{...t("password"),type:"password",className:"shrink grow rounded bg-transparent text-sm"})),null!=l.password&&ev.createElement("span",{className:"mt-2 flex self-start text-sm text-danger"},l.password.message),ev.createElement("button",{className:"mt-4 w-full rounded-lg bg-[#7b7ee3] px-4 py-2 text-sm font-medium text-appcolor-800",type:"submit",disabled:r},r?ev.createElement(eI.Spinner,{width:12,height:12}):"Open Project"))))},sq=function(e){let{backendError:t}=e,{data:a}=(0,eB.a)(sN),n=a?.me;return ev.createElement("div",{className:"flex h-screen flex-col flex-wrap text-center"},ev.createElement(sZ,{isLoggedIn:null!=n}),"SPACE_MEMBER_LIMIT"===t.code?ev.createElement(sA,{currentUser:n},ev.createElement(eY.Z,{id:"general.space_member_limit_error_message",defaultMessage:"Maximum invites reached for this workspace or folder. Please contact the workspace owner to increase the invite limit."})):null)},sW={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUserQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"locale"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"default"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dayOfWeek"}},{kind:"Field",name:{kind:"Name",value:"timeFormat"}},{kind:"Field",name:{kind:"Name",value:"isNightMode"}},{kind:"Field",name:{kind:"Name",value:"isSidebarClosed"}},{kind:"Field",name:{kind:"Name",value:"emojiSkin"}},{kind:"Field",name:{kind:"Name",value:"onboardSpaceTour"}},{kind:"Field",name:{kind:"Name",value:"onboardEditorTour"}},{kind:"Field",name:{kind:"Name",value:"automationEarlyAccess"}}]}}]}}]}}]},sH=function(){let{data:e}=(0,eB.a)(sW),t=e?.me,a=(0,e$.useDispatch)(),n=()=>{a(rh({isOpen:!0,activeView:rT}))};return ev.createElement("div",{className:"flex h-screen flex-col flex-wrap px-10 text-center sm:px-0"},ev.createElement(sZ,{isLoggedIn:null!=t}),ev.createElement("div",{className:"m-auto flex max-w-sm flex-col items-center"},ev.createElement("div",{className:"mb-7 flex h-14 w-14 items-center justify-center rounded-md bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"share_password",className:"fill-appcolor-800"})),ev.createElement("div",{className:"text-lg text-appcolor-800"},ev.createElement(eY.Z,{id:"general.user_verification_required_error_message",defaultMessage:"Please verify your email before subscribing to Taskade."})),null!=t&&ev.createElement("div",{className:"mt-7"},ev.createElement(sC.rU,{className:"inline-block w-72 rounded-lg bg-[#7b7ee3] px-4 py-2 text-sm font-medium text-appcolor-800",to:"/settings"},ev.createElement(eY.Z,{id:"general.go_to_settings",defaultMessage:"Go to Settings"}))),ev.createElement("div",{className:"mt-10 mb-7 inline-block w-60 border border-appcolor-200"}),ev.createElement("div",{className:"text-sm text-appcolor-500"},null!=t?ev.createElement(eY.Z,{id:"general.user_verification_required_user_details",defaultMessage:"You're currently logged in as {userHandle}.",values:{span:e=>ev.createElement("span",{className:"cursor-pointer text-appcolor-800"},e),userHandle:t.handle}}):ev.createElement(eY.Z,{id:"general.user_verification_required_guest_details",defaultMessage:"You're currently not logged in. You may need to log in continue.",values:{span:e=>ev.createElement("span",{className:"cursor-pointer text-appcolor-800",onClick:n},e)}}))))},sG=eL.default.a.withConfig({displayName:"View4xx__SignUpButton",componentId:"sc-886e283e-0"})` + position: relative; + margin-left: 12px; + background-color: transparent; + border-radius: 20px; + text-decoration: none; + font-weight: 600; + padding: 8px 18px; + display: flex; + align-items: center; + justify-content: center; + + &:before { + content: ''; + position: absolute; + inset: -1px; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(0deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } +`,sK=function(e){let t=e.capture??!1,a=e.header??"404: Page Not Found",n=e.imageUrl??"/images/404.svg",l=e.isCard??!0,r=e.metadata??null,o=e.subheader??"We couldn’t find the page you were looking for. Check to see if you have typos in the URL and try again.",i=e.windowTitle,s=e.showReturnLink??!1,{onMount:d}=e;return ev.useEffect(()=>{d?.(),t&&er.$e(e=>{e.setExtras({windowTitle:i,isCard:l,imageUrl:n,header:a,metadata:r}),er.uT(a)})},[]),ev.createElement("div",{className:"flex h-screen flex-col justify-between p-4"},ev.createElement("div",{className:"flex flex-col px-2 md:px-8"},ev.createElement("div",{className:"flex items-center py-4"},ev.createElement("a",{className:"flex w-40 transition duration-150 ease-in-out hover:scale-105 hover:opacity-80",href:"/"},ev.createElement(lT.nV,{className:"text-appcolor-1000"})),ev.createElement("div",{className:"flex w-full items-center justify-end gap-x-4 text-sm"},ev.createElement("a",{className:"hidden border-b-2 border-textcolor-300 text-textcolor-500 hover:border-textcolor-900 hover:text-textcolor-900 md:flex",href:"/features",target:"_blank",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.features_link",defaultMessage:"Features"})),ev.createElement("a",{className:"hidden border-b-2 border-textcolor-300 text-textcolor-500 hover:border-textcolor-900 hover:text-textcolor-900 md:flex",href:"https://help.taskade.com",target:"_blank",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.help_link",defaultMessage:"Help"})),ev.createElement("a",{className:"border-b-2 border-textcolor-300 text-textcolor-500 hover:border-textcolor-900 hover:text-textcolor-900",href:"/downloads",target:"_blank",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.downloads_link",defaultMessage:"Downloads"})),ev.createElement(sG,{href:"/signup"},ev.createElement("span",{className:"button-value-desktop text-moving-rainbow"},ev.createElement("span",{className:"flex md:hidden"},ev.createElement(eY.Z,{id:"general.sign_up",defaultMessage:"Sign up"})),ev.createElement("span",{className:"hidden md:flex"},ev.createElement(eY.Z,{id:"general.sign_up_for_free",defaultMessage:"Sign up for free"})))))),ev.createElement("div",{className:"flex flex-col items-center pt-10"},ev.createElement("div",{className:"flex max-w-xl flex-col items-center justify-center text-center"},ev.createElement("div",{className:"max-w-md"},ev.isValidElement(n)?n:ev.createElement("a",{href:"https://www.taskade.com/"},ev.createElement("img",{className:"max-w-lg",src:n,alt:a}))),s&&ev.createElement("a",{onClick:e=>{e.preventDefault(),window.location.reload()},href:"#"},ev.createElement(eY.Z,{id:"general.refresh_page",defaultMessage:"Refresh page"})),ev.createElement("h1",{className:"text-heading2 font-bold text-appcolor-900"},a),null!=o&&ev.createElement("h2",{className:"mt-2 text-sm text-appcolor-500"},o)))),ev.createElement("div",{className:"mt-5 flex items-center justify-between p-4"},ev.createElement("div",{className:"flex"},ev.createElement("a",{className:"text-appcolor-500 hover:text-appcolor-800",href:"/"},ev.createElement(eY.Z,{id:"general.learn_more",defaultMessage:"Learn more."}))),ev.createElement("div",{className:"flex gap-3"},ev.createElement("a",{className:"text-appcolor-500 hover:text-appcolor-800",href:"https://www.youtube.com/taskade",target:"_blank",rel:"noopener noreferrer"},ev.createElement(tn.Icon,{icon:"social_youtube"})),ev.createElement("a",{className:"text-appcolor-500 hover:text-appcolor-800",href:"https://twitter.com/taskade",target:"_blank",rel:"noopener noreferrer"},ev.createElement(tn.Icon,{icon:"social_twitter"})),ev.createElement("a",{className:"text-appcolor-500 hover:text-appcolor-800",href:"https://www.instagram.com/taskade/",target:"_blank",rel:"noopener noreferrer"},ev.createElement(tn.Icon,{icon:"social_instagram"})))))},sY=eL.default.a.withConfig({displayName:"PromptGenerator__GenerateButton",componentId:"sc-9a4e4274-0"})` + &:before { + content: ''; + position: absolute; + inset: -1px; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(0deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + will-change: filter; + } +`,sQ=function(){let e=ev.useMemo(()=>eW().sample(["Kickstart a new project instantly","Plan your next big task instantly","Outline your goals instantly","Plan your agenda instantly","Brainstorm new ideas instantly","Organize your tasks instantly","Map out anything instantly","Boost your productivity instantly","Create a roadmap instantly"]),[]);return ev.createElement("div",{className:"mt-10 flex flex-row items-center gap-2 rounded-xl border-4 border-solid border-appcolor-500/30 bg-appcolor-100 px-3 py-3 transition duration-150 ease-in-out focus-within:border-appcolor-500/50 hover:border-appcolor-500/50 md:px-4"},ev.createElement("div",{className:"flex w-full"},ev.createElement(tn.Icon,{className:"mr-2 shrink-0 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("input",{placeholder:e,className:"w-full bg-transparent text-appcolor-800 placeholder:text-appcolor-500",onKeyDown:e=>{"Enter"===e.key&&(window.location.href="/")}})),ev.createElement(sY,{className:"relative ml-auto flex h-8 w-auto items-center justify-center px-3 font-normal md:w-fit md:px-4",href:"/"},ev.createElement("span",{className:"flex items-center gap-x-1 whitespace-nowrap"},ev.createElement(tn.Icon,{className:"shrink-0 animate-color-rainbow",icon:"dd_ai_spark"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.start_with_ai",defaultMessage:"Start with AI"})))))},sJ={Subheader:function(){return ev.createElement(ev.Fragment,null,ev.createElement("p",{className:"mb-4"},ev.createElement(eY.Z,{id:"general.error_404",defaultMessage:"Recheck the URL, or better yet, explore Taskade! Craft instant workflows and mind maps, automate any tasks with AI agents, and 10x your productivity with AI."})),ev.createElement(sQ,null))},Image:function(e){let t=ev.useMemo(()=>["man punctured the tires of his bicycle.svg","man catches a dead fish in an aquarium.svg","man fell asleep on the job.svg","man fell off a bridge.svg","man fell on a rocket.svg","man flies without a parachute.svg","man got tangled up in a fire hose.svg","man hanging from a branch.svg","man lifting a heavy barbell.svg","man looks into the distance.svg","man running in a wheel.svg","man saws big brain.svg","man says goodbye to his computer.svg","man stepping into a hole.svg","man was caught by a large octopus.svg","man was left without a charger.svg","man's pie is burnt.svg","woman caught her cat by the tail.svg","woman fell down and sobbed.svg","woman fell down the stairs.svg","woman gets sucked into the UFO.svg","woman looking for her fish.svg","woman pulls a feather from an ostrich.svg","woman sitting on a barrel of explosives.svg","woman slipped on the ice.svg","woman sprayed with spray can.svg","woman walks against a strong wind.svg","woman was afraid of a computer explosion.svg","woman with an axe hits an ATM.svg"],[]),a=ev.useMemo(()=>{let e=eW().sample(t);return(0,ei.assert)(null!=e),`/images/404/${encodeURIComponent(e)}`},[t]);return ev.createElement("a",{className:"flex transition duration-150 ease-in-out hover:rotate-6 hover:scale-110",href:"https://www.taskade.com/"},ev.createElement("img",{src:a,alt:e.header}))}};var sX=a(13644);let s0=function(){let e=(0,eF.TH)(),t=ev.useMemo(()=>{let t=e.pathname;return(0,sX.isStringNotBlank)(e.search)&&(t+=`?${e.search}`),new URLSearchParams({redirect:t}).toString()},[e.pathname,e.search]);return ev.createElement(ev.Fragment,null,"Looks like you're unauthorized to see this page,"," ",ev.createElement(sC.rU,{className:"text-primary",to:{pathname:"/login",search:t}},"login")," ","and try again.")},s1=eL.default.a.withConfig({displayName:"ErrorScreen__StyledAnchor",componentId:"sc-f0d0c3e2-0"})` + color: ${e=>e.theme.primaryColorScheme?.base}; +`,s2=function(e){let{backendError:t}=e,a=(0,e$.useDispatch)(),n=(0,eF.TH)(),l=(0,eF.$B)();ev.useEffect(()=>()=>{a(sk())},[a]);let[r,o]=ev.useState(null);function i(){let{statusCode:e,statusMessage:a,view:n}=t;switch(n){case"404":return"Uh-oh! Lost in Space?";case"error":return"Error";default:return`${e}: ${a}`}}ev.useEffect(()=>{if(eu()(r)){o(n);return}(n.pathname!==r.pathname||n.search!==r.search)&&a(sk())},[a,r,n]);let{statusCode:s,code:d}=t;return"PROJECT_UNAVAILABLE"===d?ev.createElement(sB,{errorCode:d}):"SPACE_MEMBER_LIMIT"===d?ev.createElement(sq,{backendError:t}):"USER_VERIFICATION_REQUIRED"===d?ev.createElement(sH,{backendError:t}):"PASSWORD_REQUIRED"===d?ev.createElement(sV,{backendError:t}):ev.createElement(sK,{capture:null==s||s>=500,imageUrl:function(){let{view:e}=t;switch(e){case"401":case"403":case"5xx":return"/images/403.svg";case"404":{let e=i();return ev.createElement(sJ.Image,{header:e})}default:return}}(),windowTitle:`${s} - Taskade`,header:i(),subheader:function(){let{message:e,view:a}=t;switch(a){case"401":return ev.createElement(s0,null);case"403":return"You don't have permission to view this page. Please request access or log in and try again.";case"404":return ev.createElement(sJ.Subheader,null);case"5xx":return ev.createElement(ev.Fragment,null,"Looks like something went wrong! Don't hesitate to report it by using our"," ",ev.createElement(s1,{href:"/contact"},"Contact Us")," page.",ev.createElement("p",null,e));case"error":return e||null;default:return null}}(),metadata:{backendError:t,location:n,match:l}})},s5=function(){return ev.createElement(eT.ql,null,ev.createElement("link",{rel:"icon",href:"/favicon.ico",type:"image/x-icon"}))},s3={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectSharedPreferencesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shareToken"}},type:{kind:"NamedType",name:{kind:"Name",value:"ShareTokenInput"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}},{kind:"Argument",name:{kind:"Name",value:"shareToken"},value:{kind:"Variable",name:{kind:"Name",value:"shareToken"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}}]}}]}}]}}]};function s4(e){let t=new URLSearchParams(e),a=t.get("share");if(!function(e){if(null==e)return!1;switch(e){case"check":case"edit":case"view":return!0;default:return!1}}(a))return null;let n=t.get(a);return null==n?null:{type:a,id:n}}let s6=function(e){let t=e.match.params.documentID,{search:a}=e.location,n=s4(a),{data:l,loading:r}=(0,eB.a)(s3,{variables:{documentId:t,shareToken:n}}),o=l?.document,i=(0,ev.useMemo)(()=>null==o?null:nQ(o),[o]);return ev.createElement(eT.ql,null,r||null==i?ev.createElement("link",{rel:"icon",href:"/favicon.ico",type:"image/x-icon"}):ev.createElement("link",{rel:"icon",href:`data:image/svg+xml,${i}`,type:"image/svg+xml"}))},s8=function(){return ev.createElement(eF.rs,null,ev.createElement(eF.AW,{path:"/d/:documentID",component:s6}),ev.createElement(eF.AW,{path:"/embed/:documentID",component:s6}),ev.createElement(eF.AW,{component:s5}))};var s7=a(64721),s9=a.n(s7);let de="active",dt="archived",da="templated",dn="list",dl="board",dr="calendar",di="actionsheet",ds="mindmap",dd="orgchart",dc="gantt",dm=[dn,dl,dr,di,ds,dd,dc];function du(e){let{username:t,password:a}=e;if(oh()(t)||oh()(a))return`${t||""}:${a||""}`}function dp(e){let{fragment:t}=e;if(!ts()(t))return`#${t}`}var dg=a(93754),df=a.n(dg);function dh(e){let{hostname:t,port:a}=e,n=[];if(oh()(t)&&n.push(t),df()(a)&&n.push(`:${a}`),!ts()(n))return n.join("")}function dy(e){let{scheme:t}=e;if(!ts()(t))return`${t}:`}function db(e){let{query:t}=e;return ts()(t)?void 0:t.startsWith("?")?t:`?${t}`}function dv(e){let t=[],a=dy(e);ts()(a)||t.push(`${a}//`);let n=du(e);ts()(n)||t.push(`${n}@`);let l=dh(e);ts()(l)||t.push(l);let{pathname:r}=e;ts()(r)||t.push(r);let o=db(e);ts()(o)||t.push(o);let i=dp(e);if(ts()(i)||t.push(i),!ts()(t))return t.join("")}var dk=a(28583),dE=a.n(dk),dx=a(40554),d_=a.n(dx),dw=a(1604);let dN=dw.z.object({scheme:dw.z.string().nullable().optional(),protocol:dw.z.string().nullable().optional(),username:dw.z.string().nullable().optional(),password:dw.z.string().nullable().optional(),hostname:dw.z.string().nullable().optional(),port:dw.z.union([dw.z.string(),dw.z.number()]).nullable().optional(),host:dw.z.string().nullable().optional(),pathname:dw.z.string().nullable().optional(),query:dw.z.string().nullable().optional(),search:dw.z.string().nullable().optional(),fragment:dw.z.string().nullable().optional(),hash:dw.z.string().nullable().optional(),slashes:dw.z.boolean().nullable().optional(),auth:dw.z.string().nullable().optional(),path:dw.z.string().nullable().optional(),href:dw.z.string().nullable().optional()}),dC=dw.z.object({scheme:dw.z.string().nullable().optional(),username:dw.z.string().nullable().optional(),password:dw.z.string().nullable().optional(),hostname:dw.z.string().nullable().optional(),port:dw.z.number().nullable().optional(),pathname:dw.z.string().nullable().optional(),query:dw.z.string().nullable().optional(),fragment:dw.z.string().nullable().optional()});function dM(e){let{scheme:t,protocol:a,username:n,password:l,hostname:r,host:o,port:i,pathname:s,query:d,search:c,fragment:m,hash:u}=dN.parse(e),p={};return oh()(t)?p.scheme=t:oh()(a)&&dE()(p,function(e){let t=e.match(/^([A-Za-z][A-Za-z0-9+-.]*):?$/);if(eu()(t))throw Error(`protocol is invalid: ${e}`);let[,a]=t;return{scheme:a}}(a)),oh()(n)&&(p.username=n),oh()(l)&&(p.password=l),oh()(r)&&(p.hostname=r),df()(i)?p.port=i:oh()(i)&&(p.port=d_()(i)),!oh()(r)&&!df()(i)&&oh()(o)&&dE()(p,function(e){let t=e.match(/^([^:]*)(?::([0-9]{0,5}))?$/);if(eu()(t))throw Error(`host is invalid: ${e}`);let[,a,n]=t,l={};if(ts()(a)||(l.hostname=a),ts()(n)||(l.port=d_()(n)),ts()(l))throw Error(`host is invalid: ${e}`);return l}(o)),oh()(s)&&(p.pathname=s),oh()(d)?p.query=d:oh()(c)&&dE()(p,function(e){let t=e.match(/^\??(.*)$/);if(eu()(t))throw Error(`search is invalid: ${e}`);let[,a]=t;return{query:a}}(c)),oh()(m)?p.fragment=m:oh()(u)&&dE()(p,function(e){let t=e.match(/^#?(.*)$/);if(eu()(t))throw Error(`hash is invalid: ${e}`);let[,a]=t;return{fragment:a}}(u)),dC.parse(p)}class dS{constructor(e){this.object=dM(e)}get scheme(){return this.object.scheme}get protocol(){return dy(this.object)}get username(){return this.object.username}get password(){return this.object.password}get auth(){return du(this.object)}get hostname(){return this.object.hostname}get port(){return this.object.port}get host(){return dh(this.object)}get pathname(){return this.object.pathname}get query(){return this.object.query}get search(){return db(this.object)}get fragment(){return this.object.fragment}get hash(){return dp(this.object)}get url(){return dv(this.object)}urlFor(e){return dv({...this.object,...dM(e)})}}function dI(e){return ec()(e,["context","urls","canonical"])}function dD(e){return ec()(e,["meta","preferences","hideChat"],!1)}function dT(e){return ec()(e,["meta","preferences","hideCompleted"],!1)}let d$=(0,tB.P1)(tQ,e=>{let t=tL.parse(e),a=ec()(t,["as"],"");return s9()([dn,dl,dr,di,ds,dd,dc],a)?a:null});function dP(e){return ec()(e,["meta","id"])}function dF(e){let t=dP(e);return eu()(t)?null:ec()(e,["entities","documents","entities",t,"sharedPreferences"],{})}function dA(e){return d$(e)||ec()(e,["meta","preferences","view"],null)||ec()(dF(e),"view",null)||dn}function dR(e){return e.session.syncState}function dj(e){return iP()(e,["meta","id"])}function dO(e){return ec()(e,["meta","revision"])}function dU(e){return ec()(e,["meta","space","id"],null)}function dZ(e){return ec()(e,["meta","conference"],!1)}let dL=(0,tB.P1)([dP,function(e){let t=dP(e);return eu()(t)?null:ec()(e,["entities","documents","entities",t,"createdBy"],"Guest")},function(e){let t=dP(e);return eu()(t)?null:ec()(e,["meta","info","updatedBy","handle"],"Guest")},function(e){let t=dP(e);return eu()(t)?null:ec()(e,["meta","updatedAt"],null)}],(e,t,a,n)=>eu()(e)?null:{createdBy:t,updatedBy:a,updatedAt:n}),dB=(0,tB.P1)([dj,function(e){return ec()(e,["contents","rootNode"])}],(e,t)=>{let a=t.textString;return ts()(a)?e?"Untitled":null:a}),dz=(0,tB.P1)([dB],e=>e?`${e} - Taskade`:null),dV=(0,tB.P1)([dP,i7,iX,i1,i9,i0],i2);function dq(e){let t=dV(e);return!(!dj(e)||ts()(t))&&ts()(t.editPath)}(0,tB.P1)([dP,function(e){return ec()(e,["documents","collaborators"],{})}],(e,t)=>ec()(t,["fetchStatus",e],""));let dW=(0,tB.P1)([dV],e=>null!=e&&lm({role:e.role,action:{project:"check",workspace:"check_project"}})),dH=(0,tB.P1)([dI,dV,tY],(e,t,a)=>eu()(e)||eu()(t)?eu()(a)?null:new dS({scheme:"https",hostname:"www.taskade.com"}).urlFor({pathname:a}):new dS(e).urlFor({pathname:t.viewPath})),dG=(0,tB.P1)([dj,dz,dH,dI],(e,t,a,n)=>{let l=new dS(n);if(e){let e="Taskade is the unified workspace for you and your team. Get work done faster and smarter with structured task lists, outline notes, kanban boards, and mind maps.";return[{name:"apple-itunes-app",content:"app-id=1264713923"},{name:"google-play-app",content:"app-id=com.taskade.mobile"},{property:"og:title",content:t},{property:"og:description",content:e},{name:"keywords",content:"notes, notepad, collaboration, outline, brainstorming, bullet journal, checklist, task list, todo list, mindmap, list maker, text editor"},{property:"og:type",content:"article"},{property:"og:url",content:a},{property:"og:image",content:l.urlFor({pathname:"/images/taskade-logo-meta5.png"})},{property:"fb:app_id",content:"120910341911924"},{property:"og:site_name",content:"Taskade"},{property:"twitter:card",content:"summary_large_image"},{property:"twitter:site",content:"@taskade"},{property:"twitter:title",content:t},{property:"twitter:description",content:e},{property:"twitter:image",content:l.urlFor({pathname:"/images/taskade-logo-meta5.png"})}]}{let e="Taskade is the unified workspace for you and your team. Get work done faster and smarter with structured task lists, outline notes, kanban boards, and mind maps.";return[{name:"apple-itunes-app",content:"app-id=1264713923"},{name:"google-play-app",content:"app-id=com.taskade.mobile"},{name:"description",content:e},{name:"keywords",content:"notes, notepad, collaboration, outline, brainstorming, bullet journal, checklist, task list, todo list, mindmap, list maker, text editor"},{property:"og:title",content:t},{property:"og:description",content:e},{property:"og:type",content:"website"},{property:"og:url",content:a||l.urlFor({pathname:"/new"})},{property:"og:image",content:l.urlFor({pathname:"/images/taskade-logo-meta5.png"})},{property:"fb:app_id",content:"120910341911924"},{property:"og:site_name",content:"Taskade"},{property:"twitter:card",content:"summary_large_image"},{property:"twitter:site",content:"@taskade"},{property:"twitter:title",content:t},{property:"twitter:description",content:e},{property:"twitter:image",content:l.urlFor({pathname:"/images/taskade-logo-meta5.png"})}]}});function dK(e){let t=ec()(e,["meta","info","stats"],null);return ec()(t,["completedCount"],0)}function dY(e){let t=ec()(e,["meta","info","stats"],null),a=dK(e),n=ec()(t,["totalCount"],0);return 0===n?0:Math.floor(a/n*100)}let dQ=(0,tB.P1)([dP,tY,tQ,tJ,iU],(e,t,a,n,l)=>(function(e,t,a,n,l,r){if(!eu()(e)&&(l||r)&&eu()(n)){let e=oz({copy:r,list:encodeURIComponent(`${t}${a}`)});return`/signup${e}`}return"/signup"})(e,t,a,n,l,!1)),dJ=eL.default.div.withConfig({displayName:"NotificationManager__Container",componentId:"sc-9f7c4001-0"})` + position: fixed; + bottom: 4px; + right: 0; + ${e=>e.$editorView&&(0,eL.css)` + right: ${e.$chatOffset?"50px":`${e.$chatWidth}px`}; + `} + width: 100%; + z-index: 4; +`,dX=eL.default.div.withConfig({displayName:"NotificationManager__StyledWrapper",componentId:"sc-9f7c4001-1"})` + position: absolute; + z-index: 1000; + bottom: 20px; + right: 20px; + + & ~ .notifications-wrapper { + background: red; + } +`,d0=(0,eL.css)` + display: inline-block; + font-size: 14px; + font-weight: 500; + border-radius: 50px; + padding: 4px 14px; + color: #fff; + background: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &:hover, + &:focus { + color: #fff; + } +`,d1=(0,eL.default)(sC.rU).withConfig({displayName:"NotificationManager__StyledLink",componentId:"sc-9f7c4001-2"})` + ${d0}; + margin-right: 8px; +`,d2=eL.default.button.withConfig({displayName:"NotificationManager__StyledButton",componentId:"sc-9f7c4001-3"})` + ${d0}; + margin: 0; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; +`,d5=(0,e$.connect)(function(e){return{notifications:e.notifications,hideChat:dD(e),docID:dP(e)}})(function(e){let{notifications:t,hideChat:a,docID:n}=e,l=(0,e$.useDispatch)(),r=()=>{l((0,l3.removeAll)())},o=document.getElementsByClassName("tc-chat")[0]?.clientWidth??330;return ev.createElement(dJ,{$editorView:!!n,$chatOffset:a,$chatWidth:o},ev.createElement(l4(),{notifications:t,noAnimation:!0,style:!1}),!ts()(t)&&ev.createElement(dX,null,ev.createElement(d1,{to:"/activity",onClick:r},ev.createElement(eY.Z,{id:"general.view_all",defaultMessage:"View All"})),ev.createElement(d2,{type:"button",onClick:r},ev.createElement(eY.Z,{id:"general.clear",defaultMessage:"Clear"}))))}),d3="@@taskade/billing/TOGGLE_PAYWALL";function d4(e,t){return{type:d3,payload:{workspaceId:e,reason:t}}}function d6(){switch(e0()){case"mac_app_store":return!1;case null:case"standalone":case"windows_app_store":return!0}}let d8=eL.default.div.withConfig({displayName:"AiCreditLimitDialogBody__Container",componentId:"sc-9eac715c-0"})` + position: relative; + z-index: 1; + backdrop-filter: blur(7px); + width: 100%; + max-width: 420px; + min-width: 100% !important; + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 24px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,d7=function(e){let{error:t,exit:a,state:n}=e,l=(0,e$.useDispatch)(),r=(0,eF.k6)(),o=d6(),i=(0,ei.getStatusCodeFromError)(t),s=(0,ei.getCodeFromError)(t),d=(0,ei.getMessageFromError)(t),c=ev.useCallback(()=>{402===i&&("ACTIVATION_REQUIRED"===s?r.push("/settings/plans"):l(d4())),a()},[s,l,r,a,i]),m=ev.useRef(null),u=n.matches("entered");return(ev.useEffect(()=>{u&&m.current?.focus()},[u]),null==t)?null:ev.createElement(d8,{className:"rounded-3xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement("div",{className:"w-full rounded-xl p-3"},ev.createElement("div",{className:"flex w-full flex-col gap-4 overflow-clip rounded-xl border border-appcolor-300 px-6 py-4"},ev.createElement("h4",{className:"flex items-center font-medium"},ev.createElement(tn.Icon,{icon:"dd_ai",className:"mr-1.5 shrink-0 pr-1"}),ev.createElement(eY.Z,{id:"general.ai_credit_limit",defaultMessage:"AI Credit Limit"})),o?ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex text-sm text-appcolor-800"},d),ev.createElement("button",{ref:m,className:"mt-3 flex w-full items-center justify-center rounded-full bg-upgrade py-2 text-sm font-bold text-textdark-100 transition duration-150 ease-in-out hover:bg-upgrade/75",onClick:c},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1"}),"ACTIVATION_REQUIRED"===s?ev.createElement(eY.Z,{id:"general.activate",defaultMessage:"Activate"}):ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))):ev.createElement("div",{className:"flex text-sm text-appcolor-800"},ev.createElement(eY.Z,{id:"electron.you_have_reached_your_ai_credit_limit",defaultMessage:"You've reached your AI Credit limit for the month."})))))};var d9=a(29829);let ce=(0,d9.oM)({name:"dialogs.aiCreditLimit",initialState:{isOpen:!1},reducers:{toggleAiCreditLimitDialog(e,t){if(null==t.payload)return{isOpen:!1};{let e;let a=t.payload.error;if(null!=a){if(a instanceof ea.cA){let t=a.graphQLErrors[0];e=t.extensions?.statusCode??t.extensions?.exception?.status?.code}else e=(0,ei.getStatusCodeFromError)(a)}if(402===e)return{isOpen:!0,error:a}}}}}),ct=(0,e$.connect)(function(e){return e.dialogs.aiCreditLimit})(function(e){let{isOpen:t,dispatch:a,error:n}=e;return t?ev.createElement(eI.ModalDialog,{backdropOpacity:eI.ModalDialogOpacity.Opaque,close:()=>{a(ce.actions.toggleAiCreditLimitDialog())},isOpen:t,autofocus:!1},e=>{let{exit:t,state:a}=e;return ev.createElement(d7,{error:n,exit:t,state:a})}):null}),ca=[{id:"content",emoji:"✍️",name:(0,te.Em)({id:"general.category.website_content",defaultMessage:"Content"}),default:!0},{id:"project_management",emoji:"\uD83D\uDCC6",name:(0,te.Em)({id:"prompt.category.project_management",defaultMessage:"Project Management"}),default:!1},{id:"productivity",emoji:"⚡️",name:(0,te.Em)({id:"prompt.category.productivity_simple",defaultMessage:"Productivity"}),default:!1},{id:"sales",emoji:"\uD83D\uDE80",name:(0,te.Em)({id:"prompt.category.sales",defaultMessage:"Sales"}),default:!1},{id:"copywriting",emoji:"\uD83D\uDCA1",name:(0,te.Em)({id:"prompt.category.copywriting",defaultMessage:"Copywriting"}),default:!1},{id:"email_marketing",emoji:"\uD83D\uDCBC",name:(0,te.Em)({id:"prompt.category.email_marketing",defaultMessage:"Email Marketing"}),default:!1},{id:"social_media",emoji:"\uD83D\uDCAC",name:(0,te.Em)({id:"prompt.category.social_media",defaultMessage:"Social Media"}),default:!1},{id:"branding_design",emoji:"\uD83C\uDFA8",name:(0,te.Em)({id:"prompt.category.branding_design",defaultMessage:"Branding / Design"}),default:!1},{id:"ux_ui",emoji:"\uD83D\uDC65",name:(0,te.Em)({id:"prompt.category.ux_ui",defaultMessage:"UX/UI"}),default:!1},{id:"ecommerce",emoji:"\uD83D\uDED2",name:(0,te.Em)({id:"prompt.category.ecommerce",defaultMessage:"E-commerce"}),default:!1},{id:"entrepreneurship",emoji:"\uD83E\uDD84",name:(0,te.Em)({id:"prompt.category.entrepreneurship",defaultMessage:"Entrepreneurship"}),default:!1},{id:"influencer_marketing",emoji:"\uD83D\uDCE3",name:(0,te.Em)({id:"prompt.category.influencer_marketing",defaultMessage:"Influencer Marketing"}),default:!1},{id:"legal",emoji:"⚖️",name:(0,te.Em)({id:"prompt.category.legal",defaultMessage:"Legal"}),default:!1},{id:"website_creation",emoji:"\uD83C\uDF10",name:(0,te.Em)({id:"prompt.category.website_creation",defaultMessage:"Website Creation"}),default:!1},{id:"analytics",emoji:"\uD83D\uDCCA",name:(0,te.Em)({id:"prompt.category.analytics",defaultMessage:"Analytics"}),default:!1},{id:"seo",emoji:"\uD83D\uDD0D",name:(0,te.Em)({id:"prompt.category.seo",defaultMessage:"SEO"}),default:!1},{id:"engineering",emoji:"\uD83D\uDEE0️",name:(0,te.Em)({id:"prompt.category.engineering",defaultMessage:"Engineering"}),default:!1},{id:"research",emoji:"\uD83E\uDDE0",name:(0,te.Em)({id:"prompt.category.research",defaultMessage:"Research"}),default:!1},{id:"strategy",emoji:"✍️",name:(0,te.Em)({id:"general.category.strategy",defaultMessage:"Strategy"}),default:!1},{id:"advertising",emoji:"\uD83C\uDFA4",name:(0,te.Em)({id:"general.category.advertising",defaultMessage:"Advertising"}),default:!1},{id:"education",emoji:"\uD83C\uDF93",name:(0,te.Em)({id:"general.category.education",defaultMessage:"Education"}),default:!1}],cn=[{category:"content",title:(0,te.Em)({id:"prompt.website_content.write_product_descriptions",defaultMessage:"Write Product Descriptions"}),value:(0,te.Em)({id:"prompt.website_content.write_product_descriptions.value2",defaultMessage:"Write a product description for [Product Name], a [Product Type]. It's designed for [Target Audience] and features [Key Features]. The description should be [Tone/Style], focusing on how the product benefits the user by [Key Benefits]. Please incorporate the following SEO keywords: [List of Keywords]. The description should be [Word Count] words long and formatted to fit our website’s product page layout."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.headline",defaultMessage:"Headline"}),value:(0,te.Em)({id:"prompt.website_content.headline.value2",defaultMessage:"Craft a catchy and attention-grabbing headline for [Content Type] that instantly draws in readers. The headline should be concise, memorable, and convey the core message or value of the content in a compelling way. Use powerful and emotive words that resonate with the target audience and create a sense of curiosity or urgency. Consider using rhetorical questions, intriguing statements, or surprising facts to pique interest. Ensure the headline is relevant to the content and aligns with the overall tone and style of the piece. Make it SEO-friendly by including relevant keywords without sacrificing creativity or readability."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.develop_email_marketing_campaigns",defaultMessage:"Develop Email Marketing Campaigns"}),value:(0,te.Em)({id:"prompt.website_content.develop_email_marketing_campaigns.value2",defaultMessage:"Develop an email marketing campaign for our [Product Line] targeted at [Target Audience]. The campaign's goal is to [Campaign Goals]. The emails should reflect our brand's [Tone/Voice], highlighting [Key Features/Benefits] of our products. Include a compelling CTA that encourages [Desired Action], and incorporate any special offers [Detail Offers/Incentives]. Ensure the email has a captivating subject line, a concise introduction, engaging body content, and adheres to [Legal/Compliance Requirements]."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.write_blog_articles",defaultMessage:"Write Blog Articles"}),value:(0,te.Em)({id:"prompt.website_content.write_blog_articles.value2",defaultMessage:"Write a series of informative and engaging blog articles on [List of Topics] that are relevant to our brand and attractive to our target audience, which includes [Target Audience Description]. The articles should have a [Tone/Style] and aim to [Content Goals]. Integrate these SEO keywords [List of Keywords] to enhance search engine visibility. Each article should include engaging elements like images or videos and end with a CTA such as [Specific CTA]. The articles should be approximately [Word Count] words each, formatted with clear subheadings and bullet points for easy reading."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.landing_page_copy",defaultMessage:"Landing Page Copy"}),value:(0,te.Em)({id:"prompt.website_content.landing_page_copy.value2",defaultMessage:"Create compelling copy for our landing page that is focused on driving conversions and enhancing user experience. Start with a powerful headline that captures the essence of our offering and resonates with our target audience. Follow with a subheadline that expands on the headline, offering a clear value proposition. Develop a concise and persuasive introductory paragraph that outlines what we offer and why it's beneficial. Include bullet points highlighting key features and benefits, using persuasive language that speaks directly to the user’s needs and pain points. Incorporate testimonials or customer reviews for social proof. Ensure the copy maintains a consistent and engaging brand voice throughout. Conclude with a clear and compelling call to action, such as ‘Sign Up’, ‘Learn More’, or ‘Get Started’, strategically placed to prompt immediate user response."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.video_script",defaultMessage:"Video Script"}),value:(0,te.Em)({id:"prompt.website_content.video_script.value2",defaultMessage:"Write a script for an engaging and informative video on [Specified Topic]. The script should start with a captivating introduction that hooks the audience immediately. Ensure it aligns with our brand's voice, whether it's professional, playful, or inspirational. The main body of the script should provide clear and concise information about the topic, incorporating engaging storytelling or case studies if applicable. Include key points, facts, or statistics that add depth to the subject matter. Plan for transitions between segments to maintain viewer engagement. Integrate interactive elements like questions or prompts for viewers to comment. Conclude with a strong closing statement that reinforces the key message and includes a call to action relevant to our brand, such as visiting our website or subscribing to our channel."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.short_summary",defaultMessage:"Short Summary"}),value:(0,te.Em)({id:"prompt.website_content.short_summary.value2",defaultMessage:"Write a concise yet informative summary covering the key points of [Subject]. Begin with a brief introduction that provides context and outlines the significance of the topic. Follow with a clear and structured presentation of the main points, ensuring each point is succinctly explained with essential details. Use bullet points or numbered lists for clarity if appropriate. Include any critical data, statistics, or quotes from authoritative sources to add credibility. Conclude with a summary statement that encapsulates the overall essence of the topic and its implications or relevance. Ensure the summary is straightforward, avoiding jargon or overly technical language to maintain accessibility for a broad audience."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.faq_generator",defaultMessage:"FAQ Generator"}),value:(0,te.Em)({id:"prompt.website_content.faq_generator.value2",defaultMessage:"Generate a comprehensive list of FAQs for [Product/Service/Topic] that addresses common customer queries and concerns. Begin by identifying the most frequently asked questions by customers, drawing from customer service interactions, social media inquiries, and feedback forms. Ensure the questions cover a broad range of topics, including product features, usage instructions, troubleshooting, pricing, availability, and support services. Write clear and concise answers for each question, providing helpful and accurate information. Include any relevant tips, best practices, or additional resources that could assist the customer. Organize the FAQs in a logical order, grouping similar topics together for easy navigation. Conclude with a section for any additional support options available, such as customer service contact information or links to more detailed resources."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.create_podcasts",defaultMessage:"Create Podcasts"}),value:(0,te.Em)({id:"prompt.website_content.create_podcasts.value2",defaultMessage:"Plan and create an engaging podcast series centered around [Podcast Theme] that aligns with our brand’s values and interests. The target audience is [Target Audience Description]. The series will consist of [Number] episodes, each lasting approximately [Length] minutes, following a [Format]. Each episode will cover topics such as [List of Topics], featuring [Types of Guests/Segments]. The podcast should have a [Tone/Style] and include strategies to engage our listeners like [Engagement Strategies]. Promote the series through [Promotional Tactics]. Ensure all episodes meet our technical standards for [Technical Requirements]."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.newsletter_creation",defaultMessage:"Newsletter creation"}),value:(0,te.Em)({id:"prompt.website_content.newsletter_creation.value2",defaultMessage:"Design and draft a monthly newsletter for [Company Name] to engage with our email subscribers and keep them updated about the latest developments. Begin with a captivating header and a personalized greeting that resonates with the subscribers. For the main content, include a mix of the following elements: Company News, Upcoming Events, Feature Article, Customer Spotlight, Special Offers or Promotions, Useful Resources, Engagement Opportunities, and Visual Elements. Conclude with a closing message that thanks subscribers for their continued support and includes a clear call-to-action."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.ebook_creation",defaultMessage:"Ebook creation"}),value:(0,te.Em)({id:"prompt.website_content.ebook_creation.value2",defaultMessage:"Compose an informative eBook on [Topic] that serves as an effective lead magnet on our website. Outline the key concepts and information that the eBook will cover, ensuring it provides substantial value and insights related to the topic. Structure the content into clear, digestible chapters, each focusing on a specific aspect of [Topic]. Write in an engaging and accessible style, suitable for our target audience, and include real-life examples, case studies, or anecdotes. Incorporate visually appealing elements like charts, graphs, and images. Conclude each chapter with key takeaways or actionable tips, and design an attractive cover page and layout that aligns with our brand's visual identity."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.customer_case_study",defaultMessage:"Customer Case Study"}),value:(0,te.Em)({id:"prompt.website_content.customer_case_study.value2",defaultMessage:"Develop a comprehensive case study illustrating how a company successfully utilized [Product] to achieve significant outcomes. Include a brief introduction about the company, feature quotes from key clients or representatives, and present key success metrics. Incorporate graphical elements like charts or infographics. Conclude with a summary of the product's role in the company’s achievements."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.social_media_content_calendar",defaultMessage:"Social media content calendar"}),value:(0,te.Em)({id:"prompt.website_content.social_media_content_calendar.value2",defaultMessage:"Develop a monthly content calendar for our social media channels, aligning with our brand voice and strategy. Plan and schedule diverse types of engaging content, including informative posts, interactive polls, behind-the-scenes glimpses, and promotional announcements. Allocate specific days for themed posts and include key industry dates for special content. Ensure a balance between promotional, educational, and entertaining content, and incorporate analytics for strategy refinement."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.infographic_creation",defaultMessage:"Infographic creation"}),value:(0,te.Em)({id:"prompt.website_content.infographic_creation.value2",defaultMessage:"Create an informative and visually appealing infographic on [Topic] for our blog post. The infographic should present key points, statistics, or trends related to [Topic] that resonate with our target audience. Use a color scheme and design elements that align with our brand’s style. Ensure the text is clear and the visuals are engaging, and optimize the infographic for web viewing and social media sharing."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.webinar_content_planning",defaultMessage:"Webinar content planning"}),value:(0,te.Em)({id:"prompt.website_content.webinar_content_planning.value2",defaultMessage:"Plan and organize a comprehensive webinar on [Topic] for our subscribers. Cover key aspects of [Topic], providing valuable insights. Include an introduction, main content sections, a Q&A session, and a conclusion. Invite expert speakers, include interactive elements, and ensure convenient scheduling. Develop promotional materials and conclude with a call to action encouraging attendees to explore more of our services or products."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.instagram_caption",defaultMessage:"Instagram Caption"}),value:(0,te.Em)({id:"prompt.website_content.instagram_caption.value2",defaultMessage:"Craft an engaging Instagram caption for a post themed around [Post Theme] that resonates with our brand voice. The caption should start with a catchy line, use a tone matching our brand, and encourage audience interaction. Include relevant hashtags and a call to action, ensuring the caption reflects our brand’s personality and values, and encourages community engagement."})},{category:"content",title:(0,te.Em)({id:"prompt.website_content.content_audit",defaultMessage:"Content audit"}),value:(0,te.Em)({id:"prompt.website_content.content_audit.value2",defaultMessage:"Conduct a content audit on our website [Website URL] to evaluate the performance of our existing content and identify areas for improvement. Review all content for relevance, engagement, and SEO effectiveness. Analyze key metrics, identify high and low-performing content, and provide recommendations for content optimization. Summarize findings in a report with actionable insights."})},{category:"content",title:(0,te.Em)({id:"prompt.content.brochure",defaultMessage:"Craft Brochure"}),value:(0,te.Em)({id:"prompt.content.brochure.value2",defaultMessage:"Craft a brochure for [Product], highlighting its unique qualities and advantages. The target audience is [Target Audience Description]. Include key features like [List of Features] and their benefits, emphasizing how they solve [Specific Problems or Needs]. Feature client testimonials that attest to the product's effectiveness. The brochure should have a visually appealing design with product images and follow our [Brand's Color Scheme/Design Theme]. The content should be structured to first introduce the product, followed by features, client feedback, and end with a compelling CTA like [Specific CTA]. Choose a [Brochure Format] that best showcases this information."})},{category:"content",title:(0,te.Em)({id:"prompt.content.infographic_creation",defaultMessage:"Infographic Creation"}),value:(0,te.Em)({id:"prompt.content.infographic_creation.value2",defaultMessage:"Create an informative and visually appealing infographic on [Topic] for inclusion in our blog post. The infographic should succinctly present key points, statistics, or trends related to [Topic] that resonate with our target audience of [Target Audience Description]. Use a color scheme and design elements that align with our brand's style guidelines. The infographic must include clear, easy-to-read text, engaging visuals like icons or charts, and should be structured to guide the viewer through the information logically. Please ensure it's optimized for web viewing and can be easily shared on social media platforms."})},{category:"content",title:(0,te.Em)({id:"prompt.content.webinar_content_planning",defaultMessage:"Webinar Content Planning"}),value:(0,te.Em)({id:"prompt.content.webinar_content_planning.value2",defaultMessage:"Plan and organize a comprehensive webinar on [Topic] for our subscribers. The webinar should cover key aspects of [Topic], providing valuable insights and practical information. Structure it to include an introduction, main content sections, a Q&A session, and a conclusion. Identify and invite expert speakers who can contribute depth to the discussion. Include interactive elements like polls or quizzes to engage the audience. Ensure the webinar is scheduled at a time convenient for the majority of our subscribers. Develop promotional materials to advertise the webinar through our email list, social media, and website. Conclude with a call to action encouraging attendees to explore more of our services or products related to [Topic]."})},{category:"content",title:(0,te.Em)({id:"prompt.content.craft_content_strategy",defaultMessage:"Craft Content Strategy"}),value:(0,te.Em)({id:"prompt.content.craft_content_strategy.value2",defaultMessage:"Create a start-to-finish roadmap for developing a comprehensive content strategy for our brand. Begin with audience analysis to understand preferences and pain points. Proceed to define content goals aligned with brand objectives. Identify key content types and channels suitable for our audience. Develop a content creation plan with timelines and responsibilities. Incorporate SEO best practices and performance metrics for evaluation. Conclude with a review and adaptation phase for continuous improvement of the strategy."})},{category:"content",title:(0,te.Em)({id:"prompt.content.content_production_schedule",defaultMessage:"Content Production Schedule"}),value:(0,te.Em)({id:"prompt.content.content_production_schedule.value2",defaultMessage:"Outline a daily schedule optimized for maximum content production for our brand. Start with a morning brief to review priorities and goals. Allocate focused blocks for content creation, including writing, designing, and editing, separated by short breaks to maintain productivity. Schedule time for content planning and research. Include a midday review to assess progress and adjust tasks. Dedicate late afternoon for collaborative work and feedback sessions. End the day with a wrap-up and preparation for the next day."})},{category:"content",title:(0,te.Em)({id:"prompt.content.brainstorming_sessions",defaultMessage:"Brainstorming Sessions"}),value:(0,te.Em)({id:"prompt.content.brainstorming_sessions.value2",defaultMessage:"Provide tactics to stay energized and engaged during long content brainstorming sessions. Include short, regular breaks for physical activity and mental rest. Suggest incorporating interactive and diverse brainstorming methods like mind mapping or role-playing to maintain interest. Recommend healthy snacks and hydration to maintain energy levels. Encourage changing the environment or session format periodically to keep the atmosphere dynamic. Include tips for effective facilitation to ensure productive and focused discussions."})},{category:"content",title:(0,te.Em)({id:"prompt.content.content_ideas_capture",defaultMessage:"Content Ideas Capture"}),value:(0,te.Em)({id:"prompt.content.content_ideas_capture.value2",defaultMessage:"Share techniques for capturing actionable content ideas from meetings about [Brand or Topic]. Recommend actively listening for key themes and questions raised. Suggest noting down direct quotes and unique insights for authenticity in content. Advise on categorizing ideas into themes for future reference. Include tips on using mind maps or idea boards for visual organization. Emphasize the importance of immediate review post-meeting to identify and prioritize the most viable content ideas."})},{category:"content",title:(0,te.Em)({id:"prompt.content.blog_post_features_benefits",defaultMessage:"Blog Post Showcasing Features and Benefits"}),value:(0,te.Em)({id:"prompt.content.blog_post_features_benefits.value2",defaultMessage:"Create a blog post showcasing the features and benefits of a product. Begin with an engaging introduction that highlights a common problem or need. Detail each feature of the product, directly linking it to a specific benefit for the user. Use real-life scenarios or case studies to demonstrate the product's impact. Include high-quality images or videos of the product in use. Conclude with a summary of key benefits and a clear, compelling call to action."})},{category:"content",title:(0,te.Em)({id:"prompt.content.blog_post_value_benefits",defaultMessage:"Blog Post Showcasing Value and Benefits"}),value:(0,te.Em)({id:"prompt.content.blog_post_value_benefits.value2",defaultMessage:"Create a blog post showcasing the value and benefits of a product. Start with an engaging introduction that highlights a common problem or need your target audience faces. Detail the product's features and explain how each specifically addresses those needs. Include customer testimonials or case studies to provide real-world proof of the product's effectiveness. Use high-quality images or videos of the product in use. Conclude with a clear call to action, directing readers to where they can purchase or learn more about the product."})},{category:"content",title:(0,te.Em)({id:"prompt.content.blog_post_customer_persona",defaultMessage:"Blog Post Speaking Directly to Customer Persona"}),value:(0,te.Em)({id:"prompt.content.blog_post_customer_persona.value2",defaultMessage:"Create a persuasive blog post to encourage the purchase of [Product/Service]. Begin with an engaging introduction highlighting a common problem or need. Detail how [Product/Service] provides an effective solution, focusing on unique features and benefits. Include customer testimonials for credibility. Address potential objections and provide clear, supportive responses. Conclude with a compelling call to action, encouraging readers to make a purchase, and provide easy access to the purchasing platform or contact information."})},{category:"content",title:(0,te.Em)({id:"prompt.content.blog_post_trust_credibility",defaultMessage:"Blog Post Establishing Trust and Credibility"}),value:(0,te.Em)({id:"prompt.content.blog_post_trust_credibility.value2",defaultMessage:"Create a blog post aimed at establishing trust and credibility. Begin with introducing authoritative sources and data to support your points. Include expert opinions and relevant case studies to underscore your expertise. Write in a clear, concise, and honest tone, avoiding jargon to ensure accessibility. Address common questions or misconceptions to demonstrate understanding of the audience's concerns. Conclude by reinforcing your commitment to providing reliable and valuable information, inviting feedback for continued improvement."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.manage_project_team",defaultMessage:"Manage Project Team"}),value:(0,te.Em)({id:"prompt.project_management.manage_project_team.value2",defaultMessage:"Provide a step-by-step guide on managing the project team for [Project], including setting goals and communication practices."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.prepare_project_kickoff",defaultMessage:"Prepare Project Kickoff"}),value:(0,te.Em)({id:"prompt.project_management.prepare_project_kickoff.value2",defaultMessage:"Develop a detailed checklist for the project kickoff of [Project] covering all necessary preparations."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.create_comprehensive_project_charter",defaultMessage:"Create Comprehensive Project Charter"}),value:(0,te.Em)({id:"prompt.project_management.create_comprehensive_project_charter.value2",defaultMessage:"Draft a detailed project charter for [Project Name], encompassing the project overview, goals, team structure, schedule, resources, risks, and stakeholder commitments."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.prepare_kickoff_meeting_agenda",defaultMessage:"Prepare Project Kick-Off Meeting Agenda"}),value:(0,te.Em)({id:"prompt.project_management.prepare_kickoff_meeting_agenda.value2",defaultMessage:"Craft an agenda for the kick-off meeting of [Project Name] that covers all key discussion points."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.develop_team_roles_responsibilities",defaultMessage:"Develop Project Team Roles and Responsibilities"}),value:(0,te.Em)({id:"prompt.project_management.develop_team_roles_responsibilities.value2",defaultMessage:"Outline the roles and duties for the project team on [Project Name], ensuring role clarity and project alignment."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.establish_milestones_timeline",defaultMessage:"Establish Project Milestones and Timeline"}),value:(0,te.Em)({id:"prompt.project_management.establish_milestones_timeline.value2",defaultMessage:"Set up the key milestones and a timeline for [Project Name] to track progress and manage timelines effectively."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.design_communication_plan",defaultMessage:"Design Project Communication Plan"}),value:(0,te.Em)({id:"prompt.project_management.design_communication_plan.value2",defaultMessage:"Formulate a communication strategy for [Project Name] detailing stakeholder engagement and information dissemination."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.create_status_report",defaultMessage:"Create Project Status Report"}),value:(0,te.Em)({id:"prompt.project_management.create_status_report.value2",defaultMessage:"Assemble a status report for [Project Name] that encapsulates achievements, upcoming tasks, and current issues."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.construct_risk_management_plan",defaultMessage:"Construct Project Risk Management Plan"}),value:(0,te.Em)({id:"prompt.project_management.construct_risk_management_plan.value2",defaultMessage:"Create a risk management strategy for [Project Name], including risk assessment and mitigation measures."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.develop_resource_plan",defaultMessage:"Develop Project Resource Plan"}),value:(0,te.Em)({id:"prompt.project_management.develop_resource_plan.value2",defaultMessage:"Outline the resource requirements and allocation plan for [Project Name], addressing all resource aspects."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.track_project",defaultMessage:"Track Project"}),value:(0,te.Em)({id:"prompt.project_management.track_project.value2",defaultMessage:"Provide an actionable checklist for monitoring [Project] progress against set goals and milestones."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.run_virtual_meetings",defaultMessage:"Run Virtual Project Meetings"}),value:(0,te.Em)({id:"prompt.project_management.run_virtual_meetings.value2",defaultMessage:"Share guidelines on conducting effective virtual meetings for project [Project], ensuring remote collaboration success."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.develop_budget_financial_plan",defaultMessage:"Develop Project Budget and Financial Plan"}),value:(0,te.Em)({id:"prompt.project_management.develop_budget_financial_plan.value2",defaultMessage:"Build a comprehensive financial framework for [Project], detailing expenditures and funding strategies."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.write_quality_management_plan",defaultMessage:"Write Project Quality Management Plan"}),value:(0,te.Em)({id:"prompt.project_management.write_quality_management_plan.value2",defaultMessage:"Draft a plan to ensure quality standards for [Project Name] are defined, managed, and achieved throughout its cycle."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.evaluate_performance",defaultMessage:"Evaluate Project Performance"}),value:(0,te.Em)({id:"prompt.project_management.evaluate_performance.value2",defaultMessage:"Apply evaluation techniques to review the progress and performance of [Project Name], offering actionable insights."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.update_management_plan",defaultMessage:"Update Project Management Plan"}),value:(0,te.Em)({id:"prompt.project_management.update_management_plan.value2",defaultMessage:"Revise and enhance the project management plan for [Project Name] with the incorporation of new data and stakeholder feedback."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.write_closure_report",defaultMessage:"Write Project Closure Report"}),value:(0,te.Em)({id:"prompt.project_management.write_closure_report.value2",defaultMessage:"Compose an all-encompassing closure report for [Project Name], capturing achievements and takeaways for future projects."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.create_stakeholder_plan",defaultMessage:"Create Project Stakeholder Management Plan"}),value:(0,te.Em)({id:"prompt.project_management.create_stakeholder_plan.value2",defaultMessage:"Formulate a stakeholder engagement plan for [Project Name] that ensures involved parties are effectively managed and informed."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.setup_change_management_plan",defaultMessage:"Set Up Project Change Management Plan"}),value:(0,te.Em)({id:"prompt.project_management.setup_change_management_plan.value2",defaultMessage:"Initiate a change management protocol for [Project Name] to navigate and control scope changes smoothly."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.develop_issue_management_plan",defaultMessage:"Develop Project Issue Management Plan"}),value:(0,te.Em)({id:"prompt.project_management.develop_issue_management_plan.value2",defaultMessage:"Establish a systematic approach for identifying and resolving issues throughout the lifecycle of [Project Name]."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.assess_project_feasibility",defaultMessage:"Assess Project Feasibility"}),value:(0,te.Em)({id:"prompt.project_management.assess_project_feasibility.value2",defaultMessage:"Outline a feasibility study for [Project Name], detailing the economic, technical, legal, and scheduling considerations to make an informed project decision."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.define_project_success_criteria",defaultMessage:"Define Project Success Criteria"}),value:(0,te.Em)({id:"prompt.project_management.define_project_success_criteria.value2",defaultMessage:"Document the key success criteria for [Project Name] that will be used to measure the project’s effectiveness upon completion."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.implement_project_control_processes",defaultMessage:"Implement Project Control Processes"}),value:(0,te.Em)({id:"prompt.project_management.implement_project_control_processes.value2",defaultMessage:"Establish control mechanisms for [Project Name] to monitor project activities and manage changes to performance baselines."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.plan_quality_assurance_activities",defaultMessage:"Plan Project Quality Assurance Activities"}),value:(0,te.Em)({id:"prompt.project_management.plan_quality_assurance_activities.value2",defaultMessage:"Develop a schedule for quality assurance activities for [Project Name] to maintain high standards throughout the project lifecycle."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.conduct_stakeholder_analysis",defaultMessage:"Conduct Project Stakeholder Analysis"}),value:(0,te.Em)({id:"prompt.project_management.conduct_stakeholder_analysis.value2",defaultMessage:"Perform a comprehensive stakeholder analysis for [Project Name], identifying needs, expectations, and potential influences on project outcomes."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.organize_project_documentation",defaultMessage:"Organize Project Documentation"}),value:(0,te.Em)({id:"prompt.project_management.organize_project_documentation.value2",defaultMessage:"Set up a documentation plan for [Project Name] that specifies how to record, store, and access project documents effectively."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.optimize_resource_allocation",defaultMessage:"Optimize Project Resource Allocation"}),value:(0,te.Em)({id:"prompt.project_management.optimize_resource_allocation.value2",defaultMessage:"Create a resource allocation strategy for [Project Name] that maximizes efficiency and reduces waste."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.plan_training_development",defaultMessage:"Plan for Project Training and Development"}),value:(0,te.Em)({id:"prompt.project_management.plan_training_development.value2",defaultMessage:"Develop a training plan to enhance team capabilities and performance for [Project Name]."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.coordinate_procurement_management",defaultMessage:"Coordinate Project Procurement Management"}),value:(0,te.Em)({id:"prompt.project_management.coordinate_procurement_management.value2",defaultMessage:"Craft a procurement plan for [Project Name] outlining the processes for vendor selection, contract management, and purchase agreements."})},{category:"project_management",title:(0,te.Em)({id:"prompt.project_management.establish_environmental_compliance",defaultMessage:"Establish Project Environmental Compliance"}),value:(0,te.Em)({id:"prompt.project_management.establish_environmental_compliance.value2",defaultMessage:"Outline environmental compliance measures and sustainable practices to be adopted in [Project Name]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.brainstorming_prompts_for_idea_generation",defaultMessage:"Use brainstorming prompts for idea generation"}),value:(0,te.Em)({id:"prompt.brainstorming_prompts_for_idea_generation.value2",defaultMessage:"Provide a list of brainstorming prompts or questions related to [Topic/Problem] to stimulate creative thinking and generate a diverse range of ideas. Include open-ended questions that encourage exploration and innovative solutions. Consider asking about potential challenges, opportunities, and unconventional approaches to the topic. Aim to inspire participants to think outside the box and contribute unique insights. Provide a variety of prompts to cater to different thinking styles and perspectives."})},{category:"productivity",title:(0,te.Em)({id:"prompt.mind_mapping_for_visual_exploration",defaultMessage:"Use mind mapping for visual exploration"}),value:(0,te.Em)({id:"prompt.mind_mapping_for_visual_exploration.value2",defaultMessage:"Create a mind map for [Topic/Problem] to visually represent ideas, concepts, and connections, helping me identify new insights and opportunities. Begin by defining the central topic or problem at the center of the mind map. Branch out with key ideas and subtopics related to the central theme. Use lines, colors, and shapes to illustrate relationships and connections between ideas. Encourage creative thinking and brainstorming to uncover potential solutions or innovative approaches. Continue expanding the mind map with additional details and branches as insights emerge."})},{category:"productivity",title:(0,te.Em)({id:"prompt.apply_five_whys_technique",defaultMessage:"Implement the Five Whys technique for root cause analysis"}),value:(0,te.Em)({id:"prompt.apply_five_whys_technique.value2",defaultMessage:"Apply the Five Whys method to [Problem/Issue] to uncover the root cause and identify potential solutions. Start by stating the problem clearly and concisely. Then, ask 'Why?' five times, each time probing deeper to understand the underlying causes. Document the answers to each 'Why?' question. Once you've reached the fifth 'Why?', analyze the answers to determine the root cause of the problem. Finally, brainstorm and propose potential solutions or corrective actions to address the root cause and prevent recurrence."})},{category:"productivity",title:(0,te.Em)({id:"prompt.leverage_analogies_complex_concepts",defaultMessage:"Leverage analogies to simplify complex concepts"}),value:(0,te.Em)({id:"prompt.leverage_analogies_complex_concepts.value2",defaultMessage:"Construct analogies or metaphors to help me better understand and communicate the key aspects of [Complex Idea/Concept]. Create simple, relatable comparisons that capture the essence of the idea and make it more accessible. Use everyday scenarios or objects to illustrate the various components and relationships within the concept. Ensure that the analogies or metaphors aid in clarifying complex aspects, making them easier to grasp and explain to others."})},{category:"productivity",title:(0,te.Em)({id:"prompt.ai_enhanced_office_workflow",defaultMessage:"AI-Enhanced Office Workflow"}),value:(0,te.Em)({id:"prompt.ai_enhanced_office_workflow.value2",defaultMessage:"Brainstorm unique and creative ways to enhance each step of your workflow using the power of generative AI with software such as [Software]. Suggest how AI can automate repetitive tasks, generate reports with insightful analysis, assist in data entry and validation, or provide intelligent suggestions for decision-making. Explore how AI can streamline communication, improve project management, and enhance overall productivity in an office setting. Provide practical and innovative ideas to leverage AI for workplace efficiency."})},{category:"productivity",title:(0,te.Em)({id:"prompt.apply_pomodoro_technique_focused_work",defaultMessage:"Apply the Pomodoro Technique for focused work"}),value:(0,te.Em)({id:"prompt.apply_pomodoro_technique_focused_work.value2",defaultMessage:"Explain the Pomodoro Technique and guide me through setting up my work sessions and breaks for optimal focus and productivity during my [Working Hours]. Begin by describing the Pomodoro Technique concept of dividing work into focused intervals (Pomodoros) and short breaks. Suggest an initial work session duration, typically 25 minutes, followed by a 5-minute break. Recommend taking a longer break, around 15-30 minutes, after completing four Pomodoros. Provide tips for minimizing distractions during work sessions. Explain how to use timers or apps to track Pomodoros and breaks. Offer flexibility to adjust session lengths based on personal preferences and tasks."})},{category:"productivity",title:(0,te.Em)({id:"prompt.employ_two_minute_rule_quick_wins",defaultMessage:"Employ the Two-Minute Rule for quick wins"}),value:(0,te.Em)({id:"prompt.employ_two_minute_rule_quick_wins.value2",defaultMessage:"Explain the Two-Minute Rule and help me identify tasks related to [a specific project or daily tasks] that I can complete immediately to build momentum and a sense of accomplishment. Start by explaining the concept of the Two-Minute Rule, which suggests that if a task can be completed in two minutes or less, it should be done immediately rather than postponed. Then, provide a list of tasks related to [Project/Task] that fit this criterion and can be tackled quickly. Include a brief description of each task and why completing it promptly can be beneficial."})},{category:"productivity",title:(0,te.Em)({id:"prompt.reflect_and_review_regularly",defaultMessage:"Implement regular reflection and review"}),value:(0,te.Em)({id:"prompt.reflect_and_review_regularly.value2",defaultMessage:"Design a weekly or monthly reflection routine to help me assess my progress, identify areas of improvement, and realign my priorities for maximum productivity in my [Work/Personal] goals. Begin by defining the objectives of the reflection routine and the specific goals you want to focus on. Create a step-by-step process that includes reviewing accomplishments, analyzing challenges, setting new objectives, and creating actionable plans. Specify the tools or templates to use, such as journals, spreadsheets, or apps. Provide guidance on scheduling and sticking to the routine for consistent self-assessment and improvement."})},{category:"productivity",title:(0,te.Em)({id:"prompt.develop_routines_consistency_discipline",defaultMessage:"Develop routines for consistency and discipline"}),value:(0,te.Em)({id:"prompt.develop_routines_consistency_discipline.value2",defaultMessage:"Design a morning and evening routine to help me establish consistency, discipline, and a productive mindset throughout my [Day-to-Day Activities]. Start with a morning routine that includes activities like setting clear daily goals, practicing mindfulness or meditation, and engaging in physical activity. Specify the time for waking up and the sequence of activities. For the evening routine, focus on winding down, reflecting on the day, and preparing for the next day. Include relaxation techniques, journaling, and reviewing progress toward goals. Ensure that both routines align with your goals and values and promote overall well-being."})},{category:"productivity",title:(0,te.Em)({id:"prompt.cultivate_positive_thinking_patterns",defaultMessage:"Cultivate Positive Thinking Patterns"}),value:(0,te.Em)({id:"prompt.cultivate_positive_thinking_patterns.value2",defaultMessage:"Help me reframe negative thought patterns around [Topic] into positive ones and suggest techniques to maintain a more optimistic mindset. Begin by identifying common negative thoughts or beliefs related to [Topic]. Provide guidance on how to challenge and reframe these thoughts with evidence and positive affirmations. Offer mindfulness and relaxation techniques to manage stress and anxiety related to [Topic]. Share strategies for fostering a positive outlook, including gratitude journaling, visualization, and goal setting. Emphasize the importance of self-compassion and self-care in maintaining a positive mindset."})},{category:"productivity",title:(0,te.Em)({id:"prompt.embrace_lifelong_learning",defaultMessage:"Embrace lifelong learning"}),value:(0,te.Em)({id:"prompt.embrace_lifelong_learning.value2",defaultMessage:"Create a personalized reading list and resource guide for continuous learning and self-improvement in the area of [Chosen Field or Interest]. Begin by understanding the individuals current knowledge and goals within this field. Curate a list of recommended books, articles, online courses, and podcasts that cover various aspects of the subject. Provide brief descriptions and insights for each resource, explaining how it contributes to the individuals growth. Consider their preferred learning style and format. Organize the resources in a user-friendly format for easy access and reference."})},{category:"productivity",title:(0,te.Em)({id:"prompt.gtd_methodology",defaultMessage:"Optimize your workflow with the GTD methodology"}),value:(0,te.Em)({id:"prompt.gtd_methodology.value2",defaultMessage:"Adopt the GTD (Getting Things Done) approach to process your [tasks/ideas] into a streamlined system. Instruct me in setting up an environment to capture, clarify, organize, reflect, and engage with my tasks. Tailor the GTD workflow to suit my personal or team-based settings and enhance my overall productivity in managing [projects/commitments]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.kanban_visualization",defaultMessage:"Increase productivity with Kanban visualization"}),value:(0,te.Em)({id:"prompt.kanban_visualization.value2",defaultMessage:'Guide me in constructing a Kanban board to manage [project workflow/task progress]. Help me identify and categorize tasks as "To Do," "In Progress," and "Completed." Recommend strategies for effectively visualizing workloads and optimizing the flow of tasks from inception to completion for [individual/team] use.'})},{category:"productivity",title:(0,te.Em)({id:"prompt.time_management_with_time_blocking",defaultMessage:"Advance time management using Time Blocking"}),value:(0,te.Em)({id:"prompt.time_management_with_time_blocking.value2",defaultMessage:"Instruct me on employing Time Blocking to master my schedule effectively. Assist me in partitioning my day into dedicated blocks reserved for specific [tasks/activities/themes], and advise on best practices for task batching and day theming to streamline my workflow and enhance focus during [work/study hours]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.tackle_priority_tasks_with_frog_method",defaultMessage:"Address priority tasks first with Eat the Frog method"}),value:(0,te.Em)({id:"prompt.tackle_priority_tasks_with_frog_method.value2",defaultMessage:'Aide me in applying the Eat the Frog technique to overcome procrastination by tackling my most challenging [task/project] first in my daily routine. Propose a system for identifying and prioritizing my "frogs" day by day, ensuring that I start my [workday/study session] with significant accomplishments.'})},{category:"productivity",title:(0,te.Em)({id:"prompt.pomodoro_focus_sessions",defaultMessage:"Enhance focus with Pomodoro Technique"}),value:(0,te.Em)({id:"prompt.pomodoro_focus_sessions.value2",defaultMessage:"Introduce the Pomodoro Technique into my routine to combat procrastination and sustain attention. Assist in arranging work periods using timed intervals (pomodoros) of focused work followed by short breaks, tailored to my [personal preference/task nature]. Provide a guide for adopting this technique to maintain productivity throughout my [study sessions/working hours]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.eisenhower_matrix_for_prioritization",defaultMessage:"Use Eisenhower Matrix for effective task prioritization"}),value:(0,te.Em)({id:"prompt.eisenhower_matrix_for_prioritization.value2",defaultMessage:"Facilitate an understanding of the Eisenhower Matrix to sort my tasks based on urgency and importance. Provide instructions on categorizing my duties into Do, Decide, Delegate, and Delete quadrants—the Eisenhower Matrix—to make informed decisions regarding the prioritization of my [daily activities/workload]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.okrs_for_goal_alignment",defaultMessage:"Align goals with Objectives and Key Results (OKRs)"}),value:(0,te.Em)({id:"prompt.okrs_for_goal_alignment.value2",defaultMessage:"Initiate the Objectives and Key Results (OKRs) framework for setting measurable and ambitious goals that align with larger organizational or personal visions. Guide me in delineating my main objectives and quantifiable key results to measure progress, ensuring focus on critical tasks that yield impactful outcomes in my [career/studies/life goals]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.weekly_review_for_productivity_boost",defaultMessage:"Implement a Weekly Review routine for a productivity boost"}),value:(0,te.Em)({id:"prompt.weekly_review_for_productivity_boost.value2",defaultMessage:"Craft a Weekly Review action plan for reflection and planning to optimize my time and energy across various life domains. Guide me in assessing my previous weeks accomplishments, challenges while setting up the upcoming week for success by identifying actionable steps aligned with my [short-term and long-term goals]."})},{category:"productivity",title:(0,te.Em)({id:"prompt.commitment_inventory_assessment",defaultMessage:"Balance life areas with Commitment Inventory assessment"}),value:(0,te.Em)({id:"prompt.commitment_inventory_assessment.value2",defaultMessage:"Assist me in conducting a Commitment Inventory to evaluate and allocate my time and resources across different areas of life. Instruct me on how to assess and balance my commitments to ensure all crucial aspects of my [professional, social, personal] life receive adequate attention and growth opportunities."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.develop_sales_pitch",defaultMessage:"Develop Sales Pitch"}),value:(0,te.Em)({id:"prompt.sales.develop_sales_pitch.value2",defaultMessage:"Develop a compelling sales pitch for our product [Product Name] aimed at our target market [Target Market]. Start by understanding the specific needs, pain points, and preferences of the target audience. Craft a persuasive message that highlights how [Product Name] addresses their challenges and delivers unique value. Include compelling storytelling, testimonials, and data-backed benefits. Specify the key selling points, pricing, and any special offers. Ensure that the sales pitch is engaging, concise, and tailored to resonate with the target market's interests and motivations."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.outreach_sequence",defaultMessage:"Outreach Sequence"}),value:(0,te.Em)({id:"prompt.sales.outreach_sequence.value2",defaultMessage:"Create a 3-part outreach sequence for [Company URL] aimed at [Target Customer] with additional details: [Word]. Begin by defining the target customer profile, their pain points, and needs. Craft a personalized email sequence with a compelling subject line and opening. In the first email, introduce the company and highlight the value proposition. In the second email, provide more detailed information about the product or service. In the third email, include a special offer or call to action. Specify the timeline for sending each email and any follow-up strategies."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.create_sales_presentation",defaultMessage:"Create Sales Presentation"}),value:(0,te.Em)({id:"prompt.sales.create_sales_presentation.value2",defaultMessage:"Create a persuasive sales presentation outlining the key features and benefits of our product [Product Name]. Begin by defining the target audience and their needs. Craft a compelling narrative that highlights how our product addresses those needs. Present the product's unique selling points and competitive advantages. Include real-life examples, testimonials, and use cases to reinforce the value proposition. Use visuals and data to support key points. Structure the presentation for clarity and engagement. Conclude with a strong call to action that encourages the audience to take the desired step, such as making a purchase."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_call_script",defaultMessage:"Sales Call Script"}),value:(0,te.Em)({id:"prompt.sales.sales_call_script.value2",defaultMessage:"Craft a sales call script for [Product/Service] ensuring to cover key selling points, handle common objections, and end with a strong call to action. Begin with a warm introduction and a brief explanation of the purpose of the call. Highlight the unique value propositions and benefits of [Product/Service]. Include responses to common objections and questions. Use persuasive language to build interest and trust. Conclude with a clear and compelling call to action, guiding the prospect towards the desired next steps, whether it's a purchase, a meeting, or further information."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.cold_calling_script",defaultMessage:"Cold Calling Script"}),value:(0,te.Em)({id:"prompt.sales.cold_calling_script.value2",defaultMessage:"Create an effective cold calling script for our sales team that clearly communicates the value of our product/service. Begin by defining the target audience and their pain points. Craft an engaging script that captures the recipient's attention within the first few seconds. Highlight the key benefits and unique selling points of our product/service. Include objection-handling techniques and a strong call to action. Ensure that the script is conversational and encourages a two-way dialogue. Provide examples of effective opening lines and responses to common objections."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_outreach",defaultMessage:"Sales Outreach"}),value:(0,te.Em)({id:"prompt.sales.sales_outreach.value2",defaultMessage:"Plan a sales outreach strategy targeting potential leads for [Product/Service], developing a compelling pitch and follow-up process. Begin by defining the target audience and segments. Craft a personalized pitch that highlights the benefits of [Product/Service] for each audience. Specify the communication channels and sequences for outreach, including emails, calls, and social media. Include a clear call to action and response tracking system. Provide guidance on handling objections and objections. Develop a timeline and key performance indicators (KPIs) to measure the effectiveness of the outreach strategy."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_email",defaultMessage:"Sales Email"}),value:(0,te.Em)({id:"prompt.sales.sales_email.value2",defaultMessage:"Draft a compelling sales email for [Product/Service] aimed at [Target Audience], focusing on benefits and the value proposition. Start by identifying the key selling points and unique advantages of the [Product/Service]. Craft a personalized email that addresses the specific needs or pain points of the target audience. Highlight how the [Product/Service] can solve their problems or improve their lives. Include a clear call to action that encourages recipients to take the desired step, such as making a purchase or requesting more information. Ensure the email is concise, engaging, and visually appealing."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.draft_sales_follow_up_email",defaultMessage:"Draft Sales Follow-up Email"}),value:(0,te.Em)({id:"prompt.sales.draft_sales_follow_up_email.value2",defaultMessage:"Draft an engaging follow-up email to send to potential clients [Client Name] who have shown interest in our product/service. Begin by acknowledging their interest and expressing gratitude for considering our offerings. Personalize the email by referencing specific interactions or discussions. Highlight the key benefits and unique value of our product/service. Include a clear call to action, such as scheduling a demo or requesting more information. Craft a compelling subject line to increase email open rates. Ensure the email is concise, persuasive, and free of grammatical errors."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.proposal_writing",defaultMessage:"Proposal Writing"}),value:(0,te.Em)({id:"prompt.sales.proposal_writing.value2",defaultMessage:"Write a convincing sales proposal for [Client Name] showcasing how our [Product/Service] can solve their specific needs. Start with a personalized introduction and understanding of the client's challenges. Highlight the key features and benefits of our solution that directly address their pain points. Provide case studies or testimonials that demonstrate successful outcomes for similar clients. Include a clear pricing structure and return on investment (ROI) analysis. Craft a persuasive conclusion that encourages the client to take action and engage with our offering."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.customer_profile",defaultMessage:"Customer Profile"}),value:(0,te.Em)({id:"prompt.sales.customer_profile.value2",defaultMessage:"Create a detailed customer profile for our target audience, including demographic information, interests, and pain points. Begin by defining the core characteristics of our ideal customers, such as age, gender, location, and income level. Analyze their interests, hobbies, and preferences. Identify their challenges, pain points, and needs that our products or services can address. Develop a comprehensive customer persona that humanizes our target audience and provides insights into their behaviors and motivations. Ensure this profile informs our marketing strategies and product development."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_strategy_plan",defaultMessage:"Sales Strategy Plan"}),value:(0,te.Em)({id:"prompt.sales.sales_strategy_plan.value2",defaultMessage:"Construct a sales strategy plan that outlines our sales objectives, target market, sales process, and team roles. Start by defining clear sales goals and revenue targets. Identify our target market segments and customer profiles. Detail the sales process, including lead generation, qualification, nurturing, and closing. Specify the roles and responsibilities of the sales team, including sales representatives and managers. Include strategies for sales training, performance evaluation, and lead tracking. Ensure alignment with our overall business objectives and timelines for achieving sales targets."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.client_retention_strategies",defaultMessage:"Client Retention Strategies"}),value:(0,te.Em)({id:"prompt.sales.client_retention_strategies.value2",defaultMessage:"Create client retention strategies geared towards maintaining strong relationships with our existing clients and reducing customer churn. Start by analyzing the factors contributing to customer churn and identifying at-risk clients. Craft personalized retention plans for each client segment. Specify communication strategies, loyalty programs, and engagement initiatives. Include methods for gathering client feedback and addressing concerns promptly. Emphasize the importance of ongoing communication and providing exceptional value to clients. Ensure that the strategies align with our brand values and customer-centric approach."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.cold_dm_for_product_comparison",defaultMessage:"Cold DM for Product Comparison"}),value:(0,te.Em)({id:"prompt.sales.cold_dm_for_product_comparison.value2",defaultMessage:"Generate a cold DM idea that will compare my [Product/Service] to similar options on the market and persuade my [Ideal Customer Persona] to choose us with clear and compelling evidence. Craft a message that highlights the unique benefits, features, and advantages of our [Product/Service] over competitors. Include data, testimonials, or case studies to support our claims. Ensure the message is personalized and resonates with the recipient's needs and pain points. Encourage engagement and a call to action that directs them to learn more or make a decision."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.cold_dm_highlighting_unique_selling_points",defaultMessage:"Cold DM Highlighting Unique Selling Points"}),value:(0,te.Em)({id:"prompt.sales.cold_dm_highlighting_unique_selling_points.value2",defaultMessage:"Generate a cold DM idea that highlights the unique selling points of my [Product/Service]. Craft an attention-grabbing message that introduces our offering and its key benefits. Personalize the message to the recipient's needs or pain points, showcasing how our [Product/Service] can solve their specific challenges. Include a compelling call to action that encourages them to engage further, such as scheduling a demo or exploring our website. Ensure the message is concise, value-driven, and tailored to the target audience."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.cold_dm_with_personalized_approach",defaultMessage:"Cold DM with Personalized Approach"}),value:(0,te.Em)({id:"prompt.sales.cold_dm_with_personalized_approach.value2",defaultMessage:"Generate a cold DM idea that will use a personalized and targeted approach to engage my ideal customer persona and persuade them to take [Desired Action] with a clear and compelling message. Start by defining the characteristics and pain points of the ideal customer persona. Craft a DM message that addresses their specific needs and challenges, highlighting how [Product/Service] can provide a solution. Personalize the message with their name and relevant details. Include a persuasive call to action that clearly communicates the benefits of taking [Desired Action]."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.set_sales_targets",defaultMessage:"Set Sales Targets"}),value:(0,te.Em)({id:"prompt.sales.set_sales_targets.value2",defaultMessage:"Set realistic sales targets for our sales team for the next quarter. Begin by reviewing historical sales data, market trends, and the team's performance. Consider factors such as seasonality, competition, and economic conditions. Define specific sales goals for each team member and the overall team. Ensure that targets are challenging yet attainable, taking into account individual strengths and territories. Specify key performance indicators (KPIs) for tracking progress. Provide a clear strategy for achieving these targets and motivating the sales team."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.create_sales_forecast_report",defaultMessage:"Create Sales Forecast Report"}),value:(0,te.Em)({id:"prompt.sales.create_sales_forecast_report.value2",defaultMessage:"Create a future sales forecast report based on our current sales data and market trends. Begin by compiling historical sales data, including revenue, units sold, and customer demographics. Analyze market trends, industry benchmarks, and economic indicators that may impact sales. Develop a predictive model or forecasting method, such as time series analysis or regression analysis, to project future sales. Consider seasonality and external factors. Provide a comprehensive report with forecasted sales figures, assumptions, and a sensitivity analysis to account for uncertainties."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.apology_for_delay",defaultMessage:"Apology for Delay"}),value:(0,te.Em)({id:"prompt.sales.apology_for_delay.value2",defaultMessage:"Generate an empathetic apology email to [First Name], who I last spoke to on [Last Interaction] for a delay. Begin by expressing sincere apologies for the inconvenience caused by the delay. Acknowledge the impact it may have had on [First Name]'s experience. Provide a brief explanation for the delay without making excuses. Assure them of our commitment to improving and delivering better service. Offer a resolution or compensation if applicable. Close the email with a genuine and empathetic tone, inviting [First Name] to reach out with any further concerns."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.webinar_follow_up",defaultMessage:"Webinar Follow-up"}),value:(0,te.Em)({id:"prompt.sales.webinar_follow_up.value2",defaultMessage:"Write a follow-up email to [First Name], whose email is [Email], after attending a webinar, thanking them for their participation. Begin by expressing gratitude for their time and attendance at the recent webinar. Highlight key takeaways or insights from the webinar content. Mention any upcoming events, resources, or offers related to the webinar topic that might interest them. Encourage them to reach out with any questions or feedback. Provide contact information for further assistance. Conclude with a warm and appreciative tone."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.testimonial_request",defaultMessage:"Testimonial Request"}),value:(0,te.Em)({id:"prompt.sales.testimonial_request.value2",defaultMessage:"Create an email to [First Name] requesting a customer testimonial, sharing their experience with our product and service. Begin by expressing appreciation for their continued support and use of our product. Explain the importance of customer testimonials in helping others make informed decisions. Encourage them to share their honest feedback and describe their positive experiences. Provide guidelines for crafting the testimonial, such as specific questions or points to address. Offer assistance and express gratitude for their willingness to contribute. Include instructions for submitting the testimonial and any incentives, if applicable."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_door_opener_strategy",defaultMessage:"Sales Door Opener Strategy"}),value:(0,te.Em)({id:"prompt.sales.sales_door_opener_strategy.value2",defaultMessage:"Develop an effective door opener strategy to gain initial entrance to new accounts or expand into new divisions within existing accounts. Begin by defining the target accounts or divisions and their specific needs or pain points. Craft a compelling value proposition that addresses these needs. Identify key decision-makers and influencers within the accounts. Develop tailored outreach methods and messaging, such as personalized emails or introductory calls. Specify the timeline and steps for executing the door opener strategy, including follow-up actions and nurturing tactics."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_performance_review",defaultMessage:"Sales Performance Review"}),value:(0,te.Em)({id:"prompt.sales.sales_performance_review.value2",defaultMessage:"Conduct a comprehensive sales performance review of our sales team over the last quarter, identifying areas of success and opportunities for improvement. Start by gathering sales data, including revenue, conversion rates, and customer feedback. Analyze individual and team performance against targets. Recognize top performers and achievements. Identify specific challenges or bottlenecks in the sales process. Develop recommendations and action plans for addressing areas that require improvement. Outline strategies for enhancing sales training and motivation. Provide insights to optimize sales strategies and enhance overall team performance."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.product_demo_plan",defaultMessage:"Product Demo Plan"}),value:(0,te.Em)({id:"prompt.sales.product_demo_plan.value2",defaultMessage:"Develop a product demo plan for conducting engaging demos that highlight the key features and benefits of our product/service to potential clients. Start by defining the goals of the demos and the target audience. Create a detailed script or outline for the demo presentation, emphasizing the most compelling aspects of the product/service. Specify the demo format, whether it's live, recorded, or interactive. Include strategies for addressing common questions or objections from clients. Provide guidelines for conducting successful demos that leave a lasting impression and encourage client engagement."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_incentive_program",defaultMessage:"Sales Incentive Program"}),value:(0,te.Em)({id:"prompt.sales.sales_incentive_program.value2",defaultMessage:"Design a sales incentive program to motivate our sales team to achieve and exceed their targets. Begin by defining program objectives and the desired outcomes. Specify the criteria for earning incentives, such as sales targets, customer satisfaction, or other key performance indicators. Determine the types of rewards or incentives to be offered, including bonuses, commissions, or non-monetary rewards. Create a clear and transparent system for tracking and reporting sales performance. Outline the communication plan for introducing the program to the sales team and providing ongoing motivation."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.influencers_list",defaultMessage:"Influencers List"}),value:(0,te.Em)({id:"prompt.sales.influencers_list.value2",defaultMessage:"Write an outreach email to [First Name], praising their work as an influencer and expressing interest in working with them to represent our company brand. Start by complimenting their achievements and the value they bring to their audience. Explain our interest in collaborating and how their unique style aligns with our brand. Express excitement about the potential partnership. Request that they respond if they are interested, and mention that we can share more details about the collaboration. Maintain a friendly, professional, and energetic tone throughout the email."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.no_response_follow_up",defaultMessage:"No Response Follow-up"}),value:(0,te.Em)({id:"prompt.sales.no_response_follow_up.value2",defaultMessage:"Write a follow-up email to [Name], who works at [Company Name], and has not yet responded to my last email. Begin with a polite and friendly opening, expressing your continued interest in connecting with them. Briefly recap the content of your previous email for context. Mention the value or benefits they would gain from responding or engaging in further conversation. Provide a gentle reminder of the action you're requesting, such as scheduling a meeting or providing information. Express understanding of their busy schedule and offer flexibility. Include a clear and concise call to action, and thank them for their time and consideration."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.thank_you_email",defaultMessage:"Thank You Email"}),value:(0,te.Em)({id:"prompt.sales.thank_you_email.value2",defaultMessage:"Generate a personalized thank you email to [first name] after a purchase. Begin by expressing gratitude for their choice and trust in [Your Company/Brand]. Highlight the value they have added by choosing your [Product/Service] and reassure them of continued support. Offer any helpful resources or contact information for further assistance. Conclude with an invitation for feedback to enhance their experience and a sneak peek into future deals, products, or loyalty benefits."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.icebreaker",defaultMessage:"Icebreaker"}),value:(0,te.Em)({id:"prompt.sales.icebreaker.value2",defaultMessage:"Write an icebreaker for an introduction email to [First Name] who works at [Company]. Make it friendly, personal, but still professional. Begin by acknowledging their role at [Company] and express genuine interest in their work. Share a brief personal anecdote or common interest that establishes a connection. Keep the tone warm and approachable while maintaining professionalism. Conclude by expressing enthusiasm for the potential collaboration or conversation ahead."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sales_prospection",defaultMessage:"Sales Prospection"}),value:(0,te.Em)({id:"prompt.sales.sales_prospection.value2",defaultMessage:"Write a sales prospection email to [First Name], who has shown an interest in our product. Begin by acknowledging their previous interaction or interest in our product. Highlight the key benefits and features of the product that align with their needs and preferences. Offer a personalized incentive or discount to encourage them to take the next step. Provide clear contact information and a call to action for them to reach out or make a purchase. Express enthusiasm for the opportunity to serve their needs and answer any questions they may have."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.prospection_call_email",defaultMessage:"Prospection Call Email"}),value:(0,te.Em)({id:"prompt.sales.prospection_call_email.value2",defaultMessage:"Write a prospection email to [First Name] who works at [Company], proposing a call to discuss how I can help them reach their goals. Start by introducing yourself and your company briefly. Mention any common interests or connections, if applicable. Express interest in their company and its goals. Highlight your expertise and how it aligns with their needs. Suggest a specific date and time for a call, making it convenient for them. Include a clear call to action for them to confirm the call and provide contact details. End with a courteous and professional tone."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.product_hunt_upvotes_list",defaultMessage:"Product Hunt Upvotes List"}),value:(0,te.Em)({id:"prompt.sales.product_hunt_upvotes_list.value2",defaultMessage:"Write a message to [First Name] thanking them for their ongoing support and requesting an upvote on our Product Hunt launch. Make it fun, friendly, and energetic. Begin by expressing gratitude for their continued support and enthusiasm for our product. Highlight the excitement surrounding our Product Hunt launch and how their upvote can make a significant difference. Keep the message engaging and conversational, encouraging them to join in on the excitement. Include a clear and enthusiastic call to action for them to upvote our product on Product Hunt. Convey the sense of community and collaboration in this endeavor."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.develop_sales_training_program",defaultMessage:"Develop Sales Training Program"}),value:(0,te.Em)({id:"prompt.sales.develop_sales_training_program.value2",defaultMessage:"Develop a comprehensive sales training program for our sales team to enhance their selling skills and product knowledge. Start by defining the training objectives and desired outcomes. Identify key topics such as product knowledge, sales techniques, objection handling, and customer relationship management. Create a detailed curriculum with modules, resources, and assessment methods. Specify the training delivery format, whether in-person, virtual, or a combination. Include a timeline for training sessions and ongoing support. Ensure that the program aligns with our sales goals and strategies."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.product_service_intro_analogies",defaultMessage:"Product/Service Intro Using Analogies"}),value:(0,te.Em)({id:"prompt.sales.product_service_intro_analogies.value",defaultMessage:"For a [Audience], craft a sales pitch for [Product/Service] using metaphors or analogies that make its intricate workings relatable. Focus on breaking down complex features into understandable concepts that resonate with the audience’s everyday experiences. Ensure the analogies are relevant, engaging, and highlight the unique aspects of the product/service."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.narrative_interconnected_features",defaultMessage:"Narrative for Interconnected Features"}),value:(0,te.Em)({id:"prompt.sales.narrative_interconnected_features.value",defaultMessage:"Given that the [Product/Service] has features [A], [B], and [C], create a cohesive narrative highlighting their interconnected benefits. Structure the story to demonstrate how each feature complements the others, creating a synergistic effect that enhances the overall user experience. Emphasize the holistic value proposition offered by the combined features."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.uvp_against_market_competitors",defaultMessage:"UVP Against Market Competitors"}),value:(0,te.Em)({id:"prompt.sales.uvp_against_market_competitors.value",defaultMessage:"Considering market competitors [X], [Y], and [Z], frame the Unique Value Proposition (UVP) of [Product/Service] to underline its superiority. Develop a narrative that highlights the distinct advantages of our product/service while maintaining a respectful tone towards competitors. Focus on showcasing unique features, benefits, and customer experiences that set our offering apart."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.emotional_triggers_uvp",defaultMessage:"Emotional Triggers for UVP"}),value:(0,te.Em)({id:"prompt.sales.emotional_triggers_uvp.value",defaultMessage:"From a psychological perspective, identify emotional triggers that can make the UVP of [Product/Service] more persuasive. Craft a narrative that taps into emotions like trust, security, aspiration, or belonging, to create a deeper connection with the audience. Use storytelling techniques to evoke these emotions and tie them back to the benefits of the product/service."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.sequencing_testimonials",defaultMessage:"Sequencing Testimonials for Impact"}),value:(0,te.Em)({id:"prompt.sales.sequencing_testimonials.value",defaultMessage:"Sequence and present testimonials from customers in sectors [P], [Q], and [R] for maximum impact, targeting an audience primarily from sector [P]. Arrange the testimonials in a way that they build upon each other, highlighting different aspects of the product/service. Use storytelling to weave these testimonials into a compelling narrative that resonates with the target audience’s sector-specific needs and aspirations."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.statistic_storyline_product_service",defaultMessage:"Statistic Storyline for Product/Service"}),value:(0,te.Em)({id:"prompt.sales.statistic_storyline_product_service.value",defaultMessage:"Given the data showing a 120% efficiency improvement using [Product/Service], create a storyline that turns this statistic into a vivid, relatable benefit. Develop a narrative that humanizes the data, possibly through a customer success story, illustrating how the product/service has tangibly improved efficiency in a relatable context."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.behavioral_psychology_cta",defaultMessage:"Behavioral Psychology-Driven CTA"}),value:(0,te.Em)({id:"prompt.sales.behavioral_psychology_cta.value",defaultMessage:"Leverage principles from behavioral psychology to craft a Call to Action (CTA) for [Product/Service] that taps into users’ Fear Of Missing Out (FOMO). Create a sense of urgency and exclusivity around the offer, motivating immediate action while maintaining a tone that is enthusiastic but not overbearing."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.behavioral_psychology_cta",defaultMessage:"Behavioral Psychology-Driven CTA"}),value:(0,te.Em)({id:"prompt.sales.behavioral_psychology_cta.value",defaultMessage:"Leverage principles from behavioral psychology to craft a Call to Action (CTA) for [Product/Service] that taps into users’ Fear Of Missing Out (FOMO). Create a sense of urgency and exclusivity around the offer, motivating immediate action while maintaining a tone that is enthusiastic but not overbearing."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.inertia_countering_cta",defaultMessage:"Inertia-Countering CTA Strategies"}),value:(0,te.Em)({id:"prompt.sales.inertia_countering_cta.value",defaultMessage:"Considering the inertia faced by customers in [industry], develop strategies for a Call to Action (CTA) that encourage immediate action without seeming pushy. Focus on creating a compelling narrative that highlights the immediate benefits and ease of taking the next step, while addressing potential hesitations or barriers the customer might have."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.peak_end_rule_sales_pitch",defaultMessage:"Peak-End Rule for Memorable Sales Pitch"}),value:(0,te.Em)({id:"prompt.sales.peak_end_rule_sales_pitch.value",defaultMessage:"Utilize the peak-end rule from cognitive science to design the conclusion of your sales pitch for [Product/Service]. Plan the pitch to ensure that the most impactful points are emphasized towards the end, creating a lasting memory. Include a compelling story or a surprising fact that resonates with the audience’s needs and aspirations."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.pitch_adaptation_specific_values",defaultMessage:"Pitch Adaptation for Specific Values"}),value:(0,te.Em)({id:"prompt.sales.pitch_adaptation_specific_values.value",defaultMessage:"Adapt your pitch for [Product/Service] to resonate deeply with [specific audience] who values [sustainability] and [innovation]. Focus on how the product/service aligns with these values, using examples and storytelling to demonstrate its relevance and benefits in these areas. Highlight any sustainable practices or innovative features that set your offering apart."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.culturally_sensitive_pitch",defaultMessage:"Culturally Sensitive Pitch Tailoring"}),value:(0,te.Em)({id:"prompt.sales.culturally_sensitive_pitch.value",defaultMessage:"Tailor your pitch for [Product/Service] to be culturally sensitive yet compelling for [specific region/country]. Research and incorporate cultural nuances and preferences into your pitch. Focus on aspects of the product/service that align with the region’s values, norms, and market needs, ensuring that your messaging is respectful and effectively resonates with the local audience."})},{category:"sales",title:(0,te.Em)({id:"prompt.sales.heros_journey_narrative",defaultMessage:"Hero's Journey Narrative for Sales Pitch"}),value:(0,te.Em)({id:"prompt.sales.heros_journey_narrative.value",defaultMessage:"Restructure your sales pitch for [Product/Service] to follow the Heros Journey narrative arc. Start by presenting the audience’s common pain point as the ‘call to adventure’, then position [Product/Service] as the ‘mentor’ that provides them with the solution. Illustrate how using the product/service will lead them to ‘overcome challenges’ and reach a ‘rewarding resolution’, effectively solving their problem."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.create_about_us_page_2",defaultMessage:"Create About Us Page"}),value:(0,te.Em)({id:"prompt.copywriting.create_about_us_page_2.value2",defaultMessage:"Compose an About Us page that showcases the unique culture and core values of [company name]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.develop_website_copy_2",defaultMessage:"Develop Website Copy"}),value:(0,te.Em)({id:"prompt.copywriting.develop_website_copy_2.value2",defaultMessage:"Craft website copy that engages visitors and reflects the unique selling points of [website name]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_company_vision_statement_2",defaultMessage:"Write Company Vision Statement"}),value:(0,te.Em)({id:"prompt.copywriting.write_company_vision_statement_2.value2",defaultMessage:"Articulate a future-focused vision statement for [company name], highlighting aspirations and long-term impact."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_product_reviews",defaultMessage:"Write Product Reviews"}),value:(0,te.Em)({id:"prompt.copywriting.write_product_reviews.value2",defaultMessage:"Write convincing product reviews for our new product [product name] to boost sales."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.create_case_studies",defaultMessage:"Create Case Studies"}),value:(0,te.Em)({id:"prompt.copywriting.create_case_studies.value2",defaultMessage:"Create detailed case studies showcasing the success stories of our customers using our product [product name]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.craft_email_body_copy",defaultMessage:"Craft Email Body Copy"}),value:(0,te.Em)({id:"prompt.copywriting.craft_email_body_copy.value2",defaultMessage:"Write persuasive email body copy for [specific campaign] to encourage [desired action]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_press_release",defaultMessage:"Write Press Release"}),value:(0,te.Em)({id:"prompt.copywriting.write_press_release.value2",defaultMessage:"Write a concise and compelling press release to announce [specific news or event] related to our company [company name]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.develop_social_media_posts",defaultMessage:"Develop Social Media Posts"}),value:(0,te.Em)({id:"prompt.copywriting.develop_social_media_posts.value2",defaultMessage:"Develop engaging social media posts for our platform [platform name] to increase followers and engagement."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.create_blog_posts",defaultMessage:"Create Blog Posts"}),value:(0,te.Em)({id:"prompt.copywriting.create_blog_posts.value2",defaultMessage:"Create informative and interesting blog posts for our website [website name] on the topic of [topic]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_product_descriptions",defaultMessage:"Write Product Descriptions"}),value:(0,te.Em)({id:"prompt.copywriting.write_product_descriptions.value2",defaultMessage:"Write compelling product descriptions for our new product [product name] aiming to highlight its benefits and features."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.develop_ad_copy",defaultMessage:"Develop Ad Copy"}),value:(0,te.Em)({id:"prompt.copywriting.develop_ad_copy.value2",defaultMessage:"Develop attention-grabbing ad copies for our forthcoming ad campaign for [product name] targeting [target audience]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.create_landing_page_content",defaultMessage:"Create Landing Page Content"}),value:(0,te.Em)({id:"prompt.copywriting.create_landing_page_content.value2",defaultMessage:"Create engaging and persuasive content for our new landing page aimed to sell [product/service name]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_customer_testimonials",defaultMessage:"Write Customer Testimonials"}),value:(0,te.Em)({id:"prompt.copywriting.write_customer_testimonials.value2",defaultMessage:"Write credible and engaging customer testimonials to be published on our website [website name]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_email_subject_lines",defaultMessage:"Write Email Subject Lines"}),value:(0,te.Em)({id:"prompt.copywriting.write_email_subject_lines.value2",defaultMessage:"Develop powerful and effective email subject lines to boost open rates for our future email marketing campaigns."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.write_meta_descriptions",defaultMessage:"Write Meta Descriptions"}),value:(0,te.Em)({id:"prompt.copywriting.write_meta_descriptions.value2",defaultMessage:"Develop SEO-friendly and compelling meta descriptions for [webpage on website name] to increase CTR from search engine results."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.develop_content_strategy",defaultMessage:"Develop Content Strategy"}),value:(0,te.Em)({id:"prompt.copywriting.develop_content_strategy.value2",defaultMessage:"Develop a comprehensive content strategy for [company name] to boost online presence and engagement."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.engaging_text",defaultMessage:"Engaging Text"}),value:(0,te.Em)({id:"prompt.copywriting.engaging_text.value2",defaultMessage:"Please write a compelling [type of text] that speaks directly to my [ideal customer persona] and encourages them to take [desired action] on my [website/product]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.persuasive_text_for_purchase",defaultMessage:"Persuasive Text for Purchase"}),value:(0,te.Em)({id:"prompt.copywriting.persuasive_text_for_purchase.value2",defaultMessage:"I need a [type of text] that will persuade [ideal customer persona] to purchase my [product/service] by highlighting its unique benefits and addressing any potential objections."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.text_to_convince_subscription",defaultMessage:"Text to Convince Subscription"}),value:(0,te.Em)({id:"prompt.copywriting.text_to_convince_subscription.value2",defaultMessage:"Compose persuasive text that emotionally resonates with readers to boost subscription rates for [service/product]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.explain_features_and_benefits",defaultMessage:"Explain Features and Benefits"}),value:(0,te.Em)({id:"prompt.copywriting.explain_features_and_benefits.value2",defaultMessage:"Write clear and engaging text that comprehensively explains the features and benefits of [product/service], addressing customer pain points directly."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.text_with_strong_headline_and_hook",defaultMessage:"Text with Strong Headline and Hook"}),value:(0,te.Em)({id:"prompt.copywriting.text_with_strong_headline_and_hook.value2",defaultMessage:"Craft captivating text with a strong headline and hook that incorporates storytelling to draw readers in for [campaign/purpose]."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.showcase_unique_features_and_benefits",defaultMessage:"Showcase Unique Features and Benefits"}),value:(0,te.Em)({id:"prompt.copywriting.showcase_unique_features_and_benefits.value2",defaultMessage:"Develop vibrant copy that showcases the unique features and benefits of [product/service], tailored to overcome common customer objections."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.establish_trust_and_credibility_text",defaultMessage:"Establish Trust and Credibility Text"}),value:(0,te.Em)({id:"prompt.copywriting.establish_trust_and_credibility_text.value2",defaultMessage:"Craft a text that establishes trust and credibility for [brand/company], weaving in emotions to foster a sense of urgency amongst potential customers."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.clear_explanation_of_features_and_benefits",defaultMessage:"Clear Explanation of Features and Benefits"}),value:(0,te.Em)({id:"prompt.copywriting.clear_explanation_of_features_and_benefits.value2",defaultMessage:"Deliver concise and impactful text that lays out the clear features and benefits of [product/service], positioning it as a valuable must-have."})},{category:"copywriting",title:(0,te.Em)({id:"prompt.copywriting.address_needs_and_pain_points",defaultMessage:"Address Needs and Pain Points"}),value:(0,te.Em)({id:"prompt.copywriting.address_needs_and_pain_points.value2",defaultMessage:"Develop tailored website copy that speaks to different market segments, directly addressing their needs and pain points for a more personalized experience on [website name]."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.aida_newsletter_campaign",defaultMessage:"AIDA Newsletter Campaign"}),value:(0,te.Em)({id:"prompt.email_marketing.aida_newsletter_campaign.value2",defaultMessage:"Create a newsletter using the AIDA framework. Start with an Attention-grabbing headline that piques the reader's interest. Build Interest by introducing valuable content or offers. Create Desire by explaining how the content or offers can benefit the reader. End with a Call to Action that prompts the reader to take a specific action, such as visiting our website, signing up for a webinar, or making a purchase. Ensure the newsletter is visually appealing and easy to read, with a clear flow from attention to action."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.email_automation_sequence",defaultMessage:"Email Automation Sequence"}),value:(0,te.Em)({id:"prompt.email_marketing.email_automation_sequence.value2",defaultMessage:"Set up an email automation sequence for our company to nurture leads and guide them through the buying journey. Begin by defining the stages of the buyer's journey and the key touchpoints where leads need guidance. Create a series of automated emails that provide valuable content, address common questions, and showcase the benefits of our products/services. Specify the timing and triggers for each email in the sequence. Incorporate personalization and segmentation based on lead behavior and interests. Include clear calls to action that encourage leads to move to the next stage of the journey."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.newsletter_content_ideas",defaultMessage:"Newsletter Content Ideas"}),value:(0,te.Em)({id:"prompt.email_marketing.newsletter_content_ideas.value2",defaultMessage:"Generate a list of engaging content ideas for our newsletter about {Topic}. Consider the interests and preferences of our newsletter subscribers. Include article topics, tips, how-tos, interviews, and any relevant news or updates related to {Topic}. Ensure that the content ideas are varied and provide value to our subscribers."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.welcome_email",defaultMessage:"Welcome Email"}),value:(0,te.Em)({id:"prompt.email_marketing.welcome_email.value2",defaultMessage:"Craft a warm and welcoming email for new subscribers to our newsletter. Provide a brief introduction to our company and the value they can expect from our newsletter. Highlight the benefits of staying connected with our brand through the newsletter, such as exclusive content, updates, and offers. Include a clear call to action, inviting them to explore our latest content or products."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.customer_retention_email",defaultMessage:"Customer Retention Email"}),value:(0,te.Em)({id:"prompt.email_marketing.customer_retention_email.value2",defaultMessage:"Create an email campaign aimed at improving customer retention for our company. Develop a series of engaging and personalized emails that provide value to customers, such as exclusive offers, loyalty rewards, or helpful tips. Include a compelling call to action in each email to encourage customers to continue their relationship with our brand."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.seasonal_email_campaign",defaultMessage:"Seasonal Email Campaign"}),value:(0,te.Em)({id:"prompt.email_marketing.seasonal_email_campaign.value2",defaultMessage:"Create a seasonal email campaign around {Holiday/Season Event} to promote our {Product/Service}. Craft a series of engaging email messages that align with the theme of {Holiday/Season Event}, incorporating visuals and a compelling narrative. Include a clear call to action and a sense of urgency."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.re_engagement_email",defaultMessage:"Re-engagement Email"}),value:(0,te.Em)({id:"prompt.email_marketing.re_engagement_email.value2",defaultMessage:"Write a re-engagement email to connect with subscribers who have been inactive for a while. Highlight recent updates or offerings that may rekindle their interest. Include a compelling call to action that encourages them to take a specific step, such as visiting our website or making a purchase."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.unsubscribe_rate_reduction_strategy",defaultMessage:"Unsubscribe Rate Reduction Strategy"}),value:(0,te.Em)({id:"prompt.email_marketing.unsubscribe_rate_reduction_strategy.value2",defaultMessage:"Devise methods to minimize the unsubscribe rate for an email list by continually providing value and effectively managing email frequency. Develop strategies to ensure that each email provides valuable information and offers. Implement an email preference center for subscribers to customize their email frequency."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.test_email_subject_lines",defaultMessage:"Test Email Subject Lines"}),value:(0,te.Em)({id:"prompt.email_marketing.test_email_subject_lines.value2",defaultMessage:"Perform A/B testing on various email subject lines to determine the most effective ones for our company. Specify the metrics to measure, such as open rates and conversion rates. Analyze the results to identify which subject line generates the highest engagement and use it for the full email campaign."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.email_metrics_tracking",defaultMessage:"Email Metrics Tracking"}),value:(0,te.Em)({id:"prompt.email_marketing.email_metrics_tracking.value2",defaultMessage:"Establish a process for tracking critical email marketing metrics for our company. Define the objectives of our email marketing campaigns and the key metrics that align with these objectives. Develop a system for collecting and analyzing data, including benchmarks for success, to improve email campaign performance."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.strong_headline_and_hook",defaultMessage:"Email with Strong Headline and Hook"}),value:(0,te.Em)({id:"prompt.email_marketing.strong_headline_and_hook.value2",defaultMessage:"Generate a strong headline and hook for a promotional email that promotes our {Product/Service} and aims to grab the recipient's attention immediately. Ensure that both the headline and hook align with the email's main message and call to action."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.promotional_campaign",defaultMessage:"Promotional Campaign"}),value:(0,te.Em)({id:"prompt.email_marketing.promotional_campaign.value2",defaultMessage:"Plan a promotional email campaign for our {Product/Service} with special offers for our loyal customers. Include a clear call to action and a sense of urgency to encourage conversions. Provide a timeline for the email campaign and a strategy for measuring its success."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.convincing_email_for_purchase",defaultMessage:"Convincing Email for Purchase"}),value:(0,te.Em)({id:"prompt.email_marketing.convincing_email_for_purchase.value2",defaultMessage:"Create an email that will convince potential customers to purchase our {Product/Service} by highlighting its unique benefits and addressing any potential objections. Use customer testimonials or case studies as social proof and provide a clear and persuasive call to action."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.features_and_benefits_explanation",defaultMessage:"Clear Explanation of Features and Benefits in Email"}),value:(0,te.Em)({id:"prompt.email_marketing.features_and_benefits_explanation.value2",defaultMessage:"Generate an email that presents clear explanations of our {Product/Service} features and benefits. Use concise and persuasive language and include visuals or infographics if applicable. Conclude with a strong call to action."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.upselling_email_campaign",defaultMessage:"Upselling Email Campaign"}),value:(0,te.Em)({id:"prompt.email_marketing.upselling_email_campaign.value2",defaultMessage:"Develop an email campaign designed to upsell customers to higher-tiered products or additional features. Include personalized recommendations and create a sense of urgency with limited-time offers. Provide clear calls to action for customers to explore the upsell options."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.urgency_and_strong_offer",defaultMessage:"Email with Urgency and Strong Offer"}),value:(0,te.Em)({id:"prompt.email_marketing.urgency_and_strong_offer.value2",defaultMessage:"Create an email that conveys urgency with a strong offer to purchase our {Product/Service}. Highlight any special discounts or incentives and use persuasive language to motivate immediate action. Ensure the email is visually appealing and optimized for mobile devices."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.cold_email_to_overcome_objections",defaultMessage:"Cold Email to Overcome Objections"}),value:(0,te.Em)({id:"prompt.email_marketing.cold_email_to_overcome_objections.value2",defaultMessage:"Create a cold email designed to overcome objections about our {Product/Service} by providing detailed explanations and evidence. Highlight the unique value and benefits, and include a call to action that encourages recipients to seek additional information."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.build_trust_and_credibility",defaultMessage:"Establish Trust and Credibility"}),value:(0,te.Em)({id:"prompt.email_marketing.build_trust_and_credibility.value2",defaultMessage:"Generate an email with the goal of building trust and credibility in our brand. Communicate our brand's reliability, expertise, and commitment to customer satisfaction. Highlight any industry certifications or awards and provide a clear call to action."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.attention_grabbing_cold_email",defaultMessage:"Cold Email for Attention Grabbing"}),value:(0,te.Em)({id:"prompt.email_marketing.attention_grabbing_cold_email.value2",defaultMessage:"Create an attention-grabbing cold email. Craft a compelling subject line and open with a specific solution or offer that addresses the needs of the recipient. Include a clear call to action and keep the email personalized to the recipient's industry or role."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.showcase_benefits_cold_email",defaultMessage:"Cold Email Showcasing Benefits"}),value:(0,te.Em)({id:"prompt.email_marketing.showcase_benefits_cold_email.value2",defaultMessage:"Create a cold email highlighting the benefits of our {Product/Service}. Communicate the benefits clearly and persuasively, addressing the recipient's specific needs or pain points. Provide a clear call to action for them to take the next steps."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.cold_email_unique_selling_points",defaultMessage:"Cold Email with Unique Selling Points"}),value:(0,te.Em)({id:"prompt.email_marketing.cold_email_unique_selling_points.value2",defaultMessage:"Create a cold email that emphasizes the unique selling points of our {Product/Service}. Use persuasive language to convey how it addresses the recipient's needs and include a call to action for them to learn more or make a purchase."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.cold_email_establish_authority",defaultMessage:"Cold Email to Establish Authority"}),value:(0,te.Em)({id:"prompt.email_marketing.cold_email_establish_authority.value2",defaultMessage:"Create a cold email designed to position our brand as an authority in the area of {Market/Topic}. Provide relevant statistics or case studies and include a call to action that invites recipients to engage further with our brand."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.subscription_value_email",defaultMessage:"Subscription Value Explanation"}),value:(0,te.Em)({id:"prompt.email_marketing.subscription_value_email.value2",defaultMessage:"Create an email that outlines the value of a subscription to our {Service/Product}. Highlight the benefits and features, showcase customer testimonials, and encourage the recipient to subscribe with a clear call to action and a sense of urgency."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.identify_industry_trends",defaultMessage:"Industry Trends"}),value:(0,te.Em)({id:"prompt.email_marketing.identify_industry_trends.value2",defaultMessage:"Identify the leading trends in [industry] to feature in our newsletter related to {Topic}. Include innovations, emerging technologies, and market insights that are of interest to our audience."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.personalization_strategy",defaultMessage:"Email Personalization"}),value:(0,te.Em)({id:"prompt.email_marketing.personalization_strategy.value2",defaultMessage:"Implement an email personalization strategy based on subscriber preferences and behavior. Develop personalized content and employ dynamic content and product recommendations to increase engagement and conversions."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.subscriber_segmentation",defaultMessage:"Subscriber Segmentation"}),value:(0,te.Em)({id:"prompt.email_marketing.subscriber_segmentation.value2",defaultMessage:"Develop a strategy for subscriber segmentation to better target our email marketing efforts. Define the criteria for segmentation and craft tailored campaigns for each segment to enhance relevance and engagement."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.email_list_growth",defaultMessage:"Email List Growth"}),value:(0,te.Em)({id:"prompt.email_marketing.email_list_growth.value2",defaultMessage:"Create a plan to expand our email subscription list through various strategies. Define the target audience, employ organic and paid strategies, and provide KPIs to measure the success of the growth initiatives."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.lead_magnet_promotion",defaultMessage:"Lead Magnet Promotion Email"}),value:(0,te.Em)({id:"prompt.email_marketing.lead_magnet_promotion.value2",defaultMessage:"Craft an email promoting a new lead magnet, such as an e-book or webinar, to our target audience. The email should highlight the benefits of the lead magnet, tease the content it provides, and include a clear call to action to download or sign up. Personalization and a subject line that generates curiosity are key to this email’s effectiveness."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.post_purchase_follow_up",defaultMessage:"Post-Purchase Follow-Up Email"}),value:(0,te.Em)({id:"prompt.email_marketing.post_purchase_follow_up.value2",defaultMessage:"Design a post-purchase follow-up email aimed at enhancing customer satisfaction and encouraging further engagement. The email should thank the customer for their purchase, provide useful information or tutorials on the product or service bought, and cross-sell related products. A section asking for feedback or a review can also be included to build rapport and collect valuable customer data."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.cart_abandonment_recovery",defaultMessage:"Cart Abandonment Recovery Email"}),value:(0,te.Em)({id:"prompt.email_marketing.cart_abandonment_recovery.value2",defaultMessage:"Compose a cart abandonment recovery email with the goal of bringing customers back to complete their purchase. The email should include a reminder of the items left in the cart, highlight the benefits of the products, offer assistance in case of checkout trouble, and potentially provide an incentive such as a limited-time discount or free shipping to encourage completion of the purchase."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.member_exclusive_offer",defaultMessage:"Member Exclusive Offer Email"}),value:(0,te.Em)({id:"prompt.email_marketing.member_exclusive_offer.value2",defaultMessage:"Create an email for an exclusive offer available only to members or subscribers as part of a loyalty program. The email should make the recipient feel valued and part of an elite group. It should clearly outline the details of the offer, how to redeem it, and the timeframe in which it’s available, using language that conveys exclusivity and privilege."})},{category:"email_marketing",title:(0,te.Em)({id:"prompt.email_marketing.feedback_request_email",defaultMessage:"Feedback Request Email"}),value:(0,te.Em)({id:"prompt.email_marketing.feedback_request_email.value2",defaultMessage:"Develop an email requesting feedback on a recent product or service experience. The email should emphasize the importance of the customer’s opinion, describe how the feedback will be used to improve the product or service, and express appreciation for their input. Include a straightforward and accessible link or method to submit the feedback. The tone should be appreciative and respectful of the recipient’s time and opinion."})},{category:"social_media",title:{id:"prompt.social_media.instagram_story_features_benefits",defaultMessage:"Instagram Story Showcasing Unique Features and Benefits"},value:{id:"prompt.social_media.instagram_story_features_benefits.value2",defaultMessage:"Write an Instagram story highlighting the unique features and benefits of our [Product/Service]. Be sure to cover [Unique Features and Benefits] in a format that grabs attention. Deploy visuals, text overlays, and animations. End with a strong call to action to explore more or buy."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_product_comparison",defaultMessage:"Product Comparison Instagram Story"},value:{id:"prompt.social_media.instagram_story_product_comparison.value2",defaultMessage:"Create an Instagram story comparing two similar products, highlighting features, benefits, and distinctions. Use engaging visuals and captions to deliver your message, and include promotions. Encourage action with a 'swipe up' or website link."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_unique_selling_points",defaultMessage:"Instagram Story Highlighting Unique Selling Points"},value:{id:"prompt.social_media.instagram_story_unique_selling_points.value2",defaultMessage:"Craft an Instagram story emphasizing the unique selling points of our [Product/Service]. Use persuasive text and visuals, incorporate testimonials, and conclude with a clear call to action to visit our site or learn more."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_step_by_step_guide",defaultMessage:"Instagram Story with Step-By-Step Guide"},value:{id:"prompt.social_media.instagram_story_step_by_step_guide.value2",defaultMessage:"Design an engaging Instagram story providing a step-by-step guide on [Topic]. Make it visually clear and concise, with a summary and call to action at the end, encouraging saves, shares, and further brand interaction."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_unique_offer",defaultMessage:"Instagram Story with Unique Offer"},value:{id:"prompt.social_media.instagram_story_unique_offer.value2",defaultMessage:"Develop an Instagram story with compelling imagery highlighting a special offer. Convey urgency and exclusivity, and prompt viewers to swipe up or click to enjoy the benefits."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_positive_reviews",defaultMessage:"Instagram Story to Encourage Positive Reviews"},value:{id:"prompt.social_media.instagram_story_positive_reviews.value2",defaultMessage:"Compose an Instagram story encouraging positive reviews of our [Product/Service]. Create a call to action for feedback, using hashtags and stickers to improve reach and thanking followers for their support."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_sneak_peek",defaultMessage:"Instagram Story Providing Sneak Peek of Upcoming Products"},value:{id:"prompt.social_media.instagram_story_sneak_peek.value2",defaultMessage:"Create an Instagram story teasing upcoming products with visuals and hints about features. Build excitement with a countdown, engaging questions or predictions, and a clear call to action."}},{category:"social_media",title:{id:"prompt.social_media.instagram_story_behind_the_scenes",defaultMessage:"Instagram Story with Behind-The-Scenes Content"},value:{id:"prompt.social_media.instagram_story_behind_the_scenes.value2",defaultMessage:"Produce an Instagram story sharing behind-the-scenes looks at [Project/Product]. Use visuals and captions to bring followers into your creative world, prompting interaction and followership."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_viral_product_showcase",defaultMessage:"Viral Twitter Thread Showcasing Product or Service"},value:{id:"prompt.social_media.twitter_thread_viral_product_showcase.value2",defaultMessage:"Write a captivating Twitter thread about our [Product/Service] that could go viral. Start with a hook, include customer stories, visuals, and a persuasive call to action. Use hashtags and encourage engagement throughout the thread."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_product_value",defaultMessage:"Twitter Thread Showcasing Product Value and Benefits"},value:{id:"prompt.social_media.twitter_thread_product_value.value2",defaultMessage:"Craft a Twitter thread detailing a product's value and benefits. Engage with an attractive intro, distinct features, visuals, customer examples, and conclude with a CTA to explore or purchase."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_success_stories",defaultMessage:"Twitter Thread Showcasing Success Stories"},value:{id:"prompt.social_media.twitter_thread_success_stories.value2",defaultMessage:"Develop a Twitter thread that tells success stories with our [Product/Service]. Kick off with value, add real-life stories, stats, and visuals, inviting followers to engage and learn more."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_product_comparison",defaultMessage:"Twitter Thread for Product Comparison"},value:{id:"prompt.social_media.twitter_thread_product_comparison.value2",defaultMessage:"Construct a Twitter thread comparing two products, clarifying their features and suitability. Provide a balanced view with visuals and conclude with a recommendation or call to action for audience engagement."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_solution_to_pain_points",defaultMessage:"Twitter Thread Demonstrating Solution to Pain Points"},value:{id:"prompt.social_media.twitter_thread_solution_to_pain_points.value2",defaultMessage:"Author a Twitter thread addressing specific pain points with actionable solutions. Share your advice in a series of tweets with engaging language and visuals, ending with an interactive call to action."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_relatable_story",defaultMessage:"Twitter Thread Telling a Relatable Story"},value:{id:"prompt.social_media.twitter_thread_relatable_story.value2",defaultMessage:"Formulate a Twitter thread narrating a relatable story on [Topic]. Use engaging storytelling techniques and concise tweets to keep the audience hooked, and wrap with a hashtag to foster discussion."}},{category:"social_media",title:{id:"prompt.social_media.twitter_thread_behind_the_scenes",defaultMessage:"Behind-The-Scenes Twitter Thread"},value:{id:"prompt.social_media.twitter_thread_behind_the_scenes.value2",defaultMessage:"Create a Twitter thread that takes your audience behind the scenes. Share stories and visuals of your team's work, ask for your audience's stories, and express your gratitude for their support."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_product_value",defaultMessage:"YouTube Video Showcasing Product Value and Benefits"},value:{id:"prompt.social_media.youtube_video_product_value.value2",defaultMessage:"Produce a YouTube video that explains the value and benefits of [Product/Service], with a script angled toward features, benefits, customer success, and a strong CTA for viewers to take the next step."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_persuading_audience",defaultMessage:"Viral YouTube Video Persuading Audience"},value:{id:"prompt.social_media.youtube_video_persuading_audience.value2",defaultMessage:"Construct a viral YouTube video for [Purpose], aimed at captivating and persuading a defined audience. Focus on compelling, shareable content that encourages viewer engagement and action."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_success_stories",defaultMessage:"YouTube Video Showcasing Success Stories"},value:{id:"prompt.social_media.youtube_video_success_stories.value2",defaultMessage:"Assemble a YouTube video that showcases success stories from [Product/Service] users. Incorporate testimonials and visuals showcasing transformations, and support the narrative with a CTA."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_selling_points",defaultMessage:"YouTube Video Highlighting Unique Selling Points"},value:{id:"prompt.social_media.youtube_video_selling_points.value2",defaultMessage:"Craft a YouTube video focused on the unique selling points of our [Product/Service]. Develop a storyboard that combines explanations, demonstrations, and testimonies to engage the audience."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_step_by_step_guide",defaultMessage:"YouTube Video with Step-by-Step Guide"},value:{id:"prompt.social_media.youtube_video_step_by_step_guide.value2",defaultMessage:"Create a YouTube video with a detailed step-by-step guide on [Topic]. Outline the process clearly, support with visual aids, and maintain consistent pacing and clarity throughout the video."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_relatable_story",defaultMessage:"YouTube Video Telling a Relatable Story"},value:{id:"prompt.social_media.youtube_video_relatable_story.value2",defaultMessage:"Develop a deeply relatable YouTube video on [Topic] that engages the audience emotionally. Plan a compelling story arc, maintain a relatable tone, and guide viewers towards a meaningful takeaway."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_connection_message",defaultMessage:"Craft LinkedIn Connection Message"},value:{id:"prompt.social_media.linkedin_connection_message.value2",defaultMessage:"Write a LinkedIn connection message for [LinkedIn URL] with a fun, friendly tone, highlighting mutual interests or connections and the purpose of [Purpose]. Ensure an approachable closing."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_article_leadership_advice",defaultMessage:"LinkedIn Article Offering Leadership Advice"},value:{id:"prompt.social_media.linkedin_article_leadership_advice.value2",defaultMessage:"Write a LinkedIn article where our CEO/Executive shares personal leadership advice and experiences. Connect these lessons to broader industry themes and invite readers to engage with their perspectives."}},{category:"social_media",title:{id:"prompt.social_media.facebook_post_community_service_initiative",defaultMessage:"Facebook Post about Community Service Initiative"},value:{id:"prompt.social_media.facebook_post_community_service_initiative.value2",defaultMessage:"Craft a Facebook post detailing our company’s involvement in a community service initiative. Include images from the event, highlight the impact of the work, and thank participants and organizers."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_post_customer_case_study",defaultMessage:"LinkedIn Post Featuring Customer Case Study"},value:{id:"prompt.social_media.linkedin_post_customer_case_study.value2",defaultMessage:"Develop a LinkedIn post that outlines a customer case study, highlighting the challenges faced, solutions provided, and the results achieved. Encourage readers to download the full case study."}},{category:"social_media",title:{id:"prompt.social_media.twitter_update_company_growth",defaultMessage:"Twitter Update on Company Growth"},value:{id:"prompt.social_media.twitter_update_company_growth.value2",defaultMessage:"Tweet an update on our company's growth and milestones. Include key statistics or infographics and express gratitude towards our employees and customers for their role in our success."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_post_technology_innovation",defaultMessage:"LinkedIn Post on Technology Innovation"},value:{id:"prompt.social_media.linkedin_post_technology_innovation.value2",defaultMessage:"Create a LinkedIn post discussing a recent technology innovation by our team. Explain its significance, potential industry disruption, and invite feedback from the tech community."}},{category:"social_media",title:{id:"prompt.social_media.instagram_live_announcement_product_demo",defaultMessage:"Instagram Live Announcement for Product Demo"},value:{id:"prompt.social_media.instagram_live_announcement_product_demo.value2",defaultMessage:"Announce an upcoming Instagram Live session where we will demonstrate our new [Product/Service]. Include date and time details, and tease some features that will be shown."}},{category:"social_media",title:{id:"prompt.social_media.pinterest_board_inspiration_campaign",defaultMessage:"Pinterest Board for Inspiration Campaign"},value:{id:"prompt.social_media.pinterest_board_inspiration_campaign.value2",defaultMessage:"Create a Pinterest board for our ‘Inspire with [Brand/Product]’ campaign. Curate content that resonates with our brand values and encourages users to add to their own boards."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_article_industry_insights",defaultMessage:"LinkedIn Article Sharing Industry Insights"},value:{id:"prompt.social_media.linkedin_article_industry_insights.value2",defaultMessage:"Write a LinkedIn article providing deep insights about recent trends in [Industry]. Include data analysis, expert opinions, and actionable advice. Encourage readers to share their thoughts and engage with the content."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_post_job_vacancy_announcement",defaultMessage:"LinkedIn Post Announcing Job Vacancy"},value:{id:"prompt.social_media.linkedin_post_job_vacancy_announcement.value2",defaultMessage:"Create a LinkedIn post to announce a job vacancy at our company. Highlight the role's importance, desired qualifications, and how to apply. Make the post engaging to attract top talent."}},{category:"social_media",title:{id:"prompt.social_media.instagram_reels_product_launch",defaultMessage:"Instagram Reels for Product Launch"},value:{id:"prompt.social_media.instagram_reels_product_launch.value2",defaultMessage:"Plan an Instagram Reels series for the launch of our new [Product]. Strategize creative ways to reveal features, display benefits, and include user-generated content. End with a call to action for the launch event."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_post_success_highlight",defaultMessage:"LinkedIn Post Highlighting Company Success"},value:{id:"prompt.social_media.linkedin_post_success_highlight.value2",defaultMessage:"Craft a LinkedIn post celebrating a major company milestone or success. Share insights into the journey, acknowledge the team's efforts, and express gratitude towards customers and partners."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_post_expert_opinion",defaultMessage:"LinkedIn Post Sharing Expert Opinion"},value:{id:"prompt.social_media.linkedin_post_expert_opinion.value2",defaultMessage:"Develop a LinkedIn post where our in-house expert shares their opinion on [Topic]. Use compelling data and insights to assert authority and initiate industry discussions."}},{category:"social_media",title:{id:"prompt.social_media.facebook_live_qa_announcement",defaultMessage:"Facebook Live Q&A Session Announcement"},value:{id:"prompt.social_media.facebook_live_qa_announcement.value2",defaultMessage:"Create an engaging Facebook post to announce an upcoming live Q&A session with [Expert/Executive]. Highlight the topics to be covered and encourage followers to submit their questions."}},{category:"social_media",title:{id:"prompt.social_media.instagram_poll_customer_feedback",defaultMessage:"Instagram Poll for Customer Feedback"},value:{id:"prompt.social_media.instagram_poll_customer_feedback.value2",defaultMessage:"Design an Instagram poll story asking customers for feedback on [Product Feature]. Use this interactive method to gather insights while increasing engagement."}},{category:"social_media",title:{id:"prompt.social_media.twitter_announcement_new_partnership",defaultMessage:"Twitter Announcement of New Partnership"},value:{id:"prompt.social_media.twitter_announcement_new_partnership.value2",defaultMessage:"Compose an announcement tweet for our new partnership with [Company]. Illustrate the benefits of this collaboration and share the excitement for the opportunities it brings to our customers."}},{category:"social_media",title:{id:"prompt.social_media.tiktok_challenge_brand_campaign",defaultMessage:"TikTok Challenge for Brand Campaign"},value:{id:"prompt.social_media.tiktok_challenge_brand_campaign.value2",defaultMessage:"Initiate a TikTok challenge that aligns with our brand campaign for [Product/Service]. Encourage user participation with a branded hashtag and attractive incentives for the best submissions."}},{category:"social_media",title:{id:"prompt.social_media.pinterest_infographic_how_to_guide",defaultMessage:"Pinterest Infographic for 'How-To' Guide"},value:{id:"prompt.social_media.pinterest_infographic_how_to_guide.value2",defaultMessage:"Develop an informative and visually appealing Pinterest infographic that serves as a 'How-To' guide for [Process/Task]. Make it shareable and easy to understand, driving traffic to our website."}},{category:"social_media",title:{id:"prompt.social_media.facebook_post_optimization",defaultMessage:"Optimize Facebook Post for Engagement"},value:{id:"prompt.social_media.facebook_post_optimization.value",defaultMessage:"Evaluate and suggest improvements for a Facebook post draft to maximize engagement. Provide a rating out of 10, specific recommendations for enhancing engagement, and the best posting time in PST. Focus on creating a natural, conversational tone with minimal edits."}},{category:"social_media",title:{id:"prompt.social_media.instagram_content_enhancement",defaultMessage:"Enhance Instagram Content for Better Engagement"},value:{id:"prompt.social_media.instagram_content_enhancement.value",defaultMessage:"Review an Instagram post or story draft and offer suggestions to achieve a 10/10 engagement score. Include optimal posting times in PST and emphasize improvements that maintain brevity and a natural conversational style, without using emojis."}},{category:"social_media",title:{id:"prompt.social_media.twitter_post_refinement",defaultMessage:"Refine Twitter Post for Peak Engagement"},value:{id:"prompt.social_media.twitter_post_refinement.value",defaultMessage:"Analyze a draft tweet and provide a score out of 10 for engagement potential. Offer concise suggestions to enhance the tweet’s effectiveness, including the optimal time to post in PST, while keeping the tweet’s original intent and style."}},{category:"social_media",title:{id:"prompt.social_media.linkedin_post_enhancement",defaultMessage:"Enhance LinkedIn Post for Greater Engagement"},value:{id:"prompt.social_media.linkedin_post_enhancement.value",defaultMessage:"Assess a LinkedIn post draft, rating its engagement potential out of 10. Provide targeted recommendations to improve its impact, including the best time to post in PST. Focus on maintaining professionalism and relevance to the LinkedIn audience."}},{category:"social_media",title:{id:"prompt.social_media.youtube_video_content_strategy",defaultMessage:"Strategize YouTube Video for Maximum Engagement"},value:{id:"prompt.social_media.youtube_video_content_strategy.value",defaultMessage:"Evaluate a YouTube video concept or script, offering a rating and suggestions to achieve 10/10 engagement. Advise on content structure, pacing, and visual aids to enhance viewer retention and interaction, and suggest the best time to publish the video."}},{category:"social_media",title:{id:"prompt.social_media.tiktok_video_engagement_boost",defaultMessage:"Boost TikTok Video Engagement"},value:{id:"prompt.social_media.tiktok_video_engagement_boost.value",defaultMessage:"Provide a comprehensive review of a TikTok video draft, scoring its potential engagement out of 10. Offer concise, actionable advice on how to increase its appeal to TikTok’s audience, including the best time to post for optimal visibility."}},{category:"branding_design",title:{id:"prompt.branding_design.create_brand_name",defaultMessage:"Create brand name"},value:{id:"prompt.branding_design.create_brand_name.value2",defaultMessage:"Come up with a unique and memorable brand name for our new [Product/Service]. Start by defining the core attributes and value proposition of the [Product/Service]. Consider the target audience and their preferences. Brainstorm creative and meaningful name ideas that convey the essence of the [Product/Service] and align with our brand identity. Ensure the name is easy to pronounce, spell, and remember. Check for domain name availability and legal trademarks to secure the chosen name."}},{category:"branding_design",title:{id:"prompt.branding_design.develop_brand_tone",defaultMessage:"Develop brand tone"},value:{id:"prompt.branding_design.develop_brand_tone.value2",defaultMessage:"Create a unique brand tone that represents the values and personality of [brand name]."}},{category:"branding_design",title:{id:"prompt.branding_design.develop_brand_messaging",defaultMessage:"Develop brand messaging"},value:{id:"prompt.branding_design.develop_brand_messaging.value2",defaultMessage:"Develop brand messaging to promote [Product/Service]. Start by defining the unique selling points and key benefits of the [Product/Service]. Identify the target audience and their pain points or needs that the [Product/Service] addresses. Craft a compelling brand message that resonates with the audience, highlighting how [Product/Service] solves their problems or improves their lives. Ensure consistency in tone, style, and messaging across all marketing channels. Include a clear call to action that encourages the audience to take the desired step, such as purchasing or signing up."}},{category:"branding_design",title:{id:"prompt.branding_design.choose_website_color_palette",defaultMessage:"Choose website color palette"},value:{id:"prompt.branding_design.choose_website_color_palette.value2",defaultMessage:"Choose a color palette for our website [Website Name] that aligns with our brand identity. Begin by defining our brand's core values, personality, and target audience. Consider the emotions and associations we want the colors to evoke. Select a primary color that represents our brand essence and 2-3 complementary colors to create visual harmony. Ensure accessibility and readability. Provide hex codes or color values for the chosen palette and specify where each color should be used on the website to maintain consistency."}},{category:"branding_design",title:{id:"prompt.branding_design.develop_brand_guidelines",defaultMessage:"Develop brand guidelines"},value:{id:"prompt.branding_design.develop_brand_guidelines.value2",defaultMessage:"Craft comprehensive [Brand Guidelines] to ensure consistency across all marketing platforms. Define the visual identity, tone, and messaging that represent our brand effectively. Begin with an overview of our brand's mission, values, and personality. Specify the logo usage guidelines, including size, placement, and color variations. Outline typography choices and color palettes. Detail the tone of voice, messaging style, and key brand messages. Provide examples and usage instructions for various marketing materials. Include guidelines for photography and imagery. Ensure the guidelines are user-friendly and accessible to all team members and partners."}},{category:"branding_design",title:{id:"prompt.branding_design.create_brand_positioning_statement",defaultMessage:"Create brand positioning statement"},value:{id:"prompt.branding_design.create_brand_positioning_statement.value2",defaultMessage:"Create a powerful brand positioning statement that effectively communicates the unique value of our brand [Brand Name]. Begin by defining the target audience and their needs or pain points. Highlight the key benefits and differentiators of our brand. Craft a concise and memorable statement that positions our brand as the solution to the audience's challenges. Ensure the statement is emotionally compelling and resonates with our brand identity. Keep it clear and easy to remember, making it a central message in our marketing efforts."}},{category:"branding_design",title:{id:"prompt.branding_design.create_brand_style_guide",defaultMessage:"Create Brand Style Guide"},value:{id:"prompt.branding_design.create_brand_style_guide.value2",defaultMessage:"Provide a step-by-step guide to creating a brand style guide for [Brand]. Begin with an overview of the purpose and importance of a brand style guide. Step 1: Define Brand Identity - Describe the brand's mission, values, and personality. Step 2: Visual Elements - Specify logo usage, color palette, typography, and design elements. Step 3: Messaging - Define tone of voice, key messages, and messaging style. Step 4: Consistency - Ensure visual and messaging consistency across all materials. Step 5: Usage Guidelines - Provide instructions for logo placement, color usage, and typography. Step 6: Accessibility - Address accessibility considerations. Step 7: Distribution - Share the style guide with relevant stakeholders."}},{category:"branding_design",title:{id:"prompt.branding_design.develop_brand_persona",defaultMessage:"Develop brand persona"},value:{id:"prompt.branding_design.develop_brand_persona.value2",defaultMessage:"Develop a brand persona for our company [Company Name] that effectively communicates our brand identity and values. Start by defining the core attributes, mission, and personality of our brand. Consider how our brand would be perceived if it were a person. Describe the brand persona's characteristics, such as age, gender, behavior, and values. Explain how this persona aligns with our target audience and reflects our brand's essence. Provide guidelines for maintaining consistency in all brand communications and interactions."}},{category:"branding_design",title:{id:"prompt.branding_design.create_brand_awareness_campaigns",defaultMessage:"Create brand awareness campaigns"},value:{id:"prompt.branding_design.create_brand_awareness_campaigns.value2",defaultMessage:"Design a brand awareness campaign for [Product/Service] to enhance our brand recognition. Begin by defining campaign objectives and target audience. Craft a creative concept that effectively communicates the essence of [Product/Service] and our brand identity. Develop a multi-channel strategy that includes social media, content marketing, email marketing, and advertising. Specify key messages, visuals, and storytelling elements for the campaign. Include a timeline and budget allocation. Outline metrics for measuring the campaign's success in boosting brand awareness."}},{category:"branding_design",title:{id:"prompt.branding_design.design_logo",defaultMessage:"Design logo"},value:{id:"prompt.branding_design.design_logo.value2",defaultMessage:"Design a unique and memorable logo to represent our brand [Brand Name]. Start by defining the core values and personality traits that our brand embodies. Consider the target audience and their preferences. Create a visual concept that encapsulates the essence of our brand and is instantly recognizable. Incorporate meaningful symbols, typography, and color choices that align with our brand identity. Ensure the logo works well in various sizes and formats, from digital to print. Provide multiple design options for consideration."}},{category:"branding_design",title:{id:"prompt.branding_design.design_package",defaultMessage:"Design package"},value:{id:"prompt.branding_design.design_package.value2",defaultMessage:"Design an alluring and brand-compliant packaging for our product [Product Name]. Begin by defining the key elements of our brand identity that should be reflected in the packaging design. Consider the target audience and their preferences. Create a visually captivating packaging concept that effectively communicates the essence of the product and our brand. Specify the use of brand colors, logo placement, and typography. Ensure that the packaging is not only aesthetically pleasing but also functional and environmentally friendly. Provide design mockups for review and iteration."}},{category:"branding_design",title:{id:"prompt.branding_design.develop_visual_brand_identity",defaultMessage:"Develop visual brand identity"},value:{id:"prompt.branding_design.develop_visual_brand_identity.value2",defaultMessage:"Develop a cohesive and strong [Visual Brand Identity] across all platforms. Create a distinct visual language that resonates with our target audience and communicates our brand values effectively. Start by defining our brand's core attributes, mission, and personality. Specify the color palette, typography choices, and design elements that represent our brand identity. Provide guidelines for logo usage, imagery, and visual consistency. Ensure that the visual brand identity is adaptable to various marketing materials and platforms while maintaining a unified and recognizable look and feel."}},{category:"branding_design",title:{id:"prompt.branding_design.create_brochure_design",defaultMessage:"Create brochure design"},value:{id:"prompt.branding_design.create_brochure_design.value2",defaultMessage:"Create a professional and engaging brochure design for our company [Company Name]. Start by defining the key messages and objectives of the brochure. Consider the target audience and their preferences. Craft a visually appealing design that effectively communicates our company's services, values, and achievements. Specify the layout, color scheme, typography, and imagery that align with our brand identity. Ensure that the brochure is informative, easy to read, and visually engaging. Provide design mockups for review and iteration."}},{category:"branding_design",title:{id:"prompt.branding_design.design_promotional_material",defaultMessage:"Design promotional material"},value:{id:"prompt.branding_design.design_promotional_material.value2",defaultMessage:"Design promotional material for our upcoming event [Event Name]. Begin by defining the key details of the event, including date, time, venue, and purpose. Craft visually appealing promotional materials, such as posters, flyers, and social media graphics, that effectively communicate event information and generate excitement. Specify design elements, color schemes, and typography choices that align with the event's theme or branding. Include a clear call to action and registration information. Provide design mockups for review and iteration."}},{category:"branding_design",title:{id:"prompt.branding_design.design_marketing_collateral",defaultMessage:"Design marketing collateral"},value:{id:"prompt.branding_design.design_marketing_collateral.value2",defaultMessage:"Design marketing collateral, including brochures, flyers, and posters for our brand [Brand Name]. Start by defining the key messages and objectives of the marketing materials. Consider the target audience and their preferences. Craft visually appealing designs that effectively communicate our brand's products, services, and values. Specify design elements, color schemes, typography, and imagery that align with our brand identity. Ensure that the marketing collateral is informative, eye-catching, and consistent in style. Provide design mockups for review and iteration."}},{category:"branding_design",title:{id:"prompt.branding_design.design_website_landing_page",defaultMessage:"Design website landing page"},value:{id:"prompt.branding_design.design_website_landing_page.value2",defaultMessage:"Design a captivating landing page for our website [Website Name] to improve user engagement. Start by defining the page's primary goal, whether it's lead generation, product promotion, or event registration. Craft a visually appealing and user-friendly layout that effectively communicates the value proposition and encourages action. Specify design elements, color schemes, and imagery that align with our brand identity and messaging. Include a clear call to action and forms for lead capture if applicable. Ensure the landing page is responsive and optimized for conversion. Provide design mockups for review and iteration."}},{category:"branding_design",title:{id:"prompt.branding_design.design_website_footer",defaultMessage:"Design website footer"},value:{id:"prompt.branding_design.design_website_footer.value2",defaultMessage:"Design a website footer for [Website Name] that includes important links and information. Start with an overview of the websites purpose and target audience. Create a visually appealing footer that incorporates key elements such as contact information, social media links, navigation links, and copyright notices. Ensure that the footer is consistent with the overall design and branding of the website. Specify the layout, colors, typography, and any additional elements that should be included in the footer."}},{category:"branding_design",title:{id:"prompt.branding_design.design_reviews_best_practices",defaultMessage:"Design Reviews Best Practices"},value:{id:"prompt.branding_design.design_reviews_best_practices.value2",defaultMessage:"Share best practices for design reviews for [Brand or Project] for continuous improvement. Begin with the purpose and objectives of design reviews. Step 1: Preparing for Review - Define review goals, assemble the review team, and gather necessary materials. Step 2: Conducting the Review - Evaluate design elements, usability, and alignment with objectives. Step 3: Feedback and Discussion - Encourage open and constructive feedback, fostering collaboration. Step 4: Iteration - Use feedback to refine and improve designs. Step 5: Documentation - Document review findings and action items. Step 6: Post-Review Follow-Up - Implement changes and monitor progress. Step 7: Continuous Learning - Promote a culture of learning and improvement through reviews."}},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.develop_user_personas",defaultMessage:"Develop user personas"}),value:(0,te.Em)({id:"prompt.ux_ui.develop_user_personas.value2",defaultMessage:"Develop detailed user personas for our platform [Platform Name] to better understand our target audience and improve the design. Start by defining the platform's objectives and key features. Create fictional user profiles that represent different segments of our audience, considering factors like demographics, goals, pain points, and behavior patterns. Include persona names, photos, and detailed descriptions of their preferences and challenges. Specify how each persona interacts with the platform and their specific needs. Use these personas to inform design decisions and user experience enhancements."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.create_website_style_guide",defaultMessage:"Create website style guide"}),value:(0,te.Em)({id:"prompt.ux_ui.create_website_style_guide.value2",defaultMessage:"Create a comprehensive style guide for [Website Name] to maintain consistency in design. Start by defining the core design elements, including typography, color palette, and visual elements, that represent our websites identity. Specify guidelines for layout, spacing, and alignment to ensure a uniform look and feel across all pages. Address responsive design principles for different devices. Provide examples and usage instructions for different design components, such as buttons, forms, and navigation menus. Include accessibility guidelines and ensure the style guide is user-friendly for all team members."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.improve_website_usability",defaultMessage:"Improve website usability"}),value:(0,te.Em)({id:"prompt.ux_ui.improve_website_usability.value2",defaultMessage:"Improve website usability for [Website Name] to increase user satisfaction and reduce bounce rate. Begin by conducting a thorough usability assessment of the website, identifying pain points and areas for improvement. Create a plan to enhance navigation, layout, and content organization. Specify changes to improve mobile responsiveness and load times. Consider user feedback and implement user-friendly features. Prioritize accessibility and ensure compliance with web standards. Provide a timeline for implementing these improvements and a strategy for ongoing usability testing."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.conducting_user_research",defaultMessage:"Conducting user research"}),value:(0,te.Em)({id:"prompt.ux_ui.conducting_user_research.value2",defaultMessage:"Conduct user research to understand how users interact with our platform [Platform Name] and identify areas for improvement. Begin by defining the research objectives and the specific aspects of the platform to be evaluated. Develop a research plan that includes user surveys, interviews, and usability testing. Recruit a diverse group of users representative of our target audience. Collect data on user behavior, pain points, and preferences. Analyze the findings to gain insights into user needs and expectations. Provide recommendations for enhancing the platform based on user feedback and usability testing results."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.develop_information_architecture",defaultMessage:"Develop information architecture"}),value:(0,te.Em)({id:"prompt.ux_ui.develop_information_architecture.value2",defaultMessage:"Develop a clear and effective information architecture for our platform [Platform Name] to improve navigation and usability. Start by conducting a thorough analysis of the platform's content and user needs. Define the primary categories and subcategories of information that should be organized. Create a hierarchical structure that logically arranges content for easy access. Specify the labeling and terminology that will be used for menus and navigation links. Consider user testing and feedback to refine the information architecture. Ensure that the new structure enhances user experience and simplifies content discovery."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.create_landing_page_design",defaultMessage:"Create landing page design"}),value:(0,te.Em)({id:"prompt.ux_ui.create_landing_page_design.value2",defaultMessage:"Create attractive and user-friendly [Landing Page Designs] for our marketing campaigns. Start by defining the objectives and target audience of each landing page. Craft visually appealing and responsive designs that engage visitors and guide them toward desired actions, such as signing up, making a purchase, or filling out a form. Specify the layout, color scheme, typography, and imagery that align with the campaign's messaging and branding. Ensure that the landing pages are optimized for conversion and provide a seamless user experience. Provide design mockups for review and iteration."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.design_website_navigation",defaultMessage:"Design website navigation"}),value:(0,te.Em)({id:"prompt.ux_ui.design_website_navigation.value2",defaultMessage:"Design a clear and user-friendly navigation for our website [Website Name] to enhance the user experience. Begin by assessing the websites content and structure. Create an intuitive navigation menu that organizes content logically and prioritizes key pages or sections. Specify menu labels, drop-down menus if applicable, and any additional navigation elements such as search bars or breadcrumbs. Ensure that the navigation is responsive and accessible across devices. Provide a wireframe or visual representation of the proposed navigation for review and implementation."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.create_user_flows",defaultMessage:"Create user flows"}),value:(0,te.Em)({id:"prompt.ux_ui.create_user_flows.value2",defaultMessage:"Create intuitive user flows for our platform [Platform Name] to enhance user experience. Begin by defining the key user tasks and goals. Develop user flows that guide users seamlessly through the platform's features and functionalities. Specify the logical sequence of steps, interactions, and decision points. Consider user personas and their needs at each stage of the flow. Ensure that the user flows prioritize clarity, efficiency, and ease of navigation. Provide wireframes or diagrams to visualize the proposed user flows for review and refinement."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.develop_website_user_experience",defaultMessage:"Develop website user experience"}),value:(0,te.Em)({id:"prompt.ux_ui.develop_website_user_experience.value2",defaultMessage:"Develop a user-friendly experience for our website [Website Name] to increase user satisfaction. Begin by conducting a website usability audit to identify pain points and areas for improvement. Consider the target audience and their needs. Create a user-centered design that prioritizes intuitive navigation, clear information architecture, and responsive design for mobile users. Specify improvements to page layout, content organization, and user interface elements. Include strategies for optimizing page load times and ensuring accessibility. Provide recommendations for enhancing the overall user experience."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.create_mobile_app_design",defaultMessage:"Create mobile app design"}),value:(0,te.Em)({id:"prompt.ux_ui.create_mobile_app_design.value2",defaultMessage:"Design a user-friendly and visually stunning mobile app for our platform [Platform Name]. Start by defining the core features and functionality of the app. Consider the target user demographics and their preferences. Craft an intuitive user interface (UI) and user experience (UX) design that ensures ease of navigation and engagement. Specify the color scheme, typography, and visual elements that align with our platform's branding. Include interactive and user-centric design elements. Provide design mockups for review and iteration."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.design_responsive_web_pages",defaultMessage:"Design responsive web pages"}),value:(0,te.Em)({id:"prompt.ux_ui.design_responsive_web_pages.value2",defaultMessage:"Design responsive web pages for our platform [Platform Name] to ensure a good user experience on multiple devices. Start by defining the key features and functionalities of the platform. Create wireframes and mockups for various pages, including the homepage, user dashboard, and product listings. Specify design elements, layout, and navigation that adapt seamlessly to different screen sizes and resolutions. Ensure consistency in branding and user interface elements. Provide design prototypes for review and testing across various devices."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.improve_website_accessibility",defaultMessage:"Improve website accessibility"}),value:(0,te.Em)({id:"prompt.ux_ui.improve_website_accessibility.value2",defaultMessage:"Identify and implement ways to enhance the accessibility of our platform [Platform Name] to make it more user-friendly for people with disabilities. Begin by conducting an accessibility audit to identify areas of improvement. Consider the needs of users with various disabilities, including visual, auditory, and motor impairments. Develop a plan to address accessibility issues, including improving website navigation, providing alternative text for images, and ensuring compatibility with assistive technologies. Specify a timeline and responsible team members for implementing accessibility enhancements. Emphasize the importance of inclusive design and compliance with accessibility standards."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.create_design_wireframes",defaultMessage:"Create design wireframes"}),value:(0,te.Em)({id:"prompt.ux_ui.create_design_wireframes.value2",defaultMessage:"Create design wireframes for our platform [Platform Name] to translate user needs and business goals into effective design solutions. Begin by defining the key features and functionalities of the platform. Consider user personas and their requirements. Develop wireframes that outline the layout, navigation, and user interface elements. Specify the placement of key components, such as buttons, forms, and content sections. Ensure that the wireframes align with the platform's objectives and provide a clear visual representation of the user experience. Provide wireframe drafts for review and refinement."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.ux_research_outreach",defaultMessage:"UX Research Outreach"}),value:(0,te.Em)({id:"prompt.ux_ui.ux_research_outreach.value2",defaultMessage:"Write an email to [Name], a valued user, inviting them to a UX research interview, where their valuable feedback will help shape our product. Begin by expressing appreciation for their continued support and use of our product. Explain the purpose and importance of the UX research interview in improving the user experience. Provide details about the interview, including date, time, format, and expected duration. Highlight any incentives or rewards for participation. Include a clear call to action for them to confirm their availability and participation. Express eagerness to hear their insights and feedback."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.optimize_app_performance",defaultMessage:"Optimize App Performance"}),value:(0,te.Em)({id:"prompt.ux_ui.optimize_app_performance.value2",defaultMessage:"Analyze and improve the performance of our mobile application [App Name] for a smoother user experience. Start by identifying performance bottlenecks through diagnostic tools. Evaluate the app's responsiveness, speed, and resource consumption. Implement strategies for optimizing code, reducing load times, and enhancing the responsiveness of UI elements. Consider using lazy loading, efficient data retrieval, and other techniques to improve app efficiency. Test performance improvements across different devices and platforms. Provide recommendations for ongoing performance monitoring."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.create_design_system",defaultMessage:"Create Design System"}),value:(0,te.Em)({id:"prompt.ux_ui.create_design_system.value2",defaultMessage:"Establish a design system for our platform [Platform Name] to streamline design and development workflows. Document the design principles, color palette, typography, iconography, and UI components. Define usage rules and provide examples for applying the design system across different contexts. Ensure that the system promotes consistency and efficiency while offering enough flexibility for creativity. Facilitate collaboration by making the design system accessible to all team members. Plan for regular updates to the design system based on user feedback and design trends."})},{category:"ux_ui",title:(0,te.Em)({id:"prompt.ux_ui.visual_branding_strategy",defaultMessage:"Visual Branding Strategy"}),value:(0,te.Em)({id:"prompt.ux_ui.visual_branding_strategy.value2",defaultMessage:"Develop a visual branding strategy for our platform [Platform Name] to establish a strong brand identity and emotional connection with users. Define the brand's values, personality, and unique selling proposition. Translate these into visual language with a distinctive color scheme, typography, imagery, and graphical elements. Ensure visual branding is consistently applied across all user touchpoints, including the website, mobile app, marketing materials, and social media. Create branded templates and guidelines for team members to use in their work. Assess the effectiveness of the visual branding strategy in communicating the brand narrative and resonating with the desired audience."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.refine_product_descriptions_for_seo",defaultMessage:"Refine product descriptions for SEO"}),value:(0,te.Em)({id:"prompt.ecommerce.refine_product_descriptions_for_seo.value2",defaultMessage:"Rewrite and enhance product descriptions with SEO best practices in mind to improve search engine visibility and rankings for our e-commerce platform [platform name]. Focus on incorporating targeted keywords, engaging language, and clear, concise information."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.create_engaging_product_tales",defaultMessage:"Create engaging product tales"}),value:(0,te.Em)({id:"prompt.ecommerce.create_engaging_product_tales.value2",defaultMessage:"Craft captivating product tales that not only detail the features and benefits but also tell a story that resonates with our target audience for our e-commerce platform [platform name]. Aim to evoke emotions and connect on a personal level to increase product attractiveness."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.optimize_product_headlines",defaultMessage:"Optimize product headlines"}),value:(0,te.Em)({id:"prompt.ecommerce.optimize_product_headlines.value2",defaultMessage:"Develop compelling product headlines that instantly grab attention and convey the core value proposition. Utilize A/B testing to determine which headlines yield better engagement and conversion rates for our e-commerce platform [platform name]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.conduct_competitive_analysis_descriptions",defaultMessage:"Conduct competitive analysis for product descriptions"}),value:(0,te.Em)({id:"prompt.ecommerce.conduct_competitive_analysis_descriptions.value2",defaultMessage:"Execute a competitive analysis to understand how our product descriptions stack up against competitors. Identify gaps and opportunities for improvement to create more compelling and persuasive descriptions that can lead to increased market share for our e-commerce platform [platform name]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_return_refund_policy",defaultMessage:"Develop return and refund policy"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_return_refund_policy.value2",defaultMessage:"Develop a clear return and refund policy for our e-commerce website [URL] to boost customer trust and satisfaction."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_shipping_tax_rules",defaultMessage:"Develop shipping and tax rules"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_shipping_tax_rules.value2",defaultMessage:"Define shipping and tax rules for our e-commerce website [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_shopping_cart_abandonment_strategy",defaultMessage:"Develop shopping cart abandonment strategy"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_shopping_cart_abandonment_strategy.value2",defaultMessage:"Create a strategy to mitigate shopping cart abandonment on our e-commerce website [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_customer_service_plan",defaultMessage:"Develop e-commerce customer service plan"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_customer_service_plan.value2",defaultMessage:"Develop a comprehensive customer service plan to improve customer satisfaction on our e-commerce website [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_product_recommendation_system",defaultMessage:"Develop product recommendation system"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_product_recommendation_system.value2",defaultMessage:"Create a product recommendation system to improve sales on our e-commerce website [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.create_cross_selling_upselling_strategy",defaultMessage:"Create cross-selling and upselling strategy"}),value:(0,te.Em)({id:"prompt.ecommerce.create_cross_selling_upselling_strategy.value2",defaultMessage:"Develop a strategy for cross-selling and upselling to increase the average order value on our e-commerce website [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.create_order_management_system",defaultMessage:"Create order management system"}),value:(0,te.Em)({id:"prompt.ecommerce.create_order_management_system.value2",defaultMessage:"Design an order management system for our e-commerce platform [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.create_email_marketing_strategy",defaultMessage:"Create e-commerce email marketing strategy"}),value:(0,te.Em)({id:"prompt.ecommerce.create_email_marketing_strategy.value2",defaultMessage:"Create an email marketing strategy for our e-commerce website [URL] to engage customers and increase sales."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_product_catalog",defaultMessage:"Develop product catalog"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_product_catalog.value2",defaultMessage:"Compile a detailed product catalog for our e-commerce website [URL]."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.create_website_mobile_optimization",defaultMessage:"Create website mobile optimization"}),value:(0,te.Em)({id:"prompt.ecommerce.create_website_mobile_optimization.value2",defaultMessage:"Optimize our e-commerce website [URL] for mobile use."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.develop_ecommerce_seo_strategy",defaultMessage:"Develop e-commerce SEO strategy"}),value:(0,te.Em)({id:"prompt.ecommerce.develop_ecommerce_seo_strategy.value2",defaultMessage:"Develop an SEO strategy specific to our e-commerce website [URL] to increase visibility and boost sales."})},{category:"ecommerce",title:(0,te.Em)({id:"prompt.ecommerce.implement_customer_review_system",defaultMessage:"Implement customer review system"}),value:(0,te.Em)({id:"prompt.ecommerce.implement_customer_review_system.value2",defaultMessage:"Implement a customer review system on our e-commerce website [URL] to boost credibility and sales."})},{category:"entrepreneurship",title:{id:"prompt.create_solid_business_model",defaultMessage:"Create a solid business model"},value:{id:"prompt.create_solid_business_model.value2",defaultMessage:"Guide me in creating a comprehensive business model for my [Product/Service] idea, detailing the key components such as revenue streams, customer segments, and distribution channels. Begin by defining the unique value proposition of [Product/Service]. Identify target customer segments and their needs. Specify the pricing strategy and revenue streams, including any subscription models or additional services. Outline the distribution channels and marketing strategies to reach customers effectively. Include a cost structure analysis to determine profitability. Ensure alignment with long-term goals and scalability."}},{category:"entrepreneurship",title:{id:"prompt.learn_from_industry_leaders_and_experts",defaultMessage:"Learn from industry leaders and experts"},value:{id:"prompt.learn_from_industry_leaders_and_experts.value2",defaultMessage:"Identify 5 influential leaders or experts in [Industry/Field] and suggest resources, such as books, articles, or podcasts, where I can learn from their experiences and insights. Provide a brief introduction to each leader, highlighting their achievements and contributions to the field. Offer recommendations for specific resources, including titles and authors of books, links to articles, or names of podcasts, where I can gain valuable knowledge and insights from these experts."}},{category:"entrepreneurship",title:{id:"prompt.challenge_assumptions",defaultMessage:"Challenge assumptions to break conventional thinking"},value:{id:"prompt.challenge_assumptions.value2",defaultMessage:"List common assumptions about [Problem or Industry] and suggest ways to challenge or break them to create novel solutions. Begin by identifying prevalent beliefs or assumptions within the context of [Problem or Industry]. Then, propose strategies or approaches to question and challenge these assumptions. Encourage creative thinking and alternative perspectives that can lead to innovative solutions. Provide examples or scenarios to illustrate how breaking these assumptions can open new avenues for problem-solving and improvement."}},{category:"entrepreneurship",title:{id:"prompt.develop_compelling_value_proposition",defaultMessage:"Develop a compelling value proposition"},value:{id:"prompt.develop_compelling_value_proposition.value2",defaultMessage:"Assist me in crafting a compelling value proposition for my [Product/Service] idea, highlighting its unique selling points and benefits to the target audience. Start by defining the core features and benefits of the [Product/Service]. Consider the target audience and their pain points or needs. Craft a concise and persuasive value proposition that communicates how [Product/Service] addresses those pain points and provides unique advantages. Ensure clarity, relevance, and a customer-centric approach in the value proposition. Provide examples and messaging that resonate with the audience."}},{category:"entrepreneurship",title:{id:"prompt.identify_high_impact_skills",defaultMessage:"Identify high-impact skills for your career"},value:{id:"prompt.identify_high_impact_skills.value2",defaultMessage:"Determine the top 5 high-impact skills for a [Job Title/Industry] and provide a focused learning plan to develop them. Begin by conducting a skills assessment for the specific role or industry. Identify the skills that are most critical for success. Craft a learning plan that includes relevant courses, certifications, or training programs for each skill. Specify the timeframes and resources required for skill development. Consider mentorship or on-the-job opportunities for practical experience. Provide guidance on measuring skill proficiency and tracking progress."}},{category:"entrepreneurship",title:{id:"prompt.master_bootstrapping",defaultMessage:"Master bootstrapping"},value:{id:"prompt.master_bootstrapping.value2",defaultMessage:"Share effective bootstrapping strategies to help me efficiently allocate resources and minimize costs while starting and growing my [Product/Service] idea. Provide insights on how to prioritize spending, reduce overhead, and make the most of limited resources. Include tips on cost-effective marketing, lean operations, and creative financing options. Share success stories and real-world examples of bootstrapping entrepreneurs who have achieved growth while staying financially disciplined."}},{category:"entrepreneurship",title:{id:"prompt.identify_your_niche_and_target_market",defaultMessage:"Identify your niche and target market"},value:{id:"prompt.identify_your_niche_and_target_market.value2",defaultMessage:"Help me identify a profitable niche and target market for my [Product/Service] idea and analyze the existing competition. Begin by defining the core features and benefits of the [Product/Service]. Conduct market research to identify potential niches or segments with unmet needs. Specify criteria for evaluating niche profitability, such as market size, growth potential, and competition level. Provide guidance on conducting competitive analysis to assess existing players, their strengths, and weaknesses. Recommend strategies for positioning the [Product/Service] effectively within the chosen niche and targeting the ideal customer persona."}},{category:"entrepreneurship",title:{id:"prompt.decline_proposal",defaultMessage:"Decline Proposal"},value:{id:"prompt.decline_proposal.value2",defaultMessage:"Create a polite email to [First Name], whom I last interacted with on [Last Interaction], declining their proposal. Begin by expressing appreciation for their proposal and the opportunity to consider it. Provide a clear and respectful reason for declining, such as current priorities or alignment with our goals. Express interest in potential future collaborations or discussions. Maintain a courteous and professional tone throughout the email. Thank them for their understanding and the effort put into the proposal."}},{category:"entrepreneurship",title:{id:"prompt.co_investors_catch_up",defaultMessage:"Co-investors Catch-up"},value:{id:"prompt.co_investors_catch_up.value2",defaultMessage:"Write a short, friendly email to an investor named [Name] to check in on how they are and suggest a coffee catch-up. Begin by expressing genuine interest in their well-being and mentioning a recent event or accomplishment related to their investments. Keep the tone warm and personal. Suggest a casual coffee meeting at a convenient location and time. Offer flexibility in scheduling to accommodate their availability. Conclude the email by expressing excitement about the possibility of catching up and discussing future opportunities."}},{category:"entrepreneurship",title:{id:"prompt.contact_investors",defaultMessage:"Contact Investors"},value:{id:"prompt.contact_investors.value2",defaultMessage:"Write an icebreaker for an introductory email to [Name], who is an investor at [Company Name]. Begin by expressing genuine interest in their work and accomplishments. Mention a recent noteworthy achievement or project associated with their company. Find a common point of connection, such as shared industry interests or mutual contacts. Craft a friendly and engaging icebreaker that encourages a positive response and sets a collaborative tone for the email."}},{category:"entrepreneurship",title:{id:"prompt.manage_partnerships",defaultMessage:"Manage Partnerships"},value:{id:"prompt.manage_partnerships.value2",defaultMessage:"Write an intro email to [First Name] who works at [Company URL], suggesting a partnership. Make it friendly but professional. Begin by introducing yourself and your company briefly. Express genuine interest in their work and company. Highlight potential areas of collaboration and mutual benefit. Keep the tone warm and inviting, and include a clear call to action for further discussion or a meeting. Sign off with a courteous closing and your contact information."}},{category:"entrepreneurship",title:{id:"prompt.interview_applicants",defaultMessage:"Interview Applicants"},value:{id:"prompt.interview_applicants.value2",defaultMessage:"Write an email to [First Name] thanking them for their job application and inviting them to a first interview. Ask for their availability and maintain a friendly and professional tone throughout the email."}},{category:"entrepreneurship",title:{id:"prompt.contact_applicants",defaultMessage:"Contact Applicants"},value:{id:"prompt.contact_applicants.value2",defaultMessage:"Write an email to [First Name] thanking them for their job application, and inform them that we are reviewing it and will get back to them with feedback soon. Make the tone friendly and professional, expressing appreciation for their interest in our company and the position. Mention that their application is under review, and provide an estimated timeline for when they can expect to hear from us. Express openness to any questions or further information they may have."}},{category:"entrepreneurship",title:{id:"prompt.reach_out_on_linkedin",defaultMessage:"Reach Out on LinkedIn"},value:{id:"prompt.reach_out_on_linkedin.value2",defaultMessage:"Create a message to reach out to [LinkedIn URL] on LinkedIn about [Topic]. Craft a personalized and engaging message that introduces yourself and the reason for the connection. Clearly communicate the value or benefit of discussing the [Topic] with the recipient. Use a professional and courteous tone, and offer flexibility in terms of scheduling or communication. End the message with a clear call to action, such as suggesting a meeting or requesting their input on the [Topic]. Ensure that the message is concise and respectful of their time."}},{category:"entrepreneurship",title:{id:"prompt.employee_onboarding",defaultMessage:"Employee Onboarding"},value:{id:"prompt.employee_onboarding.value2",defaultMessage:"Create an agenda for an onboarding session with new employee [First Name], whose job title is [Job Title] at [Company Name]. Begin with a welcome and introduction to the company. Provide an overview of the company's mission, values, and culture. Outline the role-specific training and responsibilities. Include introductions to key team members and departments. Present information on company policies, benefits, and resources. Schedule a tour of the workplace if applicable. Address any questions or concerns. Conclude with next steps and expectations for the employee's first days."}},{category:"entrepreneurship",title:{id:"prompt.recruiting_outreach",defaultMessage:"Recruiting Outreach"},value:{id:"prompt.recruiting_outreach.value2",defaultMessage:"Write a recruitment email to [Name], expressing interest in a first call to discuss [Job Title]. Start by introducing yourself and your company. Highlight the key qualifications and skills that make [Name] an ideal candidate for the role. Express enthusiasm about the potential fit and the value [Name] could bring to the team. Provide options for scheduling the first call and express willingness to accommodate [Name]'s availability. Keep the email concise, friendly, and professional, with a clear call to action to schedule the call."}},{category:"entrepreneurship",title:{id:"prompt.turn_down_applicant",defaultMessage:"Turn Down Applicant"},value:{id:"prompt.turn_down_applicant.value2",defaultMessage:"Write an email to [First Name] thanking them for their job application for the role of [Job Title] and informing them that we will unfortunately not be progressing it. Make the tone polite and encouraging."}},{category:"entrepreneurship",title:{id:"prompt.initial_consultation",defaultMessage:"Initial Consultation"},value:{id:"prompt.initial_consultation.value2",defaultMessage:"Write an email to [First Name] requesting an initial consultation for their services as [Job Title]. Make it friendly but professional, expressing your interest in their expertise and a desire to explore potential collaboration. Highlight the value you believe their services can bring to your project or organization. Suggest a convenient date and time for the consultation, and provide your contact information for scheduling. Express appreciation for their time and consideration."}},{category:"entrepreneurship",title:{id:"prompt.manage_freelances",defaultMessage:"Manage Freelances"},value:{id:"prompt.manage_freelances.value2",defaultMessage:"Write an email to [Name] requesting an invoice for the last project they completed for us. Begin with a polite greeting and mention the project's name and completion date for reference. Request the invoice, specifying any relevant details such as payment terms or billing address. Express appreciation for their work and mention any additional information or documentation required for processing the invoice. Include contact information for follow-up and a closing thank-you message."}},{category:"entrepreneurship",title:{id:"prompt.outsourcing_email",defaultMessage:"Outsourcing Email"},value:{id:"prompt.outsourcing_email.value2",defaultMessage:"Write an email to [Name], who works as [Job Title], asking if they are interested in working on a project with the title, and to provide their rates. Begin with a polite greeting and introduction. Explain the project briefly, highlighting its objectives and scope. Express your interest in their expertise and inquire about their availability and interest in collaborating. Request their rates or fee structure for the project. Provide contact details for further communication and thank them for their consideration."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.evaluate_business_opportunities",defaultMessage:"Evaluate Business Opportunities"},value:{id:"prompt.entrepreneurship.evaluate_business_opportunities.value2",defaultMessage:"Assist me in evaluating the viability and potential of new business opportunities related to [industry/sector]. Begin by outlining the criteria to assess market demand, customer need, and profitability. Recommend methods for conducting market research and competitive analysis. Guide me in identifying possible risks and challenges, as well as strategies for risk mitigation. Conclude with a framework for making informed decisions on whether to pursue, adjust, or abandon the business opportunities."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.optimize_operational_efficiency",defaultMessage:"Optimize Operational Efficiency"},value:{id:"prompt.entrepreneurship.optimize_operational_efficiency.value2",defaultMessage:"Provide me with strategies to enhance operational efficiency for my [type of business] business. Focus on core areas such as workflow optimization, cost reduction, and improving productivity. Suggest systems and tools for streamlining processes and automating redundant tasks. Offer advice on performance metrics and how to track the effectiveness of operational changes. Share best practices and case studies of businesses that have successfully improved their operations."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.build_a_brand_identity",defaultMessage:"Build a Brand Identity"},value:{id:"prompt.entrepreneurship.build_a_brand_identity.value2",defaultMessage:"Guide me in developing a strong brand identity for my [Product/Service]. Explain the importance of a cohesive brand experience and how it contributes to customer recognition and loyalty. Walk me through the process of defining brand elements such as logo, color scheme, typography, and messaging. Discuss the role of storytelling in building the brand narrative. Provide tips on how to maintain brand consistency across various marketing channels and customer touchpoints."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.write_a_business_plan",defaultMessage:"Write a Business Plan"},value:{id:"prompt.entrepreneurship.write_a_business_plan.value2",defaultMessage:"Instruct me on how to craft a detailed business plan for my [Product/Service]. Begin with an executive summary that outlines the business vision and objectives. Guide me through the process of market analysis, business structure, product/service offering, marketing and sales strategies, and financial projections. Emphasize the significance of each section in attracting investors and guiding the business's future growth. Offer examples of effective business plan structures and components for clarity and inspiration."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.navigate_funding_options",defaultMessage:"Navigate Funding Options"},value:{id:"prompt.entrepreneurship.navigate_funding_options.value2",defaultMessage:"Provide an overview of various funding options available for startups and small businesses in the [specific industry/sector]. Discuss traditional funding routes such as bank loans, venture capital, and angel investment. Also, explore alternative funding sources like crowdfunding, grants, and bootstrapping. Offer insights into the pros and cons of each option, the application processes, and how to determine the best fit based on my business model and growth plans."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.craft_investor_pitches",defaultMessage:"Craft Investor Pitches"},value:{id:"prompt.entrepreneurship.craft_investor_pitches.value2",defaultMessage:"Assist me in crafting a persuasive investor pitch for my [Product/Service]. Provide a structure for the pitch that includes an engaging opening, a clear explanation of the problem or opportunity, a presentation of my solution, and its market potential. Encourage the inclusion of unique selling points, traction gained, the business model, team expertise, and financial overview. Advice on handling common questions and objections from investors. End with guidance on a strong closing that motivates action."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.explore_export_opportunities",defaultMessage:"Explore Export Opportunities"},value:{id:"prompt.entrepreneurship.explore_export_opportunities.value2",defaultMessage:"Explore potential export opportunities for my [Product/Service] within [target market/region]. Provide a step-by-step guide on assessing international market viability, including economic, cultural, and legal factors to consider. Explain the process of adapting products and marketing efforts to suit foreign markets. Offer advice on logistics, compliance with local regulations, and strategies for finding and working with international partners. Discuss how to leverage governmental resources and export assistance programs."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.establish_online_presence",defaultMessage:"Establish Online Presence"},value:{id:"prompt.entrepreneurship.establish_online_presence.value2",defaultMessage:"Help me establish a robust online presence for my [type of business]. Recommend the most effective digital platforms for my industry and audience, including social media, e-commerce, and professional networking sites. Discuss the development of a user-friendly website with SEO optimization to improve visibility. Share tactics for engaging content creation and harnessing online advertising tools to target potential customers. Advise on reputation management strategies and measuring online performance metrics."}},{category:"entrepreneurship",title:{id:"prompt.entrepreneurship.scale_your_business",defaultMessage:"Scale Your Business"},value:{id:"prompt.entrepreneurship.scale_your_business.value2",defaultMessage:"I'm ready to scale my [type of business]. Provide guidance on how to prepare for and manage the growth phase effectively. Discuss the importance of revisiting and updating the business model to ensure it supports scaling. Address challenges such as maintaining quality, managing increased demand, and keeping organizational culture intact. Suggest ways to expand the team, infrastructure, and operations while safeguarding financial stability. Share success stories and lessons from businesses that have scaled successfully."}},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.develop_mvp",defaultMessage:"Develop a Minimum Viable Product (MVP) for Market Validation"}),value:(0,te.Em)({id:"prompt.develop_mvp.value",defaultMessage:"Guide me in developing a minimum viable product (MVP) for my [Product/Service] to validate its market potential. Outline steps for creating an MVP that captures the essence of the product while minimizing development costs. Discuss strategies for testing the MVP with target customers, gathering feedback, and iterating based on responses. Emphasize the importance of MVP in refining product-market fit before full-scale development."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.implement_agile",defaultMessage:"Implement Agile Methodologies for Project Management"}),value:(0,te.Em)({id:"prompt.implement_agile.value",defaultMessage:"Provide a plan to implement agile methodologies in project management and product development for my startup. Discuss the principles of agile methodology, its benefits such as increased efficiency and adaptability, and how it can be applied in various aspects of the startup. Offer a step-by-step guide to transition to an agile framework, including team training, tool selection, and tracking progress."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.effective_pricing_strategies",defaultMessage:"Develop Effective Pricing Strategies"}),value:(0,te.Em)({id:"prompt.effective_pricing_strategies.value",defaultMessage:"Assist in developing pricing strategies for [Product/Service] that balance profitability with market demand. Offer insights into various pricing models, such as cost-plus, value-based, and dynamic pricing. Discuss how to analyze market trends, competitor pricing, and customer value perception to set an optimal price point. Include tactics for testing and adjusting prices based on market response."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.customer_interviews_feedback",defaultMessage:"Conduct Customer Interviews and Gather Feedback"}),value:(0,te.Em)({id:"prompt.customer_interviews_feedback.value",defaultMessage:"Guide me in conducting customer interviews to gather feedback for [Product/Service]. Provide a framework for creating interview questions, selecting interviewees, and conducting interviews effectively. Emphasize how to analyze and use customer feedback for continuous improvement of the product or service."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.secure_funding_resources",defaultMessage:"Secure Funding and Resources"}),value:(0,te.Em)({id:"prompt.secure_funding_resources.value",defaultMessage:"Develop strategies for obtaining necessary funding and resources for my [type of business]. Discuss various funding sources like venture capital, angel investors, crowdfunding, and grants. Provide advice on preparing effective pitches, financial projections, and business plans to attract potential investors. Also, cover alternative resources such as strategic partnerships and government programs."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.build_manage_startup_team",defaultMessage:"Build and Manage a Startup Team"}),value:(0,te.Em)({id:"prompt.build_manage_startup_team.value",defaultMessage:"Provide insights on assembling and managing a balanced and effective team for a startup environment. Discuss the roles essential for startup success, techniques for recruiting talented individuals, and strategies for nurturing a collaborative and innovative team culture. Address leadership skills needed to guide and motivate the team towards shared goals and objectives."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.setting_vision_goals",defaultMessage:"Set Vision and Goals for Your Business"}),value:(0,te.Em)({id:"prompt.setting_vision_goals.value",defaultMessage:"Assist in setting a clear vision and concrete goals for [Business/Startup]. Discuss the importance of having a well-defined vision to guide decision-making and inspire team members. Offer frameworks for goal-setting, including SMART goals, and advice on aligning goals with the overall vision. Emphasize on communicating the vision and goals effectively to stakeholders and employees."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.inspire_motivate_teams",defaultMessage:"Inspire and Motivate Entrepreneurial Teams"}),value:(0,te.Em)({id:"prompt.inspire_motivate_teams.value",defaultMessage:"Provide strategies for inspiring and motivating team members in an entrepreneurial setting. Focus on leadership approaches that foster a positive, innovative, and productive work environment. Discuss the role of effective communication, recognition, and empowerment in boosting team morale and productivity."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.strategic_decisions",defaultMessage:"Make Strategic Decisions"}),value:(0,te.Em)({id:"prompt.strategic_decisions.value",defaultMessage:"Offer guidance on making strategic decisions for [Business/Startup]. Discuss the importance of strategic planning, understanding market dynamics, and evaluating risks. Provide frameworks for decision-making processes, including data-driven analysis and considering long-term impacts. Emphasize the need for adaptability and learning from outcomes."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.foster_collaboration_teamwork",defaultMessage:"Foster Collaboration and Teamwork"}),value:(0,te.Em)({id:"prompt.foster_collaboration_teamwork.value",defaultMessage:"Develop strategies to enhance collaboration and teamwork within a startup environment. Discuss methods for creating a culture of open communication, mutual respect, and shared responsibility. Offer tips on team-building activities, conflict resolution, and leveraging diverse skills and perspectives for innovation and problem-solving."})},{category:"entrepreneurship",title:(0,te.Em)({id:"prompt.develop_leadership_skills",defaultMessage:"Develop Leadership Skills and Competencies"}),value:(0,te.Em)({id:"prompt.develop_leadership_skills.value",defaultMessage:"Guide on developing essential leadership skills for entrepreneurship. Focus on skills such as strategic thinking, emotional intelligence, decision-making, and effective communication. Provide resources for self-improvement, such as workshops, mentorship, and leadership courses. Discuss how to apply these skills in managing a startup and leading a team towards success."})},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.collaboration_outreach_email",defaultMessage:"Influencer Collaboration Outreach Email"},value:{id:"prompt.influencer_marketing.collaboration_outreach_email.value2",defaultMessage:"Compose an outreach email to [Influencer Name], introducing yourself and [Your Company Name]. Highlight recent work of theirs that aligns with your brand and propose collaboration. Elaborate on the potential partnership and how it could benefit both parties, align with their audience, and resonate with shared brand values. Encourage a discussion on campaign ideas and close with your contact details for further communication."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_planning_checklist",defaultMessage:"Influencer Campaign Planning Checklist"},value:{id:"prompt.influencer_marketing.campaign_planning_checklist.value2",defaultMessage:"Develop a checklist for planning an influencer campaign, beginning with goal identification and target audience analysis. Include budget setting, timeline planning, and tasks such as influencer research based on [Product Info] and outreach, creation of content guidelines, and setting up legal agreements. Ensure inclusion of tracking methods and post-campaign analysis for measuring success against [Company Name]'s objectives."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_management_strategy",defaultMessage:"Influencer Campaign Management Strategy"},value:{id:"prompt.influencer_marketing.campaign_management_strategy.value2",defaultMessage:"Outline a strategy for managing an influencer campaign, detailing steps from the initial groundwork like goal setting and influencer selection to final execution. Discuss the importance of maintaining open communication with [Influencer Name(s)], ensuring all content aligns with [Your Brand's] identity, and how to manage compensation agreements. Address the methodology of campaign tracking and the significance of agility to respond to any unforeseen events."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.follow_up_strategy_post_campaign",defaultMessage:"Post-Campaign Influencer Follow-Up Strategy"},value:{id:"prompt.influencer_marketing.follow_up_strategy_post_campaign.value2",defaultMessage:"Compose a follow-up strategy for [Your Company Name] to engage with [Influencer Name] after the campaign, emphasizing appreciation for their work and discussing performance metrics. Plan how to maintain a relationship with the influencer, keeping them updated about future campaigns, and continue to recognize their contributions on social platforms, fostering a long-term partnership."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.content_approval_workflow",defaultMessage:"Influencer Content Approval Workflow"},value:{id:"prompt.influencer_marketing.content_approval_workflow.value2",defaultMessage:"Design a workflow specific to [Your Company Name] for approving influencer-created content, ensuring alignment with [Product/Service] branding. Describe each stage, from the initial creative briefing to content drafts, incorporating feedback, and final approval. Suggest practical tools and protocols for timely approvals and resolutions of potential issues."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.legal_guidelines_for_partnerships",defaultMessage:"Legal Guidelines for Influencer Partnerships"},value:{id:"prompt.influencer_marketing.legal_guidelines_for_partnerships.value2",defaultMessage:"Provide a comprehensive guide covering legal essentials for influencer partnerships. Detail contract components vital for [Your Product/Service] campaigns, compliance with advertising laws, disclosure rules, and intellectual property considerations. Offer advice on drafting contracts that protect both [Your Company Name] and the influencer's interests."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.crisis_management_in_campaigns",defaultMessage:"Crisis Management Plan for Influencer Campaigns"},value:{id:"prompt.influencer_marketing.crisis_management_in_campaigns.value2",defaultMessage:"Sketch out a crisis management plan for [Company Name's] influencer campaigns, addressing potential adverse scenarios. Explain immediate response tactics, maintaining brand integrity while navigating public opinion, and how to recalibrate the campaign in light of the crisis. Emphasize preparedness for real-time monitoring and rapid communication channels with [Influencer Name]."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.performance_metrics_tracking",defaultMessage:"Performance Metrics and Tracking for Influencer Campaigns"},value:{id:"prompt.influencer_marketing.performance_metrics_tracking.value2",defaultMessage:"Outline essential performance metrics for [Company Name] to track during an influencer campaign, such as engagement, reach, and sentiment toward [Product/Service]. Discuss tools for efficient tracking, such as specific software or platforms best suited for these metrics, and present methods to share data insights with [Influencer Name] for optimized campaign performance."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.scaling_campaigns_effectively",defaultMessage:"Guide to Scaling Influencer Campaigns Effectively"},value:{id:"prompt.influencer_marketing.scaling_campaigns_effectively.value2",defaultMessage:"Construct a guide for [Company Name] on how to scale influencer campaigns, discussing when to broaden the campaign's reach, how to leverage successful partnerships with influencers like [Influencer Name], and diversifying content across platforms. Offer advice on evaluating scalability through measured outcomes and maintaining brand congruency during growth."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.budget_allocation_for_campaigns",defaultMessage:"Budget Allocation for Influencer Campaigns"},value:{id:"prompt.influencer_marketing.budget_allocation_for_campaigns.value2",defaultMessage:"Deliver a strategy for [Company Name] on the allocation of budgets in influencer campaigns, featuring directives for apportioning funds to influencer remuneration, content creation tied to [Product Info], and reserve funds for flexibility. Include tips for maximizing spend efficiency and ensuring alignment with campaign objectives and deliverables."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.press_release_proposal",defaultMessage:"Outreach Email to Propose Press Release Distribution"},value:{id:"prompt.influencer_marketing.press_release_proposal.value2",defaultMessage:"Create an outreach email to [Name] at [Company Name] with the website [Company URL], offering a press release for distribution. Begin with a friendly introduction of yourself and your company. Highlight the synergy between your respective entities and the mutual benefits of the press release. Explain the significance and objectives of the press release, summarizing its key points. Enclose the document and suggest additional resources if needed. Seek their interest in sharing the release and ask for feedback or requirements for collaboration. Include your contact details for any further discussions and arrangements."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.step_by_step_guide_campaign",defaultMessage:"Step-by-Step Guide to Building an Influencer Campaign"},value:{id:"prompt.influencer_marketing.step_by_step_guide_campaign.value2",defaultMessage:"Construct a detailed step-by-step guide for creating an influencer campaign. Start with identifying campaign goals and the intended audience. Explain the process of selecting suitable influencers whose image and audience coincide with your brand. Offer advice on negotiating deals and setting up compensation packages. Describe the content development and confirmation stages, stressing the importance of collaboration and adhering to brand standards. Provide methods for tracking campaign efficacy. Share strategies for preserving relationships with influencers and refining the campaign based on feedback. Conclude with advice on conducting a thorough post-campaign evaluation."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_showcasing_brand_values",defaultMessage:"Influencer Campaign Emphasizing Brand Values"},value:{id:"prompt.influencer_marketing.campaign_showcasing_brand_values.value2",defaultMessage:"Create an influencer marketing campaign that highlights your brand's core values: [List of Brand Values]. Choose influencers whose personal brands mirror these values and develop a campaign idea that permits them to naturally promote the values through their content. Designate the platforms and content forms to be utilized in the campaign. Draft essential messages and dialogue points that will resonate with the influencers' followers. Include a plan for assessing the success of the campaign in conveying brand values and fostering brand recognition."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_unique_selling_points",defaultMessage:"Influencer Campaign Highlighting the Unique Selling Points"},value:{id:"prompt.influencer_marketing.campaign_unique_selling_points.value2",defaultMessage:"Develop an influencer campaign that spotlights the unique selling features of our [Product/Service]. Start by clarifying the primary characteristics and advantages of the [Product/Service]. Single out potential influencers who cater to our target audience. Formulate a campaign concept that efficiently brings out the distinctive qualities of the [Product/Service]. Determine the content format, such as video demonstrations, social posts, or articles. Draft a timeline for the campaign, inclusive of influencer outreach, content production, and promotional phases. Incorporate strategies for tracking campaign achievement and calculating return on investment."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_employing_influence_authority",defaultMessage:"Influencer Campaign Employing Influence and Authority"},value:{id:"prompt.influencer_marketing.campaign_employing_influence_authority.value2",defaultMessage:"Create a campaign drawing upon the influence and authority of chosen leaders in the space. Pinpoint influencers who are in sync with our brand and desired market. State campaign aims, such as increasing brand profile, endorsing products, or genetic content. Draft an appealing proposition that outlines the perks of the partnership and its relevance to the influencer's following. Set the campaign extent, deliverables, and recompense. Accentuate the principal messaging and discussion points. Provide guidelines for honesty in endorsements. Construct an alliance that benefits both our brand and the influencers positively."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_product_value_benefits",defaultMessage:"Influencer Campaign Focused on Product Value and Benefits"},value:{id:"prompt.influencer_marketing.campaign_product_value_benefits.value2",defaultMessage:"Generate an influencer campaign that brings to light the value and perks of our product, including: [List of Benefits]. Kick off by identifying influencers who target a similar market to ours. Compose a campaign strategy embodying the key messages and objectives. Develop a creative brief for influencers, spotlighting the advantages to focus on in their narrative. Specify the content format (e.g., posts, narratives, reviews) and planned sharing calendar. Provide measures for assessing the campaign's efficacy and for monitoring the sway of influencer endorsements over consumer decisions."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.informational_campaign",defaultMessage:"Informational Influencer Campaign"},value:{id:"prompt.influencer_marketing.informational_campaign.value2",defaultMessage:"Construct an influencer campaign that elucidates the information surrounding our [Product/Service/Company]. Commence with framing campaign targets and the audience. Identify fitting influencers who match our brand values and possess a pertinent audience. Make a captivating campaign theme that efficiently conveys critical information regarding what we offer. Detail campaign deliverables, such as sponsored narratives, reviews, or social media shout-outs. Determine the terms of collaboration and recompense for the influencers. Set out guidelines for messaging and story-telling that uphold our brand's genuineness. Designate a timeline for the campaign and the metrics for gauging its impact."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.campaign_success_stories",defaultMessage:"Influencer Campaign Featuring Success Stories"},value:{id:"prompt.influencer_marketing.campaign_success_stories.value2",defaultMessage:"Orchestrate an influencer campaign that celebrates success anecdotes from patrons utilizing our [Product/Service]. Start by singling out influencers within our sphere or industry with an authentic tie to our brand and product. Devise an impactful campaign theme accentuating true consumer success tales and accrued benefits. Build a magnetic message for influencers to disseminate, spotlighting the transformations or positive changes users have seen. Indicate the content form, be it video endorsements, blogs, or social media narratives. Compile a scheme for charting and measuring the effectiveness of the campaign in generating user engagement and conversions."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.facebook_ad_unique_experiences",defaultMessage:"Facebook Ad Promoting Unique Personal Experiences"},value:{id:"prompt.influencer_marketing.facebook_ad_unique_experiences.value2",defaultMessage:"Create a Facebook advertisement that showcases personal stories connected with using our [Product/Service]. Draft a captivating narrative that brings to light authentic anecdotes and feedback from happy customers. Catalog the exact benefits and results they have obtained utilizing our [Product/Service]. Use genuine language and sentiments to forge a connection with the audience. Add visuals like images or footage that amplifies the tales and augments the ad's visual allure. End with a powerful call to action, inspiring viewers to discover more or trial our [Product/Service] on their own."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.facebook_ad_urgency_fomo",defaultMessage:"Facebook Ad Creating a Sense of Urgency and FOMO"},value:{id:"prompt.influencer_marketing.facebook_ad_urgency_fomo.value2",defaultMessage:"Conceive a Facebook advertisement that instills a sense of urgency and Fear of Missing Out (FOMO) for our [Product/Service]. Draft a gripping headline that immediately captures attention and emits a limited-time or exclusive offer feel. Display the primary benefits and attractive features of the [Product/Service]. Utilize persuasive writing to convey that disregarding this opportunity would be disadvantageous. Lay out a transparent call to action that spurs users to click on the ad and act instantly. Incorporate engaging visuals that are in line with the ad's messaging. Ensure the ad is succinct and captures interest promptly."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.facebook_ad_influencer_social_proof",defaultMessage:"Facebook Ad Leveraging Influencer Social Proof"},value:{id:"prompt.influencer_marketing.facebook_ad_influencer_social_proof.value2",defaultMessage:"Develop a Facebook ad that capitalizes on influencer social proof to endorse our [Product/Service]. Choose a pertinent influencer who has given our product or service a positive review or endorsement. Draft ad copy that spotlights the influencer's backing, quoted testimony, or visual content exhibiting the influencer with the product. Focus on the key advantages and selling points of our [Product/Service]. Incorporate a confident 'Shop Now' or 'Learn More' call to action. Employ compelling language and precise audience targeting for maximal effect."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.youtube_ad_strong_headline_hook",defaultMessage:"YouTube Ad with an Engaging Headline and Hook"},value:{id:"prompt.influencer_marketing.youtube_ad_strong_headline_hook.value2",defaultMessage:"Write a YouTube advertisement with an arresting headline and hook for our [Product/Service]. Craft an attention-snatching headline that rouses viewer curiosity and encourages further watching. Devise a hook that swiftly conveys the principal benefits and merit of the [Product/Service] within the first few seconds of the ad. Create a clear and succinct message motivating viewers to act, be it to explore our website or complete a purchase. Ensure that the advertisement is captivating and upholds our brand identity."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.youtube_ad_introducing_product_service",defaultMessage:"YouTube Ad Script for Introducing a Product or Service"},value:{id:"prompt.influencer_marketing.youtube_ad_introducing_product_service.value2",defaultMessage:"Compose a YouTube ad script presenting our [Product/Service]. Begin with a hook that peaks viewers' interest. Emphasize the standout benefits and unique selling points of [Product/Service]. Illustrate how it fulfills a specific problem or need. Integrate visuals and demonstrations to highlight its functions. Use convincing language and a decisive call to action, urging viewers to discover more or make a purchase. Keep the ad succinct and gripping, with a notable concluding remark or tagline. Detail the ad's length and any visual or sound components to include."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.youtube_ad_showcasing_product_value_benefits",defaultMessage:"YouTube Ad Highlighting Product Value and Benefits"},value:{id:"prompt.influencer_marketing.youtube_ad_showcasing_product_value_benefits.value2",defaultMessage:"Write a YouTube advertisement underlining the value and benefits of our [Product/Service], including these benefits: [List of Benefits]. Create a script that demonstrates how our [Product/Service] meets specific needs and augments the lives of our target demographic. Conceptualize visuals, narratives, and an engaging tone to capture viewer interest. Specify the ad's duration and the significant visual scenes or elements to be included. Ensure a direct and memorable call to action, coaxing viewers to engage further, as in visiting our website or committing to a purchase."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.success_story_youtube_ad",defaultMessage:"YouTube Ad Featuring a Success Story"},value:{id:"prompt.influencer_marketing.success_story_youtube_ad.value2",defaultMessage:"Draft a YouTube advertisement that features a triumph story related to our [Product/Service], with details incorporating [Success Story Details]. Devise a narrative that starts with the customer's challenges and their encounter with our [Product/Service]. Accentuate the favorable impacts they attained, spotlighting specific results or benefits. Present their endorsement and fervor for our brand. Wrap up with an unequivocal call to action, driving viewers to learn more or experiment with our [Product/Service]. Keep the advertisement succinct and riveting, ensuring it maintains the viewer's focus from beginning to end."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.youtube_ad_highlighting_unique_selling_points",defaultMessage:"YouTube Ad Spotlighting Unique Selling Points"},value:{id:"prompt.influencer_marketing.youtube_ad_highlighting_unique_selling_points.value2",defaultMessage:"Compose a YouTube ad emphasizing the unique selling aspects of our [Product/Service], with these unique propositions: [List of Unique Selling Points]. Develop a persuasive and brief script that relays the essence of our [Product/Service] to the intended audience. Incorporate visuals, animations, or live demonstrations that vividly explain these unique elements. Determine the duration of the ad and any branding elements necessary. Make sure the advertisement finishes with a persuasive call to action compelling viewers to make the next move."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.informational_youtube_ad",defaultMessage:"Informational YouTube Ad"},value:{id:"prompt.influencer_marketing.informational_youtube_ad.value2",defaultMessage:"Write an educational YouTube advertisement about our [Product/Service]. Begin by outlining the foundational messages and propositions of the [Product/Service]. Compose a script that focuses on the advantages, functions, and selling points. Identify the graphic elements, such as illustrations, animations, and footage, that ought to be paired with the script. Determine the ad's length and blueprint (e.g., explainer, testimonial, demo). Guarantee that the advertisement is engrossing, informational, and tailored to our target audience. Add a straightforward call to action and branding elements."}},{category:"influencer_marketing",title:{id:"prompt.influencer_marketing.behind_the_scenes_youtube_ad",defaultMessage:"Behind-The-Scenes YouTube Ad"},value:{id:"prompt.influencer_marketing.behind_the_scenes_youtube_ad.value2",defaultMessage:"Author a YouTube ad script that offers an insider view of our [Company/Brand], convincing our [Ideal Customer Persona] to act on [Desired Action] with a genuine and relatable vibe. Initiate by showcasing the appeal of a behind-the-scenes look and its relevance to our ethos. Feature key points of our company ethos, principles, and pledge to excellence. Highlight likable team members or staff who embody our brand's authenticity. Formulate a compelling storyline that emotionally resonates with the viewer. Conclude with a clear and alluring call to action that encourages [Desired Action]."}},{category:"legal",title:(0,te.Em)({id:"prompt.legal.website_privacy_policy_development",defaultMessage:"Website Privacy Policy Development"}),value:(0,te.Em)({id:"prompt.legal.website_privacy_policy_development.value2",defaultMessage:"Prepare a comprehensive privacy policy for our website [URL] in line with legal standards. Start by outlining the types of user data collected and the purposes for which it is used. Specify data protection measures and compliance with relevant regulations (e.g., GDPR, CCPA). Include information on user rights, consent, and data security practices. Detail the sharing of data with third parties, if applicable. Provide clear contact information for data inquiries. Ensure that the policy is easy to understand and accessible to users. Review and update the policy regularly to stay compliant with evolving regulations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.write_website_terms_and_conditions",defaultMessage:"Write Website Terms and Conditions"}),value:(0,te.Em)({id:"prompt.legal.write_website_terms_and_conditions.value2",defaultMessage:"Draft terms and conditions for our website [URL] to clearly define the rules for users. Begin by outlining the websites purpose and user expectations. Specify user rights and responsibilities, including content usage, privacy, and conduct guidelines. Address intellectual property rights, disclaimers, and limitations of liability. Include procedures for dispute resolution and any applicable legal regulations. Ensure that the terms and conditions are written in a clear and understandable manner. Highlight any recent updates or changes to the terms."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.create_website_cookie_consent_banner",defaultMessage:"Create Website Cookie Consent Banner"}),value:(0,te.Em)({id:"prompt.legal.create_website_cookie_consent_banner.value2",defaultMessage:"Design a cookie consent banner for our website [URL] in compliance with data protection laws. Specify the banner's layout, position, and appearance to ensure visibility and user-friendliness. Include clear and concise messaging that explains the use of cookies and seeks user consent. Provide options for users to accept or decline cookies and link to our privacy policy for further information. Ensure that the design is responsive and compatible with different devices and browsers. Consider user experience and ease of interaction."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.develop_website_GDPR_compliance",defaultMessage:"Develop Website GDPR Compliance"}),value:(0,te.Em)({id:"prompt.legal.develop_website_GDPR_compliance.value2",defaultMessage:"Develop a comprehensive plan to ensure our website [URL] is fully GDPR-compliant. Begin by providing an overview of the General Data Protection Regulation (GDPR) and its implications for our website. Identify the types of data collected and processed through the website and the lawful basis for processing. Specify the steps to obtain user consent for data collection, storage, and processing. Address data access and deletion requests, as well as data breach response procedures. Ensure that the plan includes regular compliance audits and updates to align with GDPR regulations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.write_website_refund_return_policy",defaultMessage:"Write Website Refund and Return Policy"}),value:(0,te.Em)({id:"prompt.legal.write_website_refund_return_policy.value2",defaultMessage:"Craft a user-friendly refund and return policy for our website [URL] to increase customer satisfaction and trust. Begin by defining the terms and conditions of the policy, including eligibility, time frames, and processes. Ensure transparency and clarity in the policy language. Address common customer concerns and questions related to refunds and returns. Specify the steps for initiating a return or refund request. Include information on how refunds will be processed and the expected timeline. Emphasize our commitment to customer satisfaction and provide clear contact information for inquiries."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.create_website_copyright_policy",defaultMessage:"Create Website Copyright Policy"}),value:(0,te.Em)({id:"prompt.legal.create_website_copyright_policy.value2",defaultMessage:"Draft a thorough copyright policy for our website [URL] to protect our original content and comply with the law. Begin by outlining the purpose and scope of the copyright policy, emphasizing our commitment to protecting intellectual property rights. Define the types of content covered by copyright and the rights and restrictions associated with each. Specify the procedures for reporting copyright infringement and our response to such reports. Include guidelines for obtaining permission to use our copyrighted content. Ensure compliance with relevant copyright laws and regulations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.create_website_trademark_policy",defaultMessage:"Create Website Trademark Policy"}),value:(0,te.Em)({id:"prompt.legal.create_website_trademark_policy.value2",defaultMessage:"Write a comprehensive trademark policy for our website [URL]. Begin by defining the purpose of the policy and the importance of protecting our trademarks. Specify the proper use of our trademarks, including logo usage and trademark acknowledgment. Outline the rules and restrictions for third-party use of our trademarks, including affiliates and partners. Provide instructions for reporting potential trademark infringements and the actions we may take in response. Include legal disclaimers and terms of use for our trademarks. Ensure clarity and alignment with intellectual property laws and regulations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.develop_website_accessibility_compliance",defaultMessage:"Develop Website Accessibility Compliance"}),value:(0,te.Em)({id:"prompt.legal.develop_website_accessibility_compliance.value2",defaultMessage:"Ensure our website [URL] adheres to accessibility standards. Begin by conducting a comprehensive accessibility audit of the website to identify areas of non-compliance. Specify the changes needed to make the website accessible to all users, including those with disabilities. Address issues related to navigation, images, forms, and content readability. Provide recommendations for implementing accessible design elements and ensuring compatibility with screen readers and other assistive technologies. Include a timeline for making these accessibility improvements and testing them for compliance."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.write_website_data_protection_policy",defaultMessage:"Write Website Data Protection Policy"}),value:(0,te.Em)({id:"prompt.legal.write_website_data_protection_policy.value2",defaultMessage:"Create a robust data protection policy for our website [URL] to ensure legal compliance and data security. Start by outlining the scope of the policy and its purpose in safeguarding user data. Specify the types of data collected and the methods of collection. Describe how user data is stored, processed, and protected. Include information on user consent, data retention, and the rights of users regarding their data. Address compliance with relevant data protection laws, such as GDPR or CCPA. Provide a clear contact point for data-related inquiries and a process for handling data breaches."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.create_website_dispute_resolution_procedure",defaultMessage:"Create Website Dispute Resolution Procedure"}),value:(0,te.Em)({id:"prompt.legal.create_website_dispute_resolution_procedure.value2",defaultMessage:"Formulate a comprehensive dispute resolution procedure for our website [URL] to handle potential user conflicts. Start by defining the types of disputes or conflicts that may arise on the website, considering user interactions, transactions, or content. Develop a step-by-step procedure for users to report disputes and seek resolution. Specify the roles and responsibilities of website administrators or moderators in resolving disputes. Include clear communication channels and response times. Detail escalation procedures for unresolved disputes. Ensure that the procedure aligns with legal requirements and encourages fair and efficient conflict resolution."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.website_ADA_compliance_audit",defaultMessage:"Website ADA Compliance Audit"}),value:(0,te.Em)({id:"prompt.legal.website_ADA_compliance_audit.value2",defaultMessage:"Conduct an audit to ensure our website [URL] complies with the standards outlined in the Americans with Disabilities Act (ADA). Start by reviewing the ADA guidelines and requirements for web accessibility. Perform a comprehensive audit of the websites design, content, and functionality to identify potential accessibility barriers. Document any issues found, such as lack of alt text, keyboard navigation problems, or contrast issues. Provide recommendations for remediation and improvements to meet ADA compliance standards. Include a timeline for implementing these changes and ongoing monitoring for accessibility."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.plan_website_terms_revisions",defaultMessage:"Plan Website Terms Revisions"}),value:(0,te.Em)({id:"prompt.legal.plan_website_terms_revisions.value2",defaultMessage:"Develop a strategic plan for updating the terms and conditions of our website [website URL]. Begin with a comprehensive review of current terms to identify necessary changes. Prioritize updates that reflect new legal requirements, changes in services, or user feedback. Plan a schedule for regular term reviews. Prepare a draft of the revised terms and conditions, ensuring clarity and compliance. Outline the process for user notification about changes to the terms, seeking consent if required. Document the version history and approval process for internal records."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.organize_data_protection_resources",defaultMessage:"Organize Data Protection Resources"}),value:(0,te.Em)({id:"prompt.legal.organize_data_protection_resources.value2",defaultMessage:"Compile and organize resources and tools necessary to support the data protection policy of our website [website URL]. Categorize resources based on their functions such as compliance monitoring, data security, and user consent management. Identify key personnel responsible for managing and executing data protection measures. Establish a centralized repository for documentation, such as internal policies, audit logs, and data breach incident reports. Create training materials for staff on data protection best practices. Plan for regular updates to resources in line with evolving data protection regulations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.write_executive_summary_for_compliance_plan",defaultMessage:"Write Executive Summary for Compliance Plan"}),value:(0,te.Em)({id:"prompt.legal.write_executive_summary_for_compliance_plan.value2",defaultMessage:"Compose an executive summary for a comprehensive compliance plan for our website [website URL]. Briefly describe the objectives of the plan and its significance in ensuring legal conformity and data security. Highlight major compliance targets, including GDPR, CCPA, and ADA. Summarize key strategies for achieving compliance, such as policy development, technology deployment, and staff training. Emphasize the timelines for implementation, review cycles, and the framework for ongoing compliance monitoring. Present the benefits of the compliance plan for stakeholders, including risk mitigation and user trust reinforcement."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.create_website_content_review_checklist",defaultMessage:"Create Website Content Review Checklist"}),value:(0,te.Em)({id:"prompt.legal.create_website_content_review_checklist.value2",defaultMessage:"Develop a detailed checklist for reviewing content on our website [website URL] to ensure legal compliance and adherence to our standards. Include checks for copyright, data privacy, and accuracy of information. List steps to verify sources and to obtain necessary permissions for user-generated content. Incorporate guidelines for ethical considerations and non-discrimination. Provide criteria for consistency with the brand message and tone. Ensure the checklist can be efficiently used by content creators and reviewers to maintain high-quality, compliant content."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.implement_privacy_policy_training_program",defaultMessage:"Implement Privacy Policy Training Program"}),value:(0,te.Em)({id:"prompt.legal.implement_privacy_policy_training_program.value2",defaultMessage:"Outline a training program for staff at all levels of our website [website URL] to effectively understand and implement our privacy policy. Identify key privacy principles and legal requirements to be covered in the training. Develop educational materials including case studies, best practices, and role-specific guidelines. Schedule training sessions and establish criteria for mandatory participation. Plan for assessments to ensure staff comprehension and the ability to apply policy knowledge in their roles. Arrange for periodic refreshers or updates in line with changes to privacy regulations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.set_up_content_monitoring_system",defaultMessage:"Set Up Content Monitoring System"}),value:(0,te.Em)({id:"prompt.legal.set_up_content_monitoring_system.value2",defaultMessage:"Establish a robust content monitoring system for our website [website URL] to ensure ongoing compliance and quality control. Identify content areas requiring frequent review, such as user-generated content sections. Determine criteria for flagging non-compliant or problematic content. Select and implement the appropriate monitoring tools, including manual review processes and automated systems with AI capabilities. Train designated staff on how to use the system and respond to incidences. Develop a response protocol including steps for content takedown, modification, or user engagement."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.audit_third_party_service_agreements",defaultMessage:"Audit Third-Party Service Agreements"}),value:(0,te.Em)({id:"prompt.legal.audit_third_party_service_agreements.value2",defaultMessage:"Perform a thorough audit of all third-party service agreements related to our website [website URL]. Evaluate the contracts to ensure that they meet legal standards and protect our users data. Check for clauses regarding data sharing, confidentiality, and liability. Summarize the findings and identify any gaps in compliance or risks associated with each agreement. Develop recommendations for renegotiating terms or seeking alternative providers if necessary. Plan for regular audits to stay abreast of legal changes and maintain alignment with our data protection policy."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.prepare_legal_documentation_for_new_features",defaultMessage:"Prepare Legal Documentation for New Features"}),value:(0,te.Em)({id:"prompt.legal.prepare_legal_documentation_for_new_features.value2",defaultMessage:"Compile and create all necessary legal documents for the roll-out of new features on our website [website URL]. Identify potential legal implications of the new features and develop user agreements, privacy updates, and disclaimers as required. Collaborate with the development team to understand the features in detail. Anticipate user questions and concerns; incorporate clear, instructive language into the documents. Ensure all documentation reflects current legal requirements and is easily accessible to users. Set up an internal review process before releasing the new features to the public."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.organize_legal_department_digital_assets",defaultMessage:"Organize Legal Department Digital Assets"}),value:(0,te.Em)({id:"prompt.legal.organize_legal_department_digital_assets.value2",defaultMessage:"Create an organization system for the digital assets of our legal department pertaining to our website [website URL]. Start by categorizing documents such as policies, contracts, and compliance records. Implement a digital asset management (DAM) system for easy retrieval and version control. Define access permissions and security measures to protect sensitive information. Plan for a regular review process to update or archive outdated assets. Provide training for legal department personnel on the DAM system and document the procedures for maintaining the organization of assets."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_evaluate_compliance_risks",defaultMessage:"Evaluate Compliance Risks"}),value:(0,te.Em)({id:"prompt.legal.advisor_evaluate_compliance_risks.value2",defaultMessage:"As a legal advisor, conduct a risk assessment for our website [website URL] to identify potential areas of non-compliance with laws and regulations such as GDPR, CCPA, or ADA. Develop a risk matrix outlining likelihood and severity of legal repercussions. Propose mitigation strategies, including enhanced policies, staff training, or technology solutions. Provide guidance on implementing regular compliance audits and updating practices according to new legal standards or case law developments."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_develop_IP_strategy",defaultMessage:"Develop Intellectual Property Strategy"}),value:(0,te.Em)({id:"prompt.legal.advisor_develop_IP_strategy.value2",defaultMessage:"As a legal advisor, create an intellectual property (IP) protection strategy for our website [website URL]. Analyze our current IP assets and identify any gaps in protection. Recommend the best practices for trademark and copyright registration, including international considerations if applicable. Advise on monitoring and enforcement mechanisms to respond to IP infringements effectively. Outline training for staff to recognize and escalate potential IP issues."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_outline_data_breach_response",defaultMessage:"Outline Data Breach Response Plan"}),value:(0,te.Em)({id:"prompt.legal.advisor_outline_data_breach_response.value2",defaultMessage:"As a legal advisor, draft a data breach response plan for our website [website URL]. Detail immediate actions to contain and assess a breach, including any required notifications to authorities and affected individuals under applicable data protection laws. Recommend policies for communication transparency and remediation measures to restore public trust. Suggest ongoing monitoring tactics to prevent future occurrences and regular drills to test the response effectiveness."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_review_contract_templates",defaultMessage:"Review Contract Templates"}),value:(0,te.Em)({id:"prompt.legal.advisor_review_contract_templates.value2",defaultMessage:"As a legal advisor, conduct a comprehensive review of existing contract templates related to website services, partnerships, and third-party provider arrangements for [website URL]. Ensure that the templates are up-to-date and in compliance with current laws. Identify areas that could be standardized to streamline negotiations. Recommend clauses for dispute resolution, liability, and data protection. Propose a process for regular updating and training of staff involved in contract drafting and execution."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_prepare_user_consent_framework",defaultMessage:"Prepare User Consent Framework"}),value:(0,te.Em)({id:"prompt.legal.advisor_prepare_user_consent_framework.value2",defaultMessage:"As a legal advisor, establish a user consent framework for collecting and using personal data on our website [website URL]. Ensure the consent process is compliant with data privacy laws such as GDPR and that the process is transparent, freely given, and easily understandable. Define how user consent will be obtained, documented, and managed, considering both online and offline interactions. Offer guidance on implementing regular reviews and updates to the consent mechanisms to adapt to regulatory changes."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_create_litigation_preparedness_plan",defaultMessage:"Create Litigation Preparedness Plan"}),value:(0,te.Em)({id:"prompt.legal.advisor_create_litigation_preparedness_plan.value2",defaultMessage:"As a legal advisor, develop a litigation preparedness plan for our website [website URL]. Map out a protocol for responding to legal threats or notices, from initial receipt to potential court proceedings. Include strategies for document preservation, internal assessments, privilege considerations, and engaging with external counsel. Plan for training key personnel on their roles during litigation stages and crisis communication plans for addressing public and investor relations."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_guide_to_estate_planning_integration",defaultMessage:"Guide to Estate Planning Integration"}),value:(0,te.Em)({id:"prompt.legal.advisor_guide_to_estate_planning_integration.value2",defaultMessage:"As a legal advisor, guide our website [website URL] users on integrating their digital assets, including accounts and online content, into their estate plans. Provide a framework that outlines how users can manage digital legacy within their estate planning documents. Advise on the incorporation of terms of service agreements and relevant legal provisions affecting digital asset succession. Outline tools or services for secure transmission of access credentials to designated heirs or executors, ensuring compliance with privacy laws and platform policies."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_navigate_global_regulations_expansion",defaultMessage:"Navigate Global Regulations for Expansion"}),value:(0,te.Em)({id:"prompt.legal.advisor_navigate_global_regulations_expansion.value2",defaultMessage:"As a legal advisor, provide a navigational guide for our website [website URL] as we plan to expand into international markets. Identify key legal and regulatory issues related to international e-commerce, data transfer, and local content regulations. Offer strategic advice on adapting our business practices, website policies, and contractual arrangements to comply with diverse regulatory environments. Assist in assessing potential legal risks in target markets and propose risk management strategies."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_assess_subpoena_implications",defaultMessage:"Assess Subpoena Implications"}),value:(0,te.Em)({id:"prompt.legal.advisor_assess_subpoena_implications.value2",defaultMessage:"As a legal advisor, evaluate the implications of a subpoena received by our website [website URL] for user data. Review the subpoena for legality, jurisdiction, and scope. Advise on our rights and obligations, including any potential conflicts with our privacy policy or user agreements. Draft a response plan that includes steps for validating the subpoena, engaging with law enforcement, and where applicable, notifying affected users. Recommend internal policies for the handling of such requests in the future to ensure consistency and legal compliance."})},{category:"legal",title:(0,te.Em)({id:"prompt.legal.advisor_anticipate_regulatory_changes_impact",defaultMessage:"Anticipate Regulatory Changes Impact"}),value:(0,te.Em)({id:"prompt.legal.advisor_anticipate_regulatory_changes_impact.value2",defaultMessage:"As a legal advisor, anticipate the impact of forthcoming regulatory changes on our website [website URL]. Monitor legislative developments relevant to our operations, including data privacy, consumer protection, and digital transactions. Provide foresight into potential legal shifts and the likely timeline for enactment. Assess which areas of our business may be affected and propose proactive strategies for adaptation. Guide the team in implementing updates to policies, practices, and technologies to maintain regulatory compliance ahead of enforcement."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.build_product_landing_pages",defaultMessage:"Build product landing pages"}),value:(0,te.Em)({id:"prompt.website_creation.build_product_landing_pages.value2",defaultMessage:"Build product landing pages for our new product [Product Name] to showcase its [Features] and [Benefits]. Start by defining the key features and benefits of the product. Create visually appealing and informative landing pages that highlight these features and benefits effectively. Specify the layout, imagery, and content structure for each landing page. Ensure that the landing pages are user-friendly, mobile-responsive, and optimized for conversion. Include compelling calls to action that encourage visitors to learn more or make a purchase. Provide design mockups and content guidelines for the landing pages."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.create_faq_page",defaultMessage:"Create a FAQ Page"}),value:(0,te.Em)({id:"prompt.website_creation.create_faq_page.value2",defaultMessage:"Create a comprehensive FAQ page for our website [URL] to quickly address common customer queries. Start by identifying the most frequently asked questions related to our products/services. Organize the questions into categories for easy navigation. Craft concise and informative answers that provide solutions and address customer concerns. Ensure the FAQ page is user-friendly, accessible, and easy to search. Include a clear call to action for customers to contact us for additional support if needed. Provide a plan for regularly updating the FAQ page with new questions and answers."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.website_navigation_menu_creation",defaultMessage:"Website Navigation Menu Creation"}),value:(0,te.Em)({id:"prompt.website_creation.website_navigation_menu_creation.value2",defaultMessage:"Design a clear, intuitive navigation menu for our website [URL] that allows easy access to all of its pages. Begin by reviewing the existing website structure and content. Identify key pages, sections, and categories that need to be included in the navigation menu. Craft a menu layout that is user-friendly and visually appealing. Ensure logical grouping and hierarchy of menu items. Specify the use of dropdown menus or sub-menus if needed. Provide a mockup of the navigation menu with labels and links for review and implementation."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.create_sitemap_for_website",defaultMessage:"Create sitemap for website"}),value:(0,te.Em)({id:"prompt.website_creation.create_sitemap_for_website.value2",defaultMessage:"Create a sitemap for our website [URL] to help search engines crawl and index our website efficiently. Begin by conducting an inventory of all web pages and content on the site. Organize the content into a logical hierarchy, considering the user experience. Specify the URLs, page titles, and meta descriptions for each page. Include any multimedia files or additional resources. Ensure that the sitemap follows the XML sitemap protocol and adheres to search engine guidelines. Provide a plan for regularly updating and submitting the sitemap to search engines for optimal visibility."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.develop_site_structure",defaultMessage:"Develop site structure"}),value:(0,te.Em)({id:"prompt.website_creation.develop_site_structure.value2",defaultMessage:"Develop a logical and intuitive site structure for our website [URL] to enhance navigation and usability. Start by analyzing the current website structure and identifying areas for improvement. Organize content and pages into clear categories and subcategories that align with user needs and expectations. Define a user-friendly menu hierarchy and labeling system. Consider the use of breadcrumbs and internal linking to facilitate navigation. Ensure that the site structure accommodates future content expansion. Provide a visual representation of the proposed site structure for review and approval."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.website_content_creation",defaultMessage:"Website Content Creation"}),value:(0,te.Em)({id:"prompt.website_creation.website_content_creation.value2",defaultMessage:"Develop engaging content for all pages of our new website [URL] to attract and retain users. Begin by defining the purpose and target audience for each page. Craft informative and compelling content that aligns with the websites goals and user needs. Ensure clear and concise messaging, avoiding jargon. Incorporate visuals, such as images and videos, to enhance engagement. Implement SEO best practices to improve discoverability. Create a content calendar and plan for regular updates to keep the website fresh and relevant."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.optimize_website_for_seo",defaultMessage:"Optimize Website for SEO"}),value:(0,te.Em)({id:"prompt.website_creation.optimize_website_for_seo.value2",defaultMessage:"Optimize [URL] for search engines to improve its visibility and ranking. Begin by conducting a comprehensive SEO audit of the website to identify areas for improvement. Develop an on-page SEO strategy that includes keyword research and optimization, meta tags, headers, and content improvements. Implement technical SEO enhancements such as site speed optimization, mobile-friendliness, and schema markup. Create a backlink strategy to improve domain authority. Specify a content plan for regular updates and fresh content. Provide recommendations for ongoing SEO monitoring and adjustments."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.develop_website_accessibility",defaultMessage:"Develop Website Accessibility"}),value:(0,te.Em)({id:"prompt.website_creation.develop_website_accessibility.value2",defaultMessage:"Ensure our website [URL] adheres to web accessibility standards to cater to users with disabilities. Begin by conducting a comprehensive accessibility audit of the website, identifying areas of non-compliance with WCAG (Web Content Accessibility Guidelines). Create an action plan to address accessibility issues, including alternative text for images, keyboard navigation, and proper semantic HTML. Specify the timeline and responsible team members for implementing accessibility improvements. Ensure ongoing testing and monitoring to maintain compliance and provide an inclusive online experience for all users."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.implement_contact_forms",defaultMessage:"Implement contact forms"}),value:(0,te.Em)({id:"prompt.website_creation.implement_contact_forms.value2",defaultMessage:"Implement user-friendly contact forms on our website to facilitate easy communication with our visitors. Begin by assessing the current contact forms on our website and identifying any pain points or areas for improvement. Design a user-friendly contact form that is intuitive, visually appealing, and responsive across devices. Specify the required fields, including name, email, and message. Include clear labels and instructions. Ensure that the form is easy to submit, and provide a confirmation message upon submission. Test the contact form functionality thoroughly to ensure a seamless user experience."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.addition_of_analytics_tools",defaultMessage:"Addition of Analytics Tools"}),value:(0,te.Em)({id:"prompt.website_creation.addition_of_analytics_tools.value2",defaultMessage:"Set up analytical tools like Google Analytics on our website [URL] to measure site performance and user behavior. Begin by accessing the website backend or admin panel. Install Google Analytics tracking code on all relevant pages. Configure account settings, including goals, filters, and user permissions. Set up event tracking to monitor specific user interactions. Specify the reporting frequency and recipients for analytics reports. Ensure that e-commerce tracking is enabled if applicable. Test the tracking setup to verify data accuracy. Provide a step-by-step guide for ongoing monitoring and analysis."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.optimize_website_speed",defaultMessage:"Optimize website speed"}),value:(0,te.Em)({id:"prompt.website_creation.optimize_website_speed.value2",defaultMessage:"Create an optimization plan to improve our website speed [URL]. Begin by conducting a thorough website performance analysis to identify bottlenecks and areas for improvement. Outline specific optimization strategies, including image compression, code minification, and server optimization. Specify a timeline for implementing these improvements and allocate resources accordingly. Include a plan for ongoing monitoring and performance testing to ensure sustained improvements. Provide key performance metrics and benchmarks to track progress and evaluate the impact of optimizations."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.design_mobile_responsive_site",defaultMessage:"Design a mobile responsive site"}),value:(0,te.Em)({id:"prompt.website_creation.design_mobile_responsive_site.value2",defaultMessage:"Design a mobile-responsive site for our website [URL] to enhance user experience on mobile devices. Begin by assessing the current website performance on mobile platforms and identifying areas for improvement. Develop a mobile-responsive design that adapts to various screen sizes and orientations. Prioritize key content and ensure that its easily accessible and navigable on mobile devices. Optimize page load times for mobile users. Specify design elements, such as responsive layouts, touch-friendly buttons, and mobile-friendly fonts. Ensure that the mobile version of the site aligns with the overall branding and user experience."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.implement_live_chat_support",defaultMessage:"Implement live chat support"}),value:(0,te.Em)({id:"prompt.website_creation.implement_live_chat_support.value2",defaultMessage:"Implement a live chat support system on our website [URL] to provide real-time assistance to our customers. Start by defining the objectives of the live chat system such as improving customer service, increasing conversions, or reducing support response times. Choose a suitable live chat platform or tool that integrates seamlessly with our website. Develop a plan for training and staffing support agents. Customize the chat interface to align with our brand identity. Specify the hours of operation and response time targets. Provide guidelines for handling various customer inquiries and escalations. Outline a strategy for monitoring and improving the live chat support systems performance."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.design_website_footer",defaultMessage:"Design Website Footer"}),value:(0,te.Em)({id:"prompt.website_creation.design_website_footer.value2",defaultMessage:"Design an informative and useful footer for our website [URL], including links to main pages, social icons, and contact information. Begin by defining the key pages and sections that should be included in the footer. Craft a visually appealing layout that is easy to navigate. Specify the placement and style of social media icons, ensuring they are linked to our official profiles. Include contact details such as phone number, email address, and physical address if applicable. Ensure that the footer is consistent with the overall website design and branding."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.ecommerce_functionality",defaultMessage:"Ecommerce Functionality"}),value:(0,te.Em)({id:"prompt.website_creation.ecommerce_functionality.value2",defaultMessage:"Implement ecommerce functionality including a shopping cart and secure payment options on our website [URL]. Begin by assessing the current website platform and hosting environment. Select and integrate an ecommerce plugin or solution that aligns with the website technology stack. Configure the shopping cart to handle product listings, pricing, and inventory management. Ensure seamless integration with secure payment gateways such as PayPal or Stripe. Test the functionality thoroughly to verify that customers can browse, select, and purchase products securely. Provide documentation on how to manage and maintain the ecommerce system."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.integrate_social_media",defaultMessage:"Integrate Social Media"}),value:(0,te.Em)({id:"prompt.website_creation.integrate_social_media.value2",defaultMessage:"Integrate social media sharing buttons on our website [URL] to promote social sharing and engagement. Begin by identifying the social media platforms most relevant to our audience and brand. Specify the placement of sharing buttons on the website, considering user experience and visibility. Provide code or plugin recommendations for implementing the sharing buttons. Ensure that the buttons are visually appealing and aligned with our brand identity. Include instructions for tracking social sharing analytics and measuring the impact on website traffic and engagement."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.user_registration_and_authentication",defaultMessage:"User Registration and Authentication"}),value:(0,te.Em)({id:"prompt.website_creation.user_registration_and_authentication.value2",defaultMessage:"Implement a user registration and authentication system for our website [URL] to allow personalized user experiences. Begin by defining the user registration process, including required user information and registration flow. Specify the authentication methods such as email verification or social media login. Outline security measures to protect user data. Design user profile pages that allow customization and personalization. Ensure seamless integration with the websites existing features and content. Provide guidelines for user account management and password recovery. Conduct testing to ensure a smooth user registration and authentication experience."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.content_strategy_development",defaultMessage:"Content Strategy Development"}),value:(0,te.Em)({id:"prompt.website_creation.content_strategy_development.value2",defaultMessage:"Create a comprehensive content strategy for our website [URL] that aligns with our brand values and business goals. Conduct a content audit to evaluate existing materials. Identify key topics and themes that resonate with our target audience. Develop a content calendar that outlines the creation and publishing schedule. Plan various content types including blog posts, videos, infographics, and case studies. Incorporate SEO best practices to enhance online visibility. Establish metrics for tracking content performance and iterate the strategy based on insights gathered."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.marketing_plan_implementation",defaultMessage:"Marketing Plan Implementation"}),value:(0,te.Em)({id:"prompt.website_creation.marketing_plan_implementation.value2",defaultMessage:"Implement a strategic marketing plan to increase traffic and engagement on our website [URL]. Start with a market analysis and identify our target customer segments. Develop marketing campaigns tailored to these segments. Choose the appropriate digital channels for content distribution, including social media, email marketing, and paid advertising. Set clear objectives and KPIs for each campaign. Allocate budget and resources efficiently. Execute the marketing activities according to the timeline set. Monitor and analyze campaign performance regularly to refine tactics and ensure the highest ROI."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.seo_keyword_research",defaultMessage:"SEO Keyword Research"}),value:(0,te.Em)({id:"prompt.website_creation.seo_keyword_research.value2",defaultMessage:"Conduct thorough SEO keyword research to guide the content creation and optimization for our website [URL]. Utilize various keyword research tools to identify high-potential search terms relevant to our business and industry. Analyze search volume, competition, and user intent behind each keyword. Group keywords strategically for use in website copy, blog posts, and metadata. Prioritize a mix of short-tail and long-tail keywords to capture a broad audience. Provide a keyword map for website sections and content pieces to ensure consistent usage across the site."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.brand_messaging_guidelines",defaultMessage:"Brand Messaging Guidelines"}),value:(0,te.Em)({id:"prompt.website_creation.brand_messaging_guidelines.value2",defaultMessage:"Develop clear brand messaging guidelines to maintain a consistent voice and tone across our website [URL]. Define our brands core values, mission, and unique selling proposition. Translate these elements into a messaging strategy that speaks to our target audience. Outline the style and tone of voice for different types of content. Provide sample copy as a reference for all content creators. Ensure that all website content, from homepage to blog posts, reflects the brand messaging guidelines. Continuously train content teams on best practices in upholding brand standards."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.content_auditing_and_optimization",defaultMessage:"Content Auditing and Optimization"}),value:(0,te.Em)({id:"prompt.website_creation.content_auditing_and_optimization.value2",defaultMessage:"Perform a content audit for our website [URL] to identify opportunities for optimization. Review and evaluate existing content for relevance, quality, and SEO performance. Determine the pieces that require updates, repurposing, or removal. Develop a plan for revising and enhancing content, incorporating targeted keywords and current SEO best practices. Monitor content metrics to assess the impact of the optimization efforts. Provide a schedule for regular content reviews to ensure ongoing relevance and performance."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.competitor_analysis_for_seo",defaultMessage:"Competitor Analysis for SEO"}),value:(0,te.Em)({id:"prompt.website_creation.competitor_analysis_for_seo.value2",defaultMessage:"Conduct a detailed competitor analysis to understand their SEO strategies and identify areas where our website [URL] can improve. Analyze competitors keyword rankings, backlink profiles, content approach, and website structure. Identify gaps in their strategies that we can capitalize on. Use insights gained to refine our own SEO tactics, focusing on weaknesses and strengths relative to the competition. Craft an action plan to improve our search rankings and outperform competitors. Provide continuous monitoring to adapt to changes and maintain a competitive edge."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.on_page_seo_improvement",defaultMessage:"On-Page SEO Improvement"}),value:(0,te.Em)({id:"prompt.website_creation.on_page_seo_improvement.value2",defaultMessage:"Enhance on-page SEO elements for our website [URL] to boost search engine rankings and user experience. Audit all pages to ensure optimization of title tags, meta descriptions, header tags, and images. Integrate primary and related keywords into high-quality, useful content. Ensure URLs are clean and descriptive. Improve website load speed and mobile responsiveness. Address internal link structure to distribute page authority throughout the site. Analyze user behavior to reduce bounce rates and encourage longer visit durations. Document on-page SEO guidelines for consistency across all website content."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.social_media_integration_plan",defaultMessage:"Social Media Integration Plan"}),value:(0,te.Em)({id:"prompt.website_creation.social_media_integration_plan.value2",defaultMessage:"Develop a plan for integrating social media into our website [URL] to enhance engagement and cross-channel visibility. Choose the most relevant social platforms for our target audience and objectives. Embed social media feeds to display real-time updates on the website. Add social sharing buttons to content pages to increase shareability. Create social media login options for a simplified user experience. Plan regular social media content that links back to the website, driving traffic and engagement. Track and analyze the impact of social media integrations on website metrics and user behavior."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.technical_seo_enhancements",defaultMessage:"Technical SEO Enhancements"}),value:(0,te.Em)({id:"prompt.website_creation.technical_seo_enhancements.value2",defaultMessage:"Execute technical SEO enhancements to improve [URL]s indexation and performance. Begin by fixing crawl errors and broken links. Ensure that the robots.txt file is optimized to guide search engine crawlers effectively. Implement SSL for a secure connection and improved trust. Optimize website architecture for seamless crawling and indexing. Apply structured data markup to enhance SERP displays. Improve website speed through caching, compression, and optimized hosting. Document a technical SEO checklist and schedule routine audits to maintain performance standards."})},{category:"website_creation",title:(0,te.Em)({id:"prompt.website_creation.content_distribution_network_setup",defaultMessage:"Content Distribution Network Setup"}),value:(0,te.Em)({id:"prompt.website_creation.content_distribution_network_setup.value2",defaultMessage:"Set up a content distribution network (CDN) for our website [URL] to enhance content delivery speed globally. Evaluate and select a CDN provider that meets our technical requirements and budget. Integrate the CDN into the websites infrastructure to cache content at multiple, geographically diverse servers. Configure settings for optimal performance and security. Provide guidelines for managing and updating the CDN settings. Monitor CDN performance and make adjustments as necessary to ensure fast load times and a positive user experience for international visitors."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.analyze_website_traffic",defaultMessage:"Analyze website traffic"}),value:(0,te.Em)({id:"prompt.analytics.analyze_website_traffic.value2",defaultMessage:"Analyze the traffic on our website [URL] to understand the sources driving visits, and devise strategies to enhance web traffic."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.develop_website_performance_metrics",defaultMessage:"Develop website performance metrics"}),value:(0,te.Em)({id:"prompt.analytics.develop_website_performance_metrics.value2",defaultMessage:"Define key performance metrics to assess the success and efficiency of our website [URL]."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.create_website_attribution_modeling",defaultMessage:"Create website attribution modeling"}),value:(0,te.Em)({id:"prompt.analytics.create_website_attribution_modeling.value2",defaultMessage:"Develop a website attribution model to track customer journeys and conversion paths at [URL]."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.create_user_behavior_reports",defaultMessage:"Create user behavior reports"}),value:(0,te.Em)({id:"prompt.analytics.create_user_behavior_reports.value2",defaultMessage:"Create comprehensive user behavior reports for our website [URL] to drive improvements in functionality and user experience."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.create_website_customer_lifetime_value",defaultMessage:"Create website customer lifetime value"}),value:(0,te.Em)({id:"prompt.analytics.create_website_customer_lifetime_value.value2",defaultMessage:"Calculate the customer lifetime value (CLV) for customers on our website [URL] to help guide business decisions."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.develop_website_funnel_optimization",defaultMessage:"Develop website funnel optimization"}),value:(0,te.Em)({id:"prompt.analytics.develop_website_funnel_optimization.value2",defaultMessage:"Improve funnel optimization for our website [URL] by identifying and addressing drop-off points in the conversion process."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.website_conversion_rate_optimization",defaultMessage:"Website conversion rate optimization"}),value:(0,te.Em)({id:"prompt.analytics.website_conversion_rate_optimization.value2",defaultMessage:"Develop a strategy to improve the conversion rate of our website [URL]."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.implement_website_ab_testing",defaultMessage:"Implement website A/B testing"}),value:(0,te.Em)({id:"prompt.analytics.implement_website_ab_testing.value2",defaultMessage:"Create and implement an A/B testing plan for our website [URL]."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.website_sales_analytics",defaultMessage:"Website sales analytics"}),value:(0,te.Em)({id:"prompt.analytics.website_sales_analytics.value2",defaultMessage:"Perform a detailed sales analytics for [URL] to measure the effectiveness of sales strategies and identify areas of improvement."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.develop_website_heatmaps",defaultMessage:"Develop website heatmaps"}),value:(0,te.Em)({id:"prompt.analytics.develop_website_heatmaps.value2",defaultMessage:"Create heatmaps for our website [URL] to understand user behavior and improve site layout and content."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.website_social_media_integration",defaultMessage:"Website social media integration"}),value:(0,te.Em)({id:"prompt.analytics.website_social_media_integration.value2",defaultMessage:"Integrate social media tracking for our website [URL] to analyze the performance of social media campaigns."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.identify_behavioral_trends",defaultMessage:"Identify behavioral trends"}),value:(0,te.Em)({id:"prompt.analytics.identify_behavioral_trends.value2",defaultMessage:"Identify and analyze behavioral trends among users on our website [URL] to align marketing strategies with user preferences."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.evaluate_customer_feedback",defaultMessage:"Evaluate customer feedback"}),value:(0,te.Em)({id:"prompt.analytics.evaluate_customer_feedback.value2",defaultMessage:"Gather and evaluate customer feedback from various sources for our website [URL] to enhance the overall user experience."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.optimization_of_marketing_channels",defaultMessage:"Optimization of marketing channels"}),value:(0,te.Em)({id:"prompt.analytics.optimization_of_marketing_channels.value2",defaultMessage:"Optimize the use of various marketing channels to increase visitation and engagement on our website [URL]."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.analyze_user_acquisition_efficiency",defaultMessage:"Analyze user acquisition efficiency"}),value:(0,te.Em)({id:"prompt.analytics.analyze_user_acquisition_efficiency.value2",defaultMessage:"Conduct in-depth analysis of our websites [URL] user acquisition channels to enhance return on investment (ROI) and reduce cost per acquisition (CPA)."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.assess_content_performance",defaultMessage:"Assess content performance"}),value:(0,te.Em)({id:"prompt.analytics.assess_content_performance.value2",defaultMessage:"Evaluate the performance of content on our website [URL], identifying the most effective pieces and suggesting areas for improvement."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.optimize_mobile_user_experience",defaultMessage:"Optimize mobile user experience"}),value:(0,te.Em)({id:"prompt.analytics.optimize_mobile_user_experience.value2",defaultMessage:"Formulate strategies for optimizing the mobile user experience for visitors of our website [URL], ensuring accessibility and engagement."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.develop_user_retention_programs",defaultMessage:"Develop user retention programs"}),value:(0,te.Em)({id:"prompt.analytics.develop_user_retention_programs.value2",defaultMessage:"Create programs aimed at increasing user retention and loyalty on our website [URL] through targeted analysis and engagement initiatives."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.track_competitive_market_trends",defaultMessage:"Track competitive market trends"}),value:(0,te.Em)({id:"prompt.analytics.track_competitive_market_trends.value2",defaultMessage:"Monitor competitive market trends to benchmark and steer our website [URL] towards a competitive edge in the industry."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.measure_seo_effectiveness",defaultMessage:"Measure SEO effectiveness"}),value:(0,te.Em)({id:"prompt.analytics.measure_seo_effectiveness.value2",defaultMessage:"Analyze the effectiveness of search engine optimization (SEO) strategies implemented on our website [URL] to improve organic search rankings."})},{category:"analytics",title:(0,te.Em)({id:"prompt.analytics.optimize_checkout_process",defaultMessage:"Optimize checkout process"}),value:(0,te.Em)({id:"prompt.analytics.optimize_checkout_process.value2",defaultMessage:"Streamline and optimize the checkout process for our website [URL] to reduce cart abandonment rates and increase conversions."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.conduct_competitor_seo_analysis",defaultMessage:"Conduct competitor SEO analysis"}),value:(0,te.Em)({id:"prompt.seo.conduct_competitor_seo_analysis.value2",defaultMessage:"Conduct a detailed SEO analysis of our top competitors and identify ways to improve our website [Website URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.perform_keyword_research",defaultMessage:"Perform keyword research"}),value:(0,te.Em)({id:"prompt.seo.perform_keyword_research.value2",defaultMessage:"Perform comprehensive keyword research for our website [URL] to better align our content with potential search queries."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.create_website_sitemap",defaultMessage:"Create website sitemap"}),value:(0,te.Em)({id:"prompt.seo.create_website_sitemap.value2",defaultMessage:"Develop a complete website sitemap for our website [URL] to improve search engine crawling."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.develop_website_meta_descriptions",defaultMessage:"Develop website meta descriptions"}),value:(0,te.Em)({id:"prompt.seo.develop_website_meta_descriptions.value2",defaultMessage:"Write compelling meta descriptions for critical pages of our website [URL] to improve click-through rate from search results."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.create_website_local_seo_optimization",defaultMessage:"Create website local SEO optimization"}),value:(0,te.Em)({id:"prompt.seo.create_website_local_seo_optimization.value2",defaultMessage:"Create a plan to improve the local SEO of our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.develop_website_content_optimization",defaultMessage:"Develop website content optimization"}),value:(0,te.Em)({id:"prompt.seo.develop_website_content_optimization.value2",defaultMessage:"Create a strategy for optimizing the content of our website [URL] to improve SEO."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.optimize_content_for_discoverability",defaultMessage:"Optimize content for discoverability"}),value:(0,te.Em)({id:"prompt.seo.optimize_content_for_discoverability.value2",defaultMessage:"Explain the best practices for using keywords, hashtags, and descriptions to improve the discoverability of my [URL] on each platform."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.write_website_image_optimization",defaultMessage:"Write website image optimization"}),value:(0,te.Em)({id:"prompt.seo.write_website_image_optimization.value2",defaultMessage:"Optimize images on our website [URL] by adding appropriate alt text."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.create_website_bounce_rate_reduction_plan",defaultMessage:"Create website bounce rate reduction plan"}),value:(0,te.Em)({id:"prompt.seo.create_website_bounce_rate_reduction_plan.value2",defaultMessage:"Create a plan to reduce the bounce rate on our website [URL] to improve user engagement and stickiness."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.improve_website_loading_speed",defaultMessage:"Improve website loading speed"}),value:(0,te.Em)({id:"prompt.seo.improve_website_loading_speed.value2",defaultMessage:"Identify and implement ways to improve our website [URL] loading speed."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.website_mobile_optimization",defaultMessage:"Website mobile optimization"}),value:(0,te.Em)({id:"prompt.seo.website_mobile_optimization.value2",defaultMessage:"Optimize our website [URL] for mobile use."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.inbound_and_outbound_link_strategy",defaultMessage:"Inbound and Outbound Link Strategy"}),value:(0,te.Em)({id:"prompt.seo.inbound_and_outbound_link_strategy.value2",defaultMessage:"Develop a strategy for improving the number of high-quality inbound and outbound links for our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.develop_website_traffic_analysis",defaultMessage:"Develop website traffic analysis"}),value:(0,te.Em)({id:"prompt.seo.develop_website_traffic_analysis.value2",defaultMessage:"Establish a method for regularly analyzing and interpreting the traffic data on our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.analyze_website_conversion_rate",defaultMessage:"Analyze website conversion rate"}),value:(0,te.Em)({id:"prompt.seo.analyze_website_conversion_rate.value2",defaultMessage:"Analyze the conversion rate of our website [URL] and identify actionable insights to improve it."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.develop_user_behavior_tracking",defaultMessage:"Develop user behavior tracking"}),value:(0,te.Em)({id:"prompt.seo.develop_user_behavior_tracking.value2",defaultMessage:"Implement user behavior tracking on our website [URL] to better understand user interaction and improve the user experience."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.create_seo_friendly_urls_and_slugs",defaultMessage:"Create SEO friendly URLs and slugs"}),value:(0,te.Em)({id:"prompt.seo.create_seo_friendly_urls_and_slugs.value2",defaultMessage:"Create SEO-friendly URLs and slugs for our website [URL] to improve its visibility on search engine results."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.social_media_seo_strategy",defaultMessage:"Social media SEO strategy"}),value:(0,te.Em)({id:"prompt.seo.social_media_seo_strategy.value2",defaultMessage:"Develop a strategy to leverage social media to boost the SEO of our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.audit_website_seo_performance",defaultMessage:"Audit website SEO performance"}),value:(0,te.Em)({id:"prompt.seo.audit_website_seo_performance.value2",defaultMessage:"Conduct a comprehensive SEO performance audit for our website [URL] to identify optimization opportunities."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.enhance_local_business_listings",defaultMessage:"Enhance local business listings"}),value:(0,te.Em)({id:"prompt.seo.enhance_local_business_listings.value2",defaultMessage:"Develop a plan to optimize and enhance our local business listings for improved local SEO performance."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.implement_structured_data_markup",defaultMessage:"Implement structured data markup"}),value:(0,te.Em)({id:"prompt.seo.implement_structured_data_markup.value2",defaultMessage:"Plan and implement structured data markup for our website [URL] to boost SEO and enhance content visibility."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.optimize_website_navigation_structure",defaultMessage:"Optimize website navigation structure"}),value:(0,te.Em)({id:"prompt.seo.optimize_website_navigation_structure.value2",defaultMessage:"Design a plan to optimize the navigation structure of our website [URL] for better user experience and SEO."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.create_effective_link_building_campaign",defaultMessage:"Create effective link building campaign"}),value:(0,te.Em)({id:"prompt.seo.create_effective_link_building_campaign.value2",defaultMessage:"Develop an effective link building campaign to improve the backlink profile of our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.conduct_seo_friendly_content_audit",defaultMessage:"Conduct SEO-friendly content audit"}),value:(0,te.Em)({id:"prompt.seo.conduct_seo_friendly_content_audit.value2",defaultMessage:"Perform an SEO-friendly content audit for our website [URL] to ensure maximum search engine visibility."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.craft_effective_cta_elements",defaultMessage:"Craft effective CTA elements"}),value:(0,te.Em)({id:"prompt.seo.craft_effective_cta_elements.value2",defaultMessage:"Strategize and craft effective Call-to-Action (CTA) elements for our web pages to boost conversions."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.perform_content_gap_analysis",defaultMessage:"Perform content gap analysis"}),value:(0,te.Em)({id:"prompt.seo.perform_content_gap_analysis.value2",defaultMessage:"Conduct a content gap analysis to identify SEO opportunities for new and existing content on our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.analyze_user_engagement_metrics",defaultMessage:"Analyze user engagement metrics"}),value:(0,te.Em)({id:"prompt.seo.analyze_user_engagement_metrics.value2",defaultMessage:"Analyze user engagement metrics for our website [URL] and suggest improvements to boost SEO."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.create_a_backlink_audit_plan",defaultMessage:"Create a backlink audit plan"}),value:(0,te.Em)({id:"prompt.seo.create_a_backlink_audit_plan.value2",defaultMessage:"Develop a comprehensive plan to audit, maintain, and improve the backlink profile for our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.optimize_website_page_titles",defaultMessage:"Optimize website page titles"}),value:(0,te.Em)({id:"prompt.seo.optimize_website_page_titles.value2",defaultMessage:"Construct a plan to optimize page titles across our website [URL] for enhanced SEO impact."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.develop_content_pruning_strategy",defaultMessage:"Develop content pruning strategy"}),value:(0,te.Em)({id:"prompt.seo.develop_content_pruning_strategy.value2",defaultMessage:"Develop a content pruning strategy to remove or improve outdated content on our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.integrate_seo_into_marketing_strategy",defaultMessage:"Integrate SEO into marketing strategy"}),value:(0,te.Em)({id:"prompt.seo.integrate_seo_into_marketing_strategy.value2",defaultMessage:"Create an integrated marketing strategy that includes SEO best practices to enhance overall brand visibility for our website [URL]."})},{category:"seo",title:(0,te.Em)({id:"prompt.seo.develop_multilingual_seo_strategy",defaultMessage:"Develop multilingual SEO strategy"}),value:(0,te.Em)({id:"prompt.seo.develop_multilingual_seo_strategy.value2",defaultMessage:"Develop a multilingual SEO strategy to target non-English speaking audiences and improve foreign market reach for our website [URL]."})},{category:"engineering",title:{id:"prompt.engineering.virtual_github_pr_reviews",defaultMessage:"Virtual Github PR Reviews"},value:{id:"prompt.engineering.virtual_github_pr_reviews.value2",defaultMessage:"Review the pull request in Github diff format. Take into account that you only have access to the [Code_Diff]. Provide improvements in code, adhering to [Language_Conventions]. Evaluate the changes for code quality, readability, and adherence to coding standards. Identify any potential bugs, security vulnerabilities, or performance issues. Offer specific recommendations for improvement, including code snippets and explanations. Ensure that the changes align with the project's objectives and maintain consistency with existing codebase. Provide constructive feedback to the contributor to enhance code quality."}},{category:"engineering",title:{id:"prompt.engineering.generate_ai_changelog",defaultMessage:"Generate AI Changelog"},value:{id:"prompt.engineering.generate_ai_changelog.value2",defaultMessage:"Interpret the [Commit and Diff Messages] to create meaningful, concise descriptions for each commit. Review the commit messages and changes made in each commit. Summarize the purpose and impact of each commit in a clear and concise manner. Provide a brief description that communicates what was achieved or fixed in each commit. Ensure that the descriptions are informative and follow best practices for commit message clarity and formatting."}},{category:"engineering",title:{id:"prompt.engineering.automated_test_suite_design",defaultMessage:"Automated Test Suite Design"},value:{id:"prompt.engineering.automated_test_suite_design.value2",defaultMessage:"Design an automated test suite for the [Software_Project]. Identify the critical components and modules of the software project and outline the types of tests that would be most effective. Provide code snippets for implementing these tests in [Programming_Language]. Start by categorizing the types of tests needed, such as unit tests, integration tests, and end-to-end tests. Define the test scenarios and expected outcomes for each critical component. Develop code snippets that demonstrate how to write and execute these tests using [Programming_Language] and any relevant testing frameworks or libraries."}},{category:"engineering",title:{id:"prompt.engineering.performance_optimization",defaultMessage:"Performance Optimization"},value:{id:"prompt.engineering.performance_optimization.value2",defaultMessage:"Analyze the performance bottlenecks in the provided [Code Snippet]. Recommend changes to improve speed and efficiency. Provide before and after benchmarks to quantify the improvement. Ensure the recommendations adhere to the [Coding Standards]. Begin by conducting a code review to identify potential bottlenecks, such as inefficient algorithms or resource-intensive operations. Propose code optimizations, such as algorithmic improvements, caching, or parallel processing, to address the bottlenecks. Provide benchmark measurements before implementing the changes and after to demonstrate the performance improvement achieved by the recommended optimizations while adhering to the specified coding standards."}},{category:"engineering",title:{id:"prompt.engineering.code_review_checklist",defaultMessage:"Code Review Checklist"},value:{id:"prompt.engineering.code_review_checklist.value2",defaultMessage:"Create a comprehensive code review checklist tailored for [Programming Language] and [Project Type]. Include checks for syntax, performance, security, and maintainability. Provide explanations for each item on the checklist to guide reviewers effectively. Ensure that the checklist covers aspects specific to the chosen programming language and project type, such as code structure, libraries, and best practices. The checklist should assist in identifying code issues, improving code quality, and ensuring that the codebase aligns with project requirements and coding standards."}},{category:"engineering",title:{id:"prompt.engineering.security_audit",defaultMessage:"Security Audit"},value:{id:"prompt.engineering.security_audit.value2",defaultMessage:"Conduct a security audit on the given [Code Repository]. Identify vulnerabilities related to data leaks, injection attacks, and poor authentication mechanisms. Provide code fixes and best practices to mitigate these risks. Begin by reviewing the codebase thoroughly, focusing on areas where sensitive data is handled, inputs are accepted, and authentication is implemented. Identify potential security weaknesses and document them. Offer specific code changes, such as input validation, encryption, and authentication improvements, to address these vulnerabilities. Include best practices for secure coding to prevent future issues."}},{category:"engineering",title:{id:"prompt.engineering.database_design",defaultMessage:"Database Design"},value:{id:"prompt.engineering.database_design.value2",defaultMessage:"Design a database schema for a [Project_Type] with [Number_of_Tables] tables. Provide an Entity-Relationship (ER) diagram and SQL code for table creation. Ensure the design is optimized for query performance and data integrity. Define the relationships between tables and specify primary keys, foreign keys, and indexes where necessary. Include data types, constraints, and any additional details that are relevant to the project. Ensure the schema is scalable and efficient for handling the expected data volume and complexity."}},{category:"engineering",title:{id:"prompt.engineering.devops_pipeline_configuration",defaultMessage:"DevOps Pipeline Configuration"},value:{id:"prompt.engineering.devops_pipeline_configuration.value2",defaultMessage:"Outline a DevOps pipeline for a [Project_Type] built with [Technology_Stack]. Include stages for code linting, unit testing, building, and deployment. Suggest tools and provide sample configuration files. Start by defining the project's technology stack and development environment. Specify the version control system (e.g., Git) and repository structure. Describe the process for code linting using tools like [Linter_Tool] and provide a sample configuration file. Outline unit testing practices and tools (e.g., [Testing_Tool]) and include a sample test suite. Detail the build process using [Build_Tool] and provide a build configuration file. Finally, describe the deployment process to [Deployment_Target] using [Deployment_Tool] and provide a deployment configuration."}},{category:"engineering",title:{id:"prompt.engineering.api_design_and_documentation",defaultMessage:"API Design and Documentation"},value:{id:"prompt.engineering.api_design_and_documentation.value2",defaultMessage:"Design a RESTful API for a [Project Type]. Provide endpoint URLs, request-response structures, and HTTP methods for each endpoint. Include comprehensive documentation that details the functionality of each endpoint, required headers, and possible response codes. Specify the data formats (e.g., JSON, XML) for requests and responses. Define authentication and authorization mechanisms if applicable. Ensure that the API design follows REST principles for scalability, consistency, and simplicity. Include sample requests and responses to illustrate usage."}},{category:"engineering",title:{id:"prompt.engineering.front_end_component_library",defaultMessage:"Front-end Component Library"},value:{id:"prompt.engineering.front_end_component_library.value2",defaultMessage:"Create a component library for a [Project Type] using [Frontend Framework]. Identify the reusable UI elements, such as buttons, cards, and modals, that can be standardized. Provide code snippets and usage guidelines for each component, including variations and customization options. Ensure consistency in design, functionality, and accessibility across the library. Specify best practices for integrating the components into the project. Include documentation for developers to easily reference and utilize the component library to streamline UI development."}},{category:"engineering",title:{id:"prompt.engineering.code_refactoring",defaultMessage:"Code Refactoring"},value:{id:"prompt.engineering.code_refactoring.value2",defaultMessage:"Review the given [Legacy_Code] and identify areas for refactoring. Suggest changes to improve code readability, maintainability, and performance. Provide before and after code snippets to demonstrate improvements. Focus on optimizing algorithms, reducing redundancy, and enhancing code structure. Ensure that the refactored code aligns with best practices and coding standards. Highlight how the proposed changes will contribute to better overall code quality and ease of future maintenance."}},{category:"engineering",title:{id:"prompt.engineering.serverless_architecture",defaultMessage:"Serverless Architecture"},value:{id:"prompt.engineering.serverless_architecture.value2",defaultMessage:"Design a serverless architecture for a [Project_Type]. Choose the appropriate cloud services (e.g., AWS Lambda, AWS API Gateway) and outline the data flow. Specify how data will be processed, stored, and communicated between services. Provide sample configuration files (e.g., AWS SAM or Serverless Framework templates) for setting up the architecture. Include deployment steps, including how to deploy and test the serverless functions and services. Ensure scalability, security, and cost-efficiency in the design."}},{category:"engineering",title:{id:"prompt.engineering.accessibility_audit",defaultMessage:"Accessibility Audit"},value:{id:"prompt.engineering.accessibility_audit.value2",defaultMessage:"Conduct an accessibility audit for a [Web Application]. Identify areas that do not meet WCAG (Web Content Accessibility Guidelines) guidelines. Provide recommendations and code fixes to improve accessibility. Begin by defining the scope of the audit, including the specific pages or components to be assessed. Use automated accessibility testing tools and manual testing to identify issues. Document findings, including violations of WCAG guidelines and the impact on users. Provide actionable recommendations and code examples to remediate accessibility issues, ensuring compliance with WCAG standards. Include a timeline for implementing the fixes."}},{category:"engineering",title:{id:"prompt.engineering.scalability_analysis",defaultMessage:"Scalability Analysis"},value:{id:"prompt.engineering.scalability_analysis.value2",defaultMessage:"Analyze the scalability of a [Software System]. Identify potential bottlenecks and suggest architectural changes to handle increased load. Provide cost estimates for scaling the system. Begin with a comprehensive assessment of the current system's architecture, including hardware and software components. Analyze performance metrics and usage patterns to pinpoint scalability challenges. Outline architectural changes or optimizations needed to address these challenges and accommodate increased user load. Calculate the projected costs of implementing these changes, considering hardware upgrades, software licenses, and maintenance. Provide a timeline for the scalability enhancements."}},{category:"engineering",title:{id:"prompt.engineering.machine_learning_model_evaluation",defaultMessage:"Machine Learning Model Evaluation"},value:{id:"prompt.engineering.machine_learning_model_evaluation.value2",defaultMessage:"Evaluate the provided [Machine_Learning_Model] for accuracy, precision, and recall. Analyze the prediction results against the test dataset. Provide suggestions for model improvement, including hyperparameter tuning, feature selection, and algorithm adjustments. Ensure that your review adheres to best practices in [Data_Science]. Present your findings in a clear and understandable manner, suitable for both technical and non-technical stakeholders."}},{category:"engineering",title:{id:"prompt.engineering.containerization_strategy",defaultMessage:"Containerization Strategy"},value:{id:"prompt.engineering.containerization_strategy.value2",defaultMessage:"Devise a containerization strategy for [Software_Application] using [Container_Technology]. Outline the benefits of containerization for this application, including portability, scalability, and development velocity. Provide a step-by-step guide for containerizing the application, including writing Dockerfiles, managing container images, and orchestrating containers with [Orchestration_Tool]. Address multi-service communication, data persistence, and container networking as part of the strategy."}},{category:"engineering",title:{id:"prompt.engineering.blockchain_smart_contract_development",defaultMessage:"Blockchain Smart Contract Development"},value:{id:"prompt.engineering.blockchain_smart_contract_development.value2",defaultMessage:"Develop a smart contract for [Blockchain_Platform] that fulfills the specified contractual conditions for [Use_Case]. Provide a secure and efficient code implementation with inline comments for clarity. Address common smart contract vulnerabilities and include a suite of tests to ensure the contract's reliability. Offer best practices for deploying and interacting with the smart contract."}},{category:"engineering",title:{id:"prompt.engineering.embedded_systems_optimization",defaultMessage:"Embedded Systems Optimization"},value:{id:"prompt.engineering.embedded_systems_optimization.value2",defaultMessage:"Optimize the provided [Embedded_System_Code] to improve resource efficiency and execution speed. Analyze the existing codebase for inefficiencies in CPU usage, memory footprint, and power consumption. Propose optimizations such as algorithm enhancement, code refactoring, and hardware-specific adjustments. Provide revised code snippets demonstrating the optimizations and describe the expected improvements in system performance."}},{category:"engineering",title:{id:"prompt.engineering.multithreaded_program_debugging",defaultMessage:"Multithreaded Program Debugging"},value:{id:"prompt.engineering.multithreaded_program_debugging.value2",defaultMessage:"Analyze and debug the provided [Multithreaded_Code_Snippet] that is experiencing synchronization issues and deadlocks. Identify the root causes of concurrency bugs and provide solutions that ensure correct thread synchronization and improve thread safety. Suggest code changes to resolve race conditions and other parallel execution problems while maintaining optimal performance."}},{category:"engineering",title:{id:"prompt.engineering.real_time_data_processing",defaultMessage:"Real-Time Data Processing"},value:{id:"prompt.engineering.real_time_data_processing.value2",defaultMessage:"Design an architecture for real-time data processing using [Streaming_Technology] for [Use_Case]. Provide a flow diagram illustrating the components of the data pipeline. Recommend efficient data serialization and deserialization methods, stream processing functions, and persistent storage solutions. Detail the mechanisms for fault tolerance, data partitioning, and scaling to handle high-throughput data streams."}},{category:"engineering",title:{id:"prompt.engineering.network_protocol_implementation",defaultMessage:"Network Protocol Implementation"},value:{id:"prompt.engineering.network_protocol_implementation.value2",defaultMessage:"Implement the [Network_Protocol] for efficiently managing communication between distributed system components. Provide a structured code framework outlining the protocol's layers and functionalities. Incorporate essential features such as packet structuring, error detection and correction, and flow control mechanisms. Ensure the implementation is robust and adheres to the protocol's specifications for interoperability and performance."}},{category:"engineering",title:{id:"prompt.engineering.firmware_update_mechanism",defaultMessage:"Firmware Update Mechanism"},value:{id:"prompt.engineering.firmware_update_mechanism.value2",defaultMessage:"Design a secure and reliable mechanism for updating the firmware of [Embedded_Device]. Detail the update process, including new firmware distribution, installation, verification, and rollback strategies in case of failures. Ensure the solution incorporates secure authentication methods to protect against unauthorized updates and provides seamless user experience."}},{category:"engineering",title:{id:"prompt.engineering.cyber_physical_system_security",defaultMessage:"Cyber-Physical System Security"},value:{id:"prompt.engineering.cyber_physical_system_security.value2",defaultMessage:"Assess and fortify the security of a [Cyber_Physical_System] against potential cyber threats. Conduct a vulnerability assessment to identify weaknesses in data transmission, storage, and processing. Recommend defense strategies such as secure coding practices, encryption techniques, and real-time threat monitoring systems. Provide a security plan that mitigates risks and ensures the physical safety and integrity of the system."}},{category:"engineering",title:{id:"prompt.engineering.advanced_data_visualization_techniques",defaultMessage:"Advanced Data Visualization Techniques"},value:{id:"prompt.engineering.advanced_data_visualization_techniques.value2",defaultMessage:"Develop a suite of advanced data visualization techniques to represent the complexities of [Data_Set]. Explore various visualization methods such as interactive charts, heatmaps, and 3D modeling to convey insights effectively. Provide examples with code snippets and a guide on selecting the appropriate visualization type based on the data characteristics and analysis objectives."}},{category:"engineering",title:{id:"prompt.engineering.cloud_infrastructure_cost_optimization",defaultMessage:"Cloud Infrastructure Cost Optimization"},value:{id:"prompt.engineering.cloud_infrastructure_cost_optimization.value2",defaultMessage:"Analyze and optimize the cloud infrastructure costs for [Cloud_Service] being used in production. Suggest cost-saving measures such as resource right-sizing, reserved instances, and auto-scaling policies. Provide insights into cost allocation and identify underutilized resources. Propose a comprehensive cost management plan that aligns with the company's budget and resource usage patterns."}},{category:"research",title:(0,te.Em)({id:"prompt.research.systematic_literature_review",defaultMessage:"Systematic Literature Review"}),value:(0,te.Em)({id:"prompt.research.systematic_literature_review.value2",defaultMessage:"Design a protocol for a systematic literature review on [Research Topic]. Define inclusion and exclusion criteria, search strategies for databases, and methods for data extraction and analysis. Ensure that the review will synthesize relevant studies to support evidence-based practices in [Field]."})},{category:"research",title:(0,te.Em)({id:"prompt.research.competitive_analysis_report",defaultMessage:"Competitive Analysis Report"}),value:(0,te.Em)({id:"prompt.research.competitive_analysis_report.value2",defaultMessage:"Conduct a comprehensive competitive analysis to benchmark against other companies in the [Industry] sector. Map out competitor offerings, market positions, strengths, weaknesses, opportunities, and threats. Present actionable insights for strategic positioning."})},{category:"research",title:(0,te.Em)({id:"prompt.research.grant_proposal",defaultMessage:"Research Grant Proposal"}),value:(0,te.Em)({id:"prompt.research.grant_proposal.value2",defaultMessage:"Draft a detailed research grant proposal addressing a significant problem in [Research Area]. Include background information, objectives, methodology, expected outcomes, a budget, and an impact statement. Highlight the potential contributions of the project to the field and society at large."})},{category:"research",title:(0,te.Em)({id:"prompt.research.ux_study",defaultMessage:"User Experience (UX) Study"}),value:(0,te.Em)({id:"prompt.research.ux_study.value2",defaultMessage:"Plan a UX study to evaluate [Product/Service] and identify areas for improvement. Develop a research framework involving surveys, interviews, and usability tests. Analyze the data to enhance user satisfaction, engagement, and retention."})},{category:"research",title:(0,te.Em)({id:"prompt.research.market_trend_analysis",defaultMessage:"Market Trend Analysis"}),value:(0,te.Em)({id:"prompt.research.market_trend_analysis.value2",defaultMessage:"Analyze market trends and forecast future developments in the [Industry/Market]. Examine consumer behavior, emerging technologies, and regulatory changes. Provide strategic recommendations to capitalize on these trends."})},{category:"research",title:(0,te.Em)({id:"prompt.research.ethnographic_field_study",defaultMessage:"Ethnographic Field Study"}),value:(0,te.Em)({id:"prompt.research.ethnographic_field_study.value2",defaultMessage:"Design an ethnographic field study to gain in-depth insight into the cultural practices and experiences of [Population Group]. Propose observation methods, interview questions, and data recording techniques to capture the nuanced behavior and social interactions."})},{category:"research",title:(0,te.Em)({id:"prompt.research.data_management_plan",defaultMessage:"Research Data Management Plan"}),value:(0,te.Em)({id:"prompt.research.data_management_plan.value2",defaultMessage:"Create a comprehensive data management plan for a research project involving [Data Types]. Detail data collection, storage, access, sharing, and preservation strategies, ensuring compliance with ethical and legal standards."})},{category:"research",title:(0,te.Em)({id:"prompt.research.policy_impact_evaluation",defaultMessage:"Policy Impact Evaluation"}),value:(0,te.Em)({id:"prompt.research.policy_impact_evaluation.value2",defaultMessage:"Develop a framework for evaluating the impact of a specific policy in [Policy Area]. Use quantitative and qualitative data to assess implementation effectiveness, outcomes, and unintended consequences. Provide clear, actionable policy recommendations based on the findings."})},{category:"research",title:(0,te.Em)({id:"prompt.research.cross_cultural_comparative_study",defaultMessage:"Cross-Cultural Comparative Study"}),value:(0,te.Em)({id:"prompt.research.cross_cultural_comparative_study.value2",defaultMessage:"Outline a comparative study examining how different cultures approach [Topic/Issue]. Select appropriate cross-cultural frameworks and methodologies to highlight similarities and differences, and to understand broader cultural dynamics."})},{category:"research",title:(0,te.Em)({id:"prompt.research.dissemination_strategy",defaultMessage:"Research Dissemination Strategy"}),value:(0,te.Em)({id:"prompt.research.dissemination_strategy.value2",defaultMessage:"Design a strategy to effectively disseminate research findings on [Topic] to key stakeholders. Identify target audiences, appropriate channels, and communication formats. Plan for workshops, publications, and online outreach activities to maximize impact."})},{category:"research",title:(0,te.Em)({id:"prompt.research.research_ethics_compliance",defaultMessage:"Research Ethics Compliance"}),value:(0,te.Em)({id:"prompt.research.research_ethics_compliance.value2",defaultMessage:"Develop a comprehensive guide for ensuring compliance with ethical standards in research involving [specific subjects or data types]. Address consent, confidentiality, data protection, and responsible publication practices."})},{category:"research",title:(0,te.Em)({id:"prompt.research.patent_landscape_analysis",defaultMessage:"Patent Landscape Analysis"}),value:(0,te.Em)({id:"prompt.research.patent_landscape_analysis.value2",defaultMessage:"Conduct a patent landscape analysis to inform [Company Name] of the intellectual property environment relating to [Technology Field]. Identify patent trends, key players, and potential for innovation and collaboration."})},{category:"research",title:(0,te.Em)({id:"prompt.research.clinical_trial_study_protocol",defaultMessage:"Clinical Trial Study Protocol"}),value:(0,te.Em)({id:"prompt.research.clinical_trial_study_protocol.value2",defaultMessage:"Craft a protocol for a clinical trial on [Drug or Treatment Method]. Include objectives, design, methodology, inclusion/exclusion criteria, outcomes, and ethical considerations to advance medical knowledge and patient care."})},{category:"research",title:(0,te.Em)({id:"prompt.research.research_collaboration_framework",defaultMessage:"Research Collaboration Framework"}),value:(0,te.Em)({id:"prompt.research.research_collaboration_framework.value2",defaultMessage:"Outline a framework to facilitate collaborative research between [Institutions or Research Groups]. Focus on shared goals, resource allocation, joint publication strategies, and intellectual property rights."})},{category:"research",title:(0,te.Em)({id:"prompt.research.environmental_impact_study",defaultMessage:"Environmental Impact Study"}),value:(0,te.Em)({id:"prompt.research.environmental_impact_study.value2",defaultMessage:"Design a study to assess the environmental impacts of [Project or Activity]. Plan the investigation of ecological effects, propose mitigation strategies, and develop a communication plan to engage stakeholders and the public."})},{category:"research",title:(0,te.Em)({id:"prompt.research.research_methodology_workshop",defaultMessage:"Research Methodology Workshop"}),value:(0,te.Em)({id:"prompt.research.research_methodology_workshop.value2",defaultMessage:"Plan and conduct a workshop for researchers on contemporary research methodologies applicable to [Discipline]. Include hands-on sessions, expert panels, and discussions on traditional and emerging research methods."})},{category:"research",title:(0,te.Em)({id:"prompt.research.technological_feasibility_study",defaultMessage:"Technological Feasibility Study"}),value:(0,te.Em)({id:"prompt.research.technological_feasibility_study.value2",defaultMessage:"Investigate the technical feasibility of [New Technology or Product Concept]. Analyze resources required, potential challenges, market readiness, and the potential for successful deployment."})},{category:"research",title:(0,te.Em)({id:"prompt.research.historical_research_presentation",defaultMessage:"Historical Research Presentation"}),value:(0,te.Em)({id:"prompt.research.historical_research_presentation.value2",defaultMessage:"Prepare a compelling presentation showcasing historical research findings on [Historical Event or Theme]. Illustrate the significance of the findings and their impact on contemporary understanding."})},{category:"research",title:(0,te.Em)({id:"prompt.research.research_funding_allocation_strategy",defaultMessage:"Research Funding Allocation Strategy"}),value:(0,te.Em)({id:"prompt.research.research_funding_allocation_strategy.value2",defaultMessage:"Strategize the allocation of research funding for [Organization or Department], prioritizing projects based on potential for breakthroughs, societal benefits, and alignment with strategic objectives."})},{category:"research",title:(0,te.Em)({id:"prompt.research.longitudinal_study_design",defaultMessage:"Longitudinal Study Design"}),value:(0,te.Em)({id:"prompt.research.longitudinal_study_design.value2",defaultMessage:"Design a longitudinal study to track changes over time in [Population or Phenomenon]. Establish the methodology for repeated observations, data consistency, and analysis to uncover patterns and causations."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.swot_analysis",defaultMessage:"SWOT Analysis"}),value:(0,te.Em)({id:"prompt.strategy.swot_analysis.value",defaultMessage:"Please conduct a SWOT analysis for a [company] in the [industry] sector, identifying key strengths, weaknesses, opportunities, and threats that can influence its strategic direction."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.bcg_matrix",defaultMessage:"BCG Matrix"}),value:(0,te.Em)({id:"prompt.strategy.bcg_matrix.value",defaultMessage:"Generate a BCG Matrix for [company]'s various product lines in the [industry] market, classifying them as Stars, Question Marks, Cash Cows, or Dogs based on their market share and growth rate."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.porters_five_forces",defaultMessage:"Porter's Five Forces"}),value:(0,te.Em)({id:"prompt.strategy.porters_five_forces.value",defaultMessage:"Analyze the [industry] market using Porter's Five Forces framework for a [company], assessing the level of competition, the threat of new entrants, the bargaining power of suppliers and customers, and the threat of substitute products."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.ansoff_matrix",defaultMessage:"Ansoff Matrix"}),value:(0,te.Em)({id:"prompt.strategy.ansoff_matrix.value",defaultMessage:"Apply the Ansoff Matrix to identify growth strategies for a [company] in the [industry], exploring options for market penetration, market development, product development, and diversification."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.pestel_analysis",defaultMessage:"PESTEL Analysis"}),value:(0,te.Em)({id:"prompt.strategy.pestel_analysis.value",defaultMessage:"Perform a PESTEL analysis for a [company] in the [industry], identifying political, economic, social, technological, environmental, and legal factors that may impact its business operations."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.balanced_scorecard",defaultMessage:"Balanced Scorecard"}),value:(0,te.Em)({id:"prompt.strategy.balanced_scorecard.value",defaultMessage:"Develop a Balanced Scorecard for a [company] in the [industry], incorporating financial, customer, internal process, and learning and growth perspectives to measure performance."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.blue_ocean_strategy",defaultMessage:"Blue Ocean Strategy"}),value:(0,te.Em)({id:"prompt.strategy.blue_ocean_strategy.value",defaultMessage:"Outline a Blue Ocean Strategy for a [company] in the [industry], identifying ways to create uncontested market space by redefining the existing industry boundaries."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.porters_value_chain",defaultMessage:"Porter's Value Chain"}),value:(0,te.Em)({id:"prompt.strategy.porters_value_chain.value",defaultMessage:"Analyze the value chain for a [company] in the [industry], identifying primary and support activities that are key to creating value for its customers."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.ge_mckinsey_matrix",defaultMessage:"GE-McKinsey Matrix"}),value:(0,te.Em)({id:"prompt.strategy.ge_mckinsey_matrix.value",defaultMessage:"Construct a GE-McKinsey Matrix for [company]'s business units in the [industry], evaluating them on the dimensions of industry attractiveness and competitive strength."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.bowmans_strategy_clock",defaultMessage:"Bowman's Strategy Clock"}),value:(0,te.Em)({id:"prompt.strategy.bowmans_strategy_clock.value",defaultMessage:"Utilize Bowman's Strategy Clock to assess the competitive positioning of a [company] in the [industry], comparing its price and value proposition with competitors."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.vrio_framework",defaultMessage:"VRIO Framework"}),value:(0,te.Em)({id:"prompt.strategy.vrio_framework.value",defaultMessage:"Evaluate the resources and capabilities of a [company] in the [industry] using the VRIO Framework to determine if they confer a sustainable competitive advantage."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.core_competence_model",defaultMessage:"Core Competence Model"}),value:(0,te.Em)({id:"prompt.strategy.core_competence_model.value",defaultMessage:"Identify the core competencies of a [company] in the [industry] using the Core Competence Model, discussing how these can be leveraged for competitive advantage."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.tows_matrix",defaultMessage:"TOWS Matrix"}),value:(0,te.Em)({id:"prompt.strategy.tows_matrix.value",defaultMessage:"Create a TOWS Matrix for a [company] in the [industry], linking its internal strengths and weaknesses with external opportunities and threats to formulate strategic options."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.gap_analysis",defaultMessage:"Gap Analysis"}),value:(0,te.Em)({id:"prompt.strategy.gap_analysis.value",defaultMessage:"Conduct a gap analysis for a [company] in the [industry], identifying the gaps between its current performance and its strategic objectives, along with recommendations to bridge those gaps."})},{category:"strategy",title:(0,te.Em)({id:"prompt.strategy.scenario_planning",defaultMessage:"Scenario Planning"}),value:(0,te.Em)({id:"prompt.strategy.scenario_planning.value",defaultMessage:"Develop scenario planning for a [company] in the [industry], outlining multiple plausible future scenarios and how the company can respond to each."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.compelling_ad_copy",defaultMessage:"Crafting Compelling Ad Copy"}),value:(0,te.Em)({id:"prompt.advertising.compelling_ad_copy.value",defaultMessage:"Analyze and improve current ad copy to increase engagement. Provide specific strategies and techniques to make the ad copy more compelling and engaging, considering the target audience, desired response, and unique selling points. Offer examples, templates, and tips for testing and measuring effectiveness, helping drive higher engagement for advertising campaigns and ultimately leading to increased conversions and sales."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.compelling_ad_headlines",defaultMessage:"Creating Compelling Ad Headlines"}),value:(0,te.Em)({id:"prompt.advertising.compelling_ad_headlines.value",defaultMessage:"Craft compelling ad headlines to increase click-through rates. Guide users to capture attention, drive engagement, and improve digital marketing campaign effectiveness. Provide a comprehensive guide on optimizing ad headlines, including strategies for keyword research, understanding the target audience, and incorporating persuasive language to create headlines that resonate with users and improve click-through rates."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.custom_advertising_ideas",defaultMessage:"Custom Advertising Ideas"}),value:(0,te.Em)({id:"prompt.advertising.custom_advertising_ideas.value",defaultMessage:"Generate custom advertising ideas for [Product/Service]. Include creative concepts, target demographic strategies, and unique selling propositions. Focus on innovative approaches that align with brand values and resonate with the intended audience."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.google_ads_local_service",defaultMessage:"Google Ads for Local Service Ads"}),value:(0,te.Em)({id:"prompt.advertising.google_ads_local_service.value",defaultMessage:"Create a comprehensive guide on effectively using Google Ads for Local Service Ads to maximize local service visibility. Explain key features, provide step-by-step instructions, and offer tips for optimizing ads and tracking success. Focus on strategies that help local service providers increase their visibility and attract more customers through targeted advertising."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.targeting_options",defaultMessage:"Targeting Options in Advertising"}),value:(0,te.Em)({id:"prompt.advertising.targeting_options.value",defaultMessage:"Develop a comprehensive guide on targeting options in advertising. Educate digital marketing experts on the concept, importance, and types of targeting options. Include examples, benefits, limitations, and best practices for optimizing targeting options to maximize campaign success. Aim to empower digital marketing experts to effectively reach their desired audience and enhance their advertising campaign’s effectiveness."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.google_surveys",defaultMessage:"Google Surveys for Campaign Feedback"}),value:(0,te.Em)({id:"prompt.advertising.google_surveys.value",defaultMessage:"Guide users on maximizing campaign success with Google Surveys. Provide instructions on setting up and conducting surveys, choosing audiences, designing questions, distributing surveys, maximizing response rates, ensuring feedback quality, and analyzing results for actionable insights. Emphasize how Google Surveys can be used by marketing consultants for gathering feedback and making informed decisions in their campaigns."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.google_attribution",defaultMessage:"Google Attribution for Campaign Analysis"}),value:(0,te.Em)({id:"prompt.advertising.google_attribution.value",defaultMessage:"Create a guide on using Google Attribution to analyze advertising campaign performance. Include the purpose and benefits, setup process, integration with advertising platforms, data interpretation, and campaign optimization. Help digital marketing consultants understand and utilize Google Attribution to maximize campaign performance and evaluate advertising effectiveness."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.google_smart_campaigns",defaultMessage:"Google Smart Campaigns"}),value:(0,te.Em)({id:"prompt.advertising.google_smart_campaigns.value",defaultMessage:"Create a detailed guide on creating and launching campaigns with Google Smart Campaigns. Include step-by-step instructions, best practices, and tips for maximizing effectiveness. This guide should provide advertisers with the necessary knowledge and tools to effectively utilize Google Smart Campaigns for successful advertising results."})},{category:"advertising",title:(0,te.Em)({id:"prompt.advertising.google_app_campaigns",defaultMessage:"Google App Campaigns for Efficiency"}),value:(0,te.Em)({id:"prompt.advertising.google_app_campaigns.value",defaultMessage:"Develop a comprehensive guide on using Google App Campaigns to maximize campaign efficiency. Provide step-by-step instructions, best practices, and effective utilization tips. Aim to help advertising experts quickly create and launch advertising campaigns with ease, outlining the purpose and benefits of using Google App Campaigns."})},{category:"education",title:(0,te.Em)({id:"prompt.design_curriculum",defaultMessage:"Design an Engaging Curriculum"}),value:(0,te.Em)({id:"prompt.design_curriculum.value",defaultMessage:"Outline a comprehensive curriculum for a course on [Course Topic]. Detail the course structure, learning objectives, and key content for each module. Incorporate a blend of theoretical knowledge and practical application, ensuring alignment with educational standards and student interests."})},{category:"education",title:(0,te.Em)({id:"prompt.study_plan_creation",defaultMessage:"Create a Personalized Study Plan"}),value:(0,te.Em)({id:"prompt.study_plan_creation.value",defaultMessage:"Assist in developing a personalized study plan for [Subject or Course]. Include a schedule that balances study time with breaks, advice on effective study techniques tailored to the student’s learning style, and strategies for reviewing and reinforcing key concepts."})},{category:"education",title:(0,te.Em)({id:"prompt.develop_module",defaultMessage:"Create Engaging Course Modules"}),value:(0,te.Em)({id:"prompt.develop_module.value",defaultMessage:"Develop a detailed module for your course, focusing on delivering content that is clear, engaging, and of high educational value. Include interactive elements, multimedia resources, and real-world examples to enhance understanding and retention."})},{category:"education",title:(0,te.Em)({id:"prompt.research_project_guidance",defaultMessage:"Guide a Research Project"}),value:(0,te.Em)({id:"prompt.research_project_guidance.value",defaultMessage:"Provide step-by-step guidance for undertaking a research project in [Topic or Subject]. This includes formulating a research question, identifying credible sources, organizing findings, and presenting results in a coherent and academically appropriate format."})},{category:"education",title:(0,te.Em)({id:"prompt.boost_engagement",defaultMessage:"Enhance Learner Engagement"}),value:(0,te.Em)({id:"prompt.boost_engagement.value",defaultMessage:"Propose innovative and interactive methods to boost learner engagement in your online course. Include strategies for active participation, collaborative projects, and incorporating gamification elements to make learning more dynamic and enjoyable."})},{category:"education",title:(0,te.Em)({id:"prompt.create_assessments",defaultMessage:"Design Effective Assessments"}),value:(0,te.Em)({id:"prompt.create_assessments.value",defaultMessage:"Design a range of assessments for your course that align with its learning objectives. Include a mix of quizzes, assignments, and projects that evaluate understanding and application of the course material, while also providing feedback for continuous learning."})},{category:"education",title:(0,te.Em)({id:"prompt.exam_preparation_tips",defaultMessage:"Offer Exam Preparation Strategies"}),value:(0,te.Em)({id:"prompt.exam_preparation_tips.value",defaultMessage:"Suggest effective strategies for preparing for exams in [Subject]. Include techniques for memorization, time management, dealing with exam anxiety, and tips for answering different types of questions (e.g., multiple-choice, essay)."})},{category:"education",title:(0,te.Em)({id:"prompt.update_content",defaultMessage:"Plan Content Updates"}),value:(0,te.Em)({id:"prompt.update_content.value",defaultMessage:"Develop a strategy for regularly updating course content. Keep abreast of the latest trends, research, and technological advancements in your field. Plan for periodic reviews and updates to ensure your course remains relevant and up-to-date."})},{category:"education",title:(0,te.Em)({id:"prompt.group_project_collaboration",defaultMessage:"Facilitate Group Project Collaboration"}),value:(0,te.Em)({id:"prompt.group_project_collaboration.value",defaultMessage:"Propose methods for effective collaboration in a group project setting. Discuss roles and responsibilities allocation, scheduling meetings, conflict resolution strategies, and tools for remote collaboration and communication."})},{category:"education",title:(0,te.Em)({id:"prompt.skill_development_plan",defaultMessage:"Develop a Skill Enhancement Plan"}),value:(0,te.Em)({id:"prompt.skill_development_plan.value",defaultMessage:"Create a plan for developing specific skills related to [Subject/Area of Interest]. Include resources such as online courses, workshops, books, and hands-on activities. Suggest a timeline and milestones for tracking progress."})},{category:"education",title:(0,te.Em)({id:"prompt.task_list_preparing_presentations",defaultMessage:"Prepare for Presentations with Task Lists"}),value:(0,te.Em)({id:"prompt.task_list_preparing_presentations.value",defaultMessage:"Develop a task list in Taskade to methodically prepare for an academic presentation in [Subject]. Include tasks for research, creating slides, rehearsing, and gathering feedback. This structured approach helps in delivering a polished and well-prepared presentation."})},{category:"education",title:(0,te.Em)({id:"prompt.mind_map_learning_concepts",defaultMessage:"Visualize Complex Concepts with Mind Maps"}),value:(0,te.Em)({id:"prompt.mind_map_learning_concepts.value",defaultMessage:"Develop a mind map to visually break down and understand complex concepts in [Subject/Area of Study]. Use the mind map to explore different facets of the concept, establish connections between ideas, and create a memorable visual learning aid."})},{category:"education",title:(0,te.Em)({id:"prompt.task_list_thesis_milestones",defaultMessage:"Organize Thesis Writing with Task Lists"}),value:(0,te.Em)({id:"prompt.task_list_thesis_milestones.value",defaultMessage:"Create a detailed task list in Taskade for managing the thesis writing process in [Subject]. Break down the project into manageable stages, from literature review to data collection, analysis, and writing. Set deadlines and milestones to track progress and stay on schedule."})},{category:"education",title:(0,te.Em)({id:"prompt.mind_map_research_paper",defaultMessage:"Structure Research Papers with Mind Maps"}),value:(0,te.Em)({id:"prompt.mind_map_research_paper.value",defaultMessage:"Utilize Taskade’s mind map feature to outline the structure of a research paper in [Field of Study]. Organize main sections, subtopics, and key points. This visual approach helps in logically structuring the paper and ensures comprehensive coverage of the subject matter."})},{category:"education",title:(0,te.Em)({id:"prompt.interactive_mind_map_essay_topics",defaultMessage:"Brainstorm Essay Topics with Interactive Mind Map"}),value:(0,te.Em)({id:"prompt.interactive_mind_map_essay_topics.value",defaultMessage:"Use Taskade’s mind mapping tool to brainstorm and organize potential topics for an upcoming essay in [Subject]. Structure the mind map to explore different themes, subtopics, and angles for the essay. Encourage creative and critical thinking to develop unique and compelling essay ideas."})}],cl=function(e){let{template:t}=e,a=(0,eK.Z)(),[n,l]=ev.useState(!1),r=ev.useMemo(()=>a.formatMessage(t.value).split(/(\[[^\]]+\])/).filter(Boolean),[a,t.value]);return ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement("div",{onClick:()=>{l(!n)},className:og()("cursor-pointer transition duration-150 ease-in-out",n?"line-clamp-5":"line-clamp-3")},r.map((e,t)=>e.startsWith("[")&&e.endsWith("]")?ev.createElement("span",{key:t,className:"inline text-primary"},`[${e.slice(1,-1)}]`):ev.createElement("span",{key:t},e))))},cr=function(){let[e,t]=ev.useState(null),[a,n]=ev.useState(""),[l,r]=ev.useState(null),o=ev.useMemo(()=>new to.Z(cn,{keys:["title.defaultMessage","value.defaultMessage"],threshold:.3}),[]),i=(0,eK.Z)(),s=ev.useMemo(()=>a?o.search(a).map(e=>e.item):cn,[o,a]),d=ev.useMemo(()=>{let e=function(e){let t=e.map(e=>[e.id,{category:e,templates:[]}]);return new Map(t)}(ca);for(let t of s){let a=e.get(t.category);null!=a&&a.templates.push(t)}return Array.from(e.values()).filter(e=>e.templates.length>0)},[s]);ev.useEffect(()=>{let e=ca.find(e=>e.default);null!=e&&t(e.id)},[]);let c=(e,t)=>{navigator.clipboard.writeText(e),r(t)};return ev.createElement("div",{className:"flex h-[80vh] max-w-5xl flex-col"},ev.createElement("div",{className:"flex items-center border-b border-solid border-appcolor-300 p-4"},ev.createElement("div",{className:"text-md flex items-center"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"mr-2"}),ev.createElement(eY.Z,{id:"general.ai_prompt_templates",defaultMessage:"AI Prompt Templates"})),ev.createElement("div",{className:"ml-auto"},ev.createElement("input",{type:"search",id:"site-search",className:"rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm",placeholder:"Search templates...",name:"q",autoFocus:!0,onChange:e=>{n(e.target.value),r(null)}}))),ev.createElement("div",{className:"flex h-full overflow-auto"},d.length>0?ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"w-md sticky top-0 flex shrink-0 flex-col gap-px overflow-y-auto p-4"},d.map(a=>{let{category:n,templates:l}=a;return ev.createElement("button",{key:n.name.id,className:og()("flex w-full items-center rounded-lg px-3 py-1 text-sm transition duration-150 ease-out hover:bg-appcolor-200 hover:ease-in",{"bg-appcolor-200":e===n.id}),onClick:()=>t(n.id)},ev.createElement("span",{className:"mr-3"},n.emoji),ev.createElement("span",{className:"truncate"},ev.createElement(eY.Z,n.name)),ev.createElement("span",{className:"ml-1 flex rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-2 py-1 text-xs font-bold text-appcolor-800"},l.length))})),ev.createElement("div",{className:"flex-grow flex-col"},d.filter(t=>t.category.id===e).map(e=>{let{category:t,templates:a}=e;return ev.createElement("div",{key:t.name.id,className:"flex flex-col gap-2 p-4"},a.map((e,a)=>ev.createElement("div",{key:`${t.name}-${a}`,className:"group/delete relative flex flex-col gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 p-3 py-3 pl-4 text-sm hover:border-appcolor-400 hover:bg-appcolor-200"},ev.createElement("div",{className:"flex w-full gap-1"},ev.createElement("h3",{className:"w-3/4 font-medium text-appcolor-800"},ev.createElement(eY.Z,e.title)),ev.createElement("button",{className:"absolute right-2 top-2 ml-auto flex animate-color-rainbow items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-0.5 pr-3 text-xs text-appcolor-600 opacity-0 transition duration-150 ease-in-out hover:bg-appcolor-300 group-hover/delete:opacity-100",onClick:()=>c(i.formatMessage(e.value),`${t.name}-${a}`),onMouseOut:()=>r(null)},ev.createElement(tn.Icon,{className:"shrink-0 scale-75",icon:"dd_copy"}),l===`${t.name}-${a}`?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"}))),ev.createElement("div",{className:"line-clamp-5 w-full text-left text-appcolor-500"},ev.createElement(cl,{template:e})))))}))):ev.createElement("div",{className:"center-items flex flex-grow flex-col justify-center py-10"},ev.createElement("span",{className:"text-center text-appcolor-500"},ev.createElement(eY.Z,{id:"general.prompt_no_results",defaultMessage:"No results found for"})," ",`"${a}"`))))},co=(0,d9.oM)({name:"dialogs.aiPromptTemplates",initialState:{isOpen:!1},reducers:{toggleAiPromptTemplatesDialog:e=>({isOpen:!e.isOpen})}}),ci=(0,e$.connect)(function(e){return e.dialogs.aiPromptTemplates})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=ev.useCallback(()=>{a(co.actions.toggleAiPromptTemplatesDialog())},[a]);return t?ev.createElement(eI.ModalDialog,{className:"rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",isOpen:t,close:n},e=>{let{exit:t}=e;return ev.createElement(cr,{exit:t})}):null});var cs=a(50319),cd=a(30381),cc=a.n(cd);let cm="@@taskade/user/CLEAR_ACCOUNTS_ERRORS",cu="@@taskade/user/SET_ACCOUNTS_FETCH_STATUS",cp="@@taskade/user/SET_ACCOUNTS_LIST",cg="@@taskade/user/SUBMIT_CHANGE_PASSWORD_FORM",cf="@@taskade/user/UPDATE_USER",ch="@@taskade/user/UPDATE_USER_PREFERENCES";function cy(){return{type:cm,payload:{}}}function cb(e){return{type:cu,payload:{fetchStatus:e}}}function cv(e,t,a){return{type:cg,payload:{values:e,form:t,callback:a}}}function ck(e){return{type:cf,payload:{user:e}}}function cE(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:ch,payload:{key:e,value:t,localStorageKey:a}}}var cx=a(71522);let c_=["page"],cw="America/New_York",cN=cx.UPLOAD_VALID_EXTENSIONS.map(e=>`.${e}`).join(", "),cC=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-1c163933-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,cM=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"styled__CaretIcon",componentId:"sc-1c163933-1"})` + margin-left: ${eI.UiSpacing.getPx(1)}; + color: ${e=>e.theme.appColors.hex(50)}; +`,cS=eL.default.button.withConfig({displayName:"styled__RemindMe",componentId:"sc-1c163933-2"})` + display: flex; + padding: 4px 8px; + background: none; + font-weight: 500; + font-size: 14px; + border: 0; + color: ${e=>(e.theme?.isNightMode,"#999")}; + cursor: pointer; + margin-right: 5px; + + &:focus { + outline: 0; + } + + &:hover { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + } +`,cI=eL.default.button.withConfig({displayName:"styled__Confirm",componentId:"sc-1c163933-3"})` + display: flex; + padding: 4px 8px; + cursor: pointer; + background: #5cc170; + border: none; + margin-right: 5px; + border-radius: 5px; + font-weight: 500; + font-size: 14px; + color: #fff; + + &:focus { + outline: 0; + } + + &:hover { + color: #fff; + background: #4da35e; + } +`,cD=eL.default.div.withConfig({displayName:"styled__Actions",componentId:"sc-1c163933-4"})` + display: flex; + flex-direction: row; + justify-content: flex-end; +`,cT=eL.default.p.withConfig({displayName:"styled__BodyText",componentId:"sc-1c163933-5"})` + font-size: 14px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#666"}; +`,c$=eL.default.div.withConfig({displayName:"styled__FlexContainer",componentId:"sc-1c163933-6"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 5px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,cP=eL.default.h1.withConfig({displayName:"styled__Header",componentId:"sc-1c163933-7"})` + font-weight: 500; + font-size: 16px; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,cF=eL.default.button.withConfig({displayName:"MenuButton",componentId:"sc-760a1ace-0"})` + display: flex; + align-items: center; + width: 100%; + min-height: 28px; + padding: var(--menu-item-padding); + color: ${e=>e.$warning?"#EB6461":e.theme.appColors.hex(10)}; + white-space: normal; + ${e1.UiTypography.sm}; + line-height: 1; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(70)}; + } + + & span { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + + svg { + transform: var(--menu-item-icon-scale); + margin-right: var(--menu-item-gap); + flex-shrink: 0; + align-self: flex-start; + + &.caret { + margin-right: -4px; + } + } +`,cA=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(cF,o.props,t)},cR=function(e){let{onSelect:t}=e,[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1}),l=ev.useRef(null),r=ev.useRef(null),o=ev.useCallback(()=>{l.current?.focus()},[]);(0,eI.usePopupEvents)({state:a,onCollapse:o});let i=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:a,placement:"bottom-start"}),s=(0,eI.useMenuButton)({dispatch:n,ref:l,state:a}),d=ev.useCallback(e=>{if("Activate"===e.type){let{value:a}=e.payload;null!=a&&t(a)}n({type:"Collapse"})},[t]);return ev.createElement(ev.Fragment,null,ev.createElement(cS,{className:"btn-cancel",type:"button",...s.props},ev.createElement(eY.Z,{id:"general.remind_me_in_a_day",defaultMessage:"Remind me in a day"}),ev.createElement(cM,null)),a.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:n,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(cC,{initialFocus:i.initialFocus,loop:!0},ev.createElement(cA,{value:"day"},ev.createElement(eY.Z,{id:"general.remind_me_in_a_day",defaultMessage:"Remind me in a day"})),ev.createElement(cA,{value:"week"},ev.createElement(eY.Z,{id:"general.remind_me_in_a_week",defaultMessage:"Remind me in a week"})),ev.createElement(cA,{value:"month"},ev.createElement(eY.Z,{id:"general.remind_me_in_a_month",defaultMessage:"Remind me in a month"})),ev.createElement(cA,{value:"never"},ev.createElement(eY.Z,{id:"general.never",defaultMessage:"Never"}))))))},cj={day:{value:1,unit:"days"},week:{value:1,unit:"weeks"},month:{value:1,unit:"months"},never:{value:1,unit:"never"}},cO=function(e){let{headerContent:t,bodyContent:a,onConfirm:n,onSelect:l}=e;return ev.createElement(c$,null,ev.createElement(cP,null,t),ev.createElement(cT,null,a),ev.createElement(cD,null,ev.createElement(cR,{onSelect:l}),ev.createElement(cI,{className:"btn-confirm",onClick:n,type:"button"},ev.createElement(eY.Z,{id:"general.confirm",defaultMessage:"Confirm"}))))},cU=function(e){let{headerContent:t,bodyContent:a,onConfirm:n,onToggle:l,isOpen:r}=e,[o,i]=ev.useState(null),s=ev.useCallback(()=>{l(cj[o??"day"]??cj.day)},[o,l]);return ev.createElement(eI.ModalDialog,{isOpen:r,close:s},e=>{let{exit:l}=e;return ev.createElement(cO,{headerContent:t,bodyContent:a,onConfirm:n,onSelect:e=>{i(e),l()}})})},cZ=(0,la.ZP)` + mutation UpdateCurrentUserTimezoneMutation($input: UserInput!) { + me: updateMe(input: $input) { + id + timezone + } + } +`,cL=(0,d9.oM)({name:"dialogs.changeTimezone",initialState:{isOpen:!1},reducers:{toggleChangeTimezoneDialog:e=>({isOpen:!e.isOpen})}}),cB=(0,e$.connect)(function(e){return e.dialogs.changeTimezone})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=(0,eK.Z)(),l=ev.useMemo(()=>cc().tz.guess()||null,[]),r=(0,eB.a)(sN),o=r.data?.me??null,[i,s]=(0,cs.D)(cZ),d=ev.useCallback(e=>{null!=o&&i({variables:{input:{timezone:e}},optimisticResponse:{__typename:"Mutation",me:{__typename:"CurrentUser",id:o.id,timezone:e}}})},[o,i]),[c,m]=eQ("prevChangeTimezonePrompt",{nextReminderAt:null,guessedTimezone:null});ev.useEffect(()=>{if(null==o||s.loading)return;if(null==o.timezone){d(l??cw);return}if(t||null==l||l===o.timezone)return;let e=null!=c.nextReminderAt?cc()(c.nextReminderAt):null;if(null==e||e.isBefore(cc()())){a(cL.actions.toggleChangeTimezoneDialog());return}if(null==c.guessedTimezone)return;let n=cc()().tz(c.guessedTimezone).utcOffset(),r=cc()().tz(l).utcOffset();c.guessedTimezone!==l&&n!==r&&a(cL.actions.toggleChangeTimezoneDialog())},[o,a,l,t,s.loading,c,d]),ev.useEffect(()=>{t&&m((0,es.ZP)(c,e=>(e.guessedTimezone=l,e)))},[l,t,c,m]),ev.useEffect(()=>{let e=s.data?.me?.timezone??null;null!=e&&a(ck({timezone:e}))},[a,s.data]);let u=ev.useCallback(e=>{let{value:t,unit:n}=e,l=null;null!=o&&(l="never"===n?"never":cc()().add(t,n).toISOString(),m((0,es.ZP)(c,e=>(e.nextReminderAt=l,e)))),a(cL.actions.toggleChangeTimezoneDialog())},[o,a,c,m]),p=ev.useCallback(()=>{null!=l&&d(l),m((0,es.ZP)(c,e=>(e.guessedTimezone=l,e))),a(cL.actions.toggleChangeTimezoneDialog())},[a,l,c,m,d]);return t&&null!=l?ev.createElement(cU,{headerContent:n.formatMessage({id:"general.timezone_settings",defaultMessage:"Different time zone detected"}),bodyContent:n.formatMessage({id:"general.timezone_change_to",defaultMessage:"Change time zone to {guessedTimezone}?"},{guessedTimezone:l}),onConfirm:p,onToggle:u,isOpen:t}):null});a(94356),function(e){e.AddonFile="file",e.Chat="chat",e.Comment="comment"}(D||(D={}));let cz={strings:{companionError:"Import service unavailable. Please try again later."}},cV="ADD_NODE",cq="DELETE_NODE",cW="@@taskade/node/DELETE_NODES",cH="FOCUS_NODE",cG="@@taskade/node/DUPLICATE_NODE",cK="INDENT_NODE",cY="OUTDENT_NODE",cQ="SET_NODE_TEXT_CHANGE",cJ="TOGGLE_COMPLETE",cX="@@taskade/node/TOGGLE_COMPLETE_SUBTREE",c0="TOGGLE_COLLAPSE",c1="@@taskade/node/MOVE_NODES",c2="@@taskade/node/TOGGLE_COLLAPSE_ALL",c5="@@taskade/node/TOGGLE_COMPLETE_ALL",c3="TOGGLE_MARK",c4="@@taskade/node/TOGGLE_LINK",c6="@@taskade/node/INSERT_AUTOCOMPLETE_HYPERLINK",c8="@@taskade/node/INSERT_AUTOCOMPLETE_MENTION",c7="@@taskade/node/INSERT_AUTOCOMPLETE_TAG",c9="@@taskade/node/INSERT_AUTOCOMPLETE_TEXT",me="UPDATE_CONTENTS",mt="SET_FORMAT",ma="@@taskade/node/PUT_NOTE",mn="@@taskade/node/UPDATE_ATTACHMENTS",ml="@@taskade/node/CREATE_ATTACHMENT",mr="@@taskade/node/DELETE_ATTACHMENT",mo="@@taskade/node/EDIT_ATTACHMENT",mi="@@taskade/node/ADD_ATTACHMENT",ms="@@taskade/node/REMOVE_ATTACHMENT",md="@@taskade/node/UPDATE_ATTACHMENT",mc="@@taskade/node/UPLOAD_FILE_ATTACHMENT",mm="@@taskade/node/UPLOAD_FILE_COMMENT",mu="@@taskade/node/SET_COMMENT_UI_IS_ACTIVE",mp="@@taskade/node/FETCH_COMMENTS",mg="@@taskade/node/SET_COMMENTS_FETCH_STATUS",mf="@@taskade/node/SET_COMMENTS_UPLOAD_STATUS",mh="@@taskade/node/SET_COMMENTS",my="@@taskade/node/ADD_UPLOADING_ATTACHMENT",mb="@@taskade/node/REMOVE_UPLOADING_ATTACHMENT",mv="@@taskade/node/UNFOCUS_NODE",mk="@@taskade/node/CLEAR_RECUR_NODE_IDS",mE="@@taskade/node/CLEAR_COMPLETED_NODE_IDS",mx="@@taskade/node/RESET_ATTACHMENTS",m_="@@taskade/node/SET_NOTE_OPEN_NODE_ID";function mw(e){return{type:me,payload:{contents:e}}}function mN(e,t){return{type:cQ,payload:{nodeID:e,change:t}}}function mC(e,t){return{type:cY,payload:{currentID:e,ancestors:t}}}function mM(e,t,a){return{type:cq,payload:{currentID:e,ancestors:t,adopterID:a}}}function mS(e,t){return{type:cW,payload:{documentID:e,nodeIDs:t}}}function mI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2?arguments[2]:void 0;return{type:cH,payload:{focusID:e,caretPosition:t,unfocusID:a}}}function mD(e,t){return{type:mv,payload:{documentID:e,unfocusID:t}}}function mT(e,t){return{type:cG,payload:{currentID:e,ancestors:t}}}function m$(e,t){return{type:cK,payload:{currentID:e,ancestors:t}}}function mP(){for(var e=arguments.length,t=Array(e),a=0;a2&&void 0!==arguments[2]?arguments[2]:null;return{type:c3,payload:{nodeID:e,type:t,data:a}}}function mO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:c4,payload:{nodeID:e,data:t}}}function mU(e,t,a){return{type:c9,payload:{nodeID:e,text:t,range:a}}}function mZ(e,t,a){return{type:mt,payload:{nodeID:e,type:t,value:a}}}function mL(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{type:ml,payload:{documentID:e,attachment:t,callback:a,callbackIsGenerator:n}}}function mB(e,t){return{type:mr,payload:{documentID:e,which:t}}}function mz(e,t){return{type:mi,payload:{attachment:e,info:t}}}function mV(e){return{type:ms,payload:{which:e}}}function mq(e){return{type:md,payload:{attachments:e}}}function mW(e,t){return{type:my,payload:{nodeID:e,uploadID:t}}}function mH(e,t){return{type:mb,payload:{nodeID:e,uploadID:t}}}function mG(e,t,a){return{type:mc,payload:{documentID:e,nodeID:t,files:a}}}function mK(e,t){return{type:mu,payload:{nodeID:e,isActive:t}}}function mY(e,t){return{type:mg,payload:{nodeID:e,fetchStatus:t}}}function mQ(e,t){return{type:mf,payload:{nodeID:e,uploadStatus:t}}}function mJ(e){return{type:m_,payload:{nodeId:e}}}var mX=a(96368);let m0="YYYY-MM-DD",m1="file",m2="comment";(function(e){e.Assignee="assignee",e.Comment="comment",e.Date="date",e.Embed="embed",e.File="file"})(T||(T={})),function(e){e.Computer="computer",e.Cloud="cloud"}($||($={}));let m5="text",m3="file",m4="You may add up to 12 attachments per list item.";mX.RRule.DAILY,mX.RRule.WEEKLY,mX.RRule.MONTHLY,mX.RRule.YEARLY,mX.RRule.SU,mX.RRule.MO,mX.RRule.TU,mX.RRule.WE,mX.RRule.TH,mX.RRule.FR,mX.RRule.SA;var m6=a(67188),m8=a(18792),m7=a(83651),m9=a(38318),ue=a(60623),ut=a(80233),ua=a(52554),un=a(14160),ul=a(62580),ur=a(258);function uo(e,t){let a,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",l=new FormData;for(let[r,o]of Object.entries(t.fields))"key"===r?(a=`${o}/${e.name||n}`,l.append(r,a)):l.append(r,o);return l.append("file",e),{formData:l,s3ObjectKey:a}}var ui=a(54061),us=a.n(ui);let ud="https://companion.taskade.com",uc=eL.default.div.withConfig({displayName:"UploadDashboard__FlexContainer",componentId:"sc-44df7ad2-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 24px 30px; + background: ${e=>e.theme.backgroundColorHex}; +`,um=function(e){let{exit:t,generateUploadBody:a,onBeforeGetUploadParameters:n,onFileRemoved:l,onUploadError:r,onUploadSuccess:o,restrictions:i}=e,s=(0,eL.useTheme)(),d=ev.useMemo(()=>new Map,[]),c=ev.useCallback(()=>t(),[t]),m=ev.useCallback(async e=>{var t,l;null!=n&&n(e);let r=a(e);if(null==r)throw Error("Invalid upload type.");let o=await fetch("/web-api/uploads/request-data",{method:"POST",body:r,headers:{"Content-Type":"application/json"},credentials:"same-origin"});if(!o.ok){let e="There was an error uploading the file. Please try again later.";try{e=(await o.json()).message}catch(t){throw Error(e)}throw Error(e)}let i=await o.json(),s=(t=i.payload.s3Policy,l=e.name,us()(t.fields,(e,t,a)=>"key"===a?{...e,[a]:`${t}/${l}`}:{...e,[a]:t},{}));return d.set(e.id,{upload:i}),{method:"POST",url:i.payload.s3URL,headers:{},fields:s}},[a,n,d]),[u]=ev.useState(()=>new m9.Z({locale:cz,restrictions:i}).use(m8.Z,{getUploadParameters:m}).use(m7.Z,{companionUrl:ud}).use(ue.Z,{companionUrl:ud}).use(ut.Z,{companionUrl:ud}).use(ua.Z,{companionUrl:ud}).use(m6.Z).use(ur.Z,{mirror:!1,facingMode:"user",showRecordingLength:!0}).use(ul.Z).on("upload-success",async e=>{if(null==e)return;let t=d.get(e.id);d.set(e.id,{...t,successful:!0});let{awsUploadAPIBaseURL:a,token:n}=t.upload.payload,l=JSON.stringify({body:{s3ObjectKey:e.meta.key}}),r=await fetch(`${a}/uploads`,{method:"POST",headers:{"uploads-authorization-jwt":n,"Content-Type":"application/json"},body:l}),i=await r.json();d.delete(e.id),null!=o&&o(e,i)}).on("upload-error",async e=>{null!=e&&(d.delete(e.id),null!=r&&r(e))}).on("file-removed",async e=>{let t=d.get(e.id);null==t||t.successful||(d.delete(e.id),null!=l&&l(e))}));return ev.createElement(uc,null,ev.createElement(un.A,{doneButtonHandler:c,uppy:u,plugins:["GoogleDrive","Dropbox","Instagram","Box","Webcam","Audio","ScreenCapture"],theme:s?.isNightMode?"dark":"light"}))},uu=function(e){let{documentId:t,exit:a,nodeId:n,restrictions:l}=e,r=(0,e$.useDispatch)(),o=ev.useCallback(e=>JSON.stringify({type:"attachment",documentID:t,nodeID:n,includeS3Policy:"true",filename:e.name,filesize:e.size}),[t,n]),i=ev.useCallback(e=>{r(mW(n,e.id))},[r,n]),s=ev.useCallback((e,t)=>{let a={documentID:t.documentID,nodeID:t.nodeID,spaceID:t.spaceID},l={nodeID:t.nodeID,data:{type:T.File,file:t.data,info:a}};r(mL(t.documentID,l,function(){r(mH(n,e.id))}))},[r,n]),d=ev.useCallback(e=>r(mH(n,e.id)),[r,n]),c=ev.useCallback(e=>r(mH(n,e.id)),[r,n]);return ev.createElement(um,{exit:a,generateUploadBody:o,onBeforeGetUploadParameters:i,onUploadError:d,onUploadSuccess:s,onFileRemoved:c,restrictions:l})},up=(0,la.ZP)` + fragment BasicUserFields on User { + id + default_name + display_name + handle + initials + timezone + avatars_v2 { + small { + ldpi { + url + } + mdpi { + url + } + } + } + } +`,ug=(0,la.ZP)` + query ChatGetHistory($id: ID!, $last: Int!, $before: String, $shareToken: ShareTokenInput) { + document(id: $id, shareToken: $shareToken) { + id + role { + project + workspace + } + chatMessages(last: $last, before: $before) { + totalCount + edges { + cursor + node { + at + id + user { + ...BasicUserFields + } + + body { + ... on ChatMessageFileBody { + filename + fileUrls { + preview + view + download + } + file @client + lambdaResponse @client + } + ... on ChatMessageTextBody { + value + editedAt + } + ... on ChatMessageEventBody { + data { + eventType + scope + } + } + ... on ChatMessageActivityBody { + data { + ... on ChatMessageActivityDocumentCompletedData { + type + scope + } + ... on ChatMessageActivityNodeCompletedData { + type + scope + nodes { + id + text + url + } + } + } + } + } + } + } + pageInfo { + startCursor + endCursor + hasNextPage + hasPreviousPage + } + } + } + } + ${up} +`,uf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MeHandleAvatarQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"default"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]};function uh(e){let t=(0,ll.x)(),a=(0,eB.a)(uf),n=a.data?.me,l={id:e,last:10,before:null};return(0,ev.useCallback)(e=>{if(null==n)return;let a={__typename:"User",id:n.id,handle:n.handle,default_name:n.default_name,initials:n.initials,display_name:n.display_name,timezone:n.timezone,avatars_v2:n.avatars_v2},r={id:(0,ld.Z)(),user:a,at:"",body:e,__typename:"ChatMessage"},o=t.readQuery({query:ug,variables:l});null!=o&&t.writeQuery({query:ug,variables:l,data:{document:{...o.document,chatMessages:{...o.document.chatMessages,edges:[...o.document.chatMessages.edges,{cursor:"",node:r,__typename:"ChatMessageEdge"}]}}}})},[t,l,n])}function uy(e){let t=uh(e);return(0,ev.useCallback)(e=>{t(e)},[t])}let ub=function(e){let{documentId:t,exit:a,restrictions:n}=e,l=uy(t??""),r=ev.useCallback(e=>JSON.stringify({type:"message",documentID:t,includeS3Policy:"true",filename:e.name,filesize:e.size}),[t]),o=ev.useCallback((e,t)=>{l({__typename:"ChatMessageFileBody",filename:e.name,fileUrls:{__typename:"FileUrls",view:"",preview:"",download:""},file:null,lambdaResponse:t.data})},[l]);return ev.createElement(um,{exit:a,generateUploadBody:r,onUploadSuccess:o,restrictions:n})},uv="FETCH_STATUS_INITIAL",uk="FETCH_STATUS_LOADED",uE="FETCH_STATUS_LOADING",ux="FETCH_STATUS_ERROR",u_=function(e){let{documentId:t,exit:a,nodeId:n,restrictions:l}=e,r=(0,e$.useDispatch)(),o=ev.useCallback(e=>JSON.stringify({type:"comment",documentID:t,nodeID:n,includeS3Policy:"true",filename:e.name,filesize:e.size}),[t,n]),i=ev.useCallback(()=>r(mQ(n,uE)),[r,n]),s=ev.useCallback((e,t)=>{let a={documentID:t.documentID,nodeID:t.nodeID,spaceID:t.spaceID},l={nodeID:t.nodeID,data:{type:T.Comment,body:{type:m3,data:{file:t.data}},info:a}};r(mL(t.documentID,l,function(){r(mQ(n,uv))}))},[r,n]),d=ev.useCallback(()=>r(mQ(n,uv)),[r,n]),c=ev.useCallback(()=>r(mQ(n,uv)),[r,n]);return ev.createElement(um,{exit:a,generateUploadBody:o,onBeforeGetUploadParameters:i,onUploadError:d,onUploadSuccess:s,onFileRemoved:c,restrictions:l})},uw=function(e){let{documentId:t,uploadType:a}=e;if(null==t)return null;switch(a){case D.AddonFile:return ev.createElement(uu,e);case D.Chat:return ev.createElement(ub,e);case D.Comment:return ev.createElement(u_,e);default:return null}},uN=(0,d9.oM)({name:"dialogs.cloudUpload",initialState:{isOpen:!1,documentId:null,nodeId:null,restrictions:null,uploadType:null},reducers:{toggleCloudUploadDialog(e,t){let a=!e.isOpen;if(a&&null!=t&&null!=t.payload){let{documentId:e,nodeId:n,restrictions:l,uploadType:r}=t.payload;return{isOpen:a,documentId:e,nodeId:n,restrictions:l,uploadType:r}}return{isOpen:a,documentId:null,nodeId:null,restrictions:null,uploadType:null}}}}),uC=(0,e$.connect)(function(e){return e.dialogs.cloudUpload})(function(e){let{isOpen:t,documentId:a,nodeId:n,restrictions:l,uploadType:r}=e,o=(0,e$.useDispatch)(),i=ev.useCallback(()=>{o(uN.actions.toggleCloudUploadDialog())},[o]);return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:i},e=>{let{exit:t}=e;return ev.createElement(uw,{documentId:a,nodeId:n,restrictions:l,uploadType:r,exit:t})}):null});var uM=a(42441),uS=a.n(uM),uI=a(57981);function uD(e,t){if(null!=t){let{contexts:a,extras:n,level:l,tags:r,user:o}=t;if(null!=a)for(let[t,n]of Object.entries(a))e.setContext(t,n);null!=n&&e.setExtras(n),null!=l&&e.setLevel(l),null!=r&&e.setTags(r),null!=o&&e.setUser(o)}}function uT(e,t,a){let n=(0,ei.getStatusCodeFromError)(e)??ei.StatusCode.INTERNAL_SERVER_ERROR,l=n>=500?"error":"warning";return t.withScope(n=>{n.setLevel(l),uD(n,(0,ei.getSentryScopeFromError)(e)),uD(n,a),t.captureException(e)}),{level:l,statusCode:n}}let u$=null,uP=0,uF=0;function uA(){try{if("undefined"==typeof document)return null;return document.cookie}catch(e){return null}}let uR="@@taskade/dialogs/TOGGLE_COMMAND_MODAL_DIALOG";function uj(){return{type:uR,payload:{}}}let uO=(0,d9.oM)({name:"dialogs.quickAdd",initialState:{isOpen:!1},reducers:{toggleQuickAddDialog:(e,t)=>e.isOpen?{isOpen:!1}:null==t.payload?{isOpen:!0}:{calendarState:{...t.payload},isOpen:!0}}});(function(e){e[e.ACTIONS=0]="ACTIONS",e[e.RECENT=1]="RECENT",e[e.PROJECTS=2]="PROJECTS",e[e.ALL=3]="ALL"})(P||(P={})),function(e){e[e.ACTION=0]="ACTION",e[e.PROJECT=1]="PROJECT",e[e.SEARCH_ALL_PROJECTS=2]="SEARCH_ALL_PROJECTS"}(F||(F={}));let uU=[{id:"quickadd",iconName:"plus_invite",messageDescriptor:(0,te.Em)({id:"general.quickadd",defaultMessage:"Quick Add"})}];function uZ(e){switch(e.type){case P.ACTIONS:case P.RECENT:case P.PROJECTS:case P.ALL:return e.items.length;default:throw Error(`invalid SectionType on section ${e}`)}}function uL(e,t){let a=t;for(let t of e){let e=uZ(t);if(ae.theme.textColors.hex(10)}; +`,uG=eL.default.div.withConfig({displayName:"SearchInput__Container",componentId:"sc-cba17f-1"})` + padding: 1em; + flex: 1; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(80)}; + width: 100%; + display: flex; + align-items: center; +`,uK=(0,eL.default)(lT.jI).withConfig({displayName:"SearchInput__SearchIcon",componentId:"sc-cba17f-2"})` + path { + stroke: ${e=>e.theme.appColors.hex(70)}; + } +`,uY=function(e){let{value:t,onChange:a,onUpKey:n,onDownKey:l,onEscapeKey:r,onEnterKey:o}=e,i=(0,eK.Z)(),s=(0,ev.useRef)(null);(0,ev.useEffect)(()=>{s.current?.focus()},[]);let d=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()};return ev.createElement(uG,null,ev.createElement(uK,null),ev.createElement(uH,{ref:s,placeholder:i.formatMessage({id:"general.search_with_ellipsis",defaultMessage:"Search…"}),value:t,onChange:e=>{a(e.target.value)},onKeyDown:e=>{if(null!=om(e.nativeEvent)){d(e);return}({ArrowUp:n,ArrowDown:l,Enter:o,Escape:r,Backspace:d,a:e=>e.metaKey&&d(e),k:e=>e.metaKey&&r()})[e.key]?.(e)}}),ev.createElement(eI.Shortcut.Combo,{fontSize:"16px",padding:"6px",gap:"5px"},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"K")))};function uQ(e){return ev.createElement("b",null,e)}let uJ=function(e){let{query:t,item:{selected:a,action:n},exit:l}=e;return ev.createElement(uX,{selected:a,onClick:()=>{n?.(),l()}},ev.createElement("span",null,t?ev.createElement(eY.Z,{id:"general.search_all_projects_for_query",defaultMessage:'Search all projects, comments and workspaces for "{query}"',values:{query:t,b:uQ}}):ev.createElement(eY.Z,{id:"general.search_all_projects",defaultMessage:"Search all projects, comments and workspaces"})),ev.createElement(u0,null,ev.createElement(eI.Shortcut.Key,{fontSize:"10px",padding:"3px"},eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,{fontSize:"10px",padding:"3px"},"Enter")))},uX=eL.default.div.withConfig({displayName:"SearchAllProjectsItem__Container",componentId:"sc-15e2aac0-0"})` + height: 42px; + ${e1.UiTypography.sm}; + padding: 10px 20px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + cursor: pointer; + color: ${e=>e.theme.textColors.hex("10")}; + background-color: ${e=>e.selected?e.theme.appColors.hex(80):"none"}; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,u0=eL.default.div.withConfig({displayName:"SearchAllProjectsItem__Keys",componentId:"sc-15e2aac0-1"})` + display: flex; +`,u1=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-5cad2521-0"})` + position: relative; + display: grid; + grid-template-columns: 30px auto 100px; + align-items: center; + padding: 10px 20px; + ${e1.UiTypography.sm}; + cursor: pointer; + color: ${e=>e.theme.textColors.hex(10)}; + background-color: ${e=>e.$selected?e.theme.appColors.hex(80):"none"}; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + svg { + display: flex; + flex-shrink: 0; + margin-right: 12px; + transform: translateX(-2px); + path { + stroke: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } +`,u2=eL.default.div.withConfig({displayName:"styled__EmojiWrapper",componentId:"sc-5cad2521-1"})` + display: flex; + width: 20px; + height: 20px; + justify-content: center; + font-size: 18px; + line-height: 21px; + margin-right: var(--menu-item-gap); +`,u5=eL.default.span.withConfig({displayName:"styled__ItemTitle",componentId:"sc-5cad2521-2"})` + display: inline; + align-items: center; + width: 100%; + word-break: break-word; +`,u3=(0,eL.default)(eI.Shortcut.Key).withConfig({displayName:"styled__Key",componentId:"sc-5cad2521-3"})` + position: absolute; + right: 20px; + margin: 0 2px; + transition: opacity 120ms ease-in-out, transform 120ms ease-in-out; + + ${e=>e.$selected?(0,eL.css)` + transform: scale(1); + opacity: 1; + `:(0,eL.css)` + transform: scale(0.8); + opacity: 0; + `}; +`,u4=eL.default.span.withConfig({displayName:"styled__Part",componentId:"sc-5cad2521-4"})` + font-weight: ${e=>e.$bold?"bold":"normal"}; +`,u6=eL.default.div.withConfig({displayName:"styled__ProgressBarWrapper",componentId:"sc-5cad2521-5"})` + display: flex; +`,u8=function(e){let{item:{item:t,selected:a,action:n},query:l,exit:r}=e,o=(0,eK.Z)().formatMessage(t.messageDescriptor),i=(0,sX.escapeStringRegExp)(l||""),s=ev.useMemo(()=>o.split(RegExp(`(${i})`,"gi")),[o,i]);return ev.createElement(u1,{$selected:a,onClick:()=>{n?.(),r?.()}},ev.createElement(tn.Icon,{icon:t.iconName}),ev.createElement(u5,null,ts()(l)||null==l?o:s.map((e,t)=>ev.createElement(u4,{key:t,$bold:e.toLowerCase()===l.toLowerCase()},e))),ev.createElement(u3,{$selected:a,fontSize:"10px",padding:"3px"},"Enter"))},u7=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__Title",componentId:"sc-61c4e9ed-0"})` + padding: 5px 20px 5px; +`,u9=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-61c4e9ed-1"})``,pe=(0,eL.default)(u9).withConfig({displayName:"ActionSection__StyledContainer",componentId:"sc-9cce8e53-0"})` + margin-bottom: 10px; +`,pt=function(e){let{query:t,section:{items:a},exit:n}=e;return ev.createElement(pe,null,ev.createElement(u7,null,ev.createElement(eY.Z,{id:"general.actions",defaultMessage:"Actions"})),a.map(e=>ev.createElement(u8,{query:t,key:e.item.id,item:e,exit:n})))},pa=eL.default.div.withConfig({displayName:"ProgressBar__BarContainer",componentId:"sc-56b58197-0"})` + height: 7px; + width: 60px; + border-radius: 20px; + overflow: hidden; + text-indent: -10000px; + width: 120px; + position: relative; + + // NOTE: (andrew@taskade.com) To force browsers to print the progress bar. Default behaviour omits the printing of pure css elements. + print-color-adjust: exact; + -webkit-print-color-adjust: exact; + -moz-print-color-adjust: exact; + + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(70):e.theme.primaryColorScheme?.alpha10}; +`,pn=eL.default.div.withConfig({displayName:"ProgressBar__Bar",componentId:"sc-56b58197-1"})` + display: block; + height: 6px; + width: 0%; + background: ${e=>e.theme.primaryColorScheme?.base}; + border-radius: 10px; + + background: ${e=>e.theme.primaryColorScheme?.base} !important; + transition: width 0.5s ease-in-out; + + @keyframes animate-progress-bar { + 0% { + width: 0%; + } + 100% { + } + } + @-webkit-keyframes animate-progress-bar { + 0% { + width: 0%; + } + 100% { + } + } + + animation: animate-progress-bar 1s 1; + animation-delay: 10s; +`,pl=function(e){let{percentCompleted:t}=e,a=e.showTooltip??!1,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({placement:"bottom",referenceElementRef:r,arrowElementRef:o,popperElementRef:i,visible:n}),m=ev.useCallback(()=>{l(a&&t>0)},[l,a,t]),u=ev.useCallback(()=>{l(!1)},[l]);return ev.createElement(ev.Fragment,null,ev.createElement(pa,{...c,className:og()("progress-bar my-2",{show:t>0}),onMouseEnter:m,onMouseLeave:u},ev.createElement(pn,{className:"bar",style:{width:`${t}%`}})),n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"general.percent_completed",defaultMessage:"{percentCompleted}% Completed",values:{percentCompleted:t}})))},pr=function(e){let{item:{project:t,selected:a,action:n},query:l,exit:r}=e,o=t.info.stats.completedCount/t.info.stats.totalCount*100,i=nQ(t),s=t?.info?.title||"Untitled",d=(0,sX.escapeStringRegExp)(l||""),c=ev.useMemo(()=>s.split(RegExp(`(${d})`,"gi")),[s,d]),m=t?.space?.color?{primaryColor:t.space.color}:void 0;return ev.createElement(eI.ThemeProvider,{theme:m},ev.createElement(u1,{$selected:a,onClick:()=>{n?.(),r?.()}},null!=i?ev.createElement(u2,null,i):ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement(u5,null,ts()(l)?s:c.map((e,t)=>ev.createElement(u4,{key:t,$bold:e.toLowerCase()===l.toLowerCase()},e))),ev.createElement(u3,{$selected:a,fontSize:"10px",padding:"3px"},"Enter"),!a&&ev.createElement(u6,null,ev.createElement(pl,{percentCompleted:o}))))},po=(0,eL.default)(u9).withConfig({displayName:"ProjectsSection__StyledContainer",componentId:"sc-fcdbfdcf-0"})` + margin-top: 10px; +`,pi=function(e){let{query:t,section:{items:a},exit:n}=e;return ev.createElement(po,null,ev.createElement(u7,null,ev.createElement(eY.Z,{id:"general.projects",defaultMessage:"Projects"})),a.map(e=>e.type===F.PROJECT?ev.createElement(pr,{query:t,key:e.project.id,item:e,exit:n}):null))},ps=function(e){let{query:t,section:{items:a},exit:n}=e;return ev.createElement(u9,null,ev.createElement(u7,null,ev.createElement(eY.Z,{id:"general.recent",defaultMessage:"Recent"})),a.map(e=>ev.createElement(pr,{query:t,key:e.project.id,item:e,exit:n})))},pd=eL.default.div.withConfig({displayName:"Sections__Container",componentId:"sc-6ab5f705-0"})` + flex: 1; + width: 100%; + display: flex; + flex-direction: column; + padding: 15px 0 20px; +`,pc=eL.default.div.withConfig({displayName:"Sections__Cover",componentId:"sc-6ab5f705-1"})` + display: flex; + flex-direction: column; + width: 100%; + min-height: 240px; + align-items: center; + justify-content: center; +`,pm=eL.default.span.withConfig({displayName:"Sections__CoverText",componentId:"sc-6ab5f705-2"})` + max-width: 90%; + text-align: center; + word-break: break-all; + color: ${e=>e.theme.textColors.hex(50)}; +`,pu=(0,eL.default)(lT.DD).withConfig({displayName:"Sections__NoResultsIcon",componentId:"sc-6ab5f705-3"})` + margin-bottom: 10px; + path { + fill: ${e=>e.theme.appColors.hex(60)}; + } +`,pp=(0,eL.default)(lT.pF).withConfig({displayName:"Sections__ErrorIcon",componentId:"sc-6ab5f705-4"})` + margin-bottom: 10px; + path { + fill: ${e=>e.theme.appColors.hex(60)}; + } +`,pg=function(e){let{query:t,result:{sections:a,backgroundLoading:n,loading:l,error:r},exit:o}=e;return l?ev.createElement(eI.Spinner,{height:240}):r?ev.createElement(pc,null,ev.createElement(pp,null),ev.createElement(pm,null,r.toString())):null!=a&&a.length>1?ev.createElement(pd,null,a.map((e,a)=>{switch(e.type){case P.ACTIONS:return ev.createElement(pt,{key:a,query:t,section:e,exit:o});case P.RECENT:return ev.createElement(ps,{key:a,query:t,section:e,exit:o});case P.PROJECTS:return ev.createElement(pi,{key:a,query:t,section:e,exit:o});case P.ALL:return ev.createElement(uJ,{key:a,query:t,item:e.items[0],exit:o})}}),n&&ev.createElement(eI.Spinner,{height:42})):ts()(t)?ev.createElement(ev.Fragment,null,ev.createElement(pc,null,ev.createElement(pu,null),ev.createElement(pm,null,ev.createElement(eY.Z,{id:"general.command_modal_empty_state_message",defaultMessage:"Hello! \uD83D\uDC4B Search and jump to any projects."}))),ev.createElement(pd,null,a?.map((e,a)=>{if(e.type===P.ALL)return ev.createElement(uJ,{key:a,query:t,item:e.items[0],exit:o})}))):ev.createElement(ev.Fragment,null,ev.createElement(pc,null,ev.createElement(pu,null),ev.createElement(pm,null,`No results for "${t}"`)),ev.createElement(pd,null,a?.map((e,a)=>{if(e.type===P.ALL)return ev.createElement(uJ,{key:a,query:t,item:e.items[0],exit:o})})))},pf=eL.default.div.withConfig({displayName:"BasicDialogBody__FixedContainer",componentId:"sc-230aa510-0"})` + height: 480px; + display: flex; + flex-direction: column; + background: none; +`,ph=eL.default.div.withConfig({displayName:"BasicDialogBody__OuterContainer",componentId:"sc-230aa510-1"})` + min-width: 500px; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,py=eL.default.div.withConfig({displayName:"BasicDialogBody__Container",componentId:"sc-230aa510-2"})` + flex: 1; + display: flex; + flex-direction: column; + width: 100%; + align-items: center; + justify-content: center; + pointer-events: all; +`,pb=function(e){let{exit:t}=e,[a,n]=ev.useState(""),l=(0,eF.k6)(),r=function(e){let[t]=(0,uV.Z)(e.query,333,{leading:!0}),a=(0,eF.k6)(),{data:n,loading:l,error:r}=(0,eB.a)(uW,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),o=(0,ev.useMemo)(()=>{if(null==n)return null;let e=n.recentProjects?.edges?.map(e=>e.node);if(null==e)return null;let l=(ts()(t)?e:new to.Z(e,{shouldSort:!0,findAllMatches:!0,threshold:.4,keys:["info.title"]}).search(t).map(e=>{let{item:t}=e;return t})).map(e=>({type:F.PROJECT,selected:!1,action:()=>a.push(`/d/${e.id}`),project:e}));return{type:P.RECENT,items:uz()(l,5)}},[n,t,a]);return(0,ev.useMemo)(()=>({section:o,backgroundLoading:l,loading:null==o&&l,error:r}),[o,l,r])}({query:a}),o=function(e){let[t]=(0,uV.Z)(e.query,333),a=(0,eF.k6)(),{data:n,loading:l,error:r}=(0,eB.a)(uq,{variables:{query:t},skip:ts()(t),onCompleted:()=>{}}),o=(0,ev.useMemo)(()=>{let e=n?.allProjects?.edges??[];if(0===e.length)return null;let t=e.map(e=>e.node);if(null==t||ts()(t))return null;let l=t.map(e=>({type:F.PROJECT,selected:!1,action:()=>a.push(`/d/${e.id}`),project:e}));return{type:P.PROJECTS,items:[...uz()(l,5)]}},[n,a]);return(0,ev.useMemo)(()=>({section:o,backgroundLoading:l,loading:null==o&&l,error:r}),[o,l,r])}({query:a}),i=function(e){let{query:t,exit:a}=e,n=(0,e$.useDispatch)(),l=(0,eK.Z)(),r=ev.useCallback(e=>{"quickadd"===e&&(a(),n(uO.actions.toggleQuickAddDialog()))},[n,a]),o=ev.useMemo(()=>{let e;if(ts()(t))e=uU;else{let a=uU.map(e=>({...e,translatedMessage:l.formatMessage(e.messageDescriptor)}));e=new to.Z(a,{shouldSort:!0,findAllMatches:!0,threshold:.4,keys:["translatedMessage","messageDescriptor.defaultMessage"]}).search(t).map(e=>{let{item:t}=e;return{id:t.id,iconName:t.iconName,messageDescriptor:t.messageDescriptor}})}let a=e.map(e=>({type:F.ACTION,selected:!1,action:()=>r(e.id),item:e}));return{type:P.ACTIONS,items:a}},[r,l,t]);return ev.useMemo(()=>({section:o,backgroundLoading:!1,loading:!1,error:void 0}),[o])}({query:a,exit:t}),s=ev.useMemo(()=>{let e=new URLSearchParams({q:a,type:"task"});return{type:F.SEARCH_ALL_PROJECTS,selected:!1,action:()=>{l.push({pathname:"/search",search:a?`?${e.toString()}`:void 0})}}},[a,l]),d=ev.useMemo(()=>({backgroundLoading:!1,error:void 0,loading:!1,section:{type:P.ALL,items:[s]}}),[s]),{inputProps:c,sectionsResult:m}=function(e){let{query:t,sectionResults:a,exit:n}=e,l=(0,eF.k6)(),r=ev.useMemo(()=>a.reduce((e,t)=>e.loading||e.error?e:t.error?{sections:null,loading:!1,backgroundLoading:!1,error:t.error}:t.loading?{sections:null,loading:!0,backgroundLoading:!0,error:null}:null==t.section||0===uZ(t.section)?{sections:e.sections,backgroundLoading:e.backgroundLoading,loading:!1,error:null}:{sections:e.sections?[...e.sections,t.section]:[t.section],backgroundLoading:e.backgroundLoading||t.backgroundLoading,loading:!1,error:null},{sections:[],loading:!1,backgroundLoading:!1,error:null}),[a]),{index:o,up:i,down:s,reset:d}=function(e){let[t,a]=(0,ev.useState)(0);return{index:t,up:e=>{e.preventDefault(),e.stopPropagation(),a(Math.max(t-1,0))},down:n=>{n.preventDefault(),n.stopPropagation(),a(Math.min(t+1,e-1))},reset:(0,ev.useCallback)(()=>a(0),[])}}(r.sections?function(e){let t=0;for(let a of e)t+=uZ(a);return t}(r.sections):0);ev.useEffect(()=>{d()},[r,d]);let c=ts()(r.sections)||null==r.sections?null:function(e,t){let a=uL(e,t);return a?a.action:null}(r.sections,o),m=ev.useMemo(()=>ts()(r.sections)||null==r.sections?null:function(e,t){var a;let n=uL(e,t);return n?(a={...n,selected:!0},(0,es.ZP)(e,e=>{let n=t;for(let t=0;t{e.items[t]=a});default:throw Error(`invalid SectionType on section ${e}`)}}(l,n,a)),n-=r}})):e}(r.sections,o),[r.sections,o]);return{sectionsResult:{...r,sections:m},inputProps:{onUpKey:i,onDownKey:s,onEnterKey:e=>{if(e.metaKey){let e=new URLSearchParams({q:t,type:"task"});l.push({pathname:"/search",search:t?`?${e.toString()}`:void 0})}else c?.();n()},onEscapeKey:n}}}({query:a,sectionResults:ev.useMemo(()=>[i,r,o,d],[i,o,r,d]),exit:t});return ev.createElement(pf,null,ev.createElement(ph,null,ev.createElement(py,null,ev.createElement(uY,{value:a,onChange:n,...c}),ev.createElement(pg,{query:a,result:m,exit:t}))))},pv=(0,e$.connect)(function(e){return{isOpen:e?.modal?.command?.isOpen??!1}},function(e){return(0,ek.DE)({toggleCommandModalDialog:uj},e)})(function(e){let{isOpen:t,toggleCommandModalDialog:a,isLoggedIn:n}=e,l=(0,ev.useCallback)(()=>{n&&(t||u$?.track("User Opened Quick Search",{version:2},{}),a())},[n,t,a]),r=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),l()},[l]);return((0,ev.useEffect)(()=>(uS().bind("mod+k",r),()=>{uS().unbind("mod+k")}),[r]),t)?ev.createElement(pk,{autofocus:!1,isOpen:t,close:l},e=>{let{exit:t}=e;return ev.createElement(pb,{exit:t})}):null}),pk=(0,eL.default)(eI.ModalDialog).withConfig({displayName:"CommandModalDialog__StyledModalDialog",componentId:"sc-e58bc90a-0"})` + background: none; + max-width: 550px; +`,pE="@@taskade/modal/TOGGLE_DOCUMENT_COPY_V2_MODAL",px="@@taskade/modal/RESET_DOCUMENT_COPY_V2_MODAL_STATE";function p_(e,t){return{type:pE,payload:{documentID:e,options:t}}}let pw=(0,la.ZP)` + query DocumentAndSpacesQuery($documentID: ID!) { + document(id: $documentID) { + id + info + space { + id + color + name + } + templated_at + has_move_permission + } + + me { + id + memberships { + id + order + role + space { + id + color + name + archived_at + is_unread + is_subspace + parent_membership { + id + order + role + space { + id + color + name + archived_at + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + default { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + } + } + } + } + } + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + default { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + } + } + } + } + preferences { + orderby { + sort + direction + } + } + } + } + } +`;var pN=a(43174),pC=a.n(pN),pM=a(89734),pS=a.n(pM);function pI(e){let[t,a]=pC()(e,e=>eu()(e.space.parent_membership)),n=new Map(pS()(t,["order"]).map(e=>{let{id:t,order:a,role:n,space:l,preferences:r}=e;return[l.id,{id:t,order:a,role:n,space:l,preferences:r,children:[]}]}));for(let e of pS()(a,["order"])){let{id:t,order:a,role:l,space:r,preferences:o}=e,i=r.parent_membership.space.id,s=n.get(i);eu()(s)?n.set(r.id,{id:t,order:a,role:l,space:r,preferences:o,children:[]}):s.children.push({id:t,order:a,role:l,space:r,preferences:o,children:[]})}return Array.from(n.values())}class pD extends Error{description;constructor(e,t){super(e),this.description=t}}(0,te.Em)({id:"general.spaces.fetch_error",defaultMessage:"There was an error loading your spaces. Please try again."});let pT=(0,te.Em)({id:"general.workspace_required",defaultMessage:"Workspace Required"}),p$=(0,te.Em)({id:"general.spaces.at_least_one_workspace_to_move_copy_save",defaultMessage:"You must have at least one workspace with edit permission to copy, move or save templates."});(0,te.Em)({id:"general.spaces.copy_failure",defaultMessage:"Fail to copy project/template. Please try again."});let pP=(0,la.ZP)` + query SpaceDocuments( + $spaceID: ID! + $orderby: [DocumentOrdering] + $filterby: DocumentFiltering + $first: Int + $after: String + ) { + membership(space_id: $spaceID) { + id + role + space { + id + documents_v2(first: $first, after: $after, orderby: $orderby, filterby: $filterby) { + totalCount + edges { + node { + id + archived_at + assignments(first: null) { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + edit_path + has_move_permission + has_leave_permission + is_owner + is_unread + info + pinned_at + role { + project + workspace + } + shared_preferences + space { + id + is_unread + taskadePlanType + } + starred_at + view_path + tags(first: null) { + edges { + node { + id + key + raw_key + preferences { + color + } + } + } + } + templated_at + updated_at + user { + ...BasicUserFields + } + } + } + } + } + preferences { + orderby { + sort + direction + } + } + } + } + ${up} +`;var pF=a(36968),pA=a.n(pF);let pR=new Set(["asc","desc"]),pj=new Set(["created","recent","title","due"]);function pO(e){if(!pj.has(e))return null;switch(e){case"created":return"created_at";case"recent":return"updated_at";case"title":return"title";case"due":return"ended_at";default:return null}}function pU(e,t,a,n,l){let{assignee:r,label:o,page:i,size:s,sort:d}=tL.parse(a),c={spaceID:e};switch(t){case dt:pA()(c,["filterby","archived"],!0);break;case de:pA()(c,["filterby","archived"],!1),pA()(c,["filterby","templated"],!1);break;case da:pA()(c,["filterby","archived"],!1),pA()(c,["filterby","templated"],!0)}if(n){let{startedAt:e,endedAt:t}=n;if(e&&t){let a="YYYY-MM-DDTHH:mm:ss";pA()(c,["filterby","dateRange","startedAt"],e.clone().tz("UTC").locale("en").format(a)),pA()(c,["filterby","dateRange","endedAt"],t.clone().tz("UTC").locale("en").format(a))}}if(ts()(r)||pA()(c,["filterby","assignees"],r),ts()(o)||pA()(c,["filterby","tags"],o),ts()(s)||Number.isNaN(s)?c.first=20:c.first=Number(s),ts()(i)||Number.isNaN(i))c.after=null;else{let e=Math.max(1,Number(i));c.after=e>1?`${(e-1)*c.first}`:null}if(ts()(d)&&null!=l){let{sort:e,direction:t}=l,a=pO(e);c.orderby=[{sort:"pinned_at",direction:"desc"}],null!=a&&null!=t&&c.orderby.push({sort:a,direction:t})}if(!ts()(d)){let e=(tZ()(d)?d:[d]).reduce((e,t)=>{let{key:a,direction:n}=function(e){let t="desc",a="recent",[n,l]=e?e.split("-"):[null,null];return null!=l&&pR.has(l)&&(t=l),null!=n&&pj.has(n)&&(a=n),{direction:t,key:a}}(t),l=pO(a);return l&&n?[...e,{sort:l,direction:n}]:e},[{sort:"pinned_at",direction:"desc"}]);c.orderby=e}return c}function pZ(e,t){if(null==e)return{query:null,variables:null};let{pathname:a,search:n}=e,l=(0,eF.LX)(a,{path:"/:type(spaces|subspaces)/:spaceId/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents)?",exact:!0});if(null==l)return{query:null,variables:null};let r=(l.params.subspaceId||l.params.spaceId)??"",o=l.params.documentTypeOrSubspace;return"subspaces"===o&&(o=l.params.documentType),{query:pP,variables:pU(r,function(e){switch(e){case"archive":return iC;case"templates":return da;default:return iN}}(o),n,null,t)}}(0,la.ZP)` + mutation archiveDocument($id: ID!, $archived: Boolean!) { + archiveDocument(id: $id, archived: $archived) { + id + archived_at + } + } +`,(0,la.ZP)` + mutation assignToDocument($input: AssignToDocumentInput!) { + assignToDocument(input: $input) { + clientMutationId + ok + } + } +`;let pL=(0,la.ZP)` + mutation copyDocumentV2($input: CopyDocumentInput!) { + copyDocumentV2(input: $input) { + clientMutationId + document { + id + assignments(first: null) { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + archived_at + edit_path + has_leave_permission + has_move_permission + is_owner + is_unread + info + pinned_at + role { + project + workspace + } + space { + id + } + starred_at + view_path + shared_preferences + tags(first: null) { + edges { + node { + id + key + raw_key + preferences { + color + } + } + } + } + templated_at + updated_at + user { + ...BasicUserFields + } + } + } + } + ${up} +`,pB=(0,la.ZP)` + mutation copyTemplate($input: CopyTemplateInput!) { + copyTemplate(input: $input) { + clientMutationId + document { + id + assignments(first: null) { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + archived_at + edit_path + has_leave_permission + has_move_permission + is_owner + is_unread + info + pinned_at + role { + project + workspace + } + space { + id + } + starred_at + view_path + shared_preferences + tags(first: null) { + edges { + node { + id + key + raw_key + preferences { + color + } + } + } + } + templated_at + updated_at + user { + ...BasicUserFields + } + } + } + } + ${up} +`;function pz(e,t,a,n,l){return{uid:`document-copied-to-${e}-${(0,ld.Z)()}`,position:"br",autoDismiss:5,dismissible:!1,children:ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.move_success_notification",defaultMessage:"{documentTitle} copied to {toName}",values:{project:e=>ev.createElement(sC.rU,{to:`/d/${n}`},e),documentTitle:l,space:t=>a?ev.createElement(sC.rU,{to:`/spaces/${e}/templates`},t):ev.createElement(sC.rU,{to:`/spaces/${e}`},t),toName:t}}))}}function pV(e,t,a){let{apolloClient:n,location:l,successNotification:r,newDocumentTitle:o}=a,i=null!=e.templated_at||a.isTemplate,{query:s,variables:d}=pZ(l,null);return i?async(e,t)=>{if(null==t)throw Error("Invalid target");let a=(0,ld.Z)(),{id:l,name:i}=t,c=await n.mutate({mutation:pB,update:(e,t)=>{let{data:{copyTemplate:{document:a}}}=t;if(s&&d&&a&&d.spaceID===l&&!d.filterby.archived&&d.filterby.templated){let t=e.readQuery({query:s,variables:d});t=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.totalCount+=1,e.membership.space.documents_v2.edges.unshift({node:a,__typename:"DocumentEdge"}),e)),e.writeQuery({query:s,data:t,variables:d})}},variables:{input:{id:e,spaceID:l,clientMutationId:a,documentTitle:o}}});return r(pz(l,i,!0,c.data.copyTemplate.document.id,o)),c.data.copyTemplate}:async(e,t)=>{if(null==t)throw Error("Invalid target");let a=(0,ld.Z)(),l=t.id,i=t.name,c=await n.mutate({mutation:pL,update:(e,t)=>{let{data:{copyDocumentV2:{document:a}}}=t;if(s&&d&&a&&d.spaceID===l&&!d.filterby.archived&&!d.filterby.templated){let t=e.readQuery({query:s,variables:d});t=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.totalCount+=1,e.membership.space.documents_v2.edges.unshift({node:a,__typename:"DocumentEdge"}),e)),e.writeQuery({query:s,data:t,variables:d})}},variables:{input:{id:e,spaceID:l,clientMutationId:a,documentTitle:o}}});return r(pz(l,i,!1,c.data.copyDocumentV2.document.id,o)),c.data.copyDocumentV2}}(0,la.ZP)` + mutation deleteDocument($id: ID!) { + deleteDocument(id: $id) + } +`,(0,la.ZP)` + mutation deleteTemplate($input: DeleteTemplateInput!) { + deleteTemplate(input: $input) { + clientMutationId + ok + } + } +`,(0,la.ZP)` + mutation setDocumentNotifications($documentID: ID!, $key: String!, $value: String!) { + setDocumentNotifications(document_id: $documentID, key: $key, value: $value) { + id + preferences { + notifications { + browser + email + mobile + } + } + } + } +`,(0,la.ZP)` + mutation starDocument($id: ID!, $starred: Boolean!) { + starDocument(id: $id, starred: $starred) { + id + starred_at + } + } +`;let pq=(0,lb.C)({context:{documentId:null,isTemplate:!1,duplicate:!1,document:null,workspaceTrees:null,memberships:null,error:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"copydialog",initial:"loading",states:{loading:{invoke:{id:"loadWorkspaceTrees",src:"loadWorkspaceTrees",onDone:[{actions:"handleWorkspaceTreesLoaded",target:"#copydialog.loaded"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},loaded:{always:[{cond:"isDuplicating",target:"#copydialog.duplicating"},{cond:"isCopying",target:"#copydialog.active"},{target:"#copydialog.erred"}]},active:{on:{COPY:{target:"#copydialog.copying"}}},copying:{invoke:{id:"copying",src:"copying",onDone:[{actions:"documentCopied",target:"#copydialog.end"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},duplicating:{invoke:{id:"duplicating",src:"duplicating",onDone:[{actions:"documentCopied",target:"#copydialog.end"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},erred:{},end:{entry:"exit"}}},{guards:{isCopying:e=>{let{documentId:t,duplicate:a}=e;return null!=t&&!a},isDuplicating:e=>{let{documentId:t,duplicate:a}=e;return null!=t&&a}},actions:{handleErred:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleWorkspaceTreesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.document=t.data.document,e.workspaceTrees=t.data.workspaceTrees,e.memberships=t.data.memberships,e)))}});function pW(e){let{role:t,action:a}=e;return!!(!eu()(t)&&lc.Y8.can(t,a,"workspace"))}let pH=eL.default.span.withConfig({displayName:"AvatarWrapper",componentId:"sc-5d817427-0"})` + display: flex; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + font-size: 16px; + line-height: 26px; + font-weight: 500; + text-align: center; + align-items: center; + justify-content: center; + text-transform: uppercase; + border-radius: 10px; + width: 26px; + height: 26px; + flex-shrink: 0; +`,pG=eL.default.span.withConfig({displayName:"CharacterAvatar__Character",componentId:"sc-d50782d4-0"})` + /* Workaround for emoji positioning issue in Chrome on high dpi screens */ + @media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min--moz-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-device-pixel-ratio: 2), + only screen and (min-resolution: 150dpi), + only screen and (min-resolution: 2dppx) { + font-size: 2em; + transform: scale(0.5); + } +`,pK=function(e){let{character:t,...a}=e;return ev.createElement(pH,a,ev.createElement(pG,null,t))},pY=function(e){let{name:t,...a}=e,n=[...t];return ev.createElement(pK,{...a,character:n[0]})},pQ=eL.default.img.withConfig({displayName:"OldSpaceAvatar__Avatar",componentId:"sc-638d3fde-0"})` + width: 26px; + height: 26px; + border-radius: inherit; +`,pJ=function(e){let{className:t,space:a,size:n}=e,l=ev.useMemo(()=>{let e=(0,eI.getColorScheme)(a.color);if(null!=e)return e.base},[a.color]),r=ec()(a,"small"===n?["smallAvatar"]:["avatar"],null)||ec()(a,"small"===n?["preferences","avatars_v2","small","hdpi","url"]:["preferences","avatars_v2","default","hdpi","url"],null),o=ec()(a,["preferences","avatars_v2","emoji"],null);return ts()(r)?ts()(o)?ev.createElement(pY,{className:t,name:a.name,style:{backgroundColor:l}}):ev.createElement(pK,{className:t,character:o,style:{backgroundColor:l}}):ev.createElement(pH,{className:t,style:{backgroundColor:l}},ev.createElement(pQ,{alt:a.name,src:r}))},pX=eL.default.button.withConfig({displayName:"WorkspaceListItem__Button",componentId:"sc-ca425ab8-0"})` + display: flex; + background: none; + margin: 0 0 2px; + padding: 5px 10px; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + border-radius: 10px; + width: 100%; + font-weight: 400; + line-height: 28px; + color: ${e=>e.theme.textColors.hex(10)}; + + &:disabled { + opacity: 0.4; + pointer-events: none; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + outline: 0; + } +`,p0=(0,eL.default)(pJ).withConfig({displayName:"WorkspaceListItem__SpaceAvatarStyled",componentId:"sc-ca425ab8-1"})` + display: flex; + flex-shrink: 0; + background: ${e=>e.$color}; + width: 26px; + height: 26px; + border-radius: 10px; + align-self: center; + align-content: center; + justify-self: left; + justify-content: center; + color: #fff; + font-size: 15px; + line-height: 24px; + font-weight: 600; + position: relative; + text-transform: uppercase; + overflow: hidden; + margin: ${e=>e.$isSubspace?"0 10px 0 10px":"0 10px 0 0"}; +`,p1=eL.default.span.withConfig({displayName:"WorkspaceListItem__CurrentSpan",componentId:"sc-ca425ab8-2"})` + color: ${e=>e.theme.appColors.hex(50)}; + margin-left: 4px; +`,p2=function(e){let{isSubspace:t,onSelect:a,workspace:n,role:l,currentSpace:r}=e,{color:o,id:i,name:s}=n,d=e.disabled||!pW({role:l,action:"create_project"});return ev.createElement(pX,{onClick:()=>{a({type:"space",id:i,name:s,color:o})},disabled:d},ev.createElement(p0,{space:n,size:"small",$color:o,$isSubspace:t}),s," ",r===i&&ev.createElement(p1,null,"(Current)"))},p5=eL.default.div.withConfig({displayName:"WorkspacesTree__ScrollbarWrapper",componentId:"sc-6333973a-0"})` + height: auto; + min-height: 46px; + max-height: 260px; + overflow-y: scroll; + ${tM}; +`,p3=function(e){let{currentWorkspaceID:t,disableWorkspaceID:a,onSelect:n,workspacesTree:l}=e;return ev.createElement(ev.Fragment,null,ev.createElement(p5,null,l.map(e=>ev.createElement(ev.Fragment,{key:e.id},ev.createElement(p2,{disabled:a===e.space.id,workspace:e.space,onSelect:n,role:e.role,currentSpace:t}),e.children.map(e=>ev.createElement(p2,{disabled:a===e.space.id,key:e.id,isSubspace:!0,onSelect:n,workspace:e.space,role:e.role,currentSpace:t}))))))};var p4=a(30998),p6=a.n(p4),p8=a(52353),p7=a.n(p8);function p9(e,t){return e===t}function ge(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p9;return!n(ec()(e,a),ec()(t,a))}function gt(){if("undefined"!=typeof window)return window}function ga(){try{if("undefined"!=typeof localStorage)return localStorage}catch(e){}}function gn(e,t,a,n){let l=p6()(e,e=>iP()(e,[t])&&e[t]===a);return p7()(l)?e:[...e.slice(0,l),{[t]:a,content:n},...e.slice(l+1)]}function gl(e,t,a,n){return`${e.substring(0,a)}${t}${e.substring(n)}`}function gr(e){let t=gt();t.location.href===e?t.location.reload(!0):t.location.href=e}var go=a(36829);let gi=(0,la.ZP)` + query MeEmojiSkinPreferenceQuery { + me { + id + preferences { + emojiSkin + } + } + } +`,gs=(0,la.ZP)` + mutation UpdateEmojiSkinPreference($input: UserInput!) { + updateMe(input: $input) { + id + preferences { + emojiSkin + } + } + } +`,gd=eL.default.div.withConfig({displayName:"EmojiList__Wrapper",componentId:"sc-81b5b3df-0"})` + width: 360px; + border: 1px solid + ${e=>e.$hideBorder?"transparent":e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + overflow: clip; + + .emoji-mart { + border: none; + background: none; + width: inherit !important; + } + .emoji-mart-bar { + border-color: transparent; + + & .emoji-mart-anchors { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + } + } + + .emoji-mart-title-label { + display: none; + } + + .emoji-mart-preview-name { + color: ${e=>e.theme.textColors.hex(10)}; + } + + .emoji-mart-preview-shortnames, + .emoji-mart-preview-emoticons { + display: none; + } + + .emoji-mart-scroll { + ${tS} + } + + .emoji-mart-search { + display: ${e=>e.$hideSearch?"none":"flex"}; + align-items: center; + margin: 8px 0; + + & > input { + color: ${e=>e.theme.textColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + } + & .emoji-mart-search-icon { + top: 3px; + cursor: pointer; + & svg path { + fill: ${e=>e.theme.appColors.hex(50)}; + } + &:hover svg path { + fill: ${e=>e.theme.appColors.hex(10)}; + } + &:focus { + outline: 0; + } + } + } + + .emoji-mart-emoji { + &:hover:before { + background-color: ${e=>e.theme.primaryColorScheme?.alpha20}; + } + &:focus { + outline: 0; + } + } + + .emoji-mart-category { + & > .emoji-mart-category-label { + top: -1px; + span { + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.appColors.hex(10)}; + } + } + } + + .emoji-mart-skin-swatches { + zoom: 160%; + background: ${e=>e.theme.appColors.hex(90)}; + border-color: ${e=>e.theme.appColors.hex(70)}; + } +`,gc=eL.default.button.withConfig({displayName:"EmojiList__DeleteButton",componentId:"sc-81b5b3df-1"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + color: ${eI.ThemeColors.danger}; + padding: 5px 0 10px; + border-radius: 0 0 10px 10px; + border: 0; + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + + background: none; + + & svg { + margin-right: 8px; + } + + &:hover { + cursor: pointer; + background: ${eI.ThemeColors.danger}; + color: #fff; + } + + &:focus { + outline: 0; + } +`,gm=function(e){let{hideBorder:t,hideSearch:a,className:n,onRemoveClick:l,...r}=e,o=(0,eL.useTheme)(),i=o.primaryColorScheme?.base,{data:s}=(0,eB.a)(gi),d=s?.me?.id,c=s?.me?.preferences?.emojiSkin??void 0,[m]=(0,cs.D)(gs),u=(0,ev.useCallback)(e=>{m({variables:{input:{preferences:{emojiSkin:e}}}})},[m]);return ev.createElement(gd,{$hideSearch:a??!1,$hideBorder:t??!1,className:n},ev.createElement(go.cW,{color:i,showPreview:!1,...r,defaultSkin:c,onSkinChange:null!=d?u:void 0}),null!=l&&ev.createElement(gc,{onClick:l},ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.remove",defaultMessage:"Remove"})))},gu=eL.default.div.withConfig({displayName:"EmojiPopover__EventPropagationTrap",componentId:"sc-32a9fed1-0"})` + display: flex; + flex-direction: column; + border: 0px; + border-radius: 5px; + padding: 0px; +`,gp=function(e){let{hideSearch:t,onEmojiPick:a,popupProps:n,dispatch:l,onEmojiRemove:r}=e,o=e.repelFocus??!1,i=ev.useMemo(()=>{if(o)return e=>{e.preventDefault()}},[o]),s=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.key===eI.KeyboardKeys.Escape&&l({type:"Collapse"})},[l]),d=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return ev.createElement(eI.Popup,{...n,modal:!0,dispatch:l,onMouseDown:i},ev.createElement(gu,{onClick:d,onKeyDown:s},ev.createElement(gm,{hideSearch:t,onClick:a,onRemoveClick:r,showPreview:!0,title:""})))},gg=(0,eL.default)(eI.Shortcut.Combo).withConfig({displayName:"EmojiPicker__StyledCombo",componentId:"sc-b5ddc14d-0"})` + display: flex; + align-items: center; + justify-content: center; + + ${e=>e.$top&&(0,eL.css)` + margin-top: 5px; + `}; +`,gf=function(e){let{className:t,onClose:a,onEmojiPick:n,state:l,dispatch:r}=e,o=e.disabled??!1,i=e.hideSearch??!1,s=e.tooltipPlacement??"top",d=e.repelFocus??!1,c=e.popoverPlacement??"top",m=ev.useRef(null),u=ev.useRef(null),p=(0,eI.usePopup)({referenceElementRef:m,popupElementRef:u,state:l,placement:c}),g=(0,eI.useMenuButton)({dispatch:r,ref:m,state:l});(0,eI.usePopupEvents)({state:l,onCollapse:()=>{a?.()}});let f=(0,eI.useTooltip)({placement:s}),h=f.setVisible,y=(0,ev.useMemo)(()=>{if(d)return e=>{e.preventDefault()}},[d]),b=(0,ev.useCallback)(()=>{h(()=>!o)},[o,h]),v=(0,ev.useCallback)(()=>{h(!1)},[h]),k=(0,ev.useCallback)(()=>{h(!1),l.expanded?r({type:"Collapse"}):r({type:"Expand"})},[l.expanded,h,r]),E=(0,ev.useCallback)((e,t)=>{n?.(e,t)},[n]);return ev.createElement("div",{...f.referenceProps,className:t,onKeyDown:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation(),l.expanded&&e.key===eI.KeyboardKeys.Escape&&r({type:"Collapse"})}},ev.createElement("button",{...g.props,type:"button",onClick:k,disabled:o,className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",onMouseDown:y,onMouseEnter:b,onMouseLeave:v},ev.createElement(tn.Icon,{icon:"message_emoji"})),f.visible&&ev.createElement(eI.Tooltip,{arrowProps:f.arrowProps,popperProps:f.popperProps},ev.createElement(eY.Z,{id:"general.insert_emoji_with_shortcut",defaultMessage:"Insert Emoji {NEWLINE} {EMOJI}",values:{EMOJI:ev.createElement(gg,{alwaysDark:!0,$top:!0},ev.createElement(eI.Shortcut.Key,null,":")),NEWLINE:ev.createElement("br",null)}})),l.expanded&&ev.createElement(gp,{hideSearch:i,repelFocus:d,popupProps:p.props,onEmojiPick:E,dispatch:r}))},gh=eL.default.div.withConfig({displayName:"styled__FlexContainer",componentId:"sc-43aebe1e-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,gy=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__Subtitle",componentId:"sc-43aebe1e-1"})` + display: flex; + color: ${e=>e.theme.textColors.hex("50")}; + padding: 0 0 10px; +`,gb=eL.default.h1.withConfig({displayName:"styled__Header",componentId:"sc-43aebe1e-2"})` + ${e1.UiTypography.lg}; + font-weight: 500; + padding: 0; + margin: 0 0 8px; + color: ${e=>e.theme.textColors.hex(10)}; +`,gv=eL.default.p.withConfig({displayName:"styled__Paragraph",componentId:"sc-43aebe1e-3"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 20px; +`,gk=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-43aebe1e-4"})` + display: block; + width: 100%; + cursor: pointer; + margin-top: 30px; + padding: 14px 0; + + border-radius: 12px; + font-weight: 500; + font-size: 16px; + letter-spacing: 0.025em; + text-transform: uppercase; + cursor: pointer; + color: #fff; + border: 0; + + background: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha90} !important; + } + + &:focus { + outline: 0; + } + + transition: background-color 100ms ease-in; +`,gE=eL.default.div.withConfig({displayName:"FieldName__StyledContainer",componentId:"sc-246fa2c6-0"})` + margin-bottom: 20px; +`,gx=function(e){let{handleChange:t,value:a}=e,n=(0,ev.useRef)(null),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1});return ev.createElement(gE,null,ev.createElement(gy,null,ev.createElement(eY.Z,{id:"general.rename",defaultMessage:"Rename (Optional)"})),ev.createElement(rB,null,ev.createElement(rz,{type:"text",ref:n,onChange:e=>{let{value:a}=e.target;t(a)},autoComplete:"off",value:a}),ev.createElement(gf,{onEmojiPick:e=>{let{current:a}=n;if(null!=a){if(ts()(a.value))t(e.native);else{let{start:n,end:l}=oN(a);t(gl(a.value,e.native,n,l))}a.focus()}},onClose:()=>{n.current?.focus()},state:l,dispatch:r})))},g_=function(e){let{state:t,send:a}=e,n=t.context?.document?.info?.title??"",[l,r]=(0,ev.useState)(n),o=(0,ev.useCallback)(e=>{a({type:"COPY",payload:{spaceId:e.id,spaceName:e.name,newDocumentTitle:l}})},[a,l]);if(!t.matches("active"))return null;let{isTemplate:i,document:s,workspaceTrees:d}=t.context;return ev.createElement(gh,null,i?ev.createElement(ev.Fragment,null,ev.createElement(gb,null,ev.createElement(eY.Z,{id:"general.copy_template",defaultMessage:"Copy Template"})),ev.createElement(gv,null,ev.createElement(eY.Z,{id:"general.copy_template.description",defaultMessage:"Choose a workspace or folder to copy this template to and rename it if you need to."}))):ev.createElement(ev.Fragment,null,ev.createElement(gb,null,ev.createElement(eY.Z,{id:"general.copy_project",defaultMessage:"Copy Project"})),ev.createElement(gv,null,ev.createElement(eY.Z,{id:"general.copy_project.description",defaultMessage:"Choose a workspace or folder to copy this project to and rename it if you need to."}))),ev.createElement(gx,{value:l,handleChange:e=>{r(e)}}),ev.createElement(gy,null,ev.createElement(eY.Z,{id:"general.copy_to",defaultMessage:"Copy To"})),ev.createElement(p3,{currentWorkspaceID:s.space?.id,onSelect:o,workspacesTree:d}))};eL.default.div.withConfig({displayName:"Styles__FlexContainer",componentId:"sc-3d0aa2e5-0"})` + display: flex; + flex-direction: column; +`;let gw=eL.default.p.withConfig({displayName:"Styles__BodyText",componentId:"sc-3d0aa2e5-1"})` + font-size: 16px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#666"}; +`,gN=eL.default.div.withConfig({displayName:"Styles__Actions",componentId:"sc-3d0aa2e5-2"})` + display: flex; + flex-direction: row; + justify-content: flex-end; +`,gC=eL.default.button.withConfig({displayName:"Styles__Confirm",componentId:"sc-3d0aa2e5-3"})` + display: flex; + padding: 8px 16px; + cursor: pointer; + background: #5cc170; + border: none; + margin-right: 5px; + border-radius: 5px; + font-weight: 500; + color: #fff; + + &:focus { + outline: 0; + } + + &:hover { + color: #fff; + background: #4da35e; + } +`;eL.default.button.withConfig({displayName:"Styles__Delete",componentId:"sc-3d0aa2e5-4"})` + display: flex; + padding: 8px 16px; + background: rgba(255, 100, 107, 1); + border: 1px solid #ff646b; + color: #fff; + border-radius: 5px; + cursor: pointer; + margin-right: 5px; + font-weight: 500; + + &:focus { + outline: 0; + } + + &:hover { + background: rgba(255, 100, 107, 0.8); + } +`;let gM=eL.default.button.withConfig({displayName:"Styles__Cancel",componentId:"sc-3d0aa2e5-5"})` + display: flex; + padding: 8px 16px; + background: none; + font-weight: 500; + font-size: 16px; + border: 0; + color: ${e=>(e.theme?.isNightMode,"#999")}; + cursor: pointer; + margin-right: 5px; + + &:focus { + outline: 0; + } + + &:hover { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + } +`,gS=function(e){let{onClose:t}=e,a=e.error?.message??"Unknown Error",n=e.error?.description;return null!=n?ev.createElement(gh,null,ev.createElement(gb,null,a),ev.createElement(gv,null,n),ev.createElement(gk,{"aria-label":"Close",type:"button",onClick:t},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"}))):ev.createElement(gh,null,ev.createElement(gw,null,a))},gI=(0,e$.connect)(function(e){return{documentID:ec()(e,["modal","documentCopyV2","documentID"],null),isTemplate:ec()(e,["modal","documentCopyV2","isTemplate"],!1),duplicate:ec()(e,["modal","documentCopyV2","duplicate"],!1),redirect:ec()(e,["modal","documentCopyV2","redirect"],!1)}},function(e){return(0,ek.DE)({successNotification:l3.success},e)})(function(e){let{documentID:t,isTemplate:a,exit:n,successNotification:l,duplicate:r,redirect:o}=e,i=(0,ll.x)(),s=(0,eK.Z)(),d=(0,eF.TH)(),c=(0,eF.k6)(),m=(0,ev.useMemo)(()=>({documentId:t,isTemplate:a,duplicate:r}),[t,r,a]),[u,p]=(0,ls.e)(pq,{actions:{documentCopied:(e,t)=>{o&&c.push(t.data.document.view_path)},exit:()=>{n()}},context:m,services:{copying:async(e,t)=>{let{document:a,isTemplate:n,memberships:r}=e;if(null==a)throw Error("Document not found");let o=r?.find(e=>e.space.id===a.space?.id)??null,s=pV(a,o,{isTemplate:n,apolloClient:i,location:d,successNotification:l,newDocumentTitle:t.payload.newDocumentTitle}),c=t.payload.spaceId,m=t.payload.spaceName;if(null==c||null==m)throw Error("No target");return await s(a.id,{id:c,name:m})},duplicating:async e=>{let{document:t,isTemplate:a,memberships:n}=e;if(null==t)throw Error("Document not found");let r=n?.find(e=>e.space.id===t.space?.id)??null,o=pV(t,r,{isTemplate:a,apolloClient:i,location:d,successNotification:l,newDocumentTitle:t.info?.title??""}),s=t.space?.id,c=t.space?.name;if(null==s||null==c)throw Error("No target");return await o(t.id,{id:s,name:c})},loadWorkspaceTrees:async e=>{let{documentId:t}=e;if(null==t)throw new pD("Invalid Document ID");let a=await i.query({query:pw,variables:{documentID:t},fetchPolicy:"network-only"}),n=a.errors?.[0];if(null!=n)throw n;let l=a.data?.document??null,r=a.data?.me?.memberships??[];if(null==l)throw new pD("Missing Project");let o=r.filter(e=>null==e.space.archived_at);if(ts()(o))throw new pD(s.formatMessage(pT),s.formatMessage(p$));return{document:l,workspaceTrees:pI(o),memberships:o}}}}),g=(0,ev.useCallback)(()=>{n()},[n]);return u.matches("loading")||u.matches("end")?ev.createElement(gh,null,ev.createElement(eI.Spinner,{width:"400"})):u.matches("active")?ev.createElement(g_,{send:p,state:u,onClose:g}):u.matches("copying")||u.matches("duplicating")?ev.createElement(gh,null,ev.createElement(eI.Spinner,{width:"400"})):ev.createElement(gS,{error:u.context.error,onClose:g})}),gD=(0,e$.connect)(function(e){return{isOpen:ec()(e,["modal","documentCopyV2","isOpen"],!1)}},function(e){return(0,ek.DE)({onToggle:p_},e)})(function(e){let{isOpen:t,onToggle:a}=e;return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:a},e=>{let{exit:t}=e;return ev.createElement(gI,{exit:t})}):null}),gT={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MyMembershipsQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"archived_at"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"parent_membership"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"archived_at"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"collapseActiveSpaces"}},{kind:"Field",name:{kind:"Name",value:"collapseArchivedSpaces"}},{kind:"Field",name:{kind:"Name",value:"calendarView"}}]}}]}}]}}]};class g$ extends Error{description;constructor(e,t){super(e),this.description=t}}let gP=(0,te.Em)({id:"general.workspace_required",defaultMessage:"Workspace Required"}),gF=(0,te.Em)({id:"general.spaces.at_least_one_workspace_to_move_copy_save",defaultMessage:"You must have at least one workspace with edit permission to copy, move or save templates."}),gA={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"copyProjects"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CopyProjectsInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"copyProjects"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"assignments"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"archived_at"}},{kind:"Field",name:{kind:"Name",value:"edit_path"}},{kind:"Field",name:{kind:"Name",value:"has_leave_permission"}},{kind:"Field",name:{kind:"Name",value:"has_move_permission"}},{kind:"Field",name:{kind:"Name",value:"is_owner"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"pinned_at"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"starred_at"}},{kind:"Field",name:{kind:"Name",value:"view_path"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"raw_key"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"color"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"templated_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]}}]}}]}}]},gR=(0,lb.C)({context:{documentIds:null,isTemplate:!1,workspaceTrees:null,memberships:null,error:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"copydialog",initial:"loading",states:{loading:{invoke:{id:"loadWorkspaceTrees",src:"loadWorkspaceTrees",onDone:[{actions:"handleWorkspaceTreesLoaded",target:"#copydialog.loaded"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},loaded:{always:[{cond:"isCopying",target:"#copydialog.active"},{target:"#copydialog.erred"}]},active:{on:{COPY:{target:"#copydialog.copying"}}},copying:{invoke:{id:"copying",src:"copying",onDone:[{target:"#copydialog.end"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},erred:{},end:{entry:"exit"}}},{guards:{isCopying:e=>{let{documentIds:t}=e;return null!=t}},actions:{handleErred:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleWorkspaceTreesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.workspaceTrees=t.data.workspaceTrees,e.memberships=t.data.memberships,e)))}}),gj=function(e){let{documentIds:t,spaceId:a,exit:n}=e,l=(0,e$.useDispatch)(),r=(0,eK.Z)(),o=(0,eF.TH)(),i=(0,ll.x)(),s=ev.useMemo(()=>({documentIds:t,isTemplate:!1,duplicate:!1}),[t]),[d]=(0,cs.D)(gA),[c,m]=(0,ls.e)(gR,{actions:{exit:()=>{n()}},context:s,services:{copying:async(e,n)=>{let{memberships:r}=e,{spaceId:i,spaceName:s}=n.payload;if(null==r)throw Error("Memberships required");if(null==r.find(e=>e.space.id===i))throw Error("Membership required");let{query:c,variables:m}=pZ(o,null),u=(0,ld.Z)();await d({variables:{input:{clientMutationId:u,ids:t,spaceId:i}},update:(e,t)=>{if(null==c||null==m||i!==a)return;let n=t.data?.copyProjects.documents.edges;if(null==n||0===n.length)return;let l=e.readQuery({query:c,variables:m});if(null==l)return;let r=(0,es.ZP)(l,e=>{for(let t of(e.membership.space.documents_v2.totalCount+=n.length,n))t?.node!=null&&e.membership.space.documents_v2.edges.unshift({node:t.node,_typename:"DocumentEdge"})});e.writeQuery({query:c,data:r,variables:m})}});let p={uid:`documents-copied-to-${i}-${(0,ld.Z)()}`,position:"br",autoDismiss:5,dismissible:!1,children:ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.copy_projects_success_notification",defaultMessage:"Projects have been copied to {toSpaceName}",values:{space:e=>ev.createElement(sC.rU,{to:`/spaces/${i}`},e),toSpaceName:s}}))};l((0,l3.success)(p))},loadWorkspaceTrees:async e=>{let t=await i.query({query:gT,fetchPolicy:"network-only"}),a=t.errors?.[0];if(null!=a)throw a;let n=t.data?.me?.memberships??[],l=[];for(let e of n)null!=e&&null==e.space.archived_at&&l.push(e);if(0===l.length)throw new g$(r.formatMessage(gP),r.formatMessage(gF));return{workspaceTrees:pI(l),memberships:l}}}}),u=ev.useCallback(e=>{m({type:"COPY",payload:{spaceId:e.id,spaceName:e.name}})},[m]),p=ev.useCallback(()=>{n()},[n]);if(c.matches("loading")||c.matches("end")||c.matches("copying"))return ev.createElement("div",{className:"p-16"},ev.createElement(eI.Spinner,{width:400}));if(c.matches("active"))return ev.createElement("div",{className:"p-8"},ev.createElement("div",null,ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.copy_projects",defaultMessage:"Copy Projects"})),ev.createElement("p",{className:"mb-5 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.copy_projects.description",defaultMessage:"Choose a workspace or folder to copy the projects to."}))),ev.createElement("div",{className:"mb-2"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.copy_to",defaultMessage:"Copy To"}))),ev.createElement(p3,{currentWorkspaceID:a,onSelect:u,workspacesTree:c.context.workspaceTrees??[]}));let g=c.context.error?.message??"Unknown Error",f=c.context.error instanceof g$?c.context.error.description:null;return ev.createElement("div",{className:"flex flex-col items-center p-16"},ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},g),null!=f&&ev.createElement("p",{className:"text-sm"},f),ev.createElement("button",{onClick:p,className:"mt-7 w-96 rounded-xl bg-primary p-3 font-semibold uppercase hover:bg-primary/90"},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})))},gO=(0,d9.oM)({name:"dialogs.copyDocuments",initialState:{isOpen:!1},reducers:{toggleCopyDocumentsDialog:(e,t)=>e.isOpen||null==t.payload?{isOpen:!1}:{isOpen:!0,documentIds:t.payload.documentIds,spaceId:t.payload.spaceId}}}),gU=(0,e$.connect)(function(e){return e.dialogs.copyDocuments})(function(e){let t=(0,e$.useDispatch)(),{isOpen:a,documentIds:n,spaceId:l}=e,r=ev.useCallback(()=>{t(gO.actions.toggleCopyDocumentsDialog())},[t]);return a&&null!=n&&null!=l?ev.createElement(eI.ModalDialog,{isOpen:a,close:r,autofocus:!0},e=>{let{exit:t}=e;return ev.createElement(gj,{exit:t,documentIds:n,spaceId:l})}):null}),gZ="@@taskade/modal/TOGGLE_CREATE_SPACE_MODAL_DIALOG";function gL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:gZ,payload:{parentID:e,parentName:t,parentType:a,parentTaskadePlanType:n}}}let gB=ev.createContext(void 0),gz=function(e){let{children:t,spaceId:a,spaceType:n,spaceIsSubspace:l,spaceTaskadePlanType:r}=e,o=ev.useMemo(()=>({id:a,type:n,taskadePlanType:r,isPaywallEnabled:null==n||function(e){let t=e0();return!("mac_app_store"===t||"windows_app_store"===t)&&"unlimited"!==e}(n),isSubspace:l}),[a,n,r,l]);return ev.createElement(gB.Provider,{value:o},t)};function gV(){let e=ev.useContext(gB);if(void 0===e)throw Error("usePaywall expect to be called inside a Paywall Provider");return e}var gq=a(28670),gW=a.n(gq);let gH=eL.default.div.withConfig({displayName:"ColorOption__Color",componentId:"sc-f4c691f-0"})` + display: flex; + width: 30px; + height: 30px; + position: relative; + margin-right: 10px; +`,gG=eL.default.input.withConfig({displayName:"ColorOption__RadioInput",componentId:"sc-f4c691f-1"})` + position: absolute; + top: 0; + left: 0; + margin: 0; + visibility: hidden; + + &:checked ~ div svg { + opacity: 1; + } +`,gK=eL.default.label.withConfig({displayName:"ColorOption__Label",componentId:"sc-f4c691f-2"})` + display: flex; + position: relative; + padding: 14px; + z-index: 9; + cursor: pointer; + opacity: 0; + color: #999; + position: absolute; + top: 0; + left: 0; + + transition: opacity ease-in-out 0.2s; + -webkit-transition: opacity ease-in-out 0.2s; +`,gY=eL.default.div.withConfig({displayName:"ColorOption__Check",componentId:"sc-f4c691f-3"})` + display: flex; + width: 30px; + height: 30px; + position: absolute; + top: 0; + left: 0; + z-index: 5; + border: 2px solid; + border-radius: 50px; + align-items: center; + justify-content: center; + border: 2px solid ${e=>e.theme.isNightMode?"#222":"#fff"}; + background: ${e=>e.color}; + box-shadow: ${e=>e.checked?`0 0 0 2px ${e.color}`:"none"}; + + & svg { + opacity: 0; + } +`,gQ=function(e){let{checked:t,label:a,name:n,onChange:l,value:r}=e,o=`color-${a}`;return ev.createElement(gH,null,ev.createElement(gK,{"aria-label":a,htmlFor:o,onClick:e=>{e.preventDefault(),l(r)}}),ev.createElement(gG,{id:o,type:"radio",checked:t,name:n,onChange:e=>{l(e.target.value)},value:r}),ev.createElement(gY,{checked:t,color:r}))};var gJ=a(90532);function gX(e){if(!oh()(e))return null;let t=e.trim().toLowerCase();return ts()(t)?null:eI.SupportedColors.has(t)?eI.SupportedColors.get(t)??null:gW().valid(t)&&.85>gW()(t).luminance()?gW()(t).hex("rgb"):null}let g0=(0,eL.default)(eI.Popover).withConfig({displayName:"ColorPickerPopover__Popover",componentId:"sc-199ceb81-0"})` + border-radius: 12px; + display: flex; + width: 239px; + height: ${e=>e.error?"380px":"350px"}; + align-items: center; + justify-content: center; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + padding: 2px; + + &:after, + &:before { + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 9px; + border-color: ${e=>e.theme.appColors.hex(80)} transparent transparent transparent; + top: ${e=>e.isBottom?"-18px":"100%"}; + left: 50%; + margin-left: -10px; + position: absolute; + transform: ${e=>e.isBottom?"rotateZ(180deg)":null}; + } + + & :after { + border-color: ${e=>e.theme.appColors.hex(100)} transparent transparent transparent; + top: ${e=>e.isBottom?"-17px":"calc(100% - 1.5px)"}; + } + + .rcp { + width: 180px; + height: 180px; + margin: 30px auto; + } + + .rcp__palette:before { + background: ${e=>e.theme.appColors.hex(100)}; + } + + .rcp button { + outline: none; + } +`,g1=eL.default.div.withConfig({displayName:"ColorPickerPopover__FlexContainer",componentId:"sc-199ceb81-1"})` + height: 100%; + display: flex; + flex-direction: column; + padding: 0 16px 5px; + justify-content: flex-end; +`,g2=eL.default.div.withConfig({displayName:"ColorPickerPopover__TopContainer",componentId:"sc-199ceb81-2"})` + flex: 1; +`,g5=eL.default.div.withConfig({displayName:"ColorPickerPopover__BottomContainer",componentId:"sc-199ceb81-3"})` + flex: 1; +`,g3=eL.default.div.withConfig({displayName:"ColorPickerPopover__Label",componentId:"sc-199ceb81-4"})` + color: ${e=>e.theme.textColors.hex(50)}; + margin-bottom: 5px; + text-transform: uppercase; + ${e1.UiTypography.xxs}; +`,g4=eL.default.div.withConfig({displayName:"ColorPickerPopover__InputContainer",componentId:"sc-199ceb81-5"})` + display: flex; + width: 100%; + position: relative; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + transition: border-color 200ms ease-in; + background: ${e=>e.theme.appColors.hex(100)}; + overflow: hidden; + + &:focus-within { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + } +`,g6=eL.default.input.attrs({type:"text"}).withConfig({displayName:"ColorPickerPopover__TextInput",componentId:"sc-199ceb81-6"})` + ${e1.UiTypography.md}; + min-width: 0px; + width: inherit; + border: 0; + padding: 8px 10px; + background: none; + color: ${e=>e.theme.textColors.hex(10)}; + + &::placeholder { + color: ${e=>e.theme.appColors.hex(70)}; + } +`,g8=eL.default.button.attrs(e=>({style:{background:e.color}})).withConfig({displayName:"ColorPickerPopover__SetButton",componentId:"sc-199ceb81-7"})` + border: 0; + outline: 0; + background: none; + display: flex; + justify-content: center; + align-items: center; + ${e1.UiTypography.md}; + font-weight: 500; + color: white; + box-shadow: none; + width: 50px; + padding: 10px 20px !important; + cursor: pointer; + + &:hover { + background: ${e=>e.theme.appColors.hex(60)}; + } + + &:focus { + outline: 0; + } +`,g7=eL.default.div.withConfig({displayName:"ColorPickerPopover__ErrorMessage",componentId:"sc-199ceb81-8"})` + display: flex; + color: #ff646b; + ${e1.UiTypography.sm}; + border-radius: 5px; + margin-bottom: 5px; +`,g9=(0,eV.ZP)("enter"),fe=(0,eV.ZP)("esc"),ft=function(e){let{popperProps:t,isValid:a,handleUpdate:n,handleChange:l,handleValidate:r,name:o,value:i,text:s,dismiss:d}=e,c=gW()(gX(s)?s:i).hsl(),[m,u]=(0,ev.useState)({hue:c[0],saturation:100,luminosity:70,alpha:c[3]});(0,ev.useEffect)(()=>{if(gX(s)){let e=gW()(s).hsl();u({hue:isNaN(e[0])?0:e[0],saturation:100*e[1],luminosity:100*e[2],alpha:e[3]})}},[u,s]);let p=t=>{e.popperProps.ref.current.contains(t.target)||(t.preventDefault(),t.stopPropagation(),d())},g=e=>{fe(e)&&(e.preventDefault(),e.stopPropagation(),d()),g9(e)&&(e.preventDefault(),e.stopPropagation(),r())};return(0,ev.useEffect)(()=>(document.addEventListener("mousedown",p,!0),document.addEventListener("keydown",g,!0),()=>{document.removeEventListener("mousedown",p,!0),document.removeEventListener("keydown",g,!0)})),ev.createElement(g0,{error:!a,className:"animated animate-fast fadeIn",isBottom:"bottom"===t["data-popper-placement"],popperProps:t},ev.createElement(g1,null,ev.createElement(g2,null,ev.createElement(gJ.Z,{variant:"persistent",...m,onInput:e=>{n(gW().hsl(e,1,.7000000000000001).hex())},onChange:r})),ev.createElement(g5,null,ev.createElement(g3,null,ev.createElement(eY.Z,{id:"general.custom_color",defaultMessage:"Custom Color"})),!a&&ev.createElement(g7,null,ev.createElement(eY.Z,{id:"general.use_slightly_darker_colors_and_format",defaultMessage:"Use slightly darker colors and format as e.g., '#4996F6'"})),ev.createElement(g4,{className:og()("wrapper","custom-color-wrapper","animated",{subtleshake:!a})},ev.createElement(g6,{type:"text",className:"custom-color",placeholder:"e.g. #FF60F4",name:o,onChange:l,value:s}),ev.createElement(g8,{className:"space-color",color:s,"aria-label":"Select",type:"button",onClick:r},"Set")))))},fa=(0,lv.assign)((e,t)=>{if("ACTIVATE"!==t.type)throw Error("invalid execution path");let{value:a}=t.payload;return(0,es.ZP)(e,e=>(e.text=a,e))}),fn=(0,lv.assign)((e,t)=>{if("TYPING"!==t.type)throw Error("invalid execution path");let{value:a}=t.payload;return(0,es.ZP)(e,e=>(e.text=a,e))}),fl=(0,lv.assign)(e=>{let t=gX(e.text);if(null==t)throw Error("color value is not valid");return(0,es.ZP)(e,e=>(e.text=t,e))}),fr=(0,lb.J)({id:"customColorOption",context:{text:""},initial:"idle",states:{idle:{on:{ACTIVATE:{actions:["activate","activated"],target:"active"}}},active:{initial:"valid",on:{DEACTIVATE:{actions:["deactivated"],target:"idle"},TYPING:{actions:["typing"]},VALIDATE:[{actions:["validated","changed"],target:"idle",cond:{type:"isValid"}},{target:"active.invalid",internal:!0}]},states:{valid:{},invalid:{}}}}},{actions:{activate:fa,typing:fn,validated:fl},guards:{isValid:function(e){let{text:t}=e;return null!=gX(t)}}}),fo=eL.default.div.withConfig({displayName:"CustomColorOption__Color",componentId:"sc-2b222241-0"})` + display: flex; + width: 30px; + height: 30px; + position: relative; + margin-right: 10px; +`,fi=eL.default.div.withConfig({displayName:"CustomColorOption__ColorPickerPopoverToggle",componentId:"sc-2b222241-1"})` + display: flex; + width: 30px; + height: 30px; + align-items: center; + justify-content: center; + border-radius: 50px; + cursor: pointer; + border: 2px solid ${e=>e.color??"transparent"}; + padding: ${e=>e.color?"2px":"0px"}; +`,fs=function(e){let{name:t,onChange:a,value:n}=e,{popperProps:l,referenceProps:r,setVisible:o}=(0,eI.useUncontrolledPopover)({placement:"top"}),{isOpen:i,isValid:s,handleChange:d,handleToggle:c,handleValidate:m,handleUpdate:u,text:p}=function(e){let{onChange:t,value:a,setPopoverVisible:n}=e,[l,r]=(0,ls.e)(fr,{actions:{changed:e=>(t(e.text),e),activated:e=>(n(!0),e),deactivated:e=>(n(!1),e)}}),{text:o}=l.context,i=!l.matches("idle");return{isOpen:i,isValid:!l.matches("active.invalid"),handleChange:e=>{r({type:"TYPING",payload:{value:e.target.value}})},handleToggle:()=>{i?r("DEACTIVATE"):r({type:"ACTIVATE",payload:{value:null==a?"":eI.SupportedColors.has(a)?eI.SupportedColors.get(a):gW().valid(a)?a:""}})},handleValidate:()=>{r("VALIDATE")},handleUpdate:(0,ev.useCallback)(e=>{r({type:"TYPING",payload:{value:e}})},[r]),text:o}}({onChange:a,value:n,setPopoverVisible:o});(0,ev.useEffect)(()=>u(n),[u,n]);let g=(0,ev.useMemo)(()=>null==n||new Set(eI.SupportedColors.values()).has(n)?null:n,[n]),f=null!=n;return ev.createElement(fo,{className:og()("form-check-custom",{focus:i||f,hasCustomColor:f})},ev.createElement(fi,{...r,className:"space-color",disabled:i,onMouseDown:c,color:g},ev.createElement(lT.ce,null)),i&&ev.createElement(ft,{popperProps:l,isValid:s,handleUpdate:u,handleChange:d,handleValidate:m,name:t,value:n,text:p,dismiss:c}))},fd=eL.default.div.withConfig({displayName:"ColorInput__ColorOptions",componentId:"sc-a8995009-0"})` + display: flex; + flex-direction: row; +`,fc=function(e){let{name:t,onChange:a}=e,n=(0,ev.useMemo)(()=>{try{let t=e.value.trim().toLowerCase();return gW()(eI.SupportedColors.get(t)??t).hex("rgb")}catch(e){return null}},[e.value]);return ev.createElement(fd,null,ev.createElement(fs,{name:t,onChange:a,value:n}),Array.from(eI.SupportedColors.entries(),e=>{let[l,r]=e;return ev.createElement(gQ,{key:l,checked:n===r,label:l,name:t,onChange:a,value:r})}))},fm=function(e){let{visibility:t}=e;switch(t){case"collaborator":return ev.createElement(tn.Icon,{icon:"access_edit"});case"participant":return ev.createElement(tn.Icon,{icon:"access_checker"});case"viewer":return ev.createElement(tn.Icon,{icon:"access_viewer"});default:return ev.createElement(tn.Icon,{icon:"access_invite"})}},fu={id:"collaborator",name:"Collaborator",value:"collaborator"},fp={id:"participant",name:"Checker",value:"participant",isPaidFeature:!0},fg={id:"viewer",name:"Viewer",value:"viewer"},ff=[[fu.id,fu],[fp.id,fp],[fg.id,fg]],fh=new Map(ff),fy=eL.default.button.withConfig({displayName:"styled__FolderVisibilityButton",componentId:"sc-3d21f1ad-0"})` + display: flex; + width: 100%; + color: ${e=>e.theme.textColors.hex(50)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + border-radius: 0.625rem; + padding: 0.375rem 0.75rem; + + ${e1.UiTypography.sm}; + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } + + & svg { + margin-left: auto; + } +`,fb=eL.default.div.withConfig({displayName:"styled__ButtonTitle",componentId:"sc-3d21f1ad-1"})` + display: flex; + gap: var(--menu-item-gap); + align-items: center; +`,fv=eL.default.div.withConfig({displayName:"styled__MenuTitle",componentId:"sc-3d21f1ad-2"})` + display: flex; + flex-direction: column; + align-items: flex-start; +`,fk=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-3d21f1ad-3"})` + display: flex; + max-width: 430px; + overflow: auto; + flex-direction: column; + color: ${e=>e.theme.textColors.hex(10)}; + padding: 0.5rem 0; + border-radius: 0.625rem; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + ${tM}; + + max-height: auto; + @media (max-height: 800px) { + max-height: 260px; + } +`,fE=eL.default.button.withConfig({displayName:"styled__MenuButton",componentId:"sc-3d21f1ad-4"})` + display: grid; + grid-template-columns: auto 1fr auto; + grid-gap: var(--menu-item-gap); + flex-direction: row; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)} !important; + padding: 0.375rem 0.75rem; + text-align: left; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,fx=eL.default.span.withConfig({displayName:"styled__RoleTitle",componentId:"sc-3d21f1ad-5"})` + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; +`,f_=eL.default.span.withConfig({displayName:"styled__RoleDescription",componentId:"sc-3d21f1ad-6"})` + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm}; + margin-top: 0.25rem; + white-space: normal; +`,fw=eL.default.div.withConfig({displayName:"styled__Selected",componentId:"sc-3d21f1ad-7"})` + display: flex; + height: 100%; + margin-left: auto; + align-items: center; +`,fN=eL.default.span.withConfig({displayName:"styled__Badge",componentId:"sc-3d21f1ad-8"})` + align-self: flex-start; + display: flex; + width: fit-content; + color: #ffffff; + border-radius: 20px; + text-transform: uppercase; + margin-left: 5px; + font-size: 10px; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(2)}; + font-weight: 600; + user-select: none; + background: #766ef1; +`,fC=function(e){let{name:t,value:a,children:n}=e,l=(0,ev.useRef)(null),r=(0,eI.useMenuItem)({stopRef:l,name:t,value:a});return ev.createElement(fE,r.props,n)},fM=function(e){let{visibility:t}=e;switch(t){case"collaborator":return ev.createElement(f_,null,ev.createElement(eY.Z,{id:"general.workspace_viewers_will_remain_viewers",defaultMessage:"Workspace viewers will remain viewers."}));case"participant":return ev.createElement(f_,null,ev.createElement(eY.Z,{id:"general.workspace_editors_will_be_downgraded_to_checkers",defaultMessage:"Workspace editors will be downgraded to checkers."}));case"viewer":return ev.createElement(f_,null,ev.createElement(eY.Z,{id:"general.workspace_editors_will_be_downgraded_to_viewers",defaultMessage:"Workspace editors will be downgraded to viewers."}));default:return ev.createElement(f_,null,ev.createElement(eY.Z,{id:"general.this_folder_will_only_be_visible_to_you_and_people_or_groups_you_invite",defaultMessage:"This folder will only be visible to you and people or groups you invite."}))}},fS=function(e){let{workspaceName:t,visibility:a}=e;switch(a){case"collaborator":return ev.createElement(fx,null,ev.createElement(eY.Z,{id:"general.everyone_at_workspace_can_edit",defaultMessage:"Everyone at {workspaceName} can edit",values:{workspaceName:t}}));case"participant":return ev.createElement(fx,null,ev.createElement(eY.Z,{id:"general.everyone_at_workspace_can_check",defaultMessage:"Everyone at {workspaceName} can check",values:{workspaceName:t}}));case"viewer":return ev.createElement(fx,null,ev.createElement(eY.Z,{id:"general.everyone_at_workspace_can_view",defaultMessage:"Everyone at {workspaceName} can view",values:{workspaceName:t}}));default:return ev.createElement(fx,null,ev.createElement(eY.Z,{id:"general.folder_invite_only",defaultMessage:"Invite only"}))}},fI=function(e){let{menuGroupDispatch:t,initialFocus:a,roleEntries:n,selectedEntry:l,workspaceName:r}=e,o=gV();return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(fk,{initialFocus:a,loop:!0},ev.createElement(fC,{name:"visibility"},ev.createElement(fm,{visibility:"invite_only"}),ev.createElement(fv,null,ev.createElement(fS,{visibility:"invite_only",workspaceName:r}),ev.createElement(fM,{visibility:"invite_only"})),null==l&&ev.createElement(fw,null,ev.createElement(tn.Icon,{icon:"dd_check"}))),n.map(e=>{let[t,a]=e,n=(fh.get(a.value)?.isPaidFeature??!1)&&o.isPaywallEnabled;return ev.createElement(fC,{key:t,name:"visibility",value:a.value},ev.createElement(fm,{visibility:a.value}),ev.createElement(fv,null,ev.createElement(fS,{visibility:a.value,workspaceName:r}),ev.createElement(fM,{visibility:a.value})),l?.value===a.value&&!n&&ev.createElement(fw,null,ev.createElement(tn.Icon,{icon:"dd_check"})),n&&ev.createElement(fN,null,ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))})))},fD=function(e){let{onChange:t,value:a,workspaceName:n,parentSpaceId:l,className:r}=e,o=(0,e$.useDispatch)(),i=gV(),s=ev.useRef(null),d=ev.useRef(null),[c,m]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),u=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:c,placement:"bottom-start"}),p=(0,eI.useMenuButton)({state:c,dispatch:m,ref:s}),g=ev.useCallback(e=>{if(null!=e&&fh.get(e)?.isPaidFeature&&i.isPaywallEnabled){o(d4(l));return}t(e)},[o,t,l,i.isPaywallEnabled]),f=ev.useCallback(e=>{"Activate"===e.type&&("visibility"===e.payload.name&&g(e.payload.value??null),m({type:"Collapse"}))},[g,m]),h=null!=a?fh.get(a):null;return ev.createElement("div",{className:r},ev.createElement(fy,{type:"button",...p.props},ev.createElement(fb,null,ev.createElement(fm,{visibility:a}),ev.createElement(fS,{visibility:a,workspaceName:n})),ev.createElement(tn.Icon,{icon:"caret_down"})),c.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:m,modal:!0},ev.createElement(fI,{menuGroupDispatch:f,initialFocus:u.initialFocus,roleEntries:ff,selectedEntry:h,workspaceName:n})))},fT=new Set([null,"collaborator","participant","viewer"]),f$="@@taskade/dialogs/TOGGLE_INVITE_MODAL_DIALOG";function fP(e){return{type:f$,payload:{resource:eu()(e)?null:{type:"document",id:e}}}}function fF(e){return{type:f$,payload:{resource:eu()(e)?null:{type:"space",id:e}}}}function fA(){return{type:f$,payload:{resource:null}}}var fR=a(2882),fj=a(21697);let fO={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MembershipsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NamedType",name:{kind:"Name",value:"MembershipFiltering"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MembershipParts"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Space"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MembershipParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceParts"}}]}}]}}]},fU={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"WorkspaceCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"WorkspaceCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workspaceCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"errors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"Field",name:{kind:"Name",value:"status"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"reason"}}]}},{kind:"Field",name:{kind:"Name",value:"workspace"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MembershipParts"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Space"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MembershipParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceParts"}}]}}]}}]},fZ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"WorkspaceLimitQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"appSumo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"invoiceItemUuid"}},{kind:"Field",name:{kind:"Name",value:"licensedSpaceLimit"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"state"}}]}},{kind:"Field",name:{kind:"Name",value:"subscriptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"active"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"membershipType"},value:{kind:"EnumValue",value:"space"}},{kind:"ObjectField",name:{kind:"Name",value:"role"},value:{kind:"StringValue",value:"owner",block:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]};function fL(e){return fetch(e,{credentials:"same-origin",method:"GET",headers:{"X-Requested-With":"XMLHttpRequest"}})}function fB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return fetch(e,{credentials:"same-origin",method:"POST",headers:{"X-Requested-With":"XMLHttpRequest",...t},body:a})}function fz(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return fetch(e,{credentials:"same-origin",method:"PUT",headers:{"X-Requested-With":"XMLHttpRequest",...t},body:a})}function fV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return fetch(e,{credentials:"same-origin",method:"DELETE",headers:{"X-Requested-With":"XMLHttpRequest",...t},body:a})}function fq(e){if(!window||window.window!==window)throw Error("This module is only available in browser");let t=window.Blob||window.MozBlob||window.WebKitBlob;if(!t)throw Error("Blob was not supported");let a=e.match(/^data:((.*?)(;charset=.*?)?)(;base64)?,/);if(!a)throw Error("invalid dataURI");let n=a[2]?a[1]:`text/plain${a[3]||";charset=utf-8"}`,l=!!a[4],r=e.slice(a[0].length),o=l?atob(r):decodeURIComponent(r),i=[];for(let e=0;e{let t=d.current?.getContext("2d");if(null==t)return;let a=e.naturalWidth,n=e.naturalHeight,l=Math.min(a,n),o=(a-l)*.5,i=(n-l)*.5;t.drawImage(e,o,i,l,l,0,0,t.canvas.width,t.canvas.height),r(e)},[r]),m=ev.useCallback(()=>{if(o){let{type:e,size:t}=o,a=d.current?.toDataURL(e);return null==a?null:{dataURL:a,type:e,size:t}}return null},[o]),u=ev.useCallback(()=>{let e=d.current?.getContext("2d");null!=e&&e.clearRect(0,0,e.canvas.width,e.canvas.height)},[]);ev.useImperativeHandle(t,()=>({getImage:m}),[m]),ev.useEffect(()=>{null!=o?new Promise((e,t)=>{let a=new FileReader;a.onload=a=>{try{var n,l;let t=(n=a.target.result,new Promise((e,t)=>{let a=new Image;a.onload=()=>e(a),a.onerror=t,!1==(null!=n&&!!n.match(/^\s*data:([a-z]+\/[a-z]+(;[a-z-]+=[a-z-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=\-._~:@/?%\s]*\s*$/i))&&l&&(a.crossOrigin=l),a.src=n}));e(t)}catch(e){t(e)}},a.readAsDataURL(o)}).then(c).catch(l):u()},[c,o,l,u]);let p=1;a{a||c(null)},[a]);let m=ev.useCallback(()=>{c(null),o({details:"Image failed to load. Please upload a valid jpg or png file."})},[o]),u=ev.useCallback(e=>{let{height:t,width:a}=e;t{let t=e.target.files?.[0];null!=t&&c(t)},[]),g=ev.useCallback(()=>d?s.current?.getImage()??null:null,[d]),f=ev.useCallback(()=>{c(null)},[]);return(ev.useImperativeHandle(t,()=>({getImage:g,reset:f,setImage:p}),[g,f,p]),a)?ev.createElement(f2,{ref:s,height:n,image:d,minimumAvatarDimension:r,onLoadSuccess:u,onLoadFailure:m,width:l}):null}),f3=eL.default.div.withConfig({displayName:"PopoverWithEventTrap__EventPropagationTrap",componentId:"sc-211d1bb1-0"})` + display: flex; + flex-direction: column; +`,f4=function(e){let{children:t,onToggle:a,popperProps:n}=e,l=e.repelFocus??!1,r=(0,ev.useMemo)(()=>{if(l)return{onMouseDown:e=>{e.preventDefault()}}},[l]),o=(0,ev.useCallback)(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return ev.createElement(eI.Popover,{modal:!0,backdropProps:r,popperProps:n,onToggle:a},ev.createElement(f3,{onClick:o},t))},f6=function(e){let{onEmojiPick:t,role:a}=e;return ev.createElement(gm,{role:a,onClick:t,hideBorder:!0})};eL.default.div.withConfig({displayName:"styled__EventPropagationTrap",componentId:"sc-135a703d-0"})` + display: flex; + flex-direction: column; + border: 0px; + border-radius: 5px; + padding: 0px; +`;let f8=(0,eL.default)(eI.TabList).withConfig({displayName:"styled__StyledTabList",componentId:"sc-135a703d-1"})` + display: flex; + color: ${e=>e.theme.textColors.hex(10)}; + grid-gap: 10px; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,f7=eL.default.div.withConfig({displayName:"styled__StyledTab",componentId:"sc-135a703d-2"})` + display: flex; + align-items: center; + color: ${e=>e.selected?e.theme.appColors.hex(10):e.theme.appColors.hex(50)}; + border-bottom: 2px solid + ${e=>e.$selected?e.theme.appColors.hex(50):"transparent"}; + font-weight: ${e=>e.selected?"500":"400"}; + padding: 0 0 8px; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(10)}; + } +`,f9=eL.default.div.withConfig({displayName:"styled__PopoverBody",componentId:"sc-135a703d-3"})` + min-width: 395px; + padding: 16px 20px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + + & .emoji-mart { + display: flex; + flex-direction: column; + border: 0; + background: none; + border-radius: 0; + } + & .emoji-mart-bar { + border-color: transparent; + display: none; + } + & .emoji-mart-search, + & .emoji-mart-scroll { + padding: 0; + } + & .emoji-mart-category-label span { + padding-left: 0; + } +`,he=eL.default.div.withConfig({displayName:"styled__UploadTabWrapper",componentId:"sc-135a703d-4"})` + display: flex; + padding: 20px 0 0; + + & label { + display: flex; + flex: 1; + justify-content: center; + border: 1px dashed ${e=>e.theme.appColors.hex(60)}; + border-radius: 10px; + padding: 20px; + color: #999; + cursor: pointer; + transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out; + + &:hover { + border-color: ${e=>e.theme.appColors.hex(50)}; + color: ${e=>e.theme.textColors.hex(10)}; + } + } + + & input { + display: none; + } +`,ht=function(e){let{disabled:t,onChange:a,role:n}=e;return ev.createElement(he,null,ev.createElement("label",{htmlFor:"avatar-editor-file-popover"},"Select image to upload"),ev.createElement("input",{role:n,id:"avatar-editor-file-popover",name:"avatar",type:"file",accept:".jpg,.jpeg,.png",onChange:a,disabled:t}))};!function(e){e.Emoji="emoji",e.Upload="upload"}(A||(A={}));let ha=function(e){let{onEmojiPick:t,onImageChange:a}=e,[n,l]=(0,ev.useState)("emoji"),r=(0,ev.useCallback)(e=>l(e),[]);return ev.createElement(f9,null,ev.createElement(f8,{value:n,onChange:r},ev.createElement(f7,{value:"emoji"},ev.createElement(eY.Z,{id:"general.choose_emoji",defaultMessage:"Choose Emoji"})),ev.createElement(f7,{value:"upload"},ev.createElement(eY.Z,{id:"general.upload",defaultMessage:"Upload"}))),ev.createElement(eI.TabPanelSwitch,{value:n},ev.createElement(f6,{value:"emoji",onEmojiPick:t}),ev.createElement(ht,{value:"upload",onChange:a})))},hn=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-9a33770e-0"})` + display: flex; + width: 100px; + height: 100px; + overflow: hidden; + margin: 0px auto; + border-radius: 10px; + border: 1px dashed ${e=>e.$isEmpty?e.theme.appColors.hex(70):"transparent"}; + position: relative; + + &:hover { + border-color: ${e=>e.$isEmpty?e.theme.appColors.hex(60):"transparent"}; + } + transition: border-color 0.2s ease-in-out; +`,hl=eL.default.div.withConfig({displayName:"styled__AvatarPlaceholder",componentId:"sc-9a33770e-1"})` + display: flex; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + position: absolute; + & svg path { + fill: ${e=>e.theme.appColors.hex(60)}; + transition: fill 0.2s ease-in-out; + } + + ${hn}:hover & { + svg path { + fill: ${e=>e.theme.appColors.hex(10)}; + } + } +`,hr=eL.default.div.withConfig({displayName:"styled__AvatarContainer",componentId:"sc-9a33770e-2"})` + display: flex; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + font-size: 48px; + line-height: 48px; + position: absolute; + + img { + width: 100px; + height: 100px; + } +`,ho=eL.default.button.withConfig({displayName:"styled__PopoverButton",componentId:"sc-9a33770e-3"})` + position: absolute; + background: none; + margin: 0; + padding: 0; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + + height: 100px; + width: 100px; + + &:focus { + outline: 0; + } +`,hi=eL.default.button.withConfig({displayName:"styled__DeleteButton",componentId:"sc-9a33770e-4"})` + display: flex; + position: absolute; + height: 30px; + width: 30px; + border: 0; + border-radius: 10px; + cursor: pointer; + padding: 0; + right: 5px; + bottom: 5px; + background: ${e=>e.theme.appColors.hex(100)}; + transition: background-color 0.2s ease-in-out; + + :focus { + outline: 0; + } + + & svg path { + fill: ${e=>e.theme.appColors.hex(60)}; + transition: fill 0.2s ease-in-out; + } + + :hover { + background: ${e=>e.theme.appColors.hex(70)}; + & svg path { + fill: ${e=>e.theme.appColors.hex(10)}; + } + } +`,hs=ev.forwardRef(function(e,t){let{disabled:a,emoji:n,imageURL:l,onClose:r,onDeleteButtonClick:o,onEmojiPick:i,onImageLoadFailure:s,onImageLoadSuccess:d}=e,c=e.popoverPlacement??"bottom",m=e.hasNewImage??!1,u=null!=l||m||null!=n,p=(0,eI.useUncontrolledPopover)({placement:c}),g=p.visible,f=p.setVisible,h=ev.useRef(null),y=ev.useCallback(()=>{f(()=>!a)},[a,f]),b=ev.useCallback(e=>{"native"in e&&null!=e.native&&i?.(e.native),f(!1)},[i,f]),v=ev.useCallback(e=>{h.current?.setImage(e),f(!1)},[h,f]),k=ev.useCallback(()=>{let e=!g;f(e),e||r?.()},[r,g,f]),E=ev.useCallback(()=>h.current?.getImage()??null,[h]),x=ev.useCallback(()=>{h.current?.reset()},[h]);return ev.useImperativeHandle(t,()=>({getImage:E,resetImage:x}),[E,x]),ev.createElement(hn,{$isEmpty:!l||!m||null==n},!m&&ev.createElement(ev.Fragment,null,ev.createElement(hr,null,l&&null==n&&ev.createElement("img",{alt:"avatar",src:l}),n),!l&&null==n&&ev.createElement(hl,null,ev.createElement(lT.c$,null))),ev.createElement(f5,{isOpen:!0,editorHeight:100,editorWidth:100,minimumAvatarDimension:100,onLoadFailure:s,onLoadSuccess:d,ref:h}),!m&&ev.createElement(ho,{...p.referenceProps,type:"button",onClick:y,disabled:a}),p.visible&&ev.createElement(f4,{popperProps:p.popperProps,onToggle:k},ev.createElement(ha,{onEmojiPick:b,onImageChange:v})),u&&ev.createElement(hi,{onClick:o,type:"button"},ev.createElement(lT.$F,null)))}),hd=eL.default.div.withConfig({displayName:"FieldAvatar__FlexContainer",componentId:"sc-b067b3e7-0"})``,hc=eL.default.div.withConfig({displayName:"FieldAvatar__ErrorContainer",componentId:"sc-b067b3e7-1"})` + margin-top: 10px; +`,hm=function(e){let{emoji:t,error:a,onError:n,onAvatarChange:l,onEmojiChange:r,value:o}=e,i=ev.useRef(null),s=ev.useCallback(e=>{let{details:t}=e;l(null),n("avatar",{field:"avatar",message:t}),i.current&&i.current.resetImage()},[l,n]),d=ev.useCallback(()=>{l({avatarEditor:i.current}),eu()(a)||n("avatar",null),null!=t&&r(null)},[t,a,l,r,n]),c=ev.useCallback(()=>{confirm("Are you sure you want to delete the avatar?")&&(l(null),i.current&&i.current.resetImage())},[l]);return ev.createElement(hd,{className:"workspace-avatar"},a&&ev.createElement(hc,null,ev.createElement("input",{name:"avatar",type:"hidden",value:"Please upload an image with at least 100x100 pixels."}),ev.createElement(rO,null,a.message)),ev.createElement("fieldset",{className:"form-group custom-image"},ev.createElement("div",{className:"mt-4"},ev.createElement(hs,{ref:i,emoji:t,onDeleteButtonClick:c,onEmojiPick:r,onImageLoadFailure:s,onImageLoadSuccess:d,hasNewImage:!eu()(o)}))),ev.createElement("input",{type:"hidden",name:"emoji",value:t??void 0}))},hu=function(e){let{onChange:t,...a}=e,n=ev.useRef(null),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1});return ev.useEffect(()=>{n.current?.focus()},[]),ev.createElement("div",{className:"form-group folder-name-group"},ev.createElement(rZ,{htmlFor:"space-name"},ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})),ev.createElement(rB,{className:"mt-2"},ev.createElement(rz,{id:"space-name",type:"text",placeholder:"Ex. Acme or Acme Marketing",maxLength:45,ref:n,onChange:e=>{let{value:a}=e.target;t(a)},autoComplete:"off",onKeyDown:e=>{e.key===eI.KeyboardKeys.Escape&&l.expanded&&(e.stopPropagation(),e.preventDefault(),r({type:"Collapse"}))},...a}),ev.createElement(gf,{onEmojiPick:e=>{if(null==n.current)return;let{current:a}=n;if(ts()(a.value))t(e.native);else{let{start:n,end:l}=oN(a);t(gl(a.value,e.native,n,l))}a.focus()},onClose:()=>{n.current?.focus()},state:l,dispatch:r})))},hp=eL.default.h1.withConfig({displayName:"Header__StyledHeader",componentId:"sc-760d9965-0"})` + // Inherited + display: flex; + font-size: 24px !important; + padding-bottom: 0 !important; + justify-content: center; + color: ${e=>e.theme.textColors.hex(10)}; +`,hg=function(e){let{parentID:t}=e;return ev.createElement(hp,null,ts()(t)?ev.createElement(eY.Z,{id:"create_a_workspace",defaultMessage:"Create a workspace"}):ev.createElement(eY.Z,{id:"create_a_folder",defaultMessage:"Create a folder"}))};eL.default.div.withConfig({displayName:"Styles__ColorOptions",componentId:"sc-b7c268a0-0"})` + display: flex; + flex-direction: row; +`;let hf=eL.default.button.attrs(e=>({"aria-label":"Submit",type:"submit"})).withConfig({displayName:"Styles__Submit",componentId:"sc-b7c268a0-1"})` + display: flex; + width: 100%; + padding: 12px; + cursor: pointer; + justify-content: center; + outline: 0 !important; + margin-top: 30px; + border: 0; + border-radius: 12px; + text-decoration: none; + font-weight: 500; + color: #ffffff; + font-size: 1.2rem; + background: ${e=>e.theme?.primaryColorScheme?.base}; + + &:hover { + transform: scale(1.03); + } +`,hh=function(e){let{isSubspace:t,isSubmitting:a,color:n,onSubmit:l}=e,r=e=>{e.preventDefault(),l()},{className:o,style:i}=ev.useMemo(()=>ts()(n)?{}:eI.SupportedColors.has(n)?{className:og()("space-color",n),style:void 0}:gW().valid(n)?{className:"space-color",style:{background:n}}:{},[n]);return a?ev.createElement(hf,{className:o,style:i,onClick:r,disabled:!0},ev.createElement(eI.Spinner,{color:"#ffffff"})):ev.createElement(hf,{className:o,style:i,onClick:r},t?ev.createElement(eY.Z,{id:"general.create_folder",defaultMessage:"Create folder"}):ev.createElement(eY.Z,{id:"general.create_workspace",defaultMessage:"Create workspace"}))},hy=eL.default.div.withConfig({displayName:"CreateSpaceDialogBody__FlexContainer",componentId:"sc-943448ab-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 12px; + padding: 40px 60px; + background: ${e=>e.theme.appColors.hex(100)}; +`,hb=eL.default.form.withConfig({displayName:"CreateSpaceDialogBody__Form",componentId:"sc-943448ab-1"})` + & > *:last-child { + margin-bottom: 0; + } +`,hv=eL.default.button.withConfig({displayName:"CreateSpaceDialogBody__CloseModal",componentId:"sc-943448ab-2"})` + display: flex; + width: 40px; + height: 40px; + align-items: center; + justify-content: center; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.appColors.hex(50)}; + border-radius: 40px; + border: 0; + position: absolute; + top: -15px; + right: -15px; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + transition: transform 150ms ease-in-out; + + &:hover { + cursor: pointer; + background-color: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + transform: scale(1.2); + } + + &:focus { + outline: 0; + transform: scale(0.9); + } +`,hk=eL.default.div.withConfig({displayName:"CreateSpaceDialogBody__Container",componentId:"sc-943448ab-3"})` + position: relative; + z-index: 1; + backdrop-filter: blur(7px); + width: 100%; + width: 420px !important; + min-width: 100% !important; + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 0.75rem; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,hE=(0,e$.connect)(function(e){return{parentID:ec()(e,["modal","createSpace","parentID"],null),parentName:ec()(e,["modal","createSpace","parentName"],null),parentType:function(e){let t=ec()(e,["modal","createSpace","parentType"])??"";return ii.has(t)?t:null}(e),parentTaskadePlanType:ec()(e,["modal","createSpace","parentTaskadePlanType"],null)}})(function(e){var t;let{state:a,exit:n,parentID:l,parentName:r,parentType:o,parentTaskadePlanType:i}=e,s=(0,e$.useDispatch)(),{errors:d,fields:c,handleAvatarChange:m,handleEmojiChange:u,handleColorChange:p,handleError:g,handleNameChange:f,handleSubmit:h,handleVisibilityChange:y,submitting:b,formState:v,sendFormEvent:k}=function(e){let{parentID:t,exit:a,toggleSpaceInviteModalDialog:n}=e,l=(0,e$.useDispatch)(),r=(0,eF.k6)(),o=(0,ll.x)(),[i,s]=(0,ls.e)(f0,{context:{fields:{avatar:null,emoji:null,color:eI.Colors.BLUE,name:"",parentID:t,visibility:null},errors:[]},actions:{erring:(0,lv.assign)((e,t)=>{let{field:a,value:n}=t.payload;return(0,es.ZP)(e,e=>{let t=p6()(e.errors,{field:a});return -1===t?eu()(n)||e.errors.push(n):eu()(n)?e.errors.splice(t,1):e.errors[t]=n,e})}),submit:(0,lv.assign)(e=>(0,es.ZP)(e,e=>(e.errors=[],e))),typing:(0,lv.assign)((e,t)=>{let{field:a,value:n}=t.payload;return{...e,fields:{...e.fields,[a]:n}}}),onSubmitted:(0,lv.assign)((e,t)=>{let{data:a}=t;return{...e,workspace:a}}),onSubmitError:(0,lv.assign)((e,t)=>{let{data:a}=t;return(0,es.ZP)(e,e=>(eu()(a.errors)?e.errors=[a]:e.errors=a.errors,e))}),onInitialized:(0,lv.assign)((e,t)=>{let{data:a}=t;return{...e,workspaceLimit:a}}),onFailed:(0,lv.assign)((e,t)=>{let{data:a}=t;return(0,es.ZP)(e,e=>(a instanceof ei.HttpError?e.errors=[{field:"form",message:a.message}]:eu()(a.errors)?e.errors=[a]:e.errors=a.errors,e))})},services:{initialize:async e=>{if(null!=e.fields.parentID)return null;let{me:t,memberships:a}=(await o.query({query:fZ,fetchPolicy:"network-only"})).data;if(null==t)throw new ei.HttpError({code:"UNAUTHORIZED"});let n=t.appSumo?.taskadePlanType??"free",l=fR.Vl.getFeature("workspace.limit").plans[n],r=a?.totalCount??0;if("unlimited"!==l&&r>=l){let e=function(e){switch(e){case"free":return"Free";case"v1.pro":return"Pro (Legacy)";case"v2.unlimited":return"Unlimited (Legacy)";case"v3.starter":return"Starter";case"v3.plus":return"Plus";case"v3.pro":return"Pro";case"v3.business":return"Business";case"v3.ultimate":return"Ultimate";case"v3.enterprise":return"Enterprise";case"taskade_tier1":return"Appsumo Tier 1";case"taskade_tier2":return"Appsumo Tier 2";case"taskade_tier3":return"Appsumo Tier 3";default:return e}}(n),t=new fj.ZP(`You've reached the limit of {workspaceLimit, plural, + =0 {# workspace} + =1 {# workspace} + other {# workspaces} + } on the {planName} plan. Upgrade to unlock more.`,"en-US").format({workspaceLimit:l,planName:e}).toString();throw new ei.HttpError({code:"FOUND",message:t,extensions:{location:"free"===n?"/upgrade":"/settings/plans"}})}return{taskadePlanType:n,workspaceCount:r}},failed:async(e,t)=>{let{data:n}=t;if(n instanceof ei.HttpError){let e="FOUND"===n.code?n.extensions.location:void 0;"string"==typeof e&&("/upgrade"===e?l(d4()):(r.push(e),a()))}},submitting:async(e,t)=>{let{clientMutationId:a}=t.payload,{avatar:n,color:l,emoji:r,name:i,parentID:s,visibility:d}=e.fields,c=lg(!1,s),m=await o.mutate({mutation:fU,variables:{input:{clientMutationId:a,color:l,emoji:r,name:i,parentID:s,visibility:d}},update:(e,t)=>{let a=t.data?.workspaceCreate.workspace?.memberships;if(null==a)return;let n=e.readQuery({query:fO,variables:c});if(null==n)return;let l=n.memberships;null!=l&&e.writeQuery({query:fO,variables:c,data:{...n,memberships:{...l,edges:[...l.edges,...a.map(e=>({node:e,__typename:"MembershipEdge"}))]}}})}});if(null==m.data)throw new ei.HttpError({code:"UNKNOWN_ERROR"});let{workspace:u}=m.data.workspaceCreate,p=n?.avatarEditor?.getImage()??null;if(!eu()(p)){let e=await fX(u.id,p);eu()(e)}return u},submitted:async e=>{if(null==e.workspace){a();return}null==e.fields.parentID?r.push(`/spaces/${e.workspace.id}`):r.push(`/spaces/${e.fields.parentID}/subspaces/${e.workspace.id}`),n(e.workspace.id),a()}}}),{fields:d,errors:c,workspaceLimit:m}=i.context,u=(0,ev.useMemo)(()=>{let e={};for(let t of c){let{field:a}=t;e[a]=t}return e},[c]),p=ev.useCallback(e=>{s({type:"TYPING",payload:{field:"avatar",value:e}})},[s]);return{errors:u,fields:d,workspaceLimit:m,handleAvatarChange:p,handleEmojiChange:ev.useCallback(e=>{s({type:"TYPING",payload:{field:"emoji",value:e}})},[s]),handleError:ev.useCallback((e,t)=>{s({type:"ERRING",payload:{field:e,value:t}})},[s]),handleColorChange:e=>{s({type:"TYPING",payload:{field:"color",value:e}})},handleNameChange:e=>{s({type:"TYPING",payload:{field:"name",value:e}})},handleSubmit:()=>{s({type:"SUBMIT",payload:{clientMutationId:(0,ld.Z)()}})},handleVisibilityChange:e=>{s({type:"TYPING",payload:{field:"visibility",value:e}})},submitting:i.matches("submitting"),formState:i,sendFormEvent:s}}({parentID:l,exit:n,toggleSpaceInviteModalDialog:ev.useCallback(e=>{s(fF(e))},[s])}),E=a.matches("entered"),x=v.matches("uninitialized");if(ev.useEffect(()=>{E&&x&&k({type:"INITIALIZE"})},[E,x,k]),x||v.matches("initializing"))return ev.createElement(hk,{className:"rounded-3xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement("div",{className:"flex w-full flex-col gap-4 overflow-clip rounded-xl border border-appcolor-300 p-8"},ev.createElement(eI.Spinner,null)));if(v.matches("failed")){let e=d.form;return ev.createElement(hk,{className:"rounded-3xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement("div",{className:"w-full rounded-xl p-3"},ev.createElement("div",{className:"flex w-full flex-col gap-4 overflow-clip rounded-xl border border-appcolor-300 px-6 py-4"},ev.createElement("h4",{className:"flex items-center font-medium"},ev.createElement(tn.Icon,{icon:"dd_upgrade",className:"mr-1.5 shrink-0 pr-1"}),ev.createElement(eY.Z,{id:"general.workspace_limit",defaultMessage:"Workspace Limit"})),ev.createElement("div",{className:"flex text-sm text-appcolor-800"},e?.message??"Unknown Error"),ev.createElement("a",{className:"mt-3 flex w-full items-center justify-center rounded-full bg-upgrade py-2 text-sm font-bold text-textdark-100 transition duration-150 ease-in-out hover:bg-upgrade/75",href:"/upgrade"},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))))}let _=(t=c.visibility,fT.has(t))?c.visibility:null;return ev.createElement(gz,{spaceId:l??null,spaceType:o??null,spaceIsSubspace:null!=l,spaceTaskadePlanType:i},ev.createElement(hy,null,ev.createElement(hv,{type:"button",onClick:()=>n()},ev.createElement(tn.Icon,{icon:"modal_close"})),ev.createElement(hg,{parentID:l}),ev.createElement(hb,null,ev.createElement(f1,{error:d.form}),ev.createElement(hm,{emoji:c.emoji,error:d.avatar,name:"avatar",onAvatarChange:m,onEmojiChange:u,onError:g,value:c.avatar}),ev.createElement(hu,{name:"name",onChange:f,value:c.name}),ev.createElement(rZ,null,ev.createElement(eY.Z,{id:"general.color",defaultMessage:"Color"})),ev.createElement("div",{className:"mb-4 mt-2"},ev.createElement(fc,{name:"color",onChange:p,value:c.color})),null!=l&&ev.createElement("div",null,ev.createElement(rZ,null,ev.createElement(eY.Z,{id:"general.team_access",defaultMessage:"Team Access"})),ev.createElement(fD,{className:"mt-2",onChange:y,value:_,workspaceName:r??"",parentSpaceId:l})),ev.createElement(hh,{isSubspace:!eu()(l),isSubmitting:b,color:c.color,onSubmit:h}))))}),hx=(0,e$.connect)(function(e){return{isOpen:ec()(e,["modal","createSpace","isOpen"],!1)}},function(e){return(0,ek.DE)({onToggle:gL},e)})(function(e){let{isOpen:t,onToggle:a}=e;return t?ev.createElement(eI.ModalDialog,{autofocus:!1,isOpen:t,close:a},e=>{let{state:t,exit:a}=e;return ev.createElement(hE,{state:t,exit:a})}):null}),h_=(0,la.ZP)` + mutation CurrentUserDeleteMutation($input: CurrentUserDeleteInput!) { + currentUserDelete(input: $input) { + clientMutationId + ok + } + } +`,hw=eL.default.div.withConfig({displayName:"DeleteAccountModalBody__FlexContainer",componentId:"sc-bf52f361-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 400px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,hN=eL.default.div.withConfig({displayName:"DeleteAccountModalBody__TextArea",componentId:"sc-bf52f361-1"})` + ${e1.ArticleTypography.body} + margin-top: 10px; + color: ${e=>e.theme.textColors.hex(50)}; + margin-bottom: 10px; +`,hC=eL.default.h3.withConfig({displayName:"DeleteAccountModalBody__ModalHeading",componentId:"sc-bf52f361-2"})` + ${e1.ArticleTypography.heading3} + margin-bottom: 4px; + color: ${eI.ThemeColors.danger}; +`,hM=eL.default.div.withConfig({displayName:"DeleteAccountModalBody__NoticeArea",componentId:"sc-bf52f361-3"})` + margin-top: 10px; + margin-bottom: 26px; +`,hS=eL.default.p.withConfig({displayName:"DeleteAccountModalBody__NoticeText",componentId:"sc-bf52f361-4"})` + ${e1.UiTypography.md} + color: ${eI.ThemeColors.danger}; + margin-bottom: 0px; +`,hI=eL.default.button.withConfig({displayName:"DeleteAccountModalBody__CloseAccountButton",componentId:"sc-bf52f361-5"})` + font-weight: 500; + font-size 18px; + border-radius: 10px; + text-transform: uppercase; + color: #fff; + outline: 0; + border: 0; + background: ${eI.ThemeColors.danger}; + height: 54px; + cursor: ${e=>e.disabled?"default":"pointer"}; + &:hover { + background: rgba(235, 100, 97, 0.8); + } + &:disabled { + background: ${e=>e.theme.appColors.hex(80)}; + color:${e=>e.theme.textColors.hex(70)}; + } +`,hD=function(e){let{confirmation:t}=e,[a,{loading:n,error:l}]=(0,cs.D)(h_),r=(0,ev.useCallback)(async e=>{let t=await a({variables:{input:{clientMutationId:(0,ld.Z)(),confirmation:e}}});t.data?.currentUserDelete?.ok&&(window.open("https://taskade.com/feedback",void 0,"noopener,noreferrer")?.focus(),window.location.href="https://www.taskade.com/logout")},[a]),o=l?.graphQLErrors?.[0]?.message;return ev.createElement(hw,null,ev.createElement(hC,null,ev.createElement(eY.Z,{id:"general.delete_account",defaultMessage:"Delete Account"})),ev.createElement(hN,null,ev.createElement(eY.Z,{id:"general.account_deletion_notice",defaultMessage:"You will lose access to all your workspaces, subspaces and projects"})),ev.createElement(hM,null,ev.createElement(e1.Notice,{$type:"danger"},ev.createElement(hS,null,o??ev.createElement(eY.Z,{id:"general.account_deletion_confirm_text",defaultMessage:"Warning: Account deletion is permanent and cannot be undone, click “Delete Account” to delete your account."})))),ev.createElement(hI,{disabled:null!=o||n,onClick:()=>{r(t||"")}},n?ev.createElement(eI.Spinner,null):ev.createElement(eY.Z,{id:"general.delete_account",defaultMessage:"Delete Account"})))},hT=(0,d9.oM)({name:"dialogs.deleteAccount",initialState:{isOpen:!1},reducers:{toggleDeleteAccountDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0}}}),h$=(0,e$.connect)(function(e){return e.dialogs.deleteAccount})(function(e){let{isOpen:t,confirmation:a}=e,n=(0,e$.useDispatch)(),l=(0,ev.useCallback)(()=>{n(hT.actions.toggleDeleteAccountDialog())},[n]);return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:l},()=>ev.createElement(hD,{confirmation:a})):null});var hP=a(42152),hF=a.n(hP);function hA(e){return null==e?null:"unlimited"===e}var hR=a(6147);function hj(e){return l_.any().custom((t,a)=>{let n=e.safeParse(t);return n.success?n.data:a.message({custom:"ZodError"},{error:n.error})})}let hO=lw().object({size:lw().number().optional(),depth:lw().string().optional(),space:lw().string().optional(),width:lw().number().required(),format:lw().string().optional(),height:lw().number().required(),density:lw().number().optional(),channels:lw().number().optional(),hasAlpha:lw().boolean().optional(),hasProfile:lw().boolean().optional(),isProgressive:lw().boolean().optional()}).unknown(!0),hU=lw().object({id:lw().string().required(),size:lw().number().optional(),userID:lw().number().optional(),ownerID:lw().string().required(),metadata:hO.optional(),mimetype:lw().string().required(),extension:lw().string().optional(),namespace:lw().string().required(),s3KeyOriginal:lw().string().required()}).unknown(!0),hZ=lw().object({file:hU.required()}),hL=lw().object({value:lw().string().required()}),hB=lw().object({type:lw().string().valid("default","custom").required(),data:lw().when("type",{switch:[{is:"default",then:hL.required()},{is:"custom",then:hZ.required()}]})}),hz=hj(dw.z.object({rruleSet:dw.z.custom(e=>{if(!Array.isArray(e))throw Error("value is not an array");try{return(0,mX.rrulestr)(e.join("\n")),!0}catch(e){return!1}},e=>{try{return(0,mX.rrulestr)(e.join("\n")),{}}catch(e){return(0,ei.assert)(e instanceof Error,"e is not an error."),{message:"RRule Error",path:[],params:{details:e.message}}}}),timezone:dw.z.string()})),hV=lw().object({type:lw().string().valid("emoji").required(),value:lw().string().custom((e,t)=>e?(0,sX.isEmojiChar)(e)?e:t.error("any.invalid"):t.error("string.empty")).required()}),hq=hj(dw.z.enum(["none","banner","background"]));!function(e){e.DISABLED="disabled",e.ENABLED="enabled"}(R||(R={}));let hW=lw().string().allow("disabled","enabled");!function(e){e.DISABLED="disabled",e.ENABLED="enabled"}(j||(j={}));let hH=lw().string().allow("disabled","enabled"),hG=lw().object({start:ez.DateTimeDescSchema.allow(null).optional(),end:ez.DateTimeDescSchema.allow(null).optional(),view:hj(hR.u5).allow(null).optional(),avatar:hV.allow(null).optional(),background:hB.allow(null).optional(),coverImageType:hq.allow(null).optional(),chatMode:hW.allow(null).optional(),commentsMode:hH.allow(null).optional(),templateCreationSchedule:hz.allow(null).optional()}).custom(function(e){if(null!=e.start&&null!=e.end){if(0>ez.DateTimeDescHelpers.diff(e.end,e.start))throw TypeError("`end` must be same as or later than `start`");return e}if(null==e.start&&null==e.end)return e;throw TypeError("date range must have both `start` and `end` to be considered valid")}),hK=function(e){let{cover:t}=e;switch(t){case"none":return ev.createElement(eY.Z,{id:"general.none",defaultMessage:"None"});case"banner":return ev.createElement(eY.Z,{id:"general.banner",defaultMessage:"Banner"});default:return ev.createElement(eY.Z,{id:"general.background",defaultMessage:"Background"})}},hY=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-aba538ca-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,hQ=function(e){let{value:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,value:t});return ev.createElement(hY,n.props,ev.createElement(hK,{cover:t}))},hJ=(0,eL.default)(eI.Menu).withConfig({displayName:"CoverDropdownMenu__StyledMenu",componentId:"sc-de42be7-0"})` + display: flex; + overflow: auto; + flex-direction: column; + padding: var(--menu-padding); + min-width: 160px; + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); +`,hX=function(e){return ev.createElement(hJ,{loop:!0,initialFocus:e.initialFocus},ev.createElement(hQ,{value:"none"}),ev.createElement(hQ,{value:"banner"}),ev.createElement(hQ,{value:"background"}))},h0=eL.default.button.withConfig({displayName:"CoverImagePicker__Button",componentId:"sc-f7a2ac08-0"})` + display: flex; + align-items: center; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + transition: border-color ease-in-out 200ms; + border: none; +`,h1=(0,eL.default)(tn.Icon).withConfig({displayName:"CoverImagePicker__StyledIcon",componentId:"sc-f7a2ac08-1"})` + margin-left: ${eI.UiSpacing.getPx(1)}; +`,h2=function(e){let{cover:t,handleCoverSelect:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-end"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{"Activate"===e.type&&(a(lw().attempt(e.payload.value,hq)),o({type:"Collapse"}))},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(h0,{type:"button",...s.props},ev.createElement(hK,{cover:t}),ev.createElement(h1,{icon:"caret_down"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(hX,{initialFocus:i.initialFocus}))))},h5=function(e){let{themePreference:t}=e;return"light"===t?ev.createElement(eY.Z,{id:"theme_light",defaultMessage:"Light"}):ev.createElement(eY.Z,{id:"theme_dark",defaultMessage:"Dark"})},h3=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-66a00e0-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,h4=function(e){let{value:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,value:t});return ev.createElement(h3,n.props,ev.createElement(h5,{themePreference:t}))},h6=(0,eL.default)(eI.Menu).withConfig({displayName:"ThemeDropdownMenu__StyledMenu",componentId:"sc-61b4c17a-0"})` + display: flex; + overflow: auto; + flex-direction: column; + padding: var(--menu-padding); + min-width: 160px; + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); +`,h8=function(e){return ev.createElement(h6,{loop:!0,initialFocus:e.initialFocus},ev.createElement(h4,{value:"light"}),ev.createElement(h4,{value:"dark"}))},h7=eL.default.button.withConfig({displayName:"ThemePicker__Button",componentId:"sc-969e4fa4-0"})` + display: flex; + align-items: center; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + transition: border-color ease-in-out 200ms; + border: none; +`,h9=(0,eL.default)(tn.Icon).withConfig({displayName:"ThemePicker__StyledIcon",componentId:"sc-969e4fa4-1"})` + margin-left: ${eI.UiSpacing.getPx(1)}; +`,ye=function(e){let{currentTheme:t,handleThemeSelect:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-end"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{"Activate"===e.type&&(null!=e.payload.value&&a(e.payload.value),o({type:"Collapse"}))},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(h7,{type:"button",...s.props},ev.createElement(h5,{themePreference:t}),ev.createElement(h9,{icon:"caret_down"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(h8,{initialFocus:i.initialFocus}))))},yt=(0,eL.default)(tn.Icon).withConfig({displayName:"ViewIcon__StyledIcon",componentId:"sc-c9adb0e5-0"})` + margin-right: ${eI.UiSpacing.getPx(2)}; + transform: var(--menu-item-icon-scale); +`,ya=function(e){let{documentView:t}=e,a=ev.useMemo(()=>{switch(t){case dl:return"view_board";case dr:return"view_calendar";case di:return"view_actionsheet";case ds:return"view_mindmap";case dd:return"view_orgchart";case dc:return"app_store";default:return"view_list"}},[t]);return ev.createElement(yt,{icon:a})},yn=function(e){let{documentView:t}=e;switch(t){case dl:return ev.createElement(eY.Z,{id:"general.board",defaultMessage:"Board"});case dr:return ev.createElement(eY.Z,{id:"general.calendar",defaultMessage:"Calendar"});case di:return ev.createElement(eY.Z,{id:"general.action",defaultMessage:"Action"});case ds:return ev.createElement(eY.Z,{id:"general.mindmap",defaultMessage:"Mind Map"});case dd:return ev.createElement(eY.Z,{id:"general.org_chart",defaultMessage:"Org Chart"});case dc:return ev.createElement(eY.Z,{id:"general.gantt",defaultMessage:"Gantt Chart"});default:return ev.createElement(eY.Z,{id:"general.list",defaultMessage:"List"})}},yl=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-ac369977-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,yr=function(e){let{value:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,value:t});return ev.createElement(yl,n.props,ev.createElement(ya,{documentView:t}),ev.createElement(yn,{documentView:t}))},yo=(0,eL.default)(eI.Menu).withConfig({displayName:"ViewDropdownMenu__StyledMenu",componentId:"sc-5a92b225-0"})` + display: flex; + overflow: auto; + flex-direction: column; + padding: var(--menu-padding); + min-width: 160px; + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); +`,yi=function(e){return ev.createElement(yo,{loop:!0,initialFocus:e.initialFocus},ev.createElement(yr,{value:dn}),ev.createElement(yr,{value:dl}),ev.createElement(yr,{value:dr}),ev.createElement(yr,{value:di}),ev.createElement(yr,{value:ds}),ev.createElement(yr,{value:dd}),!1)},ys=(0,eL.default)(tn.Icon).withConfig({displayName:"ViewPicker__StyledIcon",componentId:"sc-8145339c-0"})` + margin-left: ${eI.UiSpacing.getPx(1)}; + color: ${e=>e.theme.appColors.hex(50)}; +`,yd=eL.default.button.withConfig({displayName:"ViewPicker__Button",componentId:"sc-8145339c-1"})` + display: flex; + align-items: center; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + transition: border-color ease-in-out 200ms; + border: none; + + &:hover, + &[aria-expanded='true'] { + ${ys} { + color: ${e=>e.theme.appColors.hex(20)}; + } + } +`,yc=function(e){let{currentView:t,handleViewSelect:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-end"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{if("Activate"===e.type){{let t=hR.u5.safeParse(e.payload.value);t.success&&a(t.data)}o({type:"Collapse"})}},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(yd,{type:"button",...s.props},ev.createElement(ya,{documentView:t}),ev.createElement(yn,{documentView:t}),ev.createElement(ys,{icon:"caret_down"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(yi,{initialFocus:i.initialFocus}))))},ym=e=>{if(0===e.length)return;let t=parseInt(e,10);return t>100?100:t<0?0:isNaN(t)?0:t},yu=e=>{if(0===e.length)return;let t=parseInt(e,10);return t<0?0:isNaN(t)?0:t},yp=(e,t)=>{switch(t.type){case"setDocumentView":return{...e,documentView:t.payload};case"setWidth":return{...e,width:ym(t.payload)};case"setHeight":return{...e,height:yu(t.payload)};case"setDocumentTheme":return{...e,themePreference:t.payload};case"setHideCopyToggle":return{...e,hideCopyToggle:t.payload};case"setHideViewToggle":return{...e,hideViewToggle:t.payload};case"setHideFooter":return{...e,hideFooter:t.payload};case"setCoverImage":return{...e,cover:t.payload};case"setAllowEdit":return{...e,allowEdit:t.payload};default:return e}},yg=eL.default.div.withConfig({displayName:"styled__EmbedCodeBox",componentId:"sc-21c2b02d-0"})` + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm} + background: ${e=>e.theme.appColors.hex(90)}; +`,yf=eL.default.button.withConfig({displayName:"styled__CopyButton",componentId:"sc-21c2b02d-1"})` + ${e1.UiTypography.sm} + background: ${e=>e.theme?.primaryColorScheme?.base}; + color: #fff; + transition: background-color ease-in-out 200ms; + + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } +`;(0,eL.default)(e1.Notice).withConfig({displayName:"styled__StyledNotice",componentId:"sc-21c2b02d-2"})` + border-color: ${e=>e.theme.appColors.hex(80)}; + background: ${e=>e.theme.appColors.hex(100)}; + ${e1.UiTypography.sm} +`;let yh=eL.default.div.withConfig({displayName:"styled__OptionWrapper",componentId:"sc-21c2b02d-3"})` + display: flex; + flex: 1 1 auto; + align-items: center; + justify-content: space-between; + + ${e1.UiTypography.sm} + color: ${e=>e.theme.appColors.hex(10)}; + + padding: 0px ${eI.UiSpacing.getPx(4)}; + height: 36px; + + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + + &:last-child { + border: none; + } +`,yy=eL.default.div.withConfig({displayName:"styled__SettingsWrapper",componentId:"sc-21c2b02d-4"})` + display: flex; + flex-direction: column; + + margin-top: 1.25rem; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + border-radius: 10px; +`,yb=eL.default.input.withConfig({displayName:"styled__Input",componentId:"sc-21c2b02d-5"})` + min-width: 40px; + max-width: 60px; + height: 28px; + border-radius: 10px; + background: none; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + + ${e1.UiTypography.sm} + text-align: center; + + &:focus { + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + &::-webkit-inner-spin-button, + &::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; + } + + &[type='number'] { + -moz-appearance: textfield; + } +`,yv=eL.default.div.withConfig({displayName:"styled__InputWrapper",componentId:"sc-21c2b02d-6"})` + width: 85px; + display: flex; + justify-content: space-between; + align-items: center; +`,yk=(0,eL.default)(e1.Switch).withConfig({displayName:"styled__StyledSwitch",componentId:"sc-21c2b02d-7"})` + cursor: pointer; + transition: all ease-in-out 300ms; +`,yE=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-21c2b02d-8"})` + & svg { + margin-right: 2px; + transform: none; + align-self: center; + } +`,yx=(0,e$.connect)(function(e){return{view:dA(e)}})(function(e){let{document:t,view:a}=e,n=(0,eL.useTheme)(),l=(0,e$.useDispatch)(),r=gV(),o=r.id,i=d6()&&!hA(r.type),s=t.shared_preferences.coverImageType,d=(0,ev.useRef)(null),[c,m]=(0,ev.useState)(!1),[u,p]=ev.useReducer(yp,{documentView:hR.u5.safeParse(a).success?a:dn,width:100,height:400,themePreference:n.isNightMode?"dark":"light",hideFooter:!1,hideViewToggle:!1,hideCopyToggle:!1,cover:s??"none",allowEdit:!1});(0,ev.useEffect)(()=>{let e=new(hF())(d.current);return e.on("success",()=>{m(!0)}),()=>{e.destroy()}},[]);let g=()=>{m(!1)},f=(0,ev.useMemo)(()=>{let e=t.view_path?.split("/v/")[1],a=t.edit_path?.split("/e/")[1];if(null==e||null==a)return;let n=new URL(`/embed/${t.id}`,"https://www.taskade.com");return n.searchParams.set("as",u.documentView),u.allowEdit?(n.searchParams.set("share","edit"),n.searchParams.set("edit",a)):(n.searchParams.set("share","view"),n.searchParams.set("view",e)),n.searchParams.set("theme",u.themePreference),n.searchParams.set("coverImageType",u.cover),u.hideFooter&&n.searchParams.set("footer","hidden"),u.hideViewToggle&&n.searchParams.set("views","hidden"),u.hideCopyToggle&&n.searchParams.set("copy","hidden"),``},[t.edit_path,t.id,t.view_path,u.allowEdit,u.cover,u.documentView,u.height,u.hideCopyToggle,u.hideFooter,u.hideViewToggle,u.themePreference,u.width]);return ev.createElement("div",{className:"flex flex-col px-8 py-0"},ev.createElement(yg,{className:"relative mb-4 flex h-16 w-full overflow-y-auto rounded-xl border border-solid border-appcolor-300 p-2"},f),ev.createElement(yf,{ref:d,className:"rounded-xl px-0 py-2 font-normal","data-clipboard-action":"copy","data-clipboard-text":f,onMouseOut:g,onBlur:g},c?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy_embed_code",defaultMessage:"Copy embed code"})),ev.createElement(yy,null,ev.createElement(yh,null,ev.createElement(eY.Z,{id:"general.embed_view",defaultMessage:"Embed view"}),ev.createElement(yc,{currentView:u.documentView,handleViewSelect:e=>{p({type:"setDocumentView",payload:e})}})),ev.createElement(yh,null,ev.createElement(eY.Z,{id:"general.embed_width",defaultMessage:"Width"}),ev.createElement(yv,null,ev.createElement(yb,{type:"number",value:u.width,onChange:function(e){p({type:"setWidth",payload:e.target.value})}}),ev.createElement("span",null,"%"))),ev.createElement(yh,null,ev.createElement(eY.Z,{id:"general.embed_height",defaultMessage:"Height"}),ev.createElement(yv,null,ev.createElement(yb,{type:"number",value:u.height,onChange:function(e){p({type:"setHeight",payload:e.target.value})}}),ev.createElement("span",null,"px"))),ev.createElement(yh,null,ev.createElement(eY.Z,{id:"general.theme_ui_text",defaultMessage:"Theme"}),ev.createElement(ye,{currentTheme:u.themePreference,handleThemeSelect:e=>{p({type:"setDocumentTheme",payload:e})}}))),ev.createElement(yy,null,t.space&&ev.createElement(ev.Fragment,null,ev.createElement(yh,null,ev.createElement("div",{className:"flex gap-2"},ev.createElement(eY.Z,{id:"general.allow_edit",defaultMessage:"Allow edit"}),i&&ev.createElement(yE,null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(yk,{checked:u.allowEdit,onChange:e=>{i&&null!=t.space?l(d4(o)):p({type:"setAllowEdit",payload:e})}})),ev.createElement(yh,null,ev.createElement("div",{className:"flex gap-2"},ev.createElement(eY.Z,{id:"general.embed_cover_image",defaultMessage:"Cover Image"}),i&&ev.createElement(yE,null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(h2,{cover:u.cover,handleCoverSelect:e=>{i&&null!=t.space?l(d4(o)):p({type:"setCoverImage",payload:e})}})),ev.createElement(yh,null,ev.createElement("div",{className:"flex gap-2"},ev.createElement(eY.Z,{id:"general.embed_footer",defaultMessage:"Hide footer"}),i&&ev.createElement(yE,null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(yk,{checked:u.hideFooter,onChange:e=>{i&&null!=t.space?l(d4(o)):p({type:"setHideFooter",payload:e})}})),ev.createElement(yh,null,ev.createElement("div",{className:"flex gap-2"},ev.createElement(eY.Z,{id:"general.embed_hide_views",defaultMessage:"Hide views"}),i&&ev.createElement(yE,null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(yk,{checked:u.hideViewToggle,onChange:e=>{i&&null!=t.space?l(d4(o)):p({type:"setHideViewToggle",payload:e})}})),ev.createElement(yh,null,ev.createElement("div",{className:"flex gap-2"},ev.createElement(eY.Z,{id:"general.embed_hide_copy",defaultMessage:"Hide copy"}),i&&ev.createElement(yE,null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(yk,{checked:u.hideCopyToggle,onChange:e=>{i&&null!=t.space?l(d4(o)):p({type:"setHideCopyToggle",payload:e})}})))),ev.createElement("div",{className:"mt-4 rounded-xl border border-appcolor-300 px-4 py-3 text-sm"},ev.createElement(eY.Z,{id:"tip.regenerate_disable_link_tip",defaultMessage:"\uD83D\uDCA1 If you regenerate or disable the invite link, your embed code will need to be updated."})))}),y_=function(e){let{expiredAt:t}=e;return ev.useMemo(()=>cc()(t).isSameOrBefore(new Date),[t])?ev.createElement("div",{className:"mx-2.5 inline-flex items-center rounded-full bg-danger/10 px-2.5 py-0.5 text-xs font-medium text-danger"},ev.createElement(eY.Z,{id:"general.expired",defaultMessage:"Expired"})):null},yw=eL.default.span.withConfig({displayName:"ProjectRoleName__RoleName",componentId:"sc-c6fa4e66-0"})` + ${e1.UiTypography.sm}; + font-weight: ${e=>e.$fontWeight?e.$fontWeight:"normal"}; + color: ${e=>e.theme.textColors.hex(10)}; +`,yN=function(e){let{role:t,fontWeight:a}=e;switch(t){case"owner":return ev.createElement(yw,{$fontWeight:a},ev.createElement(eY.Z,{id:"project_role.owner",defaultMessage:"\uD83E\uDD84 Owner"}));case"maintainer":return ev.createElement(yw,{$fontWeight:a},ev.createElement(eY.Z,{id:"project_role.maintainer",defaultMessage:"\uD83D\uDC69‍\uD83D\uDCBB Admin"}));case"collaborator":return ev.createElement(yw,{$fontWeight:a},ev.createElement(eY.Z,{id:"project_role.collaborator",defaultMessage:"✍️ Editor"}));case"participant":return ev.createElement(yw,{$fontWeight:a},ev.createElement(eY.Z,{id:"project_role.participant",defaultMessage:"✅ Checker"}));case"viewer":return ev.createElement(yw,{$fontWeight:a},ev.createElement(eY.Z,{id:"project_role.viewer",defaultMessage:"\uD83E\uDD13 Viewer"}));default:return ev.createElement(yw,{$fontWeight:a},t)}},yC=(0,la.ZP)` + fragment ProjectMemberParts on ProjectMember { + id + role { + project + workspace + } + user { + ...BasicUserFields + avatars_v2 { + small { + ldpi { + url + size { + width + height + } + } + mdpi { + url + size { + width + height + } + } + } + } + } + } + ${up} +`,yM=(0,la.ZP)` + query ProjectMembersPreviewQuery($document_id: ID!) { + document(id: $document_id) { + id + members(first: 3) { + edges { + cursor + node { + ...ProjectMemberParts + } + } + totalCount + } + } + } + ${yC} +`,yS={id:"owner",name:"Owner",value:"owner"},yI={id:"maintainer",name:"Maintainer",value:"maintainer"},yD={id:"collaborator",name:"Collaborator",value:"collaborator"},yT={id:"participant",name:"Checker",value:"participant",isPaidFeature:!0},y$={id:"viewer",name:"Viewer",value:"viewer"},yP=[[yS.id,yS],[yI.id,yI],[yD.id,yD],[yT.id,yT],[y$.id,y$]],yF=new Map(yP),yA=(0,la.ZP)` + mutation InvitationDeleteMutation($input: InvitationDeleteInput!) { + invitationDelete(input: $input) { + clientMutationId + ok + } + } +`,yR=(0,la.ZP)` + mutation ProjectMemberRemoveMutation($input: ProjectMemberRemoveInput!) { + projectMemberRemove(input: $input) { + clientMutationId + ok + } + } +`,yj={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectMembersQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"document_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"document_id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"check_token"}},{kind:"Field",name:{kind:"Name",value:"edit_path"}},{kind:"Field",name:{kind:"Name",value:"view_path"}},{kind:"Field",name:{kind:"Name",value:"is_share_link_enabled"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMemberParts"}}]}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}}]}},{kind:"Field",name:{kind:"Name",value:"space_type"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"members"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ProjectMemberParts"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"invitations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"token"}},{kind:"Field",name:{kind:"Name",value:"expired_at"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ProjectMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ProjectMember"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},yO=(0,la.ZP)` + mutation ProjectMemberUpdateMutation($input: ProjectMemberUpdateInput!) { + projectMemberUpdate(input: $input) { + clientMutationId + member { + ...ProjectMemberParts + } + } + } + ${yC} +`,yU=eL.default.span.withConfig({displayName:"ProjectRoleDescription__RoleDescription",componentId:"sc-3583f305-0"})` + font-size: 14px; + line-height: 17px; + margin-top: 2px; + color: ${e=>e.theme.textColors.hex(50)}; + display: flex; + white-space: normal; +`,yZ=function(e){let{role:t}=e;switch(t){case"owner":return ev.createElement(yU,null,ev.createElement(eY.Z,{id:"project_role.owner_description",defaultMessage:"Can fully manage and delete the project."}));case"maintainer":return ev.createElement(yU,null,ev.createElement(eY.Z,{id:"project_role.maintainer_description",defaultMessage:"Can fully manage the project."}));case"collaborator":return ev.createElement(yU,null,ev.createElement(eY.Z,{id:"project_role.collaborator_description",defaultMessage:"Can edit the project. Cannot manage the project."}));case"participant":return ev.createElement(yU,null,ev.createElement(eY.Z,{id:"workspace_role.participant_description",defaultMessage:"Can check, uncheck and comment on tasks, Cannot edit task, projects or templates."}));case"viewer":return ev.createElement(yU,null,ev.createElement(eY.Z,{id:"project_role.viewer_description",defaultMessage:"Can only comment and chat. Cannot edit the project."}));default:return null}},yL=eL.default.button.withConfig({displayName:"styled__ChangeRoleButton",componentId:"sc-da7a0146-0"})` + display: flex; + align-items: center; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm}; + column-gap: ${eI.UiSpacing.getPx(1.5)}; + + &:hover, + &[aria-expanded='true'] { + background: none; + color: ${e=>e.theme.textColors.hex(10)}; + } + + &:active { + color: ${e=>e.theme.textColors.hex(10)} !important; + background: none !important; + } + + &::after { + vertical-align: 0.14em; + margin-left: 8px; + } +`,yB=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-da7a0146-1"})` + display: flex; + overflow: auto; + flex-direction: column; + min-width: 200px !important; + max-width: 450px !important; + padding: 0.5rem 0; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + ${tM}; + + max-height: auto; + @media (max-height: 800px) { + max-height: 260px; + } +`,yz=eL.default.hr.withConfig({displayName:"styled__MenuDivider",componentId:"sc-da7a0146-2"})` + margin: 0.5rem 0; + border-color: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(70)}; +`,yV=eL.default.div.withConfig({displayName:"styled__SelectedRole",componentId:"sc-da7a0146-3"})` + display: flex; + min-width: 40px; + align-items: flex-start; + justify-content: center; +`,yq=eL.default.div.withConfig({displayName:"styled__RoleDescription",componentId:"sc-da7a0146-4"})` + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; +`,yW=eL.default.div.withConfig({displayName:"styled__Spacer",componentId:"sc-da7a0146-5"})` + width: 40px; +`,yH=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-6372f283-0"})` + display: flex; + flex-direction: row; + cursor: pointer; + outline: 0 !important; + border: none; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)} !important; + padding: 6px 20px; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,yG=function(e){let{name:t,value:a,className:n,children:l}=e,r=(0,ev.useRef)(null),o=(0,eI.useMenuItem)({stopRef:r,name:t,value:a});return ev.createElement(yH,{...o.props,className:n},l)},yK=function(e){let{initialFocus:t,roleEntries:a,selectedEntry:n,itemType:l}=e,r=gV();return ev.createElement(yB,{initialFocus:t,loop:!0},"member"===l&&null!=a&&a.map(e=>{let[t,a]=e,l=(yF.get(a.value)?.isPaidFeature??!1)&&r.isPaywallEnabled;return ev.createElement(yG,{key:t,name:"change",value:a.value},ev.createElement(yV,null,n?.value===a.value&&ev.createElement(tn.Icon,{icon:"dd_check"})),ev.createElement(yq,null,ev.createElement("div",null,ev.createElement(yN,{fontWeight:"500",role:a.value}),l&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),ev.createElement(yZ,{role:a.value})))}),"member"===l&&ev.createElement(ev.Fragment,null,ev.createElement(yz,null),ev.createElement(yG,{name:"remove"},ev.createElement(yW,null),ev.createElement(eY.Z,{id:"general.remove",defaultMessage:"Remove"}))),"invitation"===l&&ev.createElement(ev.Fragment,null,ev.createElement(yG,{name:"delete_invitation",className:"text-sm"},ev.createElement(eY.Z,{id:"general.cancel_invitation",defaultMessage:"Cancel Invitation"})),ev.createElement(yG,{name:"copy_invitation",className:"text-sm"},ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"}))))},yY=function(e){let t;let{member:a,invitation:n,roleEntries:l,projectId:r}=e,o=(0,ev.useRef)(null),i=(0,ev.useRef)(null),[s,d]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1,initialFocus:"first"}),c=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:s,placement:"top"}),m=(0,eI.useMenuButton)({ref:o,state:s,dispatch:d}),u=(0,e$.useDispatch)(),p=gV(),[g]=(0,cs.D)(yO),[f]=(0,cs.D)(yR,{refetchQueries:[{query:yM,variables:{document_id:r}}]}),[h]=(0,cs.D)(yA),y=(0,ev.useCallback)(e=>{if(null==a)return;if(yF.get(e)?.isPaidFeature&&p.isPaywallEnabled){null!=p.id&&u(d4(p.id));return}let t=(0,ld.Z)();g({optimisticResponse:{projectMemberUpdate:{__typename:"ProjectMemberUpdatePayload",clientMutationId:t,member:{...a,role:{...a.role,project:e}}}},variables:{input:{clientMutationId:t,memberID:a.id,role:e}}})},[u,a,p,g]),b=(0,ev.useCallback)(()=>{if(null==a)return;let e=(0,ld.Z)();f({optimisticResponse:{__typename:"Mutation",projectMemberRemove:{__typename:"ProjectMemberRemovePayload",clientMutationId:e,ok:!0}},update:(e,t)=>{let n=e.readQuery({query:yj,variables:{document_id:r}});null!=n&&e.writeQuery({query:yj,data:(0,es.ZP)(n,e=>{e.document?.members?.edges!=null&&(e.document.members.edges=e.document.members.edges.filter(e=>e.node?.id!==a.id))}),variables:{document_id:r}})},variables:{input:{clientMutationId:e,memberID:a.id}}})},[f,a,r]),v=ev.useCallback(()=>{if(null==n)return;let e=(0,ld.Z)();h({optimisticResponse:{__typename:"Mutation",invitationDelete:{__typename:"InvitationDeletePayload",clientMutationId:e,ok:!0}},update:(e,t)=>{let a=e.readQuery({query:yj,variables:{document_id:r}});null!=a&&e.writeQuery({query:yj,data:(0,es.ZP)(a,e=>{e.document?.invitations?.edges!=null&&(e.document.invitations.edges=e.document.invitations.edges.filter(e=>e.node?.email!==n.email))}),variables:{document_id:r}})},variables:{input:{clientMutationId:e,email:n.email,document_id:r}}})},[h,n,r]),k=ev.useCallback(()=>{if(null==n)return;let e=`https://www.taskade.com/invitations/${n.token}`;navigator.clipboard.writeText(e)},[n]),E=(0,ev.useCallback)(e=>{if("Activate"===e.type){switch(e.payload.name){case"change":y(e.payload.value);break;case"remove":b();break;case"delete_invitation":v();break;case"copy_invitation":k()}d({type:"Collapse"})}},[y,b,v,k]);return null!=a&&(t=null!=a.role.project?yF.get(a.role.project):void 0),null!=n&&(t=null!=n.role?yF.get(n.role):void 0),ev.createElement(ev.Fragment,null,ev.createElement(yL,{type:"button",...m.props},ev.createElement(yN,{role:t?.value??"viewer"}),ev.createElement(tn.Icon,{icon:"caret_down"})),s.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:d,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:E},ev.createElement(yK,{initialFocus:c.initialFocus,roleEntries:l,selectedEntry:t,itemType:null!=a?"member":"invitation"}))))},yQ=eL.default.button.withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-2f2f6c34-0"})` + padding: 6px 16px 6px 20px; + text-align: start; + color: ${e=>e.theme.textColors.hex(20)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,yJ=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(yQ,o.props,t)},yX=(0,eL.default)(eI.Menu).withConfig({displayName:"MyRoleMenu__StyledMenu",componentId:"sc-3db3bfec-0"})` + display: flex; + flex-direction: column; + + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,y0=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(yX,{initialFocus:t,loop:!0},ev.createElement(yJ,{name:"leave"},ev.createElement(eY.Z,{id:"general.leave",defaultMessage:"Leave"}))))},y1=eL.default.div.withConfig({displayName:"MyRole__MenuButton",componentId:"sc-9dc0ca7c-0"})` + display: flex; + align-items: center; + user-select: none; + cursor: pointer; + color: ${e=>e.theme.textColors.hex(50)}; + + &:hover, + &[aria-expanded='true'] { + color: ${e=>e.theme.textColors.hex(20)}; + } +`,y2=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"MyRole__IconCaretDown",componentId:"sc-9dc0ca7c-1"})` + margin-left: ${eI.UiSpacing.getPx(1.5)}; +`,y5=function(e){let{member:t}=e,[a]=(0,cs.D)(yR),n=(0,ev.useCallback)(()=>{let e=(0,ld.Z)();a({optimisticResponse:{__typename:"Mutation",projectMemberRemove:{__typename:"ProjectMemberRemovePayload",clientMutationId:e,ok:!0}},update:e=>{let a=t.id.match(/(\d+)@(.+)/);if(null==a)return;let n=a[2],l=e.readQuery({query:yj,variables:{document_id:n}});l?.document?.members?.edges!=null&&e.writeQuery({query:yj,data:(0,es.ZP)(l,e=>{if(e?.document?.members?.edges==null)return;let a=e.document.members.edges.findIndex(e=>e.node?.id===t.id);-1!==a&&e.document.members.edges.splice(a,1)}),variables:{document_id:n}})},variables:{input:{clientMutationId:e,memberID:t.id}}})},[t.id,a]),l=yF.get(t.role.project),[r,o]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),i=(0,ev.useRef)(null),s=(0,ev.useRef)(null),d=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:r,placement:"bottom"}),c=(0,eI.useMenuButton)({ref:i,dispatch:o,state:r}),m=(0,ev.useCallback)(e=>{if("Activate"===e.type){let{name:t}=e.payload;"leave"===t&&n()}},[n]);return ev.createElement(ev.Fragment,null,ev.createElement(y1,c.props,ev.createElement(yN,{role:l?.value}),ev.createElement(y2,null)),r.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:o,modal:!0},ev.createElement(y0,{initialFocus:d.initialFocus,menuGroupDispatch:m})))},y3=eL.default.div.withConfig({displayName:"ViewRole__Container",componentId:"sc-5a9d33a2-0"})` + padding-right: 25px; +`,y4=function(e){let{member:t,invitation:a}=e,n=ev.useMemo(()=>null!=t?t.role.project:null!=a?a.role:null,[a,t]);return ev.createElement(y3,null,null!=n&&ev.createElement(yN,{role:n}))},y6=function(e){let{member:t,invitation:a,roleEntries:n,type:l,projectId:r}=e;switch(l){case"me":if(null==t)return null;return ev.createElement(y5,{member:t});case"manage":return ev.createElement(yY,{member:t,invitation:a,roleEntries:n,projectId:r});case"view":return ev.createElement(y4,{member:t,invitation:a});default:return null}},y8=eL.default.div.withConfig({displayName:"InvitationList__List",componentId:"sc-b3cebd00-0"})` + max-height: 360px; + margin-top: 10px; + overflow: auto; + ${tM}; +`,y7=eL.default.div.withConfig({displayName:"InvitationList__Container",componentId:"sc-b3cebd00-1"})` + margin-top: 10px; + padding: 0 1.875rem; +`,y9=eL.default.div.withConfig({displayName:"InvitationList__Invitation",componentId:"sc-b3cebd00-2"})` + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: 10px; + padding-left: 2px; +`,be=eL.default.div.withConfig({displayName:"InvitationList__Email",componentId:"sc-b3cebd00-3"})` + flex: 3; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; + font-weight: 600; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; +`,bt=eL.default.span.withConfig({displayName:"InvitationList__AvatarWrapper",componentId:"sc-b3cebd00-4"})` + display: flex; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + font-weight: 500; + ${e1.UiTypography.sm}; + text-align: center; + align-items: center; + justify-content: center; + text-transform: uppercase; + border-radius: 36px; + width: 24px; + height: 24px; + flex-shrink: 0; +`,ba=eL.default.span.withConfig({displayName:"InvitationList__Character",componentId:"sc-b3cebd00-5"})` + /* Workaround for emoji positioning issue in Chrome on high dpi screens */ + @media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min--moz-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-device-pixel-ratio: 2), + only screen and (min-resolution: 150dpi), + only screen and (min-resolution: 2dppx) { + font-size: 2em; + transform: scale(0.5); + } +`,bn=function(e){let{invitations:t,projectId:a}=e;return ev.createElement(y7,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.pending",defaultMessage:"Pending"})),ev.createElement(y8,null,t.map(e=>{let{invitation:t,type:n}=e,{id:l,email:r,expired_at:o}=t;return 0===r.length?null:ev.createElement(y9,{key:l},ev.createElement(bt,null,ev.createElement(ba,null,r[0])),ev.createElement(be,null,r),ev.createElement(y_,{expiredAt:o}),ev.createElement(y6,{invitation:t,type:n,projectId:a}))})))};var bl=a(83868),br=a.n(bl);let bo=(0,eL.default)(tn.Icon).attrs({icon:"dd_delete",width:14,height:14}).withConfig({displayName:"DefaultChipItemComponent__DeleteIcon",componentId:"sc-c53f0bce-0"})` + cursor: pointer; +`,bi=function(e){let{chipItem:t,onEdit:a,onDeleteClick:n,highlighted:l}=e;return ev.createElement("div",{className:og()("flex shrink-0 items-center gap-x-1 rounded-2xl px-2.5 py-1 ",{"bg-appcolor-300 text-textcolor-1000":!l,"bg-primary text-applight-100":l}),onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),a(t)},title:"Double click to edit"},ev.createElement("span",{className:"text-sm"},t),ev.createElement(bo,{onClick:e=>{e.stopPropagation(),n(t)}}))};function bs(e){return null==e?"input_box":"container"}let bd=function(e,t){switch(t.type){case"SET_INPUT_TEXT":return{...e,inputText:t.value};case"HIGHLIGHT_PREVIOUS":{let t;if(null===e.highlightedItem)t=e.items[e.items.length-1];else{let a=e.items.indexOf(e.highlightedItem);t=e.items[a-1]??e.items[0]??null}let a=bs(t);return{...e,highlightedItem:t,focusedElement:a}}case"HIGHLIGHT_NEXT":{let t;if(null===e.highlightedItem)return e;{let a=e.items.indexOf(e.highlightedItem);t=e.items[a+1]??null}let a=bs(t);return{...e,highlightedItem:t,focusedElement:a}}case"HIGHLIGHT_LAST":{if(0===e.items.length)return e;let t=e.items[e.items.length-1],a=bs(t);return{...e,highlightedItem:t,focusedElement:a}}case"FOCUS_INPUT":return{...e,highlightedItem:null,focusedElement:"input_box"};case"SET_ITEMS":{let a=null;null!=e.highlightedItem&&(a=-1!==t.items.indexOf(e.highlightedItem)?e.highlightedItem:null);let n=bs(a);return{...e,items:t.items,highlightedItem:a,focusedElement:n}}}return e},bc=function(e){let{items:t,onChipItemAdded:a,onChipItemEditRequested:n,onChipItemRemoved:l,chipItemComponent:r=bi,onKeyDown:o,className:i,classNameInput:s,onSubmit:d,value:c,onChange:m,...u}=e,p=ev.useRef(null),g=ev.useRef(null),f=(0,eL.useTheme)(),h=ev.useMemo(()=>gW()(f.primaryColor??eI.Colors.BRAND).rgb().join(" "),[f.primaryColor]),[y,b]=ev.useReducer(bd,{items:t,inputText:"",highlightedItem:null,focusedElement:"input_box"});ev.useEffect(()=>{b({type:"SET_ITEMS",items:t})},[t]),ev.useEffect(()=>{switch(y.focusedElement){case"input_box":g.current?.focus();break;case"container":p.current?.focus()}},[y.focusedElement]),ev.useEffect(()=>{null!=c&&b({type:"SET_INPUT_TEXT",value:c})},[c]);let v=ev.useCallback(e=>{n?.(e)},[n]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{style:{"--color-primary":h},ref:p,className:og()("flex w-full cursor-text flex-wrap items-center gap-x-1.5 gap-y-1 rounded-lg px-3 py-1.5",i),onClick:e=>{e.target===e.currentTarget&&g.current?.focus()},onKeyDown:e=>{if(o?.(e),!e.isDefaultPrevented())switch(e.key){case",":case" ":if(e.preventDefault(),0===y.inputText.length)break;a(y.inputText);break;case eI.KeyboardKeys.Enter:if(e.preventDefault(),0===y.inputText.length){d?.();break}a(y.inputText);break;case eI.KeyboardKeys.ArrowLeft:if("input_box"===y.focusedElement&&y.inputText.length>0&&!(null!=g.current&&0===g.current.selectionStart))break;e.preventDefault(),b({type:"HIGHLIGHT_PREVIOUS"});break;case eI.KeyboardKeys.ArrowRight:if("input_box"===y.focusedElement&&y.inputText.length>0)break;e.preventDefault(),b({type:"HIGHLIGHT_NEXT"});break;case eI.KeyboardKeys.Backspace:if(y.inputText.length>0)break;if(null==y.highlightedItem){b({type:"HIGHLIGHT_LAST"});break}l(y.highlightedItem)}},tabIndex:-1},t.map(e=>ev.createElement(r,{key:e,chipItem:e,highlighted:e===y.highlightedItem,onEdit:v,onDeleteClick:l})),ev.createElement("input",{ref:g,type:"text",className:og()("shrink grow bg-transparent py-1.5 text-sm",s),value:y.inputText,onChange:e=>{m?.(e),b({type:"SET_INPUT_TEXT",value:e.target.value})},onFocus:e=>{b({type:"FOCUS_INPUT"})},...u})))},bm=eL.default.span.withConfig({displayName:"WorkspaceRoleName__RoleName",componentId:"sc-616326a7-0"})` + font-weight: ${e=>e.$fontWeight?e.$fontWeight:"normal"}; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; +`,bu=function(e){let{role:t,fontWeight:a}=e;switch(t){case"owner":return ev.createElement(bm,{$fontWeight:a},ev.createElement(eY.Z,{id:"workspace_role.owner",defaultMessage:"\uD83E\uDD84 Owner"}));case"maintainer":return ev.createElement(bm,{$fontWeight:a},ev.createElement(eY.Z,{id:"workspace_role.maintainer",defaultMessage:"\uD83D\uDC69‍\uD83D\uDCBB Admin"}));case"collaborator":return ev.createElement(bm,{$fontWeight:a},ev.createElement(eY.Z,{id:"workspace_role.collaborator",defaultMessage:"✍️ Editor"}));case"participant":return ev.createElement(bm,{$fontWeight:a},ev.createElement(eY.Z,{id:"project_role.participant",defaultMessage:"✅ Checker"}));case"viewer":return ev.createElement(bm,{$fontWeight:a},ev.createElement(eY.Z,{id:"workspace_role.viewer",defaultMessage:"\uD83E\uDD13 Viewer"}));default:return ev.createElement(bm,{$fontWeight:a},t)}},bp=eL.default.span.withConfig({displayName:"WorkspaceRoleDescription__RoleDescription",componentId:"sc-18e3c656-0"})` + display: flex; + margin-top: 2px; + color: ${e=>e.theme.textColors.hex(50)}; + white-space: normal; + ${e1.UiTypography.sm}; +`,bg=function(e){let{role:t}=e;switch(t){case"owner":return ev.createElement(bp,null,ev.createElement(eY.Z,{id:"workspace_role.owner_description",defaultMessage:"Can fully configure and edit projects, templates, and manage workspace settings and billing."}));case"maintainer":return ev.createElement(bp,null,ev.createElement(eY.Z,{id:"workspace_role.maintainer_description",defaultMessage:"Can fully configure and edit projects, templates and manage workspace billing."}));case"collaborator":return ev.createElement(bp,null,ev.createElement(eY.Z,{id:"workspace_role.collaborator_description",defaultMessage:"Can create and edit projects and templates. Cannot manage workspace settings."}));case"participant":return ev.createElement(bp,null,ev.createElement(eY.Z,{id:"workspace_role.participant_description",defaultMessage:"Can check, uncheck and comment on tasks, Cannot edit task, projects or templates."}));case"viewer":return ev.createElement(bp,null,ev.createElement(eY.Z,{id:"workspace_role.viewer_description",defaultMessage:"Can only comment and chat in projects. Cannot create or edit projects and templates."}));default:return null}},bf=[[yD.id,yD],[yT.id,yT],[y$.id,y$]],bh=new Map(bf),by=eL.default.div.withConfig({displayName:"RoleMenuItem__Wrapper",componentId:"sc-564a21d3-0"})` + cursor: pointer; + outline: 0; + display: flex; + flex-direction: row; + padding: 6px; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + outline: 0; + } +`,bb=function(e){let{name:t,value:a,children:n}=e,l=(0,ev.useRef)(null),r=(0,eI.useMenuItem)({name:t,value:a,stopRef:l});return ev.createElement(by,r.props,n)},bv=(0,eL.default)(eI.Menu).withConfig({displayName:"RoleSelectMenu__Wrapper",componentId:"sc-73c403d2-0"})` + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + max-width: 320px; + padding: 10px 0; +`,bk=eL.default.div.withConfig({displayName:"RoleSelectMenu__SelectedRole",componentId:"sc-73c403d2-1"})` + display: flex; + min-width: 40px; + justify-content: center; +`,bE=eL.default.div.withConfig({displayName:"RoleSelectMenu__RoleDescription",componentId:"sc-73c403d2-2"})` + display: flex; + flex-direction: column; +`,bx=(0,eL.default)(lT.my).withConfig({displayName:"RoleSelectMenu__IconRoleSelected",componentId:"sc-73c403d2-3"})` + & path { + stroke: ${e=>e.theme.isNightMode?"#ccc":"#333"}; + } +`,b_=function(e){let{isProject:t,menuGroupDispatch:a,value:n,initialFocus:l}=e,r=gV(),o=bh.get(n);return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(bv,{initialFocus:l,loop:!0},bf.map(e=>{let[a,n]=e,l=(bh.get(n.value)?.isPaidFeature??!1)&&r.isPaywallEnabled;return ev.createElement(bb,{key:a,value:n.value},t?ev.createElement(ev.Fragment,null,ev.createElement(bk,null,o?.value===n.value&&ev.createElement(bx,null)),ev.createElement(bE,null,ev.createElement("div",null,ev.createElement(yN,{fontWeight:"500",role:n.value}),l&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),ev.createElement(yZ,{role:n.value}))):ev.createElement(ev.Fragment,null,ev.createElement(bk,null,o?.value===n.value&&ev.createElement(bx,null)),ev.createElement(bE,null,ev.createElement("div",null,ev.createElement(bu,{fontWeight:"500",role:n.value}),l&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),ev.createElement(bg,{role:n.value}))))})))},bw=eL.default.div.withConfig({displayName:"RoleSelect__MenuButton",componentId:"sc-c1de9643-0"})` + ${e1.UiTypography.sm} + + display: flex; + align-items: center; + user-select: none; + + color: ${e=>e.theme.textColors.hex(50)}; + + &:hover, + &[aria-expanded='true'] { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(20)}; + } +`,bN=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"RoleSelect__IconCaretDown",componentId:"sc-c1de9643-1"})` + margin-left: 4px; +`,bC=function(e){let{onChange:t,value:a,isProject:n,className:l}=e,r=bh.get(a),[o,i]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),s=(0,ev.useRef)(null),d=(0,ev.useRef)(null),c=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:o,placement:"bottom"}),m=(0,eI.useMenuButton)({ref:s,state:o,dispatch:i}),u=(0,ev.useCallback)(e=>{"Activate"===e.type&&(t(e.payload.value),i({type:"Collapse"}))},[t]);return ev.createElement(ev.Fragment,null,ev.createElement(bw,{className:l,...m.props},n?ev.createElement(yN,{role:r?.value||"collaborator"}):ev.createElement(bu,{role:r?.value||"collaborator"}),ev.createElement(bN,null)),o.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:i,modal:!0},ev.createElement(b_,{value:a,isProject:n,menuGroupDispatch:u,initialFocus:c.initialFocus})))},bM=eL.default.div.withConfig({displayName:"StyledInviteBox__FlexContainer",componentId:"sc-68d774a7-0"})` + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + margin-bottom: 20px; + padding: 0 1.875rem; +`,bS=eL.default.div.withConfig({displayName:"StyledInviteBox__InputContainer",componentId:"sc-68d774a7-1"})` + display: flex; + position: relative; + flex: none; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + transition: border-color 200ms ease-in; + background: ${e=>e.theme.appColors.hex(90)}; + overflow: clip; + + &:focus-within { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + & > :last-child { + padding: 0 8px; + &:hover, + &[aria-expanded='true'] { + color: ${e=>e.theme.textColors.hex(20)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + } +`,bI=e=>(0,eL.keyframes)` + 0% { } + 30% { color: ${e}; } + 100% { } +`;eL.default.input.attrs({type:"text"}).withConfig({displayName:"StyledInviteBox__TextInput",componentId:"sc-68d774a7-2"})` + flex: 1 1 auto; + min-height: 2rem; + border: 0; + padding: 0.4375rem 0.625rem; + background: none; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + + &::placeholder { + color: ${e=>e.theme.appColors.hex(50)}; + } + ${e=>!e.$regenerating&&(0,eL.css)` + animation: ${bI(e.theme.primaryColorScheme?.base)}; + animation-duration: 1s; + `} +`;let bD=eL.default.button.withConfig({displayName:"StyledInviteBox__Button",componentId:"sc-68d774a7-3"})` + display: flex; + justify-content: center; + align-items: center; + border-radius: 10px; + font-weight: 500; + padding: 0 5px; + color: #fff; + transition: background-color 200ms ease-in; + background: ${e=>e.theme.primaryColorScheme?.base}; + padding: 0.5rem 1rem; + ${e1.UiTypography.sm}; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + &:disabled { + background: ${e=>e.theme.appColors.hex(80)}; + } +`;eL.default.button.withConfig({displayName:"StyledInviteBox__RegenerateButton",componentId:"sc-68d774a7-4"})` + display: flex; + padding: 10px 0 0; + cursor: ${e=>e.$isRegenerating?"inherit":"pointer"}; + align-self: flex-start; + color: ${e=>e.$isRegenerating?"#999":e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.$isRegenerating?"#999":e.theme.primaryColorScheme?.alpha80}; + } + ${e1.UiTypography.sm} +`;let bT=eL.default.div.withConfig({displayName:"StyledInviteBox__FormContainer",componentId:"sc-68d774a7-5"})` + display: flex; + flex-direction: column; + gap: 1rem; +`,b$=(0,la.ZP)` + query MyAccountsQuery { + myAccounts { + google { + id + metadata { + ... on AccountMetadataGoogle { + hasGooglePeople + } + } + } + } + } +`;function bP(e){return e.trim().split(/(?:;\s?|\n)/).map(e=>e.trim())}let bF=(0,la.ZP)` + query DocumentMembersQuery($document_id: ID!) { + document(id: $document_id) { + id + members { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + } + } + ${up} +`,bA=(0,la.ZP)` + query NodeAssigneeChoicesQuery($document_id: ID!, $projectMembersLimit: Int = null) { + me { + id + } + document(id: $document_id) { + id + space_type + members(first: $projectMembersLimit) { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + space { + id + type + is_subspace + memberships { + id + role + user { + ...BasicUserFields + } + } + } + } + } + ${up} +`,bR={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectMemberInviteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectMemberInviteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectMemberInvite"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"members"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ProjectMemberParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ProjectMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ProjectMember"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]};function bj(e){let{documentID:t}=e,[a,n]=(0,cs.D)(bR,{refetchQueries:[{query:yM,variables:{document_id:t}},{query:bF,variables:{document_id:t}},{query:bA,variables:{document_id:t,projectMembersLimit:30}}]});return[(e,n)=>a({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:t,invitees:e,role:n}},update:(e,a)=>{let n=a?.data?.projectMemberInvite?.members;if(null==n)return;let l=e.readQuery({query:yj,variables:{document_id:t}});l?.document?.members.edges!=null&&e.writeQuery({query:yj,data:(0,es.ZP)(l,e=>{if(e?.document?.members.edges==null)return;let t=new Set(e.document.members.edges.map(e=>e.node?.id));for(let a of n){if(t.has(a.id))continue;let n=`${e.document.members.edges.length}`;e.document.members.edges.push({__typename:"ProjectMemberEdge",cursor:n,node:a})}}),variables:{document_id:t}})}}),n]}let bO=function(e,t){switch(t.type){case"INVITEE_VALUE_ADD":{let a=new Set(e.inviteeValues);return a.add(t.value),{...e,inviteeValues:[...a],inputText:"",googlePeoplePopupFocusedIndex:-1}}case"INVITEE_VALUE_ADD_MULTIPLE":{if(0===t.values.length)return e;let a=new Set([...e.inviteeValues,...t.values]);return{...e,inviteeValues:[...a],googlePeoplePopupFocusedIndex:-1}}case"INVITEE_VALUE_EDIT":{let a=new Set(e.inviteeValues);return a.delete(t.value),{...e,inviteeValues:[...a],inputText:t.value,googlePeoplePopupFocusedIndex:-1}}case"INVITEE_VALUE_REMOVE":{let a=new Set(e.inviteeValues);return a.delete(t.value),{...e,inviteeValues:[...a],googlePeoplePopupFocusedIndex:-1}}case"ROLE_SET":return{...e,role:t.role};case"ERROR":return{...e,status:{type:"failure",error:t.error}};case"IDLE":return{...e,status:{type:"idle"}};case"LOADING":return{...e,status:{type:"loading"}};case"SUCCESS":{let t=[...e.inviteeValues];return e.inputText.length>0&&t.push(e.inputText),{...e,inviteeValues:[],status:{type:"success",inviteeValues:t},inputText:""}}case"SET_INPUT_TEXT":return{...e,inputText:t.value,googlePeoplePopupFocusedIndex:-1};case"UPDOWN_FOCUS_PREVIOUS":{let a=e.googlePeoplePopupFocusedIndex-1;return a<-1&&(a=t.itemCount-1),{...e,googlePeoplePopupFocusedIndex:a}}case"UPDOWN_FOCUS_NEXT":{let a=e.googlePeoplePopupFocusedIndex+1;return a>=t.itemCount&&(a=-1),{...e,googlePeoplePopupFocusedIndex:a}}}return e},bU=function(e){let{googlePeople:t,focused:a,onClick:n}=e,l=ev.useRef(null);return ev.useEffect(()=>{a&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[a]),ev.createElement("div",{ref:l,className:og()("flex select-none items-center gap-x-2 px-3 py-1.5 text-textcolor-700",{"bg-appcolor-200":a},"hover:bg-appcolor-200"),onClick:()=>{n(t)}},ev.createElement("div",{className:"h-6 w-6 overflow-hidden rounded-full bg-appcolor-600"},null!=t.photoUrl&&ev.createElement("img",{src:t.photoUrl,alt:"",className:"h-6 w-6"})),ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"text-sm font-bold"},t.displayName),ev.createElement("span",{className:"text-sm"},t.email)))},bZ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GooglePeopleQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GooglePeopleFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"7"}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"googlePeople"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"photoUrl"}},{kind:"Field",name:{kind:"Name",value:"displayName"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"hasNextPage"}}]}}]}}]}}]};function bL(){return[{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn(e){let{state:t}=e;t.styles.popper.minWidth=`${t.rects.reference.width}px`},effect(e){let{state:t}=e;t.elements.popper.style.minWidth=`${t.elements.reference.offsetWidth}px`}},{name:"offset",options:{offset:[0,5]}}]}let bB=ev.forwardRef(function(e,t){let{reducerState:a,reducerDispatch:n,popupState:l,popupDispatch:r}=e,o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,placement:"bottom",state:l,computeModifiersCallback:bL});ev.useEffect(()=>{s.popper.instanceRef.current?.update?.()},[s.popper.instanceRef,a.inviteeValues]);let[d,c]=ev.useState(h.DomainContact),{data:m,loading:u,fetchMore:p}=(0,eB.a)(bZ,{variables:{filterby:{type:d}}}),g=ev.useMemo(()=>{let e=new Set(a.inviteeValues);return(m?.googlePeople?.edges??[]).filter(t=>!e.has(t.node.email))},[m?.googlePeople?.edges,a.inviteeValues]);ev.useImperativeHandle(t,()=>({getItem:e=>g[e]?.node?.email??null,itemCount:g.length}),[g]);let f=ev.useMemo(()=>m?.googlePeople?.pageInfo?.endCursor,[m?.googlePeople?.pageInfo?.endCursor]),y=m?.googlePeople?.pageInfo?.hasNextPage??!1;return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"absolute bottom-0 left-0 right-0",ref:o}),l.expanded&&ev.createElement(eI.Popup,{dispatch:r,...s.props},ev.createElement("div",{className:"flex w-full flex-col overflow-hidden rounded-lg border-[1px] border-appcolor-400"},ev.createElement("div",{className:"flex bg-appcolor-100"},ev.createElement("div",{className:"w-3 border-b-2 border-b-appcolor-300"}),ev.createElement("button",{className:og()("box-border border-b-2 px-2 py-2 text-sm font-bold",{"border-b-appcolor-700 text-textcolor-700":d===h.DomainContact,"border-b-appcolor-300 text-textcolor-400 hover:text-textcolor-500":d!==h.DomainContact}),onClick:()=>{c(h.DomainContact)}},"Google Domain"),ev.createElement("button",{className:og()("box-border border-b-2 px-2 py-2 text-sm font-bold",{"border-b-appcolor-700 text-textcolor-700":d===h.UserContact,"border-b-appcolor-300 text-textcolor-400 hover:text-textcolor-500":d!==h.UserContact}),onClick:()=>{c(h.UserContact)}},"Google Contacts"),ev.createElement("div",{className:"w-3 grow border-b-2 border-b-appcolor-300"})),0===g.length&&!u&&ev.createElement("span",{className:"bg-appcolor-100 p-3 text-sm text-textcolor-400"},ev.createElement(eY.Z,{id:"google_contacts.empty_state",defaultMessage:"There are no results to display."})),ev.createElement("div",{className:"max-h-32 overflow-y-scroll bg-appcolor-100",onScroll:e=>{let t=e.currentTarget;1>Math.abs(t.scrollHeight-t.scrollTop-t.clientHeight)&&y&&p({variables:{after:f}})}},g.map((e,t)=>ev.createElement(bU,{key:e.cursor,googlePeople:e.node,focused:a.googlePeoplePopupFocusedIndex===t,onClick:e=>{n({type:"INVITEE_VALUE_ADD",value:e.email})}})),u&&ev.createElement("div",{className:"p-3"},ev.createElement(eI.Spinner,null))))))});var bz=a(13311),bV=a.n(bz),bq=a(18446),bW=a.n(bq);function bH(e,t){if(oh()(t)&&(t=t.split(".")),!tZ()(t)||!("graphQLErrors"in e))return null;let{graphQLErrors:a}=e;return tZ()(a)?bV()(a,e=>bW()(e.path,t))??null:null}let bG=eL.default.div.withConfig({displayName:"Status__ErrorMessage",componentId:"sc-1a39a691-0"})` + background: #ffe6e6; + color: #ef5656; + border: 1px solid #ef5656; + padding: 6px 10px; + border-radius: 5px; + margin-bottom: 10px; + font-size: 15px; +`,bK=eL.default.div.withConfig({displayName:"Status__SuccessMessage",componentId:"sc-1a39a691-1"})` + background: #ebffef; + color: #3cbd66; + border: 1px solid #3cbd66; + padding: 6px 10px; + border-radius: 5px; + margin-bottom: 10px; + font-size: 15px; +`,bY=function(e){let{status:t}=e;switch(t?.type){case"failure":{let e=bH(t.error,["projectMemberInvite"])??t.error;return ev.createElement(bG,null,e.message)}case"success":return ev.createElement(bK,null,`${t.inviteeValues.join(", ")} has been invited!`);case"loading":return ev.createElement(bK,null,ev.createElement(eY.Z,{id:"general.loading",defaultMessage:"Loading…"}));default:return null}},bQ=function(e){let{documentID:t}=e,a=(0,eK.Z)(),n=(0,e$.useDispatch)(),l=gV(),[r]=bj({documentID:t}),[o,i]=ev.useReducer(bO,{inviteeValues:[],status:{type:"idle"},role:"collaborator",inputText:"",googlePeoplePopupFocusedIndex:-1}),s=ev.useRef(null),[d,c]=ev.useReducer(eI.popupReducer,{expanded:!0}),{data:m,loading:u}=(0,eB.a)(b$,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-and-network"}),p=ev.useCallback(async()=>{i({type:"LOADING"});let e=[...o.inviteeValues];o.inputText.length>0&&e.push(o.inputText);let t=Array.from(new Set(e));try{await r(t,o.role),i({type:"SUCCESS"})}catch(e){i({type:"ERROR",error:e})}},[r,o.inputText,o.inviteeValues,o.role]),g=ev.useCallback(e=>{if(!br()(e)){i({type:"ERROR",error:Error("Please enter an email")});return}i({type:"IDLE"}),i({type:"INVITEE_VALUE_ADD",value:e})},[]),f=ev.useCallback(e=>{i({type:"INVITEE_VALUE_EDIT",value:e})},[]),h=ev.useCallback(e=>{i({type:"INVITEE_VALUE_REMOVE",value:e})},[]),y=ev.useCallback(e=>{if(yF.get(e)?.isPaidFeature&&l.isPaywallEnabled){null!=l.id&&n(d4(l.id));return}i({type:"ROLE_SET",role:e})},[n,l]),b=ev.useCallback(()=>{0!==o.inviteeValues.length&&p()},[o.inviteeValues.length,p]),v=ev.useCallback(e=>{let t=e.clipboardData.getData("text/plain");0!==t.length&&(e.preventDefault(),i({type:"INVITEE_VALUE_ADD_MULTIPLE",values:bP(t)}))},[]),k=ev.useCallback(e=>{i({type:"SET_INPUT_TEXT",value:e.target.value})},[]),E=ev.useCallback(e=>{c({type:"Expand"})},[]),x=ev.useCallback(e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:i({type:"UPDOWN_FOCUS_PREVIOUS",itemCount:s.current?.itemCount??0});break;case eI.KeyboardKeys.ArrowDown:i({type:"UPDOWN_FOCUS_NEXT",itemCount:s.current?.itemCount??0});break;case eI.KeyboardKeys.Enter:{if(-1===o.googlePeoplePopupFocusedIndex)return;let t=s.current?.getItem?.(o.googlePeoplePopupFocusedIndex)??null;if(null==t)return;e.preventDefault(),i({type:"INVITEE_VALUE_ADD",value:t});break}case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation()}},[o.googlePeoplePopupFocusedIndex]),_=async()=>{await p()},w=m?.myAccounts?.google?.id!=null&&m?.myAccounts?.google?.metadata?.hasGooglePeople&&!u;return ev.createElement(bM,null,ev.createElement(bY,{status:o.status}),ev.createElement(bT,null,w&&d.expanded&&ev.createElement("div",{className:"fixed bottom-0 left-0 right-0 top-0 z-10 bg-transparent",onClick:e=>{c({type:"Collapse"})}}),ev.createElement(bS,{className:"z-20"},ev.createElement(bc,{className:"shrink",classNameInput:"truncate",items:o.inviteeValues,onChipItemAdded:g,onChipItemEditRequested:f,onChipItemRemoved:h,onSubmit:b,onPaste:v,placeholder:a.formatMessage({id:"general.invite_textinput_placeholder",defaultMessage:"Invite with email…"}),value:o.inputText,onChange:k,onFocus:E,onKeyDown:x}),ev.createElement(bC,{className:"shrink-0",value:o.role,onChange:y,isProject:!0}),w&&ev.createElement(bB,{ref:s,reducerState:o,reducerDispatch:i,popupState:d,popupDispatch:c})),ev.createElement(bD,{onClick:_},ev.createElement(eY.Z,{id:"general.send_invite",defaultMessage:"Send Invite"}))))},bJ=eL.default.div.withConfig({displayName:"Invitee__FlexContainer",componentId:"sc-c38336d1-0"})` + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin-bottom: 0.625rem; + ${e1.UiTypography.sm}; + padding-right: 1rem; + + &:last-child { + margin-bottom: 0; + } +`,bX=eL.default.div.withConfig({displayName:"Invitee__Name",componentId:"sc-c38336d1-1"})` + flex: 3; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; +`,b0=eL.default.span.withConfig({displayName:"Invitee__DisplayName",componentId:"sc-c38336d1-2"})` + color: ${e=>e.theme.appColors.hex(40)}; + margin-left: 0.25rem; +`,b1=eL.default.span.withConfig({displayName:"Invitee__Handle",componentId:"sc-c38336d1-3"})` + font-weight: 600; + color: ${e=>e.theme.textColors.hex(10)}; +`,b2=eL.default.div.withConfig({displayName:"Invitee__AddIconWrapper",componentId:"sc-c38336d1-4"})` + display: inline-flex; + align-items: center; + margin-right: 8px; + border-radius: 20px; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; +`,b5=eL.default.button.withConfig({displayName:"Invitee__InviteButton",componentId:"sc-c38336d1-5"})` + display: flex; + align-items: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + cursor: pointer; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + + ${b2} { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,b3=function(e){let{user:t,onInvite:a}=e;return ev.createElement(bJ,null,ev.createElement(ao,{avatars_v2:t.avatars_v2,handle:t.handle,size:24,userID:parseInt(t.id,10)}),ev.createElement(bX,null,ev.createElement(b1,null,t.handle),t.display_name&&ev.createElement(b0,null,t.display_name)),ev.createElement(b5,{onClick:a},ev.createElement(b2,null,ev.createElement(tn.Icon,{icon:"plus_invite"})),ev.createElement(eY.Z,{id:"general.invite",defaultMessage:"Share"})))},b4=eL.default.div.withConfig({displayName:"InviteList__FlexContainer",componentId:"sc-5425b0e-0"})` + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + margin-top: 1.25rem; + padding: 0 1.875rem; +`,b6=eL.default.div.withConfig({displayName:"InviteList__SuggestedInvitees",componentId:"sc-5425b0e-1"})` + margin-top: 0.625rem; +`,b8=function(e){let{suggestedInvitees:t,documentID:a}=e,[n]=bj({documentID:a});return ev.createElement(b4,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.invite_members",defaultMessage:"Invite Members"})),ev.createElement(b6,null,t.map(e=>{switch(e.type){case"email":return null;case"user":{let{user:t}=e;return ev.createElement(b3,{key:t.id,user:t,onInvite:()=>{n([t.handle],"collaborator")}})}}})))},b7=eL.default.div.withConfig({displayName:"Member__FlexContainer",componentId:"sc-18240433-0"})` + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin-bottom: 10px; + ${e1.UiTypography.sm}; + height: 26px; + + &:last-child { + margin-bottom: 0; + } +`,b9=eL.default.div.withConfig({displayName:"Member__Name",componentId:"sc-18240433-1"})` + flex: 3; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; +`,ve=eL.default.span.withConfig({displayName:"Member__DisplayName",componentId:"sc-18240433-2"})` + color: ${e=>e.theme.appColors.hex(40)}; + margin-left: 0.25rem; +`,vt=eL.default.span.withConfig({displayName:"Member__Handle",componentId:"sc-18240433-3"})` + font-weight: 600; + color: ${e=>e.theme.textColors.hex(10)}; +`,va=function(e){let{member:t,roleEntries:a,type:n,projectId:l}=e,{user:r}=t;return ev.createElement(b7,null,ev.createElement(ao,{avatars_v2:r.avatars_v2,handle:r.handle,size:24,userID:parseInt(r.id,10)}),ev.createElement(b9,null,ev.createElement(vt,null,r.handle),r.display_name&&ev.createElement(ve,null,r.display_name)),ev.createElement(y6,{member:t,roleEntries:a,type:n,projectId:l}))},vn=eL.default.div.withConfig({displayName:"MemberList__FlexContainer",componentId:"sc-3d9c8c5c-0"})` + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + padding: 0 1.875rem; +`,vl=eL.default.div.withConfig({displayName:"MemberList__Members",componentId:"sc-3d9c8c5c-1"})` + margin-top: 0.625rem; +`,vr=function(e){let{members:t,roleEntries:a,projectId:n}=e;return ev.createElement(vn,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.project_collaborators",defaultMessage:"Project Collaborators"})),ev.createElement(vl,null,t&&t.map(e=>{let{member:t,type:l}=e;return ev.createElement(va,{key:t.id,member:t,roleEntries:a,type:l,projectId:n})})))};var vo=a(72404);let vi=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-f803fed1-0"})` + display: flex; + flex-direction: column; + padding: 0 1.875rem; +`,vs=eL.default.div.withConfig({displayName:"styled__ItemsList",componentId:"sc-f803fed1-1"})` + ${e1.UiBorderRadius.lg}; + + display: flex; + flex-direction: column; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,vd=eL.default.div.withConfig({displayName:"styled__ItemContainer",componentId:"sc-f803fed1-2"})` + ${e1.UiTypography.sm}; + + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.5rem 1rem; + color: ${e=>e.theme.textColors.hex(10)}; + border-bottom: ${e=>e.$hasBorderBottom?"1px":"0px"} solid + ${e=>e.theme.appColors.hex(70)}; + + &:last-child { + border-bottom: 0; + } + + pointer-events: ${e=>e.$isDisabled?"none":"inherit"}; +`,vc=eL.default.div.withConfig({displayName:"styled__ActionContainer",componentId:"sc-f803fed1-3"})` + ${e1.UiTypography.sm}; + display: flex; + align-items: center; + justify-content: space-between; + color: ${e=>e.theme.textColors.hex(10)}; + margin-top: 1rem; +`,vm=eL.default.div.withConfig({displayName:"styled__ItemLabel",componentId:"sc-f803fed1-4"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(2)}; + + svg { + transform: var(--global-icon-scale); + } +`,vu=eL.default.div.withConfig({displayName:"styled__ItemToggles",componentId:"sc-f803fed1-5"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(3)}; + border-color: ${e=>e.theme.appColors.hex(70)}; + + & > input { + cursor: pointer; + width: 36px; + height: 20px; + border-width: 1px; + + &:checked { + border-width: 1px; + } + } +`,vp=eL.default.div.withConfig({displayName:"styled__ButtonContainer",componentId:"sc-f803fed1-6"})` + width: 100%; + + display: flex; + flex-direction: column; +`,vg=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-f803fed1-7"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.lg}; + + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #ffffff; + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(4)}; + + transition: background-color 200ms ease-in-out; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,vf=eL.default.div.withConfig({displayName:"styled__TooltipContainer",componentId:"sc-f803fed1-8"})` + ${e1.UiTypography.xs}; + line-height: 1; + + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(1.5)}; +`,vh=function(e){let{textToCopy:t}=e,[a,n]=ev.useState(null),[l,r]=ev.useState(!1),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useState(!1),{arrowProps:m,popperProps:u,referenceProps:p}=(0,eI.useControlledTooltip)({arrowElementRef:o,popperElementRef:i,referenceElementRef:s,visible:d,placement:"bottom"});return ev.useEffect(()=>{if(null==a)return;let e=new(hF())(a);return e.on("success",()=>{r(!0)}),()=>{e.destroy()}},[a]),ev.createElement(ev.Fragment,null,ev.createElement(vp,p,ev.createElement(vg,{ref:n,"data-clipboard-action":"copy","data-clipboard-text":t,onMouseOut:()=>{r(!1)},onBlur:()=>{r(!1)},onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},l?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"}))),d&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(vf,null,ev.createElement(tn.Icon,{icon:"link",width:16,height:16}),t)))},vy={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PublicProjectPasswordPreferencesUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PublicProjectPasswordPreferencesUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicProjectPasswordPreferencesUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},vb={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PublicProjectPreferencesUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PublicProjectPreferencesUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicProjectPreferencesUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},vv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PublicProjectQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicProject"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"documentId"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"isPasswordProtected"}},{kind:"Field",name:{kind:"Name",value:"preferences"}}]}}]}}]},vk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PublicProjectUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PublicProjectUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicProjectUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"publicProject"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]},vE=(0,e$.connect)(function(e){return{documentSharedPreferences:dF(e)}})(function(e){let{document:t,documentSharedPreferences:a}=e,n=e.spacePlanType??"free",l=lm({role:t.role,action:{project:"manage"}}),r=(0,eK.Z)(),o=(0,eL.useTheme)(),i=(0,e$.useDispatch)(),[s,d]=ev.useState("placeholder"),[c,m]=ev.useState(!1),[u,p]=ev.useState(!1),[g,f]=ev.useState(!1),h=fR.Vl.getFeature("project.password").plans[n],y=d6()&&!h,{data:b,error:v,loading:k}=(0,eB.a)(vv,{variables:{documentId:t.id}}),[E,{loading:x}]=(0,cs.D)(vk),[_,{loading:w}]=(0,cs.D)(vy),[N]=(0,cs.D)(vb),C=ev.useCallback(async e=>{if(!l)return;let n=(0,ld.Z)();try{await E({variables:{input:{clientMutationId:n,documentId:t.id,isEnabled:e}},update:(n,l)=>{let{data:r,errors:o}=l;null==o&&null!=r&&(r.publicProjectUpdate?.publicProject!=null&&e&&n.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:{id:r.publicProjectUpdate.publicProject.id,document:r.publicProjectUpdate.publicProject.document,isPasswordProtected:!1,preferences:{isDarkMode:!1,coverImageType:a?.coverImageType??"none",hideCompleted:!1}}}}),r.publicProjectUpdate?.publicProject!=null||e||n.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:null}}))}}),f(!1)}catch(e){e instanceof ea.cA&&"TOO_MANY_REQUESTS"===e.graphQLErrors[0].extensions.code&&f(!0)}},[l,t.id,a?.coverImageType,E]),M=ev.useCallback(async e=>{if(!l||b?.publicProject==null)return;if(y&&null!=t.space){i(d4(t.space.id));return}let a=(0,ld.Z)();e||(p(!1),d(""),await _({variables:{input:{clientMutationId:a,id:b.publicProject.id,password:null}},update:(e,a)=>{let{data:n,errors:l}=a;null==l&&null!=n&&b?.publicProject!=null&&e.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:{...b.publicProject,isPasswordProtected:!1}}})}})),e&&(p(!0),d(""),m(!0))},[b?.publicProject,_,t.id,i,t.space,y,l]),S=ev.useCallback(async e=>{if(!l||b?.publicProject==null)return;let a=(0,ld.Z)();await N({variables:{input:{clientMutationId:a,id:b.publicProject.id,isDarkMode:e}},update:(a,n)=>{let{data:l,errors:r}=n;null==r&&null!=l&&b?.publicProject!=null&&a.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:{...b.publicProject,preferences:{...b.publicProject.preferences,isDarkMode:e}}}})}})},[l,t.id,b?.publicProject,N]),I=ev.useCallback(async e=>{if(!l||b?.publicProject==null)return;let a=(0,ld.Z)();await N({variables:{input:{clientMutationId:a,id:b.publicProject.id,coverImageType:e}},update:(a,n)=>{let{data:l,errors:r}=n;null==r&&null!=l&&b?.publicProject!=null&&a.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:{...b.publicProject,preferences:{...b.publicProject.preferences,coverImageType:e}}}})}})},[l,t.id,b?.publicProject,N]),D=ev.useCallback(async e=>{if(!l||b?.publicProject==null)return;let a=(0,ld.Z)();await N({variables:{input:{clientMutationId:a,id:b.publicProject.id,hideCompleted:e}},update:(a,n)=>{let{data:l,errors:r}=n;null==r&&null!=l&&b?.publicProject!=null&&a.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:{...b.publicProject,preferences:{...b.publicProject.preferences,hideCompleted:e}}}})}})},[l,t.id,b?.publicProject,N]),T=async e=>{d(e.target.value)},$=async()=>{if(b?.publicProject==null)return;let e=(0,ld.Z)();await _({variables:{input:{clientMutationId:e,id:b.publicProject.id,password:s}},update:(e,a)=>{let{data:n,errors:l}=a;null==l&&null!=n&&b?.publicProject!=null&&e.writeQuery({query:vv,variables:{documentId:t.id},data:{publicProject:{...b.publicProject,isPasswordProtected:!0}}})}}),d("placeholder"),m(!1)},P=ev.useMemo(()=>{if(b?.publicProject?.id!=null){let e=(0,vo.Z)(t.info.title||"untitled",{preserveTrailingDash:!0}).substring(0,100);return e=""===e?"":`${e}-`,new URL(`/p/${e}${b.publicProject.id}`,"https://www.taskade.com").toString()}return new URL(`/d/${t.id}`,"https://www.taskade.com").toString()},[t.id,b?.publicProject?.id,t.info.title]),F=ev.useMemo(()=>v?.message!=="Not Found"&&b?.publicProject!=null,[v?.message,b?.publicProject]),A=ev.useMemo(()=>v?.message!=="Not Found"&&b?.publicProject!=null&&b.publicProject.isPasswordProtected,[v?.message,b?.publicProject]),R=ev.useMemo(()=>v?.message!=="Not Found"&&b?.publicProject?.preferences?.isDarkMode!=null&&b.publicProject.preferences.isDarkMode,[v?.message,b?.publicProject]),j=ev.useMemo(()=>v?.message==="Not Found"||b?.publicProject?.preferences?.coverImageType==null?a?.coverImageType??"none":b.publicProject.preferences.coverImageType,[v?.message,b?.publicProject,a?.coverImageType]),O=ev.useMemo(()=>v?.message!=="Not Found"&&b?.publicProject?.preferences?.hideCompleted!=null&&b.publicProject.preferences.hideCompleted,[v?.message,b?.publicProject]);return x||k?ev.createElement(vi,null,ev.createElement(eI.Spinner,{width:16,height:16})):ev.createElement(vi,null,g&&ev.createElement(e1.Notice,{className:"mb-2.5",$type:"danger"},ev.createElement(eY.Z,{id:"general.public_links_rate_limit_error",defaultMessage:"Too many requests to create public links in the past few hours. Please try again later. {br}If you think this is an error, please contact support@taskade.com",values:{br:ev.createElement("br",null),support:e=>ev.createElement("a",{className:"text-primary transition duration-150 ease-in-out hover:opacity-75",href:"mailto:support@taskade.com"},e)}})),ev.createElement(vs,null,ev.createElement(vd,{$hasBorderBottom:!0,$isDisabled:!1},ev.createElement(vm,null,ev.createElement(tn.Icon,{icon:"share_public"}),ev.createElement(eY.Z,{id:"general.share_to_web",defaultMessage:"Share to web"})),ev.createElement(vu,null,ev.createElement(e1.Switch,{checked:F,onChange:C,className:l?"":"opacity-50"}))),ev.createElement("div",{className:"flex flex-col"},ev.createElement(vd,{$hasBorderBottom:!0,$isDisabled:!F},ev.createElement(vm,null,ev.createElement(tn.Icon,{icon:"mode_dark"}),ev.createElement(eY.Z,{id:"general.enable_dark_mode",defaultMessage:"Enable Dark Mode"})),ev.createElement(vu,null,ev.createElement(e1.Switch,{checked:R,onChange:S,className:l?"":"cursor-not-allowed opacity-50"}))),ev.createElement(vd,{$hasBorderBottom:!0,$isDisabled:!F},ev.createElement(vm,null,ev.createElement(tn.Icon,{icon:"dd_export_image"}),ev.createElement(eY.Z,{id:"general.embed_cover_image",defaultMessage:"Cover Image"})),ev.createElement(h2,{cover:j,handleCoverSelect:I})),ev.createElement(vd,{$hasBorderBottom:!0,$isDisabled:!F},ev.createElement(vm,null,ev.createElement(tn.Icon,{icon:"dd_hide_completed"}),ev.createElement(eY.Z,{id:"general.hide_completed",defaultMessage:"Hide completed"})),ev.createElement(vu,null,ev.createElement(e1.Switch,{checked:O,onChange:D,className:l?"":"cursor-not-allowed opacity-50"}))),ev.createElement(vd,{$hasBorderBottom:!1,$isDisabled:!F||y},ev.createElement(vm,null,ev.createElement(tn.Icon,{icon:"share_password"}),ev.createElement(eY.Z,{id:"general.require_password",defaultMessage:"Require password"}),y&&ev.createElement("div",null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(vu,null,ev.createElement(e1.Switch,{checked:A||u,onChange:M,className:l?"":"opacity-50"}))),(A||u)&&ev.createElement(vd,{$hasBorderBottom:!1,$isDisabled:!F||y},ev.createElement("div",{className:"ml-6 flex w-full cursor-text flex-row flex-wrap items-center gap-x-1.5 gap-y-1 rounded-lg border border-appcolor-300 px-3 py-1.5"},ev.createElement("input",{type:"password",className:"shrink grow rounded bg-transparent text-sm",placeholder:r.formatMessage({id:"general.password",defaultMessage:"Password"}),value:s,onChange:T,disabled:!c}),l&&c&&s.length>0&&ev.createElement("span",{className:"cursor-pointer text-sm",style:{color:o.primaryColorScheme?.base},onClick:$},w?ev.createElement(eI.Spinner,{width:12,height:12}):ev.createElement(eY.Z,{id:"general.update",defaultMessage:"Update"})),l&&!c&&ev.createElement("span",{className:"cursor-pointer text-sm",style:{color:o.primaryColorScheme?.base},onClick:()=>{l&&(d(""),m(!0))}},ev.createElement(eY.Z,{id:"general.reset",defaultMessage:"Reset"})))))),F&&ev.createElement(vc,null,ev.createElement(vh,{textToCopy:P})),ev.createElement("div",{className:"mt-4 rounded-xl border border-appcolor-300 px-4 py-3 text-sm"},ev.createElement(eY.Z,{id:"tip.share_to_web_securely_using_optional_password_protection",defaultMessage:"\uD83D\uDD12 Share to web securely using optional password protection."})))}),vx=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-3521ab9-0"})` + display: flex; + flex-direction: column; + margin-bottom: ${eI.UiSpacing.getPx(4)}; + padding: 0 1.875rem; +`,v_=eL.default.div.withConfig({displayName:"styled__ItemsList",componentId:"sc-3521ab9-1"})` + ${e1.UiBorderRadius.lg}; + + display: flex; + flex-direction: column; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,vw=eL.default.div.withConfig({displayName:"styled__ItemContainer",componentId:"sc-3521ab9-2"})` + ${e1.UiTypography.sm}; + + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.5rem 1rem; + color: ${e=>e.theme.textColors.hex(10)}; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + + &:last-child { + border-bottom: 0; + } +`,vN=eL.default.div.withConfig({displayName:"styled__ActionContainer",componentId:"sc-3521ab9-3"})` + ${e1.UiTypography.sm}; + display: flex; + align-items: center; + justify-content: space-between; + color: ${e=>e.theme.textColors.hex(10)}; + margin-top: 1rem; +`,vC=eL.default.div.withConfig({displayName:"styled__ItemLabel",componentId:"sc-3521ab9-4"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(2)}; + + svg { + transform: var(--global-icon-scale); + } +`,vM=eL.default.div.withConfig({displayName:"styled__ItemToggles",componentId:"sc-3521ab9-5"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(3)}; + border-color: ${e=>e.theme.appColors.hex(70)}; + + & > input { + cursor: pointer; + width: 36px; + height: 20px; + border-width: 1px; + + &:checked { + border-width: 1px; + } + } +`,vS=eL.default.div.withConfig({displayName:"styled__ButtonContainer",componentId:"sc-3521ab9-6"})` + width: 100%; + + display: flex; + flex-direction: column; +`,vI=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-3521ab9-7"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.lg}; + + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #ffffff; + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(4)}; + + transition: background-color 200ms ease-in-out; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,vD=eL.default.div.withConfig({displayName:"styled__TooltipContainer",componentId:"sc-3521ab9-8"})` + ${e1.UiTypography.xs}; + line-height: 1; + + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(1.5)}; +`,vT=function(e){let{textToCopy:t}=e,[a,n]=ev.useState(null),[l,r]=ev.useState(!1),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useState(!1),{arrowProps:m,popperProps:u,referenceProps:p}=(0,eI.useControlledTooltip)({arrowElementRef:o,popperElementRef:i,referenceElementRef:s,visible:d,placement:"bottom"});return ev.useEffect(()=>{if(null==a)return;let e=new(hF())(a);return e.on("success",()=>{r(!0)}),()=>{e.destroy()}},[a]),ev.createElement(ev.Fragment,null,ev.createElement(vS,p,ev.createElement(vI,{ref:n,"data-clipboard-action":"copy","data-clipboard-text":t,onMouseOut:()=>{r(!1)},onBlur:()=>{r(!1)},onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},l?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"}))),d&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(vD,null,ev.createElement(tn.Icon,{icon:"link",width:16,height:16}),t)))},v$=(0,la.ZP)` + mutation ProjectShareTokenRegenerateMutation($input: ProjectShareTokenRegenerateInput!) { + projectShareTokenRegenerate(input: $input) { + clientMutationId + document { + id + check_token + edit_path + view_path + } + } + } +`,vP=eL.default.div.withConfig({displayName:"RegenerateButton__Container",componentId:"sc-8ea5c4dd-0"})` + display: flex; + align-items: center; + justify-content: center; + + color: ${e=>e.theme.textColors.hex(60)}; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(40)}; + } + + ${e=>e.$isError&&(0,eL.css)` + color: ${eI.ThemeColors.danger}; + `}; +`,vF=function(e){let{documentId:t}=e,[a,{loading:n,error:l}]=(0,cs.D)(v$),r=ev.useCallback(()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),documentId:t}}})},[t,a]),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useState(!1),{arrowProps:m,popperProps:u,referenceProps:p}=(0,eI.useControlledTooltip)({arrowElementRef:o,popperElementRef:i,referenceElementRef:s,visible:d,placement:"top"});return n?ev.createElement(eI.Spinner,{width:16,height:16}):ev.createElement(ev.Fragment,null,ev.createElement(vP,{...p,$isError:null!=l,onClick:r,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},ev.createElement(tn.Icon,{icon:"dd_sync",width:16,height:16})),d&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(eY.Z,{id:"general.regenerate_link",defaultMessage:"Regenerate Link"})))},vA=(0,la.ZP)` + mutation ProjectShareLinkToggleMutation($input: ProjectShareLinkToggleInput!) { + projectShareLinkToggle(input: $input) { + clientMutationId + document { + id + is_share_link_enabled + } + } + } +`,vR=(0,e$.connect)(function(e){return{view:dA(e)}})(function(e){let{document:t,view:a}=e,n=gV(),l=(0,e$.useDispatch)(),[r,{loading:o}]=(0,cs.D)(vA),i=ev.useCallback(e=>{let a=(0,ld.Z)();r({variables:{input:{clientMutationId:a,documentId:t.id,enabled:e}},optimisticResponse:{projectShareLinkToggle:{__typename:"ProjectShareLinkTogglePayload",clientMutationId:a,document:{id:t.id,is_share_link_enabled:e}}}})},[t,r]),[s,d]=ev.useState("collaborator"),[c,m]=ev.useState(()=>{let e=hR.u5.safeParse(a);return e.success?e.data:"list"}),u=ev.useCallback(e=>{if(yF.get(e)?.isPaidFeature&&n.isPaywallEnabled){null!=n.id&&l(d4(n.id));return}d(e)},[l,n.id,n.isPaywallEnabled]),p=ev.useMemo(()=>{let e=new URL(`/d/${t.id}`,"https://www.taskade.com");switch(s){case"collaborator":{let a=t.edit_path?.split("/e/")[1];if(null==a)return;e.searchParams.set("share","edit"),e.searchParams.set("edit",a);break}case"participant":{let a=t.check_token;if(null==a)return;e.searchParams.set("share","check"),e.searchParams.set("check",a);break}default:{let a=t.view_path?.split("/v/")[1];if(null==a)return;e.searchParams.set("share","view"),e.searchParams.set("view",a)}}return e.searchParams.set("as",c),e.toString()},[t.check_token,t.edit_path,t.id,t.view_path,c,s]);return ev.createElement(vx,null,ev.createElement(v_,null,ev.createElement(vw,null,ev.createElement(vC,null,ev.createElement(tn.Icon,{icon:"share_link"}),ev.createElement(eY.Z,{id:"general.share_link",defaultMessage:"Share Link"})),o?ev.createElement(eI.Spinner,{width:16,height:16}):ev.createElement(vM,null,t.is_share_link_enabled&&ev.createElement(vF,{documentId:t.id}),ev.createElement(e1.Switch,{checked:t.is_share_link_enabled,onChange:i}))),t.is_share_link_enabled&&ev.createElement(ev.Fragment,null,ev.createElement(vw,null,ev.createElement(vC,null,ev.createElement(tn.Icon,{icon:"share_permission"}),ev.createElement(eY.Z,{id:"general.permissions",defaultMessage:"Permissions"})),ev.createElement(bC,{value:s,onChange:u,isProject:!0})),ev.createElement(vw,null,ev.createElement(vC,null,ev.createElement(tn.Icon,{icon:"share_view"}),ev.createElement(eY.Z,{id:"general.link_view",defaultMessage:"Link view"})),ev.createElement(yc,{currentView:c,handleViewSelect:m})))),t.is_share_link_enabled&&ev.createElement(vN,null,ev.createElement(vT,{textToCopy:p})))}),vj=(0,eL.default)(eI.TabList).withConfig({displayName:"ShareTabList__StyledTabList",componentId:"sc-f779c8cc-0"})` + display: flex; + flex-direction: row; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + position: relative; + padding: 0 1.875rem; +`,vO=eL.default.button.withConfig({displayName:"ShareTabList__StyledTab",componentId:"sc-f779c8cc-1"})` + display: flex; + color: ${e=>e.theme.appColors.hex(50)}; + border: 0px; + border-bottom: 2px solid transparent; + margin-right: 0.75rem; + padding: 0 0 0.5rem; + align-items: center; + position: relative; + top: 1px; + white-space: nowrap; + ${e1.UiTypography.sm}; + gap: 0.25rem; + + ${e=>e.selected?(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + border-color: ${e.theme.primaryColorScheme?.base}; + `:(0,eL.css)` + &:hover { + color: ${e.theme.appColors.hex(10)}; + } + `} +`,vU=function(e){let{selectedTab:t,setSelectedTab:a}=e;return ev.createElement(vj,{className:"gap-x-1",value:t,onChange:e=>a(e)},ev.createElement(vO,{value:"invite-link"},ev.createElement(tn.Icon,{icon:"share_link"}),ev.createElement(eY.Z,{id:"general.share_link",defaultMessage:"Share Link"})),ev.createElement(vO,{value:"invite-user"},ev.createElement(tn.Icon,{icon:"share_email"}),ev.createElement(eY.Z,{id:"general.email",defaultMessage:"Email"})),ev.createElement(vO,{value:"embed"},ev.createElement(tn.Icon,{icon:"share_embed"}),ev.createElement(eY.Z,{id:"general.embed",defaultMessage:"Embed"})),ev.createElement(vO,{value:"public-link"},ev.createElement(tn.Icon,{icon:"share_public"}),ev.createElement(eY.Z,{id:"general.publish",defaultMessage:"Publish"})))};var vZ=a(13218),vL=a.n(vZ);let vB="owner",vz=[[vB,Number.POSITIVE_INFINITY],["admin",1e3],["maintainer",1e3],["collaborator",20],["participant",10],["viewer",0],["outsider",Number.NEGATIVE_INFINITY]],vV=new Map(vz);function vq(e,t){if(oh()(e)){let a=vV.get(e)??Number.NEGATIVE_INFINITY;return!(a<0)&&a>=(vV.get(t)??Number.NEGATIVE_INFINITY)}if(!vL()(e))return!1;{let{project:a,workspace:n}=e;return a?vq(a,t):!!n&&vq(n,t)}}var vW=a(63105),vH=a.n(vW);function vG(e,t){return vH()(t,t=>{let[a]=t;return vq(e,a)})}var vK=a(70735),vY=a.n(vK);let vQ=function(e){let{documentID:t,invitee:a}=e,{data:n,error:l}=(0,eB.a)(yj,{variables:null!=t?{document_id:t}:void 0,skip:!t});(0,ev.useEffect)(()=>{l&&console.warn(l)},[l]);let r=(0,ev.useMemo)(()=>{if(null==n)return[];let e=n.document?.members?.edges??[],t=(0,eo.compactMap)(e,e=>{if(null!=e.node)return e.node.user}),a=(n.document?.space?.memberships??[]).map(e=>e.user);return vY()(a,t,"id").map(e=>({type:"user",user:e}))},[n]),o=(0,ev.useMemo)(()=>r.filter(e=>{let{user:{handle:t}}=e;return t.startsWith(a)}),[r,a]);return br()(a)?[...o,{type:"email",email:a}]:o},vJ=eL.default.div.withConfig({displayName:"ProjectMemberInvite__FlexContainer",componentId:"sc-c4d8de1c-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 512px; + min-width: 512px !important; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 0 0 1.875rem; + word-break: break-word; + background: ${e=>e.theme.appColors.hex(100)}; +`,vX=eL.default.div.withConfig({displayName:"ProjectMemberInvite__Header",componentId:"sc-c4d8de1c-1"})` + display: flex; + flex-direction: column; + position: sticky; + top: 0; + z-index: 1; + background: ${e=>e.theme.isNightMode?"rgba(29, 31, 34, 0.8)":"rgba(252,252,252,0.8)"}; + backdrop-filter: blur(20px); + border-radius: 10px 10px 0 0; + margin-bottom: 1rem; +`,v0=eL.default.h1.withConfig({displayName:"ProjectMemberInvite__Title",componentId:"sc-c4d8de1c-2"})` + font-weight: 500; + padding: 1.25rem 1.875rem 0.625rem; + color: ${e=>e.theme.textColors.hex(10)}; + margin: 0; + font-size: 1rem; +`,v1=eL.default.div.withConfig({displayName:"ProjectMemberInvite__Body",componentId:"sc-c4d8de1c-3"})` + max-height: 80vh; + overflow: overlay; + ${tM}; + @-moz-document url-prefix() { + overflow: auto; + } +`,v2=eL.default.a.withConfig({displayName:"ProjectMemberInvite__Anchor",componentId:"sc-c4d8de1c-4"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + &:visited { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,v5=eL.default.button.withConfig({displayName:"ProjectMemberInvite__CloseModal",componentId:"sc-c4d8de1c-5"})` + display: flex; + width: 30px; + height: 30px; + align-items: center; + justify-content: center; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.appColors.hex(50)}; + border-radius: 40px; + position: absolute; + top: -36px; + right: -36px; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + transition: transform 150ms ease-in-out; + z-index: 2; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + transform: scale(1.2); + } + + &:focus { + transform: scale(0.9); + } +`,v3=eL.default.div.withConfig({displayName:"ProjectMemberInvite__TabPanel",componentId:"sc-c4d8de1c-6"})` + display: block; +`,v4=eL.default.div.withConfig({displayName:"ProjectMemberInvite__NoticeWrapper",componentId:"sc-c4d8de1c-7"})` + margin: 0 30px; + ${e1.UiTypography.sm}; +`,v6=function(e){let{documentID:t,exit:a}=e,{error:n,loading:l,viewData:r}=function(e){let{documentID:t}=e,{data:a,error:n,loading:l}=(0,eB.a)(yj,{variables:{document_id:t},fetchPolicy:"cache-and-network"}),r=a?.me,o=a?.document;return{error:ev.useMemo(()=>{if(null!=n)return bH(n,["document"])??n;if(!l){if(null==r)return Error("Unauthorized");if(null==o)return Error("Forbidden")}return null},[o,l,r,n]),loading:l,viewData:ev.useMemo(()=>{if(null==o)return null;let{role:e,space:t}=o;if(null==e)return null;let a=t?.color,n=[],l=lm({role:e,action:{project:"manage_role"}});for(let t of o.members?.edges??[]){let{node:a}=t;if(null==a)continue;let o="view";if(a.user.id===r?.id)lm({role:e,action:{project:"leave"}})&&(o="me");else{let t=null==a.role.project||vq(e,a.role.project);l&&t&&(o="manage")}n.push({member:a,type:o})}let i=[];for(let t of o.invitations?.edges??[]){let{node:a}=t;if(null==a)continue;let n=null==a.role||vq(e,a.role);l&&n?i.push({invitation:a,type:"manage"}):i.push({invitation:a,type:"view"})}let s=null!=e.project?vG(e.project,yP):[];return{document:o,members:n,role:e,roleEntries:s,theme:null==a?void 0:{primaryColor:a},invitations:i}},[o,r])}}(e),o=vQ({documentID:t,invitee:""}),[i,s]=ev.useState("invite-link");if(l)return ev.createElement(vJ,null,ev.createElement(eI.Spinner,{delay:0,height:260}));if(null!=n)return ev.createElement(vJ,null,ev.createElement("div",null,n.message));if(null==r)return ev.createElement(vJ,null,ev.createElement("div",null,"Unable to fetch members"));let{document:d,members:c,roleEntries:m,theme:u,invitations:p}=r,g=d?.space?.id??null,f=d?.space?.type??d?.space_type??null,h=d?.space?.is_subspace??null,y=d?.space?.taskadePlanType??null;return ev.createElement(eI.ThemeProvider,{theme:u},ev.createElement(gz,{spaceId:g,spaceType:f,spaceIsSubspace:h,spaceTaskadePlanType:y},ev.createElement(vJ,null,ev.createElement(v5,{type:"button",onClick:()=>a()},ev.createElement(tn.Icon,{icon:"modal_close"})),ev.createElement(v1,null,ev.createElement(vX,null,ev.createElement(v0,null,ev.createElement(eY.Z,{id:"general.project_share.header",defaultMessage:"Share {projectName}",values:{projectName:d.info?.title||"Untitled Project"}})),ev.createElement(vU,{selectedTab:i,setSelectedTab:s})),ev.createElement(eI.TabPanelSwitch,{value:i},ev.createElement(v3,{value:"invite-user"},ev.createElement(bQ,{documentID:t})),ev.createElement(v3,{value:"invite-link"},ev.createElement(vR,{document:d})),ev.createElement(v3,{value:"embed"},d.is_share_link_enabled?ev.createElement(yx,{document:d}):ev.createElement(v4,null,ev.createElement(e1.Notice,{$type:"info"},ev.createElement(eY.Z,{id:"general.embed.info_share_links_disabled",defaultMessage:"\uD83D\uDCA1 Please enable the share link to embed this project.",values:{Anchor:e=>ev.createElement(v2,{href:"#",onClick:()=>{s("invite-link")}},e)}})))),ev.createElement(v3,{value:"public-link"},ev.createElement(vE,{document:d,spacePlanType:y}))),"embed"!==i&&"public-link"!==i&&ev.createElement(ev.Fragment,null,ev.createElement(vr,{members:c,roleEntries:m,projectId:d.id}),p.length>0&&ev.createElement(bn,{invitations:p,projectId:d.id}),!ts()(o)&&ev.createElement(b8,{suggestedInvitees:o,documentID:d.id}))),ev.createElement("div",{className:"absolute -bottom-14 left-0 w-full px-12 text-center text-textlight-0 sm:text-sm sm:leading-5"},"To learn more about project invites, embed and publishing visit our "," ",ev.createElement(v2,{href:"https://help.taskade.com/hc/en-us/articles/360016024673--Share-a-Project-Add-Collaborators",target:"_blank",rel:"noopener noreferrer"},"Help Center.")))))},v8=(0,eL.default)(eI.TabList).withConfig({displayName:"InviteTabs__StyledTabList",componentId:"sc-c1a39bb7-0"})` + display: flex; + flex-direction: row; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + position: relative; + padding: 0 1.875rem; +`,v7=eL.default.button.withConfig({displayName:"InviteTabs__StyledTab",componentId:"sc-c1a39bb7-1"})` + display: flex; + color: ${e=>e.theme.appColors.hex(50)}; + border: 0px; + border-bottom: 2px solid transparent; + margin-right: 0.75rem; + padding: 0 0 0.5rem; + align-items: center; + position: relative; + top: 1px; + white-space: nowrap; + ${e1.UiTypography.sm}; + gap: 0.5rem; + + ${e=>e.selected?(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + border-color: ${e.theme.primaryColorScheme?.base}; + `:(0,eL.css)` + &:hover { + color: ${e.theme.appColors.hex(10)}; + } + `} +`,v9=function(e){let{selectedTab:t,setSelectedTab:a}=e;return ev.createElement(v8,{value:t,onChange:e=>a(e)},ev.createElement(v7,{value:"invite-link"},ev.createElement(tn.Icon,{icon:"share_link"}),ev.createElement(eY.Z,{id:"general.share_link",defaultMessage:"Share Link"})),ev.createElement(v7,{value:"invite-user"},ev.createElement(tn.Icon,{icon:"share_email"}),ev.createElement(eY.Z,{id:"general.email",defaultMessage:"Email"})))},ke={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"InvitationDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"InvitationDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"invitationDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},kt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceMembershipsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"space_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"space_id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"invite_link"}},{kind:"Field",name:{kind:"Name",value:"invite_token"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edit"}},{kind:"Field",name:{kind:"Name",value:"check"}},{kind:"Field",name:{kind:"Name",value:"view"}}]}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"taskadePlan"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"state"}}]}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMemberParts"}}]}},{kind:"Field",name:{kind:"Name",value:"parent_membership"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMemberParts"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"invitations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"InvitationParts"}}]}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"InvitationParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Invitation"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"token"}},{kind:"Field",name:{kind:"Name",value:"expired_at"}}]}}]},ka={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"WorkspaceMemberRemoveMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"WorkspaceMemberRemoveInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workspaceMemberRemove"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isOptimistic"},directives:[{kind:"Directive",name:{kind:"Name",value:"client"}}]},{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}},{kind:"Field",name:{kind:"Name",value:"redirect"}}]}}]}}]},kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"WorkspaceMemberUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"WorkspaceMemberUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workspaceMemberUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"membership"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMemberParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},kl=eL.default.button.withConfig({displayName:"styled__ChangeRoleButton",componentId:"sc-329f5eae-0"})` + display: flex; + align-items: center; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm}; + column-gap: ${eI.UiSpacing.getPx(1.5)}; + + &:hover, + &[aria-expanded='true'] { + background: none; + color: ${e=>e.theme.textColors.hex(10)}; + } + + &:active { + color: ${e=>e.theme.textColors.hex(10)} !important; + background: none !important; + } + + &::after { + vertical-align: 0.14em; + margin-left: 8px; + } +`,kr=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-329f5eae-1"})` + display: flex; + overflow: auto; + flex-direction: column; + color: ${e=>e.theme.textColors.hex(10)}; + min-width: 200px !important; + max-width: 450px !important; + padding: 0.5rem 0; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + ${tM}; + + max-height: auto; + @media (max-height: 800px) { + max-height: 260px; + } +`,ko=eL.default.hr.withConfig({displayName:"styled__MenuDivider",componentId:"sc-329f5eae-2"})` + margin: 0.5rem 0; + border-color: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(70)}; +`,ki=eL.default.div.withConfig({displayName:"styled__SelectedRole",componentId:"sc-329f5eae-3"})` + display: flex; + min-width: 40px; + align-items: flex-start; + justify-content: center; +`,ks=eL.default.div.withConfig({displayName:"styled__RoleDescription",componentId:"sc-329f5eae-4"})` + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; +`,kd=eL.default.div.withConfig({displayName:"styled__Spacer",componentId:"sc-329f5eae-5"})` + width: 40px; +`,kc=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-6372f283-0"})` + display: flex; + flex-direction: row; + cursor: pointer; + outline: 0 !important; + border: none; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)} !important; + padding: 6px 20px; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,km=function(e){let{name:t,value:a,className:n,children:l}=e,r=(0,ev.useRef)(null),o=(0,eI.useMenuItem)({stopRef:r,name:t,value:a});return ev.createElement(kc,{...o.props,className:n},l)},ku=function(e){let{menuGroupDispatch:t,initialFocus:a,roleEntries:n,selectedEntry:l,itemType:r}=e,o=gV();return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(kr,{initialFocus:a,loop:!0},"member"===r&&n?.map(e=>{let[t,a]=e,n=(yF.get(a.value)?.isPaidFeature??!1)&&o.isPaywallEnabled;return ev.createElement(km,{key:t,name:"change",value:a.value},ev.createElement(ki,null,l?.value===a.value&&ev.createElement(tn.Icon,{icon:"dd_check"})),ev.createElement(ks,null,ev.createElement("div",null,ev.createElement(bu,{fontWeight:"500",role:a.value}),n&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),ev.createElement(bg,{role:a.value})))}),"member"===r&&ev.createElement(ev.Fragment,null,ev.createElement(ko,null),ev.createElement(km,{name:"remove"},ev.createElement(kd,null),ev.createElement(eY.Z,{id:"general.remove",defaultMessage:"Remove"}))),"invitation"===r&&ev.createElement(ev.Fragment,null,ev.createElement(km,{name:"delete_invitation",className:"text-sm"},ev.createElement(eY.Z,{id:"general.cancel_invitation",defaultMessage:"Cancel Invitation"})),ev.createElement(km,{name:"copy_invitation",className:"text-sm"},ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"})))))},kp=function(e){let{membership:t,roleEntries:a,invitation:n}=e,l=(0,e$.useDispatch)(),r=gV(),o=(0,ev.useRef)(null),i=(0,ev.useRef)(null),[s,d]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1,initialFocus:"first"}),c=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:s,placement:"top"}),m=(0,eI.useMenuButton)({state:s,dispatch:d,ref:o}),[u]=(0,cs.D)(kn),[p]=(0,cs.D)(ka),[g]=(0,cs.D)(ke),f=(0,ev.useCallback)(e=>{if(null==t)return null;if(yF.get(e)?.isPaidFeature&&r.isPaywallEnabled){null!=r.id&&l(d4(r.id));return}let a=(0,ld.Z)();u({optimisticResponse:{workspaceMemberUpdate:{__typename:"WorkspaceMemberUpdatePayload",clientMutationId:a,membership:{...t,role:e}}},variables:{input:{clientMutationId:a,memberID:t.id,role:e}}})},[l,t,r,u]),h=(0,ev.useCallback)(()=>{if(null==t)return null;let e=(0,ld.Z)();p({optimisticResponse:{workspaceMemberRemove:{__typename:"WorkspaceMemberRemovePayload",clientMutationId:e,isOptimistic:!0,ok:!0}},update:(e,a)=>{let{data:{workspaceMemberRemove:n}}=a,l=e.readQuery({query:kt,variables:{space_id:t.space.id}});if(null==l||null==l.membership)return;e.writeQuery({query:kt,data:{...l,membership:{...l.membership,space:{...l.membership.space,memberships:l.membership.space.memberships.filter(e=>e.id!==t.id)}}},variables:{space_id:t.space.id}}),n.isOptimistic||null==l.membership.space||e.modify({id:e.identify(l.membership.space),fields:{all_members(e,t){let{DELETE:a}=t;return a}}});let r=e.readQuery({query:lu,variables:lg(!1,t.space.id)});if(null!=r)for(let t of r?.memberships?.edges??[])e.modify({id:e.identify(t.node.space),fields:{memberships(e,t){let{DELETE:a}=t;return a}}})},variables:{input:{clientMutationId:e,memberID:t.id}}})},[t,p]),y=ev.useCallback(()=>{if(null==n||null==n.space)return null;let e=(0,ld.Z)();g({optimisticResponse:{__typename:"Mutation",invitationDelete:{__typename:"InvitationDeletePayload",clientMutationId:e,ok:!0}},update:(e,t)=>{if(null==n.space)return;let a=e.readQuery({query:kt,variables:{space_id:n.space.id}});null!=a&&null!=a.membership&&e.writeQuery({query:kt,data:{...a,membership:{...a.membership,space:{...a.membership.space,invitations:{...a.membership.space.invitations,edges:a.membership.space.invitations.edges.filter(e=>e.node.email!==n.email)}}}},variables:{space_id:n.space.id}})},variables:{input:{clientMutationId:e,email:n.email,space_id:n.space.id}}})},[n,g]),b=ev.useCallback(()=>{if(null==n||null==n.space)return null;let e=`https://www.taskade.com/invitations/${n.token}`;navigator.clipboard.writeText(e)},[n]),v=(0,ev.useCallback)(e=>{if("Activate"===e.type){switch(e.payload.name){case"change":f(e.payload.value);break;case"remove":h();break;case"delete_invitation":y();break;case"copy_invitation":b()}d({type:"Collapse"})}},[f,h,y,b,d]),k=yF.get(t?.role??"viewer");return null==t&&(k=yF.get(n?.role??"viewer")),ev.createElement(ev.Fragment,null,ev.createElement(kl,{type:"button",...m.props},ev.createElement(bu,{role:k?.value??"viewer"}),ev.createElement(tn.Icon,{icon:"caret_down"})),s.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:d,modal:!0},ev.createElement(ku,{menuGroupDispatch:v,roleEntries:a,selectedEntry:k,initialFocus:c.initialFocus,itemType:null!=t?"member":"invitation"})))},kg=(0,la.ZP)` + query PublicFoldersQuery( + $spaceID: ID! + $first: Int = 20 + $after: String + $filterby: SpaceFiltering + ) { + membership(space_id: $spaceID) { + id + space { + id + name + folders(first: $first, after: $after, filterby: $filterby) { + totalCount + edges { + node { + id + name + color + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + } + } + } +`,kf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ActiveWorkspaceMembershipsQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"membershipType"},value:{kind:"EnumValue",value:"space"}},{kind:"ObjectField",name:{kind:"Name",value:"archived"},value:{kind:"BooleanValue",value:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MembershipParts"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Space"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MembershipParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceParts"}}]}}]}}]},kh=eL.default.button.withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-2f2f6c34-0"})` + padding: 6px 16px 6px 20px; + text-align: start; + color: ${e=>e.theme.textColors.hex(20)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,ky=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(kh,o.props,t)},kb=(0,eL.default)(eI.Menu).withConfig({displayName:"MyRoleMenu__StyledMenu",componentId:"sc-3db3bfec-0"})` + display: flex; + flex-direction: column; + + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,kv=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(kb,{initialFocus:t,loop:!0},ev.createElement(ky,{name:"leave"},ev.createElement(eY.Z,{id:"general.leave",defaultMessage:"Leave"}))))},kk=eL.default.div.withConfig({displayName:"MyRole__MenuButton",componentId:"sc-42e20e43-0"})` + user-select: none; + cursor: pointer; + color: ${e=>e.theme.textColors.hex(20)}; +`,kE=function(e){let{exit:t,membership:a}=e,n=(0,eF.k6)(),[l]=(0,cs.D)(ka,{awaitRefetchQueries:!0,refetchQueries:e=>{let t=[{query:kf}];if(null!=e.data){let a=e.data.workspaceMemberRemove.redirect;if(null!=a){let e=(0,eF.LX)(a,{path:"/spaces/:spaceId"});if(null!=e){let a=e.params.spaceId;t.push({query:fO,variables:lg(!1,a)}),t.push({query:kg,variables:{spaceID:a,first:100,filterby:{archived:!1,hasMembership:!1,visibility:"public"}}})}else"/shared"===a&&t.push({query:fO,variables:{filterby:{membershipType:b.Shared}}})}}return t}}),r=(0,ev.useCallback)(async()=>{let e=(0,ld.Z)(),r=await l({variables:{input:{clientMutationId:e,memberID:a.id}}});if(null==r.data)return;let{redirect:o}=r.data.workspaceMemberRemove;null!=o&&(t(!0),n.push(o))},[t,n,a,l]),o=yF.get(a.role),[i,s]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),d=(0,ev.useRef)(null),c=(0,ev.useRef)(null),m=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:i,placement:"bottom"}),u=(0,eI.useMenuButton)({ref:d,dispatch:s,state:i}),p=(0,ev.useCallback)(e=>{if("Activate"===e.type){let{name:t}=e.payload;"leave"===t&&r()}},[r]);return ev.createElement(ev.Fragment,null,ev.createElement(kk,u.props,ev.createElement(yN,{role:o?.value}),ev.createElement(tn.Icon,{icon:"caret_down",className:"ml-2"})),i.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:s,modal:!0},ev.createElement(kv,{initialFocus:m.initialFocus,menuGroupDispatch:p})))},kx=eL.default.div.withConfig({displayName:"ViewRole__Container",componentId:"sc-659a2d37-0"})` + padding-right: 25px; +`,k_=function(e){let{membership:t}=e;return ev.createElement(kx,null,ev.createElement(bu,{role:t.role}))},kw=function(e){let{exit:t,membership:a,roleEntries:n,type:l,invitation:r}=e;switch(l){case"me":if(null==a)return null;return ev.createElement(kE,{membership:a,exit:t});case"manage":return ev.createElement(kp,{membership:a,invitation:r,roleEntries:n});case"view":if(null==a)return null;return ev.createElement(k_,{membership:a});default:return null}},kN=eL.default.div.withConfig({displayName:"InvitationList__List",componentId:"sc-7572720c-0"})` + max-height: 360px; + margin-top: 10px; + overflow: auto; + ${tM}; +`,kC=eL.default.div.withConfig({displayName:"InvitationList__Container",componentId:"sc-7572720c-1"})` + margin-top: 10px; + padding: 0 1.875rem; +`,kM=eL.default.div.withConfig({displayName:"InvitationList__Invitation",componentId:"sc-7572720c-2"})` + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: 10px; + padding-left: 2px; +`,kS=eL.default.div.withConfig({displayName:"InvitationList__Email",componentId:"sc-7572720c-3"})` + flex: 3; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; + font-weight: 600; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; +`,kI=eL.default.span.withConfig({displayName:"InvitationList__AvatarWrapper",componentId:"sc-7572720c-4"})` + display: flex; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + font-weight: 500; + ${e1.UiTypography.sm}; + text-align: center; + align-items: center; + justify-content: center; + text-transform: uppercase; + border-radius: 36px; + width: 24px; + height: 24px; + flex-shrink: 0; +`,kD=eL.default.span.withConfig({displayName:"InvitationList__Character",componentId:"sc-7572720c-5"})` + /* Workaround for emoji positioning issue in Chrome on high dpi screens */ + @media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min--moz-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-device-pixel-ratio: 2), + only screen and (min-resolution: 150dpi), + only screen and (min-resolution: 2dppx) { + font-size: 2em; + transform: scale(0.5); + } +`,kT=function(e){let{invitations:t}=e;return ev.createElement(kC,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.pending",defaultMessage:"Pending"})),ev.createElement(kN,null,t.map(e=>{let{invitation:t,type:a}=e,{id:n,email:l,expired_at:r}=t;return 0===l.length?null:ev.createElement(kM,{key:n},ev.createElement(kI,null,ev.createElement(kD,null,l[0])),ev.createElement(kS,null,l),ev.createElement(y_,{expiredAt:r}),ev.createElement(kw,{invitation:t,type:a}))})))},k$=(0,lb.C)({context:{fields:{invitees:[],role:"collaborator"},status:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"invitebox",initial:"idle",states:{idle:{initial:"valid",states:{valid:{},invalid:{}},on:{TYPING:{actions:"typing",target:"#invitebox.idle"},SUBMIT:{actions:"submit",target:"#invitebox.submitting"}}},submitting:{invoke:{id:"submitting",src:"submitting",onDone:[{actions:"submitted",target:"#invitebox.idle.valid"}],onError:[{actions:"submitFailed",target:"#invitebox.idle.invalid"}]}}}},{actions:{submit:(0,lv.assign)(e=>(0,es.ZP)(e,e=>(e.status={type:"loading",payload:{}},e))),submitFailed:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.status={type:"failure",payload:{error:t.data}},e))),submitted:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{invitees:t}=e.fields;return e.fields.invitees=[],e.fields.role="collaborator",e.status={type:"success",payload:{invitees:t}},e})),typing:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>{if("role"===t.payload.field){let{value:a}=t.payload;e.fields.role=a}else if("invitees"===t.payload.field){let{value:a}=t.payload;e.fields.invitees=a}return e}))}}),kP={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"WorkspaceMemberInviteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"WorkspaceMemberInviteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workspaceMemberInvite"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMemberParts"}}]}},{kind:"Field",name:{kind:"Name",value:"invitations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"InvitationParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"InvitationParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Invitation"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"token"}},{kind:"Field",name:{kind:"Name",value:"expired_at"}}]}}]};function kF(e){let{spaceID:t}=e,[a,n]=(0,cs.D)(kP);return[(e,n)=>a({variables:{input:{clientMutationId:(0,ld.Z)(),invitees:e,spaceID:t,role:n}},update:(e,a)=>{let n=a?.data?.workspaceMemberInvite?.memberships;if(null==n)return;let l=a?.data?.workspaceMemberInvite?.invitations;if(null==l)return;let r=e.readQuery({query:kt,variables:{space_id:t}});if(r?.membership?.space.memberships!=null){for(let e of n)if(-1!==p6()(r.membership.space.memberships,{id:e.id}))return;e.writeQuery({query:kt,data:(0,es.ZP)(r,e=>{if(e?.membership?.space.memberships!=null)for(let[t,a]of(e.membership.space.memberships.push(...n),l.entries())){let n={cursor:t.toString(),node:a};e.membership.space.invitations.edges[t]=n}})}),r.membership?.space!=null&&e.modify({id:e.identify(r.membership?.space),fields:{all_members(e,t){let{DELETE:a}=t;return a}}})}}}),n]}let kA=eL.default.div.withConfig({displayName:"Status__ErrorMessage",componentId:"sc-ba4b455a-0"})` + background: #ffe6e6; + color: #ef5656; + border: 1px solid #ef5656; + padding: 6px 10px; + border-radius: 5px; + margin-bottom: 10px; +`,kR=eL.default.div.withConfig({displayName:"Status__SuccessMessage",componentId:"sc-ba4b455a-1"})` + background: #ebffef; + color: #3cbd66; + border: 1px solid #3cbd66; + padding: 6px 10px; + border-radius: 5px; + margin-bottom: 10px; +`,kj=function(e){let{status:t}=e;switch(t?.type){case"failure":{let{error:e}=t.payload,a=bH(e,["workspaceMemberInvite"])??e;return ev.createElement(kA,{className:"text-sm"},a.message)}case"success":{let e=t.payload.invitees.join(", ");return ev.createElement(kR,{className:"text-sm"},`${e} has been invited!`)}case"loading":return ev.createElement(kR,{className:"text-sm"},ev.createElement(eY.Z,{id:"general.loading",defaultMessage:"Loading…"}));default:return null}},kO=function(e,t){switch(t.type){case"INVITEE_VALUE_ADD":{let a=new Set(e.inviteeValues);return a.add(t.value),{...e,inviteeValues:[...a],inputText:""}}case"INVITEE_VALUE_ADD_MULTIPLE":{if(0===t.values.length)return e;let a=new Set([...e.inviteeValues,...t.values]);return{...e,inviteeValues:[...a]}}case"INVITEE_VALUE_EDIT":{let a=new Set(e.inviteeValues);return a.delete(t.value),{...e,inviteeValues:[...a],inputText:t.value}}case"INVITEE_VALUE_REMOVE":{let a=new Set(e.inviteeValues);return a.delete(t.value),{...e,inviteeValues:[...a]}}case"SET_INPUT_TEXT":return{...e,inputText:t.value};case"SUCCESS":{let t=[...e.inviteeValues];return e.inputText.length>0&&t.push(e.inputText),{...e,inviteeValues:[],inputText:""}}}return e},kU=eL.default.div.withConfig({displayName:"InviteBox__InputContainer",componentId:"sc-a9cccfce-0"})` + display: flex; + position: relative; + flex: none; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + transition: border-color 200ms ease-in; + background: ${e=>e.theme.appColors.hex(90)}; + overflow: clip; + + &:focus-within { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + & > :last-child { + padding: 0 8px; + &:hover, + &[aria-expanded='true'] { + color: ${e=>e.theme.textColors.hex(20)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + } +`,kZ=function(e){let{disabled:t,parentSpaceId:a,spaceId:n}=e,l=gV(),r=(0,e$.useDispatch)(),o=(0,eK.Z)(),{role:i,status:s,handleRoleChange:d,handleInviteesChange:c,handleSubmit:m}=function(e){let t=(0,eK.Z)(),[a]=kF(e),[n,l]=(0,ls.e)(k$,{services:{submitting:async e=>{let{invitees:n,role:l}=e.fields;if(0===n.length)throw Error(t.formatMessage({id:"general.error_invitee_required",defaultMessage:"Please enter an email or username."}));return a(n,l)}}}),{role:r}=n.context.fields,{status:o}=n.context;return{role:r,status:o,handleInviteesChange:e=>{l({type:"TYPING",payload:{field:"invitees",value:e}})},handleRoleChange:e=>{l({type:"TYPING",payload:{field:"role",value:e}})},handleSubmit:()=>{l({type:"SUBMIT",payload:{}})}}}({spaceID:n}),[u,p]=ev.useState(s);ev.useEffect(()=>{p(s)},[s]);let[g,f]=ev.useReducer(kO,{inviteeValues:[],inputText:""}),h=ev.useCallback(e=>{if(!br()(e)){p({type:"failure",payload:{error:Error("Please enter an email")}});return}p(null),f({type:"INVITEE_VALUE_ADD",value:e})},[]),y=ev.useCallback(e=>{f({type:"INVITEE_VALUE_EDIT",value:e})},[]),b=ev.useCallback(e=>{f({type:"INVITEE_VALUE_REMOVE",value:e})},[]),v=ev.useCallback(()=>{let e=[...g.inviteeValues];g.inputText.length>0&&e.push(g.inputText),0!==e.length&&(c(Array.from(new Set(e))),m())},[c,m,g.inputText,g.inviteeValues]),k=ev.useCallback(e=>{let t=e.clipboardData.getData("text/plain");0!==t.length&&(e.preventDefault(),f({type:"INVITEE_VALUE_ADD_MULTIPLE",values:bP(t)}))},[]),E=ev.useCallback(e=>{f({type:"SET_INPUT_TEXT",value:e.target.value})},[]),x=ev.useCallback(e=>{if(yF.get(e)?.isPaidFeature&&l.isPaywallEnabled){(null!=a||null!=n)&&r(d4(a??n));return}d(e)},[r,d,l.isPaywallEnabled,a,n]);return ev.useEffect(()=>{s?.type==="success"&&f({type:"SUCCESS"})},[s?.type]),ev.createElement(bM,null,ev.createElement(kj,{status:u}),ev.createElement(bT,null,ev.createElement(kU,null,ev.createElement(bc,{className:"shrink",classNameInput:"truncate",items:g.inviteeValues,onChipItemAdded:h,onChipItemEditRequested:y,onChipItemRemoved:b,onSubmit:v,onPaste:k,placeholder:o.formatMessage({id:"general.invite_textinput_placeholder",defaultMessage:"Invite with email…"}),value:g.inputText,onChange:E}),ev.createElement(bC,{className:"shrink-0",value:i,onChange:x,isProject:!0})),ev.createElement(bD,{disabled:t,onClick:v},ev.createElement(eY.Z,{id:"general.send_invite",defaultMessage:"Send Invite"}))))},kL=eL.default.div.withConfig({displayName:"ConfirmDialog__FlexContainer",componentId:"sc-4e5a64ce-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 5px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,kB=eL.default.h1.withConfig({displayName:"ConfirmDialog__Header",componentId:"sc-4e5a64ce-1"})` + font-weight: 500; + font-size: 18px; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,kz=function(e){let{headerContent:t,bodyContent:a,cancelLabel:n,confirmLabel:l,onConfirm:r,onCancel:o}=e;return ev.createElement(kL,null,ev.createElement(kB,null,t),ev.createElement(gw,null,a),ev.createElement(gN,null,ev.createElement(gM,{className:"btn-cancel",onClick:o,type:"button"},n??ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(gC,{className:"btn-confirm",onClick:r,type:"button"},l??ev.createElement(eY.Z,{id:"general.confirm",defaultMessage:"Confirm"}))))},kV=function(e){let{headerContent:t,bodyContent:a,cancelLabel:n,confirmLabel:l,onConfirm:r,onToggle:o,isOpen:i}=e;return ev.createElement(eI.ModalDialog,{isOpen:i,close:o},e=>{let{exit:o}=e;return ev.createElement(kz,{headerContent:t,bodyContent:a,cancelLabel:n,confirmLabel:l,onConfirm:r,onCancel:()=>o()})})},kq={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SubspaceWorkspaceMembersInviteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SubspaceWorkspaceMembersInviteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"subspaceWorkspaceMembersInvite"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMemberParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},kW=eL.default.div.withConfig({displayName:"Invitee__FlexContainer",componentId:"sc-c38336d1-0"})` + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin-bottom: 0.625rem; + ${e1.UiTypography.sm}; + padding-right: 1rem; + + &:last-child { + margin-bottom: 0; + } +`,kH=eL.default.div.withConfig({displayName:"Invitee__Name",componentId:"sc-c38336d1-1"})` + flex: 3; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; +`,kG=eL.default.span.withConfig({displayName:"Invitee__DisplayName",componentId:"sc-c38336d1-2"})` + color: ${e=>e.theme.appColors.hex(40)}; + margin-left: 0.25rem; +`,kK=eL.default.span.withConfig({displayName:"Invitee__Handle",componentId:"sc-c38336d1-3"})` + font-weight: 600; + color: ${e=>e.theme.textColors.hex(10)}; +`,kY=eL.default.div.withConfig({displayName:"Invitee__AddIconWrapper",componentId:"sc-c38336d1-4"})` + display: inline-flex; + align-items: center; + margin-right: 8px; + border-radius: 20px; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; +`,kQ=eL.default.button.withConfig({displayName:"Invitee__InviteButton",componentId:"sc-c38336d1-5"})` + display: flex; + align-items: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + cursor: pointer; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + + ${kY} { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,kJ=function(e){let{user:t,onInvite:a}=e;return ev.createElement(kW,null,ev.createElement(ao,{avatars_v2:t.avatars_v2,handle:t.handle,size:24,userID:parseInt(t.id,10)}),ev.createElement(kH,null,ev.createElement(kK,null,t.handle),t.display_name&&ev.createElement(kG,null,t.display_name)),ev.createElement(kQ,{onClick:a},ev.createElement(kY,null,ev.createElement(tn.Icon,{icon:"plus_invite"})),ev.createElement(eY.Z,{id:"general.invite",defaultMessage:"Share"})))},kX=eL.default.div.withConfig({displayName:"InviteList__FlexContainer",componentId:"sc-6e1eb44e-0"})` + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + margin-top: 1.25rem; + padding: 0 1.875rem; +`,k0=eL.default.div.withConfig({displayName:"InviteList__SuggestedInvitees",componentId:"sc-6e1eb44e-1"})` + margin-top: 0.625rem; +`,k1=eL.default.button.withConfig({displayName:"InviteList__InviteAllButton",componentId:"sc-6e1eb44e-2"})` + display: flex; + align-items: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + ${e1.UiTypography.sm}; + margin-top: 0.625rem; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,k2=(0,eL.default)(tn.Icon).withConfig({displayName:"InviteList__StyledIcon",componentId:"sc-6e1eb44e-3"})` + margin: 0.125rem 0.625rem 0.125rem 0.25rem; +`,k5=function(e){let{suggestedInvitees:t,spaceID:a}=e,n=(0,e$.useDispatch)(),l=(0,eK.Z)(),[r,o]=(0,ev.useState)(!1),[i]=kF({spaceID:a}),[s]=function(e){let{subspaceId:t}=e,[a,n]=(0,cs.D)(kq);return[e=>a({variables:{input:{clientMutationId:(0,ld.Z)(),subspaceId:t,role:e}},update:(e,a)=>{let n=a?.data?.subspaceWorkspaceMembersInvite?.memberships;if(null==n||0===n.length)return;let l=e.readQuery({query:kt,variables:{space_id:t}});l?.membership?.space.memberships!=null&&e.writeQuery({query:kt,data:(0,es.ZP)(l,e=>{e?.membership?.space.memberships!=null&&e.membership.space.memberships.push(...n)})})}}),n]}({subspaceId:a});return ev.createElement(kX,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.invite_members",defaultMessage:"Invite Members"})),ev.createElement(k0,null,t.map(e=>ev.createElement(kJ,{key:e.id,user:e,onInvite:()=>{i([e.handle],"collaborator").catch(e=>{let t=(0,ei.getMessageFromError)(bH(e,["workspaceMemberInvite"])??e);n((0,l3.error)({uid:"workspace-member-invite-error",message:t,position:"br",autoDismiss:2,dismissible:!1}))})}}))),t.length>1&&ev.createElement(k1,{onClick:()=>o(!0)},ev.createElement(k2,{icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.invite_all",defaultMessage:"Invite All"})),ev.createElement(kV,{headerContent:l.formatMessage({id:"general.invite_all_confirmation.header",defaultMessage:"Confirm Invite All"}),bodyContent:l.formatMessage({id:"general.invite_all_confirmation.body",defaultMessage:"All members from the workplace will be invited to the folder."}),onConfirm:()=>{s("collaborator").catch(e=>{let t=(0,ei.getMessageFromError)(bH(e,["subspaceWorkspaceMembersInvite"])??e);n((0,l3.error)({uid:"subspace-workspace-member-invite-error",message:t,position:"br",autoDismiss:2,dismissible:!1}))}),o(!1)},onToggle:()=>o(!1),isOpen:r}))},k3=eL.default.div.withConfig({displayName:"Member__FlexContainer",componentId:"sc-b0c963a3-0"})` + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin-bottom: 0.625rem; + ${e1.UiTypography.sm}; + height: 26px; + + &:last-child { + margin-bottom: 0; + } +`,k4=eL.default.div.withConfig({displayName:"Member__Name",componentId:"sc-b0c963a3-1"})` + flex: 3; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; +`,k6=eL.default.span.withConfig({displayName:"Member__DisplayName",componentId:"sc-b0c963a3-2"})` + color: ${e=>e.theme.appColors.hex(40)}; + margin-left: 0.25rem; +`,k8=eL.default.span.withConfig({displayName:"Member__Handle",componentId:"sc-b0c963a3-3"})` + font-weight: 600; + color: ${e=>e.theme.textColors.hex(10)}; +`,k7=function(e){let{exit:t,membership:a,roleEntries:n,type:l}=e,{user:r}=a;return ev.createElement(k3,null,ev.createElement(ao,{avatars_v2:r.avatars_v2,handle:r.handle,size:24,userID:parseInt(r.id,10)}),ev.createElement(k4,null,ev.createElement(k8,null,r.handle),r.display_name&&ev.createElement(k6,null,r.display_name)),ev.createElement(kw,{membership:a,roleEntries:n,type:l,exit:t}))},k9=eL.default.div.withConfig({displayName:"MemberList__FlexContainer",componentId:"sc-2462096b-0"})` + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + padding: 0 1.875rem; +`,Ee=eL.default.div.withConfig({displayName:"MemberList__Members",componentId:"sc-2462096b-1"})` + margin-top: 0.625rem; +`,Et=function(e){let{exit:t,isSubspace:a,members:n,roleEntries:l}=e;return ev.createElement(k9,null,ev.createElement(e1.Overline,null,a?ev.createElement(eY.Z,{id:"general.overline_folder_members",defaultMessage:"Folder members"}):ev.createElement(eY.Z,{id:"general.overline_workspace_members",defaultMessage:"Workspace members"})),ev.createElement(Ee,null,n&&n.map(e=>{let{type:a,membership:n}=e;return ev.createElement(k7,{key:n.id,membership:n,roleEntries:l,type:a,exit:t})})))},Ea={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"peopleGroups"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"spaceVisibilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},En=(0,d9.oM)({name:"dialogs.editSpace",initialState:{isOpen:!1},reducers:{toggleEditSpaceDialog:(e,t)=>e.isOpen?{isOpen:!1}:{isOpen:t.payload??"general"}}}),El=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-6372f283-0"})` + display: flex; + flex-direction: row; + cursor: pointer; + outline: 0 !important; + border: none; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)} !important; + padding: 6px 20px; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,Er=function(e){let{name:t,value:a,className:n,children:l}=e,r=(0,ev.useRef)(null),o=(0,eI.useMenuItem)({stopRef:r,name:t,value:a});return ev.createElement(El,{...o.props,className:n},l)},Eo=function(e){let{menuGroupDispatch:t,initialFocus:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eI.Menu,{initialFocus:a,loop:!0},ev.createElement(Er,{name:"manage",className:"text-sm"},ev.createElement(eY.Z,{id:"general.manage",defaultMessage:"Manage"}))))},Ei=function(e){let{exit:t}=e,a=(0,e$.useDispatch)(),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"top"}),s=(0,eI.useMenuButton)({state:r,dispatch:o,ref:n}),d=ev.useCallback(e=>{"Activate"===e.type&&("manage"===e.payload.name&&(console.log(e.payload.value),t(),a(En.actions.toggleEditSpaceDialog())),o({type:"Collapse"}))},[a,t]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{type:"button",...s.props},ev.createElement(tn.Icon,{icon:"header_more"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0},ev.createElement(Eo,{menuGroupDispatch:d,initialFocus:i.initialFocus})))},Es=eL.default.div.withConfig({displayName:"PeopleGroupList__List",componentId:"sc-78020df1-0"})` + max-height: 360px; + margin-top: 10px; + overflow: auto; + ${tM}; +`,Ed=eL.default.span.withConfig({displayName:"PeopleGroupList__AvatarWrapper",componentId:"sc-78020df1-1"})` + display: flex; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + font-weight: 500; + ${e1.UiTypography.sm}; + text-align: center; + align-items: center; + justify-content: center; + text-transform: uppercase; + border-radius: 36px; + width: 24px; + height: 24px; + flex-shrink: 0; +`,Ec=eL.default.span.withConfig({displayName:"PeopleGroupList__Character",componentId:"sc-78020df1-2"})` + /* Workaround for emoji positioning issue in Chrome on high dpi screens */ + @media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min--moz-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-device-pixel-ratio: 2), + only screen and (min-resolution: 150dpi), + only screen and (min-resolution: 2dppx) { + font-size: 2em; + transform: scale(0.5); + } +`,Em=function(e){let{exit:t,space:a}=e,{data:n}=(0,eB.a)(Ea),l=n?.organization?.peopleGroups?.edges??[];return ev.useMemo(()=>{for(let e of n?.organization?.peopleGroups?.edges??[])for(let t of e?.node?.spaceVisibilities?.edges??[])if(a.id===t.node.space.id)return!0;return!1},[n?.organization?.peopleGroups?.edges,a.id])?ev.createElement("div",{className:"mt-2.5 px-[1.875rem]"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.groups",defaultMessage:"Groups"})),ev.createElement(Es,null,l.map(e=>{let{id:n,name:l,spaceVisibilities:r}=e.node,o=r?.edges?.filter(e=>e.node.space.id===a.id);return o?.length===0?null:ev.createElement("div",{className:"mb-2.5 ml-0.5 flex flex-row items-center pr-4",key:n},ev.createElement(Ed,null,ev.createElement(Ec,null,"G")),ev.createElement("div",{className:"flex-[3] overflow-hidden text-ellipsis pl-2.5 text-sm font-semibold text-appcolor-900"},l),ev.createElement(Ei,{exit:t}))}))):null};function Eu(e){let{role:t,action:a}=e;return pW({role:t,action:a})}let Ep=(0,la.ZP)` + mutation SpaceInviteTokenRegenerateMutation($input: SpaceInviteTokenRegenerateInput!) { + spaceInviteTokenRegenerate(input: $input) { + clientMutationId + inviteToken { + view + edit + check + } + } + } +`,Eg=eL.default.div.withConfig({displayName:"styled__ActionContainer",componentId:"sc-8d853c19-0"})` + ${e1.UiTypography.sm}; + display: flex; + align-items: center; + justify-content: space-between; + color: ${e=>e.theme.textColors.hex(10)}; + margin-top: 1rem; +`,Ef=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-8d853c19-1"})` + display: flex; + flex-direction: column; + margin-bottom: ${eI.UiSpacing.getPx(4)}; + padding: 0 1.875rem; +`,Eh=eL.default.div.withConfig({displayName:"styled__ItemContainer",componentId:"sc-8d853c19-2"})` + ${e1.UiTypography.sm}; + + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.5rem 1rem; + color: ${e=>e.theme.textColors.hex(10)}; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + + &:last-child { + border-bottom: 0; + } +`,Ey=eL.default.div.withConfig({displayName:"styled__ItemsList",componentId:"sc-8d853c19-3"})` + ${e1.UiBorderRadius.lg}; + + display: flex; + flex-direction: column; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,Eb=eL.default.div.withConfig({displayName:"styled__ItemLabel",componentId:"sc-8d853c19-4"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(2)}; + + svg { + transform: var(--global-icon-scale); + } +`,Ev=eL.default.div.withConfig({displayName:"styled__ItemToggles",componentId:"sc-8d853c19-5"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(3)}; + border-color: ${e=>e.theme.appColors.hex(70)}; + + & > input { + cursor: pointer; + width: 36px; + height: 20px; + border-width: 1px; + + &:checked { + border-width: 1px; + } + } +`,Ek=eL.default.div.withConfig({displayName:"styled__ButtonContainer",componentId:"sc-8d853c19-6"})` + width: 100%; + + display: flex; + flex-direction: column; +`,EE=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-8d853c19-7"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.lg}; + + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #ffffff; + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(4)}; + + transition: background-color 200ms ease-in-out; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + &:disabled { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,Ex=eL.default.div.withConfig({displayName:"styled__TooltipContainer",componentId:"sc-8d853c19-8"})` + ${e1.UiTypography.xs}; + line-height: 1; + + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(1.5)}; +`,E_=function(e){let{disabled:t,textToCopy:a}=e,[n,l]=ev.useState(null),[r,o]=ev.useState(!1),i=ev.useRef(null),s=ev.useRef(null),d=ev.useRef(null),[c,m]=ev.useState(!1),{arrowProps:u,popperProps:p,referenceProps:g}=(0,eI.useControlledTooltip)({arrowElementRef:i,popperElementRef:s,referenceElementRef:d,visible:c,placement:"bottom"});return ev.useEffect(()=>{if(null==n)return;let e=new(hF())(n);return e.on("success",()=>{o(!0)}),()=>{e.destroy()}},[n]),ev.createElement(ev.Fragment,null,ev.createElement(Ek,g,ev.createElement(EE,{disabled:t,ref:l,"data-clipboard-action":"copy","data-clipboard-text":a,onMouseOut:()=>{o(!1)},onBlur:()=>{o(!1)},onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)}},r?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"}))),c&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},ev.createElement(Ex,null,ev.createElement(tn.Icon,{icon:"link",width:16,height:16}),a)))},Ew=eL.default.div.withConfig({displayName:"RegenerateButton__Container",componentId:"sc-403bcf57-0"})` + display: flex; + align-items: center; + justify-content: center; + + color: ${e=>e.theme.textColors.hex(60)}; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(40)}; + } + + ${e=>e.$isError&&(0,eL.css)` + color: ${eI.ThemeColors.danger}; + `}; +`,EN=function(e){let{error:t,onRegenerate:a,regenerating:n}=e,l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useState(!1),{arrowProps:d,popperProps:c,referenceProps:m}=(0,eI.useControlledTooltip)({arrowElementRef:l,popperElementRef:r,referenceElementRef:o,visible:i,placement:"top"});return n?ev.createElement(eI.Spinner,{width:16,height:16}):ev.createElement(ev.Fragment,null,ev.createElement(Ew,{...m,$isError:null!=t,onClick:a,onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)}},ev.createElement(tn.Icon,{icon:"dd_sync",width:16,height:16})),i&&ev.createElement(eI.Tooltip,{arrowProps:d,popperProps:c},ev.createElement(eY.Z,{id:"general.regenerate_link",defaultMessage:"Regenerate Link"})))},EC=(0,la.ZP)` + mutation SpaceShareLinkToggleMutation($input: SpaceShareLinkToggleInput!) { + spaceShareLinkToggle(input: $input) { + clientMutationId + space { + id + invite_link + invite_token { + edit + view + check + } + } + } + } +`,EM=(0,eL.default)(e1.Switch).withConfig({displayName:"ShareLinkConfigurator__StyledSwitch",componentId:"sc-88a52698-0"})` + ${e=>e.$disabled&&"opacity: 0.5;"} +`,ES=function(e){let{currentUserRole:t,disabled:a,space:n}=e,l=(0,e$.useDispatch)(),r=gV(),o=Eu({role:t,action:"manage_settings"}),[i,{loading:s,error:d}]=(0,cs.D)(Ep),[c,{loading:m}]=(0,cs.D)(EC),[u,p]=ev.useState("collaborator"),g=ev.useMemo(()=>{if(null==n.invite_token||null==u)return n.invite_link??null;let e=new URL(`/invites/${n.id}`,"https://www.taskade.com");switch(u){case"collaborator":{let t=n.invite_token?.edit;e.searchParams.set("share","edit"),e.searchParams.set("edit",t);break}case"participant":{let t=n.invite_token?.check;e.searchParams.set("share","check"),e.searchParams.set("check",t);break}case"viewer":{let t=n.invite_token?.view;e.searchParams.set("share","view"),e.searchParams.set("view",t)}}return e.toString()},[n.id,n.invite_token,n.invite_link,u]),f=ev.useCallback(async()=>{await i({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:n.id}},update:(e,t)=>{t?.data?.spaceInviteTokenRegenerate!=null&&e.modify({id:e.identify(n),fields:{invite_token:()=>t?.data?.spaceInviteTokenRegenerate.inviteToken}})}})},[n,i]),h=ev.useCallback(e=>{if(yF.get(e)?.isPaidFeature&&r.isPaywallEnabled){null!=r.id&&l(d4(r.id));return}p(e)},[l,r.id,r.isPaywallEnabled]),y=ev.useCallback(e=>{let t=(0,ld.Z)();o&&c({variables:{input:{clientMutationId:t,spaceId:n.id,enabled:e}}})},[o,n,c]),b=null!=g;return ev.createElement(Ef,null,ev.createElement(Ey,null,ev.createElement(Eh,null,ev.createElement(Eb,null,ev.createElement(tn.Icon,{icon:"share_link"}),ev.createElement(eY.Z,{id:"general.share_link",defaultMessage:"Share Link"})),m?ev.createElement(eI.Spinner,{width:16,height:16}):ev.createElement(Ev,null,b&&ev.createElement(EN,{error:d,onRegenerate:f,regenerating:s}),ev.createElement(EM,{$disabled:!o,checked:b,onChange:y}))),b&&ev.createElement(Eh,null,ev.createElement(Eb,null,ev.createElement(tn.Icon,{icon:"share_permission"}),ev.createElement(eY.Z,{id:"general.permissions",defaultMessage:"Permissions"})),ev.createElement(bC,{value:u,onChange:h,isProject:!1}))),b&&ev.createElement(Eg,null,ev.createElement(E_,{disabled:a,textToCopy:g})))},EI=function(e){let t=(0,e$.useDispatch)();return ev.createElement("div",{className:og()("flex w-full cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75",e.className),onClick:()=>{t(d4())}},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))},ED={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MeAppSumoQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"appSumo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AppSumoParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"AppSumoParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppSumo"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"licensedSpaceLimit"}},{kind:"Field",name:{kind:"Name",value:"invoiceItemUuid"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"state"}},{kind:"Field",name:{kind:"Name",value:"usage"}}]}}]},ET=function(e){let{taskadePlan:t}=e,a=fR.Vl.getQuantity("workspace.member.limit",t.state),{data:n}=(0,eB.a)(ED),l=n?.me?.appSumo,r=l?.taskadePlanType??"free";return"unlimited"===a?null:ev.createElement("div",{className:"mx-6 mt-4 flex items-center gap-4 rounded-xl border border-appcolor-300 p-3 text-sm text-textcolor-700"},ev.createElement("span",{className:"flex-auto"},ev.createElement(eY.Z,{id:"general.upgrade_workspace_invite",defaultMessage:"Your current plan allows for a maximum of {spaceMemberLimit} members.",values:{spaceMemberLimit:a}})),"free"!==r?ev.createElement("a",{href:"/settings/plans",className:"flex shrink-0 cursor-pointer items-center justify-center gap-x-1.5 whitespace-normal rounded-full bg-upgrade px-4 py-2 pr-5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75"},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.manage_plan",defaultMessage:"Manage Plan"})):ev.createElement(EI,{className:"w-40 flex-initial"}))},E$=eL.default.div.withConfig({displayName:"WorkspaceMemberInvite__FlexContainer",componentId:"sc-bc41544b-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 460px; + min-width: 460px !important; + margin: 0 auto; + position: relative; + padding: 0 0 1.875rem; + word-break: break-word; + background: ${e=>e.theme.appColors.hex(100)}; +`,EP=eL.default.div.withConfig({displayName:"WorkspaceMemberInvite__Header",componentId:"sc-bc41544b-1"})` + display: flex; + flex-direction: column; + position: sticky; + top: 0; + z-index: 1; + background: ${e=>e.theme.isNightMode?"rgba(29, 31, 34, 0.8)":"rgba(252,252,252,0.8)"}; + backdrop-filter: blur(20px); + border-radius: 10px 10px 0 0; + margin-bottom: 1rem; +`,EF=eL.default.h1.withConfig({displayName:"WorkspaceMemberInvite__Title",componentId:"sc-bc41544b-2"})` + font-weight: 500; + padding: 1.25rem 1.875rem 0.625rem; + color: ${e=>e.theme.textColors.hex(10)}; + margin: 0; + font-size: 1rem; +`,EA=eL.default.div.withConfig({displayName:"WorkspaceMemberInvite__Body",componentId:"sc-bc41544b-3"})` + max-height: 80vh; + overflow: overlay; + ${tM}; + + @-moz-document url-prefix() { + overflow: auto; + } +`,ER=eL.default.div.withConfig({displayName:"WorkspaceMemberInvite__TabPanel",componentId:"sc-bc41544b-4"})` + display: block; +`,Ej=eL.default.a.withConfig({displayName:"WorkspaceMemberInvite__Anchor",componentId:"sc-bc41544b-5"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + &:visited { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,EO=eL.default.button.withConfig({displayName:"WorkspaceMemberInvite__CloseModal",componentId:"sc-bc41544b-6"})` + display: flex; + width: 30px; + height: 30px; + align-items: center; + justify-content: center; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.appColors.hex(50)}; + border-radius: 40px; + position: absolute; + top: -36px; + right: -36px; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + transition: transform 150ms ease-in-out; + z-index: 2; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + transform: scale(1.2); + } + + &:focus { + transform: scale(0.9); + } +`,EU=function(e){let{exit:t}=e,a=(0,e$.useDispatch)(),{error:n,loading:l,viewData:r}=function(e){let{spaceID:t}=e,a=(0,eB.a)(ED),n=(0,eB.a)(kt,{variables:{space_id:t},fetchPolicy:"cache-and-network"}),l=a.loading||n.loading,r=ev.useMemo(()=>null==a.error&&null==n.error?null:{meAppSumoQuery:a.error,spaceMembershipsQuery:n.error},[a.error,n.error]),o=a.data?.me??null,i=n.data?.membership??null;return{error:ev.useMemo(()=>{if(null!=r)return null!=r.meAppSumoQuery?bH(r.meAppSumoQuery,["me"])??r.meAppSumoQuery:null!=r.spaceMembershipsQuery?bH(r.spaceMembershipsQuery,["membership"])??r.spaceMembershipsQuery:new ei.HttpError({code:"UNKNOWN_ERROR"});if(!l){if(null==o)return new ei.HttpError({code:"UNAUTHORIZED"});if(null==i)return new ei.HttpError({code:"FORBIDDEN"})}return null},[o,r,l,i]),loading:l,viewData:ev.useMemo(()=>{if(null==i)return null;let{role:e,space:t}=i,{color:a,memberships:n}=t,l=n?.map(t=>{let a="view";return t.user.id===o?.id?lc.Y8.can(e,"leave","workspace")&&(a="me"):lc.Y8.can(e,"manage_role","workspace")&&vq(e,t.role)&&(a="manage"),{membership:t,type:a}})??[],r=[];for(let a of t.invitations?.edges??[]){let{node:t}=a;if(null==t)continue;let n=pW({role:e,action:"manage_role"}),l=vq(e,t.role);n&&l?r.push({invitation:t,type:"manage"}):r.push({invitation:t,type:"view"})}let s=vG(e,yP),d=[],c=i.space.parent_membership;if(null!=c){let e=new Set;for(let t of l)e.add(t.membership.user.id);for(let t of c.space.memberships??[])e.has(t.user.id)||d.push(t.user)}return{currentUser:o,members:l,role:e,roleEntries:s,space:t,theme:null==a?void 0:{primaryColor:a},suggestedInvites:d,invitations:r}},[o,i])}}(e),[o,i]=ev.useState("invite-link");if(l)return ev.createElement(E$,{className:"rounded-3xl"},ev.createElement(eI.Spinner,{delay:0,height:260}));if(null!=n)return ev.createElement(E$,{className:"rounded-3xl"},ev.createElement("div",null,n.message));if(null==r)return ev.createElement(E$,{className:"rounded-3xl"},ev.createElement("div",null,"Unable to fetch members"));let{currentUser:s,members:d,space:c,role:m,roleEntries:u,theme:p,invitations:g}=r,f=c.is_subspace?"subspace":"workspace",h=c.is_subspace?"360055670613":"360042451654",y=`https://help.taskade.com/hc/en-us/articles/${h}`,b=fR.Vl.getQuantity("workspace.member.limit",c.taskadePlan.state),v=d.length+g.length,k="unlimited"!==b&&v>=b,E="free"===c.taskadePlan.type,x=s?.appSumo,_=x?.taskadePlanType??"free";return ev.createElement(eI.ThemeProvider,{theme:p},ev.createElement(gz,{spaceId:c.id,spaceType:c.type,spaceIsSubspace:c.is_subspace,spaceTaskadePlanType:c.taskadePlan.type},ev.createElement(E$,{className:"rounded-3xl"},ev.createElement(EO,{type:"button",onClick:()=>t()},ev.createElement(tn.Icon,{icon:"modal_close"})),ev.createElement(EA,null,ev.createElement(EP,null,E&&"free"===_&&ev.createElement("div",{className:"light:text-textcolor-800 m-6 mb-0 flex rounded-xl border border-upgrade bg-upgrade/10 px-3 py-3 dark:text-upgrade"},ev.createElement("p",{className:"pl-1 text-sm font-medium"},ev.createElement(eY.Z,{id:"general.upgrade_to_unlock_unlimited_ai_for_your_team",defaultMessage:"Upgrade to unlock unlimited AI for your team"})),ev.createElement("button",{className:"ml-auto gap-1 rounded-full bg-upgrade px-6 py-2 text-sm font-semibold text-black text-textlight-1000 hover:bg-upgrade/70 dark:hover:bg-upgrade/70",onClick:()=>{a(d4())}},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"shrink-0"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))),ev.createElement(EF,null,ev.createElement(eY.Z,{id:"general.space_invite.header",defaultMessage:"Invite to {spaceName}",values:{spaceName:c.name}})),ev.createElement(v9,{selectedTab:o,setSelectedTab:i})),ev.createElement(eI.TabPanelSwitch,{value:o},ev.createElement(ER,{value:"invite-link"},ev.createElement(ES,{currentUserRole:m,disabled:k,space:c})),ev.createElement(ER,{value:"invite-user"},ev.createElement(kZ,{disabled:k,spaceId:c.id,parentSpaceId:c.parent_membership?.space?.id}))),null!=c.parent_membership&&ev.createElement(Em,{exit:t,space:c}),ev.createElement(Et,{isSubspace:null!=c.parent_membership,members:d,roleEntries:u,exit:t}),g.length>0&&ev.createElement(kT,{invitations:g}),null!=c.parent_membership&&r.suggestedInvites.length>0&&!k&&ev.createElement(k5,{suggestedInvitees:r.suggestedInvites,spaceID:c.id}),k&&ev.createElement(ET,{taskadePlan:c.taskadePlan})),ev.createElement("div",{className:"absolute -bottom-14 left-0 w-full px-12 text-center text-textlight-0 sm:text-sm sm:leading-5"},ev.createElement(eY.Z,{id:"space.to_learn_more_about_space_invites_visit_our_help_center",defaultMessage:"To learn more about {spaceType, select, workspace {workspace} subspace {folder} other {workspace}} invites, visit our Help Center.",values:{link:e=>ev.createElement(Ej,{href:y,target:"_blank",rel:"noopener noreferrer"},e),spaceType:f}})))))},EZ=(0,e$.connect)(function(e,t){return{resource:e?.modal?.invite?.resource??null}})(function(e){let{exit:t,resource:a}=e;switch(a.type){case"document":return ev.createElement(v6,{documentID:a.id,exit:t});case"space":return ev.createElement(EU,{spaceID:a.id,exit:t});default:return null}}),EL=(0,e$.connect)(function(e){return{isOpen:e?.modal?.invite?.isOpen??!1}},function(e){return(0,ek.DE)({onToggle:fA},e)})(function(e){let{isOpen:t,onToggle:a}=e;return t?ev.createElement(eI.ModalDialog,{autofocus:!1,isOpen:t,close:a},e=>{let{exit:t}=e;return ev.createElement(EZ,{exit:t})}):null}),EB=(0,la.ZP)` + query ProjectInfoQuery($document_id: ID!) { + document(id: $document_id) { + id + info + shared_preferences + space { + id + name + color + is_subspace + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + } + } + } + } + } + } + } + } +`,Ez=(0,d9.oM)({name:"dialogs.invitePicker",initialState:{isOpen:!1},reducers:{toggleInvitePickerDialog:(e,t)=>({isOpen:!e.isOpen,documentID:t?.payload})}}),EV=eL.default.div.withConfig({displayName:"ProjectAvatar__Wrapper",componentId:"sc-834b230b-0"})` + display: flex; + flex-shrink: 0; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + border-radius: 40%; + font-size: ${36*.6}px; + background: ${e=>e.theme.isNightMode?"#2C3035":"#f8f8f8"}; + color: ${e=>e.theme.textColors.hex(50)}; +`,Eq=eL.default.span.withConfig({displayName:"ProjectAvatar__Character",componentId:"sc-834b230b-1"})` + line-height: 36px; + text-align: center; + text-transform: uppercase; + + /* Workaround for emoji positioning issue in Chrome on high dpi screens */ + @media (min-resolution: 150dpi) { + font-size: 2em; + transform: scale(0.5); + } +`,EW=function(e){let{document:t}=e,a=nQ(t);return ev.createElement(EV,null,a?ev.createElement(Eq,null,a):ev.createElement(tn.Icon,{icon:"dd_project"}))},EH=eL.default.h4.withConfig({displayName:"InvitePickerBody__ModalHeading",componentId:"sc-deb6baa7-0"})` + ${e1.ArticleTypography.heading4} + margin-bottom: 4px; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; +`,EG=eL.default.div.withConfig({displayName:"InvitePickerBody__FlexContainer",componentId:"sc-deb6baa7-1"})` + pointer-events: fill; + display: flex; + width: 100%; + max-width: 600px; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 24px 30px; + background: ${e=>e.theme.backgroundColorHex}; +`,EK=eL.default.button.withConfig({displayName:"InvitePickerBody__Option",componentId:"sc-deb6baa7-2"})` + display: flex; + width: 100%; + max-width: 550px; + margin-bottom: 6px; + padding: 16px; + border: 2px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + background: none; + text-align: left; + cursor: pointer; + + &:last-child { + margin-top: 4px; + } + + & > .option-name { + margin-left: 12px; + word-break: break-word; + } + + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + background: ${e=>e.theme.appColors.hex(90)}; + } + + &:active { + outline: 0; + } +`,EY=eL.default.button.withConfig({displayName:"InvitePickerBody__CloseModal",componentId:"sc-deb6baa7-3"})` + display: flex; + width: 40px; + height: 40px; + align-items: center; + justify-content: center; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.appColors.hex(50)}; + border-radius: 40px; + border: 0; + position: absolute; + top: -15px; + right: -15px; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + transition: transform 150ms ease-in-out; + + &:hover { + cursor: pointer; + background-color: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + transform: scale(1.2); + } + + &:focus { + outline: 0; + transform: scale(0.9); + } +`,EQ=eL.default.h4.withConfig({displayName:"InvitePickerBody__OptionHeading",componentId:"sc-deb6baa7-4"})` + ${e1.UiTypography.md} + margin-bottom: 0.25rem; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; +`,EJ=eL.default.p.withConfig({displayName:"InvitePickerBody__OptionCopy",componentId:"sc-deb6baa7-5"})` + ${e1.UiTypography.sm} + margin: 0; + color: ${e=>e.theme.textColors.hex(50)}; + white-space: break-spaces; +`,EX=eL.default.span.withConfig({displayName:"InvitePickerBody__Name",componentId:"sc-deb6baa7-6"})` + font-weight: 500; + color: ${e=>e.theme.primaryColor}; +`,E0=function(e){let{documentID:t}=e,a=(0,e$.useDispatch)(),{data:n,error:l,loading:r}=(0,eB.a)(EB,{variables:{document_id:t},fetchPolicy:"cache-and-network"});if(r)return ev.createElement(EG,null,ev.createElement(eI.Spinner,null));if(null!=l)return ev.createElement(EG,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}));let o=n?.document,i=o?.space;if(null==o||null==i)return ev.createElement(EG,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}));let s=i.is_subspace??!1,d=null==i.color?void 0:{primaryColor:i.color},c=()=>{a(Ez.actions.toggleInvitePickerDialog())};return ev.createElement(eI.ThemeProvider,{theme:d},ev.createElement(EG,null,ev.createElement(EY,{type:"button",onClick:()=>c()},ev.createElement(tn.Icon,{icon:"modal_close"})),ev.createElement(EH,null,ev.createElement(eY.Z,{id:"general.invite_team",defaultMessage:"Invite team"})),ev.createElement("div",{className:"mb-4 mt-1 pr-3 text-sm text-textcolor-500"},s?ev.createElement(eY.Z,{id:"general.view_share_and_manage_permissions_for_the_entire_folder_or_this_project",defaultMessage:"View, share and manage permissions for the entire folder or this project."}):ev.createElement(eY.Z,{id:"general.view_share_and_manage_permissions_for_the_entire_workspace_or_this_project",defaultMessage:"View, share and manage permissions for the entire workspace or this project."})),ev.createElement(EK,{onClick:()=>{a(Ez.actions.toggleInvitePickerDialog()),a(fF(i?.id))}},i&&ev.createElement(nA,{space:i,size:"lg"}),ev.createElement("div",{className:"option-name"},ev.createElement(EQ,null,s?ev.createElement(eY.Z,{id:"general.folder_invite",defaultMessage:"Invite to Folder"}):ev.createElement(eY.Z,{id:"general.workspace_invite",defaultMessage:"Invite to workspace"})),ev.createElement(EJ,null,ev.createElement(eY.Z,{id:"general.access_to_all_projects_in_space",defaultMessage:"Access to all projects in {spaceName}.",values:{spaceName:ev.createElement(EX,null,i.name)}})))),ev.createElement(EK,{onClick:()=>{a(Ez.actions.toggleInvitePickerDialog()),a(fP(o?.id))}},o&&ev.createElement(EW,{document:o}),ev.createElement("div",{className:"option-name"},ev.createElement(EQ,null,ev.createElement(eY.Z,{id:"general.invite_to_project",defaultMessage:"Invite to project"})),ev.createElement(EJ,null,ev.createElement(eY.Z,{id:"general.access_to_project_only",defaultMessage:"Access to {projectName} only.",values:{projectName:ev.createElement(EX,null,o.info?.title||"Untitled Project")}}))))))},E1=(0,e$.connect)(function(e){return e.dialogs.invitePicker})(function(e){let{isOpen:t,documentID:a}=e,n=(0,e$.useDispatch)(),l=(0,ev.useCallback)(()=>{null!=a&&n(Ez.actions.toggleInvitePickerDialog(a))},[n,a]);return t&&null!=a?ev.createElement(eI.ModalDialog,{isOpen:t,close:l},()=>ev.createElement(E0,{documentID:a})):null}),E2="@@taskade/dialogs/TOGGLE_LARGE_FILE_MODAL_DIALOG",E5="@@taskade/dialogs/SHOW_LARGE_FILE_MODAL_DIALOG";function E3(){return{type:E5,payload:{}}}let E4=eL.default.div.withConfig({displayName:"LargeFileBody__PaywallWrapper",componentId:"sc-c455d4d2-0"})` + max-width: 360px; + position: relative; + padding: 40px 60px; + @media (min-width: 768px) { + min-width: inherit; + max-width: 550px; + } +`,E6=eL.default.h1.withConfig({displayName:"LargeFileBody__Title",componentId:"sc-c455d4d2-1"})` + justify-content: center; + color: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333"}; + + font-size: 27px; + letter-spacing: -0.005em; + font-weight: normal; + + display: block; + text-align: center; + padding: 0; + margin-bottom: 20px; + + & > span { + border-bottom: 3px solid ${e=>e.theme?.primaryColorScheme?.base}; + } +`,E8=eL.default.h2.withConfig({displayName:"LargeFileBody__Subtitle",componentId:"sc-c455d4d2-2"})` + display: flex; + justify-content: center; + text-align: center; + + font-weight: normal; + font-size: 17px; + line-height: 24px; + letter-spacing: 0.02em; + padding: 0; + margin: 20px 0; + + color: ${e=>e.theme?.isNightMode?"#999":"#666"}; +`,E7=eL.default.div.withConfig({displayName:"LargeFileBody__BackButton",componentId:"sc-c455d4d2-3"})` + display: flex; + width: 100%; + justify-content: center; + padding: 12px 0; + flex: 1 1 auto; + + background: none; + outline: 0; + border-radius: 12px; + + font-weight: 500; + font-size: 16px; + letter-spacing: 0.025em; + text-transform: uppercase; + cursor: pointer; + + color: #fff; + background: ${e=>e.theme?.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha90}; + } + + transition: background-color 100ms ease-in; +`,E9=function(e){let{exit:t}=e;return ev.createElement(E4,null,ev.createElement(E6,null,ev.createElement(eY.Z,{id:"general.large_file",defaultMessage:"Large File"})),ev.createElement(E8,null,ev.createElement(eY.Z,{id:"general.the_file_you_are_uploading_exceed_5mb_limit",defaultMessage:"The file you're uploading exceeds the 5MB limit."})),ev.createElement("div",null,ev.createElement(E7,{onClick:t},ev.createElement(eY.Z,{id:"general.okay",defaultMessage:"Okay"}))))};function xe(e){return e?.modal?.largeFile?.isOpen??!1}let xt=function(){let e=(0,e$.useSelector)(xe),t=(0,e$.useDispatch)(),a=(0,ev.useCallback)(()=>{t({type:E2,payload:{}})},[t]);return e?ev.createElement(eI.ModalDialog,{isOpen:e,close:a},e=>{let{exit:t}=e;return ev.createElement(E9,{exit:t})}):null},xa="@@taskade/modal/TOGGLE_DOCUMENT_MOVE_V2_MODAL",xn="@@taskade/modal/RESET_DOCUMENT_MOVE_V2_MODAL_STATE";function xl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:xa,payload:{documentID:e,options:t}}}let xr="Entities/ADD_ENTITIES";function xo(e){return{type:xr,payload:e}}let xi="@@taskade/document/FETCH_DOCUMENT_COLLABORATORS",xs="@@taskade/document/REMOVE_SHARED_DOCUMENT_FROM_LIST",xd="@@taskade/document/SET_DOCUMENT_COLLABORATOR_FETCH_STATUS",xc="@@taskade/document/SET_SHARED_DOCUMENTS_FETCH_STATUS",xm="@@taskade/document/SET_SHARED_DOCUMENT_LIST",xu="@@taskade/document/TOGGLE_DOCUMENT_HIDE_CHAT",xp="@@taskade/document/TOGGLE_DOCUMENT_HIDE_COMPLETED",xg="@@taskade/document/SYNC_ASSIGNEES",xf="@@taskade/document/SYNC_DATES",xh="@@taskade/document/SYNC_COUNTDOWNS",xy="@@taskade/document/SYNC_REACTION_COLLECTIONS";function xb(e,t){return{type:xd,payload:{documentID:e,fetchStatus:t}}}function xv(e){return{type:xc,payload:{fetchStatus:e}}}function xk(e){return{type:xu,payload:{documentID:e}}}function xE(e){return{type:xp,payload:{documentID:e}}}function xx(e){return{type:xs,payload:{documentID:e}}}function x_(e){return{type:xf,payload:e}}function xw(e){return{type:xh,payload:e}}function xN(e){return{type:xy,payload:e}}let xC=eL.default.div.withConfig({displayName:"ConfirmMoveDocumentModalDialog__FlexContainer",componentId:"sc-54064490-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 5px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,xM=eL.default.h1.withConfig({displayName:"ConfirmMoveDocumentModalDialog__Header",componentId:"sc-54064490-1"})` + font-weight: 500; + font-size: 18px; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,xS=function(e){let{exit:t,isTemplate:a,onConfirm:n,selectedWorkspace:l}=e;return ev.createElement(xC,null,ev.createElement(xM,null,ev.createElement(eY.Z,{id:"general.move_document_confirmation.header",defaultMessage:"Confirm Move"})),a?ev.createElement(gw,null,ev.createElement(eY.Z,{id:"general.move_document_confirmation.template_description",defaultMessage:"Some people may lose access to this template when moved."})):ev.createElement(gw,null,ev.createElement(eY.Z,{id:"general.move_document_confirmation.project_description",defaultMessage:"Some people may lose access to this project when moved."})),ev.createElement(gN,null,ev.createElement(gM,{className:"btn-cancel",onClick:()=>{t()},type:"button"},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(gC,{className:"btn-confirm",onClick:()=>{n(l)},type:"button"},ev.createElement(eY.Z,{id:"general.move_document",defaultMessage:"Move"}))))},xI=function(e){let{selectedWorkspace:t,isTemplate:a,onConfirm:n,onToggle:l}=e,r=null!=t;return r?ev.createElement(eI.ModalDialog,{isOpen:r,close:l},e=>{let{exit:l}=e;return ev.createElement(xS,{exit:l,isTemplate:a,onConfirm:n,selectedWorkspace:t})}):null},xD="TOGGLE_ARCHIVE_DOCUMENT_ENTITY",xT="UPDATE_META_SPACE",x$="@@taskade/meta/UPDATE_META_PREFERENCES",xP="@@taskade/meta/UPDATE_META_CONFERENCE";function xF(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:xD,payload:{documentID:e,callback:t}}}function xA(e){return{type:x$,payload:{preferences:e}}}let xR={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"moveDocumentV2"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"moveDocumentV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"spaceID"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"raw_key"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"color"}}]}}]}}]}}]}}]}}]}}]},xj={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"moveTemplate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MoveTemplateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"moveTemplate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"raw_key"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"color"}}]}}]}}]}}]}}]}}]}}]}}]},xO=eL.default.div.withConfig({displayName:"MoveDocumentDialogBody__FlexContainer",componentId:"sc-a559f40c-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,xU=eL.default.h1.withConfig({displayName:"MoveDocumentDialogBody__Header",componentId:"sc-a559f40c-1"})` + ${e1.UiTypography.lg}; + font-weight: 500; + padding: 0; + margin: 0 0 8px; + color: ${e=>e.theme.textColors.hex(10)}; +`,xZ=eL.default.p.withConfig({displayName:"MoveDocumentDialogBody__Paragraph",componentId:"sc-a559f40c-2"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 20px; +`,xL=(0,eL.default)(e1.Overline).withConfig({displayName:"MoveDocumentDialogBody__Subtitle",componentId:"sc-a559f40c-3"})` + display: flex; + color: ${e=>e.theme.textColors.hex("50")}; + padding: 0 0 10px; +`,xB=eL.default.button.withConfig({displayName:"MoveDocumentDialogBody__Button",componentId:"sc-a559f40c-4"})` + display: block; + width: 100%; + cursor: pointer; + margin-top: 30px; + padding: 14px 0; + + border-radius: 12px; + font-weight: 500; + font-size: 16px; + letter-spacing: 0.025em; + text-transform: uppercase; + cursor: pointer; + color: #fff; + border: 0; + + background: ${e=>e.theme?.primaryColorScheme.base}; + + &:hover { + background: ${e=>e.theme?.primaryColorScheme.alpha90} !important; + } + + &:focus { + outline: 0; + } + + transition: background-color 100ms ease-in; +`,xz=function(e){let{disableWorkspaceID:t,documentID:a,metaID:n,exit:l,removeSharedDocumentFromList:r,successNotification:o}=e,{document:i,error:s,loading:d,moveMutation:c,workspacesTree:m}=function(e,t){let{metaID:a,removeSharedDocumentFromList:n,successNotification:l}=t,{document:r,error:o,loading:i,workspacesTree:s,memberships:d}=function(e){let{data:t,error:a,loading:n}=(0,eB.a)(pw,{variables:{documentID:e},fetchPolicy:"network-only"});return(0,ev.useMemo)(()=>{if(n)return{document:null,error:null,loading:n,workspacesTree:null,memberships:null};if(a)return{document:null,error:a,loading:n,workspacesTree:null};let e=t?.document??null,l=t?.me?.memberships??[];if(eu()(e))return{document:null,error:Error("Missing Project"),loading:n,workspacesTree:null,memberships:null};let r=l.filter(e=>null==e.space.archived_at);return ts()(r)?{document:null,error:null,loading:n,workspacesTree:null,memberships:null}:{document:e,error:a,loading:n,workspacesTree:pI(r),memberships:r}},[t,a,n])}(e),c=d?.find(e=>e.space.id===r.space.id)??null,m=(0,eF.TH)(),u=(0,e$.useDispatch)(),p=(0,cs.D)(xR),g=(0,cs.D)(xj),f=ev.useCallback((e,t)=>{u(xo({documents:{[e]:{space:t?.id??null,isPinned:!1,isSharedWithUser:null==t,tags:[]}}})),u({type:xT,payload:{space:t}})},[u]),h=ev.useMemo(()=>{if(!eu()(r))return function(e,t,a){let{moveDocumentMutation:n,moveTemplateMutation:l,location:r,metaID:o,removeSharedDocumentFromList:i,successNotification:s,successCallback:d}=a,{query:c,variables:m}=pZ(r,null),u=!eu()(e.templated_at),p=(t,a)=>{var n,l,r;let c=!eu()(o);s((n=a.id,l=a.name,r=e.info.title,{uid:`document-moved-${n}-${(0,ld.Z)()}`,position:"br",autoDismiss:5,dismissible:!1,children:ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.document_move_success_notification",defaultMessage:"{documentTitle} moved to {toName}",values:{project:e=>ev.createElement(sC.rU,{to:`/d/${t}`},e),documentTitle:r,space:e=>u?ev.createElement(sC.rU,{to:`/spaces/${n}/templates`},e):ev.createElement(sC.rU,{to:`/spaces/${n}`},e),toName:l}}))})),i(t),c&&d(t,a)};if(u){let[e,t]=l;return[async(t,a)=>{let n=(0,ld.Z)(),l=a?a.id:null;await e({update:e=>{if(c&&m){let a=e.readQuery({query:c,variables:m}),n=(0,es.ZP)(a,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==t),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({query:c,data:n,variables:m})}},variables:{input:{id:t,spaceID:l,clientMutationId:n}},optimisticResponse:{__typename:"Mutation",moveTemplate:{__typename:"MoveTemplatePayload",clientMutationId:n,document:{__typename:"Document",id:t,space:{__typename:"Space",id:l}}}}}),p&&p(t,a)},t]}{let[e,t]=n;return[async(t,a)=>{let n=a?a.id:null;await e({update:e=>{if(c&&m){let a=e.readQuery({query:c,variables:m}),n=(0,es.ZP)(a,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==t),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({query:c,data:n,variables:m})}},variables:{id:t,spaceID:n},optimisticResponse:{__typename:"Mutation",moveDocumentV2:{__typename:"Document",id:t,space:{__typename:"Space",id:n}}}}),p&&p(t,a)},t]}}(r,0,{moveDocumentMutation:p,moveTemplateMutation:g,location:m,metaID:a,removeSharedDocumentFromList:n,successNotification:l,successCallback:f})},[r,c,f,m,a,p,g,n,l]);return{document:r,error:o,loading:i,moveMutation:h,workspacesTree:s}}(a,{metaID:n,removeSharedDocumentFromList:r,successNotification:o}),[u,p]=(0,ev.useState)(null);if((0,ev.useEffect)(()=>{if(!c)return;let[,e]=c;!e.called||e.error||e.error||l()},[l,c]),d)return ev.createElement(xO,null,ev.createElement(eI.Spinner,{width:"400"}));if(s)return ev.createElement(xO,null,ev.createElement("p",null,ev.createElement(eY.Z,{id:"general.spaces.fetch_error",defaultMessage:"There was an error loading your spaces. Please try again."})));if(eu()(m))return ev.createElement(xO,null,ev.createElement(xU,null,ev.createElement(eY.Z,{id:"general.workspace_required",defaultMessage:"Workspace Required"})),ev.createElement(xZ,null,ev.createElement(eY.Z,{id:"general.spaces.at_least_one_workspace_to_move_copy_save",defaultMessage:"You must have at least one workspace with edit permission to copy, move or save templates."})),ev.createElement(xB,{onClick:e=>{l()}},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})));let[g,f]=c,h=!eu()(i.templated_at);if(f.called){if(f.loading)return ev.createElement(xO,null,ev.createElement(eI.Spinner,{width:"400"}));if(f.error)return ev.createElement(xO,null,ev.createElement("p",null,ev.createElement(eY.Z,{id:"general.spaces.move_failure",defaultMessage:"Fail to move project/template. Please try again."})))}return ev.createElement(xO,null,h?ev.createElement(ev.Fragment,null,ev.createElement(xU,null,ev.createElement(eY.Z,{id:"general.move_template.header",defaultMessage:"Move Template"})),ev.createElement(xZ,null,ev.createElement(eY.Z,{id:"general.move_template.description",defaultMessage:"Choose a workspace or folder to move this template."}))):ev.createElement(ev.Fragment,null,ev.createElement(xU,null,ev.createElement(eY.Z,{id:"general.move_project.header",defaultMessage:"Move Project"})),ev.createElement(xZ,null,ev.createElement(eY.Z,{id:"general.move_project.description",defaultMessage:"Choose a workspace or folder to move this project."}))),ev.createElement(xL,null,ev.createElement(eY.Z,{id:"general.move_to",defaultMessage:"Move To"})),ev.createElement(p3,{disableWorkspaceID:t,isTemplate:h,onSelect:e=>{p(e)},workspacesTree:m}),ev.createElement(xI,{selectedWorkspace:u,isTemplate:h,onConfirm:e=>{g(a,"space"===e.type?e:null),p(null)},onToggle:()=>{p(null)}}))};xz.propTypes={disableWorkspaceID:l7().string,documentID:l7().string.isRequired,metaID:l7().string,exit:l7().func.isRequired,removeSharedDocumentFromList:l7().func.isRequired,successNotification:l7().func.isRequired},xz.defaultProps={disableWorkspaceID:null,metaID:null};let xV=(0,e$.connect)(function(e,t){return{disableWorkspaceID:ec()(e,["modal","documentMoveV2","spaceID"],null),documentID:ec()(e,["modal","documentMoveV2","documentID"],null),metaID:dP(e)}},function(e){return(0,ek.DE)({removeSharedDocumentFromList:xx,successNotification:l3.success},e)})(xz),xq=function(e){let{isOpen:t,onToggle:a}=e;return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:a},e=>{let{exit:t}=e;return ev.createElement(xV,{exit:t})}):null};xq.propTypes={isOpen:l7().bool.isRequired,onToggle:l7().func.isRequired};let xW=(0,e$.connect)(function(e,t){return{isOpen:ec()(e,["modal","documentMoveV2","isOpen"],!1)}},function(e){return(0,ek.DE)({onToggle:xl},e)})(xq);class xH extends Error{description;constructor(e,t){super(e),this.description=t}}let xG=(0,te.Em)({id:"general.workspace_required",defaultMessage:"Workspace Required"}),xK=(0,te.Em)({id:"general.spaces.at_least_one_workspace_to_move_copy_save",defaultMessage:"You must have at least one workspace with edit permission to copy, move or save templates."}),xY={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MoveProjectsMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MoveProjectsInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"moveProjects"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},xQ=(0,lb.C)({context:{documentIds:null,workspaceTrees:null,memberships:null,error:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"movedialog",initial:"loading",states:{loading:{invoke:{id:"loadWorkspaceTrees",src:"loadWorkspaceTrees",onDone:[{actions:"handleWorkspaceTreesLoaded",target:"#movedialog.loaded"}],onError:[{actions:"handleErred",target:"#movedialog.erred"}]}},loaded:{always:[{cond:"isMoving",target:"#movedialog.active"},{target:"#movedialog.erred"}]},active:{on:{MOVE:{target:"#movedialog.moving"}}},moving:{invoke:{id:"moving",src:"moving",onDone:[{target:"#movedialog.end"}],onError:[{actions:"handleErred",target:"#movedialog.erred"}]}},erred:{},end:{entry:"exit"}}},{guards:{isMoving:e=>{let{documentIds:t}=e;return null!=t}},actions:{handleErred:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleWorkspaceTreesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.workspaceTrees=t.data.workspaceTrees,e.memberships=t.data.memberships,e)))}}),xJ=function(e){let{documentIds:t,spaceId:a,exit:n}=e,l=(0,e$.useDispatch)(),r=(0,eK.Z)(),o=(0,eF.TH)(),i=(0,ll.x)(),s=ev.useMemo(()=>({documentIds:t}),[t]),[d]=(0,cs.D)(xY),[c,m]=(0,ls.e)(xQ,{actions:{exit:()=>{n()}},context:s,services:{moving:async(e,a)=>{let{memberships:n}=e,{spaceId:r,spaceName:i}=a.payload;if(null==n)throw Error("Memberships required");if(null==n.find(e=>e.space.id===r))throw Error("Membership required");let{query:s,variables:c}=pZ(o,null),m=(0,ld.Z)(),u={uid:`documents-copied-to-${r}-${(0,ld.Z)()}`,position:"br",autoDismiss:5,dismissible:!1,children:ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.move_projects_success_notification",defaultMessage:"Projects have been moved to {toSpaceName}",values:{space:e=>ev.createElement(sC.rU,{to:`/spaces/${r}`},e),toSpaceName:i}}))};l((0,l3.success)(u)),await d({variables:{input:{clientMutationId:m,ids:t,spaceId:r}},update:(e,a)=>{if(null!=s&&null!=c)for(let a of t)e.evict(e.identify({id:a,__typename:"Document"})),e.gc()}})},loadWorkspaceTrees:async e=>{let t=await i.query({query:gT,fetchPolicy:"network-only"}),a=t.errors?.[0];if(null!=a)throw a;let n=t.data?.me?.memberships??[],l=[];for(let e of n)null!=e&&null==e.space.archived_at&&l.push(e);if(0===l.length)throw new xH(r.formatMessage(xG),r.formatMessage(xK));return{workspaceTrees:pI(l),memberships:l}}}}),u=ev.useCallback(e=>{m({type:"MOVE",payload:{spaceId:e.id,spaceName:e.name}})},[m]),p=ev.useCallback(()=>{n()},[n]);if(c.matches("loading")||c.matches("end")||c.matches("moving"))return ev.createElement("div",{className:"p-16"},ev.createElement(eI.Spinner,{width:400}));if(c.matches("active"))return ev.createElement("div",{className:"p-8"},ev.createElement("div",null,ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.move_projects",defaultMessage:"Move Projects"})),ev.createElement("p",{className:"mb-5 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.move_projects.description",defaultMessage:"Choose a workspace or folder to move the projects to."}))),ev.createElement("div",{className:"mb-2"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.move_to",defaultMessage:"Move To"}))),ev.createElement(p3,{currentWorkspaceID:a,onSelect:u,workspacesTree:c.context.workspaceTrees??[]}));let g=c.context.error?.message??"Unknown Error",f=c.context.error instanceof xH?c.context.error.description:null;return ev.createElement("div",{className:"flex flex-col items-center p-16"},ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},g),null!=f&&ev.createElement("p",{className:"text-sm"},f),ev.createElement("button",{onClick:p,className:"mt-7 w-96 rounded-xl bg-primary p-3 font-semibold uppercase hover:bg-primary/90"},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})))},xX=(0,d9.oM)({name:"dialogs.copyDocuments",initialState:{isOpen:!1},reducers:{toggleMoveDocumentsDialog:(e,t)=>e.isOpen||null==t.payload?{isOpen:!1}:{isOpen:!0,documentIds:t.payload.documentIds,spaceId:t.payload.spaceId}}}),x0=(0,e$.connect)(function(e){return e.dialogs.moveDocuments})(function(e){let t=(0,e$.useDispatch)(),{isOpen:a,documentIds:n,spaceId:l}=e,r=ev.useCallback(()=>{t(xX.actions.toggleMoveDocumentsDialog())},[t]);return a&&null!=n&&null!=l?ev.createElement(eI.ModalDialog,{isOpen:a,close:r,autofocus:!0},e=>{let{exit:t}=e;return ev.createElement(xJ,{exit:t,documentIds:n,spaceId:l})}):null}),x1={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ActiveSubspaceMembershipsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"workspaceId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"membershipType"},value:{kind:"EnumValue",value:"subspace"}},{kind:"ObjectField",name:{kind:"Name",value:"archived"},value:{kind:"BooleanValue",value:!1}},{kind:"ObjectField",name:{kind:"Name",value:"parentSpaceIds"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"workspaceId"}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MembershipParts"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Space"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MembershipParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceParts"}}]}}]}}]},x2=eL.default.div.withConfig({displayName:"ConfirmMoveFolderModalDialog__FlexContainer",componentId:"sc-42675444-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 5px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,x5=eL.default.h1.withConfig({displayName:"ConfirmMoveFolderModalDialog__Header",componentId:"sc-42675444-1"})` + font-weight: 500; + font-size: 18px; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,x3=function(e){let{exit:t,onConfirm:a,selectedWorkspace:n}=e;return ev.createElement(x2,null,ev.createElement(x5,null,ev.createElement(eY.Z,{id:"general.move_folder_confirmation.header",defaultMessage:"Confirm Move"})),ev.createElement(gw,null,ev.createElement(eY.Z,{id:"general.move_folder_confirmation.folder_description",defaultMessage:"Are you sure you want to move this folder?"})),ev.createElement(gN,null,ev.createElement(gM,{className:"btn-cancel",onClick:()=>{t()},type:"button"},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(gC,{className:"btn-confirm",onClick:()=>{a(n)},type:"button"},ev.createElement(eY.Z,{id:"general.move_folder",defaultMessage:"Move"}))))},x4=function(e){let{selectedWorkspace:t,onConfirm:a,onToggle:n}=e,l=null!=t;return l?ev.createElement(eI.ModalDialog,{isOpen:l,close:n},e=>{let{exit:n}=e;return ev.createElement(x3,{exit:n,onConfirm:a,selectedWorkspace:t})}):null},x6={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DestinationWorkspacesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"actions"},value:{kind:"StringValue",value:"move_folder",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"is_subspace"},value:{kind:"BooleanValue",value:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},x8={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MoveFolderMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SubspaceMoveInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"subspaceMove"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"subspace"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}}]}}]}}]}}]},x7=eL.default.div.withConfig({displayName:"styled__FlexContainer",componentId:"sc-21269ac1-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,x9=eL.default.h1.withConfig({displayName:"styled__Header",componentId:"sc-21269ac1-1"})` + ${e1.UiTypography.lg}; + font-weight: 500; + padding: 0; + margin: 0 0 8px; + color: ${e=>e.theme.textColors.hex(10)}; +`,_e=eL.default.p.withConfig({displayName:"styled__Paragraph",componentId:"sc-21269ac1-2"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 20px; +`,_t=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-21269ac1-3"})` + display: block; + width: 100%; + cursor: pointer; + margin-top: 30px; + padding: 14px 0; + + border-radius: 12px; + font-weight: 500; + font-size: 16px; + letter-spacing: 0.025em; + text-transform: uppercase; + cursor: pointer; + color: #fff; + border: 0; + + background: ${e=>e.theme?.primaryColorScheme.base}; + + &:hover { + background: ${e=>e.theme?.primaryColorScheme.alpha90} !important; + } + + &:focus { + outline: 0; + } + + transition: background-color 100ms ease-in; +`,_a=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__Subtitle",componentId:"sc-21269ac1-4"})` + display: flex; + color: ${e=>e.theme.textColors.hex("50")}; + padding: 0 0 10px; +`,_n=function(e){let{exit:t,spaceId:a}=e,[n,l]=ev.useState(null),[r,o]=ev.useState(null),{error:i,loading:s,moveFolderMutation:d,workspacesTree:c}=function(){let{data:e,error:t,loading:a}=(0,eB.a)(x6),n=(0,cs.D)(x8),l=[];return(e?.me?.memberships!=null&&(l=e?.me?.memberships.filter(e=>null!=e)),a)?{workspacesTree:null,error:null,loading:a,moveFolderMutation:n}:t?{workspacesTree:null,error:t,loading:a,moveFolderMutation:n}:null==l?{workspacesTree:null,error:null,loading:a,moveFolderMutation:n}:{workspacesTree:pI(l),error:t,loading:a,moveFolderMutation:n}}(),m=d[0],u=async e=>{let n=(0,ld.Z)();if(null!=e)try{await m({variables:{input:{clientMutationId:n,subspaceId:a,workspaceId:e.id}},update:(e,t)=>{let{data:a,errors:n}=t;null==n&&null!=a&&a.subspaceMove?.subspace!=null&&(e.evict({id:e.identify(a.subspaceMove?.subspace)}),e.gc())},refetchQueries:[{query:x1,variables:{workspaceId:e.id}}]}),l(null),t()}catch(e){e instanceof ea.cA&&(null!=e.graphQLErrors&&o(e.graphQLErrors.map(e=>e.message).filter(e=>null!=e&&""!==e.trim())),l(null))}};return s?ev.createElement(x7,null,ev.createElement(eI.Spinner,{width:400})):i?ev.createElement(x7,null,ev.createElement("p",null,ev.createElement(eY.Z,{id:"general.spaces.fetch_error",defaultMessage:"There was an error loading your spaces. Please try again."}))):null!=r?ev.createElement(x7,null,r.map((e,t)=>ev.createElement("p",{key:`error-${t}`},e))):null==c?ev.createElement(x7,null,ev.createElement(x9,null,ev.createElement(eY.Z,{id:"general.workspace_required",defaultMessage:"Workspace Required"})),ev.createElement(_e,null,ev.createElement(eY.Z,{id:"general.spaces.at_least_one_workspace_to_move_folder",defaultMessage:"You must have at least one workspace with move folder permission."})),ev.createElement(_t,{onClick:()=>{o(null),t()}},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"}))):ev.createElement(x7,null,ev.createElement(x9,null,ev.createElement(eY.Z,{id:"general.move_folder.header",defaultMessage:"Move Folder"})),ev.createElement(_e,null,ev.createElement(eY.Z,{id:"general.move_folder.description",defaultMessage:"Choose a workspace to move this folder."})," ",ev.createElement(eY.Z,{id:"general.move_folder.access_description",defaultMessage:"People in the folder will be kept and will have access to the folder."})),ev.createElement(_a,null,ev.createElement(eY.Z,{id:"general.move_to",defaultMessage:"Move To"})),ev.createElement(p3,{onSelect:e=>{l(e)},workspacesTree:c}),ev.createElement(x4,{selectedWorkspace:n,onConfirm:u,onToggle:()=>{l(null)}}))},_l=(0,d9.oM)({name:"dialogs.moveFolder",initialState:{isOpen:!1},reducers:{toggleMoveFolderDialog:(e,t)=>e.isOpen?{isOpen:!1}:null==t.payload?e:{isOpen:!0,spaceId:t.payload}}}),_r=(0,e$.connect)(function(e){return e.dialogs.moveFolder})(function(e){let{isOpen:t,spaceId:a}=e,n=(0,e$.useDispatch)(),l=(0,ev.useCallback)(()=>{null!=a&&n(_l.actions.toggleMoveFolderDialog(a))},[n,a]);return t&&null!=a?ev.createElement(eI.ModalDialog,{isOpen:t,close:l},e=>{let{exit:t}=e;return ev.createElement(_n,{exit:t,spaceId:a})}):null}),_o=eL.default.div.withConfig({displayName:"styled__FlexContainer",componentId:"sc-f0b2b565-0"})` + width: 540px; + position: relative; + min-height: 300px; + max-height: 70vh; + overflow: auto; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 12px; + ${tM}; +`,_i=function(e){let{calendarState:t}=e;return ev.createElement(_o,null,ev.createElement(lQ,{showHeader:!1,calendarState:t}))},_s=(0,e$.connect)(function(e){return e.dialogs.quickAdd})(function(e){let{isOpen:t,calendarState:a}=e,n=(0,e$.useDispatch)(),l=ev.useCallback(()=>{n(uO.actions.toggleQuickAddDialog())},[n]);return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:l,autofocus:!1},e=>{let{exit:t}=e;return ev.createElement(_i,{exit:t,calendarState:a})}):null}),_d="@@taskade/dialogs/TOGGLE_SHORTCUTS_MODAL_DIALOG";function _c(){return{type:_d,payload:{}}}let _m=function(){let[e,t]=ev.useState(!1),a=(0,ev.useRef)(null),n=(0,ev.useRef)(null),l=(0,ev.useRef)(null),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:e});return ev.createElement(e1.Shortcut.Key,{...i,onMouseEnter:()=>{t(!0)},onMouseLeave:()=>{t(!1)}},eI.ModifierKeys.ModSymbol,e&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},eI.ModifierKeys.Mod))},_u=function(){let e=(0,eK.Z)(),t=[{hasIndentArrow:!1,name:e.formatMessage({id:"general.open_add_ons_menu",defaultMessage:"Open Add-ons Menu"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"/"))},{hasIndentArrow:!0,name:e.formatMessage({id:"general.due_date",defaultMessage:"Due Date"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"D")},{hasIndentArrow:!0,name:e.formatMessage({id:"general.assign",defaultMessage:"Assign"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"A")},{hasIndentArrow:!0,name:e.formatMessage({id:"general.comment",defaultMessage:"Comment"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"C")},{hasIndentArrow:!0,name:e.formatMessage({id:"general.upload_or_attach_file",defaultMessage:"Upload/Attach File"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"F")},{hasIndentArrow:!0,name:e.formatMessage({id:"general.embed",defaultMessage:"Embed"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"E")},{hasIndentArrow:!0,name:e.formatMessage({id:"general.timer",defaultMessage:"Timer"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"T")},{hasIndentArrow:!0,name:e.formatMessage({id:"general.reaction",defaultMessage:"Reaction"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"R")}];return ev.createElement(ev.Fragment,null,t.map((e,t)=>ev.createElement("div",{className:"flex items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300",key:t},ev.createElement("div",{className:"flex gap-2"},e.hasIndentArrow&&ev.createElement("span",{className:"text-appcolor-500"},"⤷"),e.name),ev.createElement("div",{className:"ml-auto flex items-center"},e.shortcuts))))},_p=function(){let e=(0,eK.Z)(),t=[{name:e.formatMessage({id:"ai.taskade_ai",defaultMessage:"Taskade AI"}),shortcut:"/ai",description:e.formatMessage({id:"ai.desc.taskade_ai",defaultMessage:"Unlock the full potential of Taskade AI for enhanced productivity and efficiency."})},{name:e.formatMessage({id:"ai.custom_ai_agents",defaultMessage:"Custom AI Agents"}),shortcut:"/agents",description:e.formatMessage({id:"ai.desc.custom_ai_agents",defaultMessage:"Create and train your own custom AI agents to automate tasks and enhance productivity with your own custom AI prompts, commands, and more. Build your AI workforce today."})},{name:e.formatMessage({id:"ai.ai_assistant",defaultMessage:"AI Assistant"}),shortcut:"/assistant",description:e.formatMessage({id:"ai.desc.ai_assistant",defaultMessage:"Access the AI Assistant to harness various AI tools and streamline your workflow."})},{name:e.formatMessage({id:"ai.insert_replace_regenerate",defaultMessage:"Insert, Replace, Regenerate"}),shortcut:"Various Keys",description:e.formatMessage({id:"ai.desc.insert_replace_regenerate",defaultMessage:"After generating output with the AI assistant, you have several options: Click Insert or press Enter to add the generated text to your project. Click Replace or press Shift + Enter to overwrite the selected text. Click Regenerate or press R + Enter to prompt the AI to create a different version."})},{name:e.formatMessage({id:"ai.ai_multiselect",defaultMessage:"AI Multi-Select"}),shortcut:"Mouse + Toolbar",description:e.formatMessage({id:"ai.desc.ai_multiselect",defaultMessage:"With AI Multi-Select, you can efficiently select multiple tasks or notes by clicking and dragging your mouse. This action activates the AI Assistant toolbar, allowing you to apply AI-powered actions like summarizing or prioritizing to your selected items."})},{name:e.formatMessage({id:"ai.ai_reprompting",defaultMessage:"AI Reprompting"}),shortcut:"Various Options",description:e.formatMessage({id:"ai.desc.ai_reprompting",defaultMessage:"AI Reprompting enables you to modify the AI-generated output in various ways. You can choose to continue writing to add more content, make the text longer for more detailed information, or reprompt by typing follow-up prompts for further exploration or different perspectives."})},{name:e.formatMessage({id:"ai.custom_commands_multiselect",defaultMessage:"Custom AI Agent Commands"}),shortcut:"AI Agent Button",description:e.formatMessage({id:"ai.desc.custom_commands_multiselect",defaultMessage:"Apply your predefined Custom AI Agent commands to single or multiple tasks or paragraphs. Create your custom commands or use available templates, select multiple tasks or paragraphs, and apply the command directly from the AI Agent button in the toolbar for efficient content management. For individual tasks, simply use the Add-Ons Menu."})},{name:e.formatMessage({id:"ai.choose_language",defaultMessage:"Choose Language for AI Responses"}),shortcut:"Prompt/Context",description:e.formatMessage({id:"ai.desc.choose_language",defaultMessage:'Taskade AI can respond in the language of your prompt or context. You can specify the language directly in your prompt (e.g., "Respond in Spanish") or provide context in the desired language. This feature enables seamless interaction with AI in multiple languages, catering to a global user base.'})},{name:e.formatMessage({id:"ai.subtask",defaultMessage:"Subtask"}),shortcut:"/subtask",description:e.formatMessage({id:"ai.desc.subtask",defaultMessage:"Generate subtasks for a parent task."})},{name:e.formatMessage({id:"ai.brainstorm",defaultMessage:"Brainstorm"}),shortcut:"/brainstorm",description:e.formatMessage({id:"ai.desc.brainstorm",defaultMessage:"Discover and explore new, exciting ideas."})},{name:e.formatMessage({id:"ai.outline",defaultMessage:"Outline"}),shortcut:"/outline",description:e.formatMessage({id:"ai.desc.outline",defaultMessage:"Structure and organize your document."})},{name:e.formatMessage({id:"ai.expand",defaultMessage:"Expand"}),shortcut:"/expand",description:e.formatMessage({id:"ai.desc.expand",defaultMessage:"Expand and enrich your content to be more descriptive."})},{name:e.formatMessage({id:"ai.rewrite",defaultMessage:"Rewrite"}),shortcut:"/rewrite",description:e.formatMessage({id:"ai.desc.rewrite",defaultMessage:"Improve the legibility and clarity of your writing."})},{name:e.formatMessage({id:"ai.summarize",defaultMessage:"Summarize"}),shortcut:"/summarize",description:e.formatMessage({id:"ai.desc.summarize",defaultMessage:"Turn long content into a quick summary."})},{name:e.formatMessage({id:"ai.ask",defaultMessage:"Ask"}),shortcut:"/ask",description:e.formatMessage({id:"ai.desc.ask",defaultMessage:"Answer questions based on AI's existing knowledge."})},{name:e.formatMessage({id:"ai.translate",defaultMessage:"Translate"}),shortcut:"/translate",description:e.formatMessage({id:"ai.desc.translate",defaultMessage:"Translate text into one of the available languages."})},{name:e.formatMessage({id:"ai.prioritize",defaultMessage:"Prioritize"}),shortcut:"/prioritize",description:e.formatMessage({id:"ai.desc.prioritize",defaultMessage:"Prioritize tasks based on their importance."})},{name:e.formatMessage({id:"ai.research_agent",defaultMessage:"Research Agent"}),shortcut:"/research",description:e.formatMessage({id:"ai.desc.research_agent",defaultMessage:"Search the web to find more information about a topic."})},{name:e.formatMessage({id:"ai.seo_agent",defaultMessage:"SEO Agent"}),shortcut:"/seo",description:e.formatMessage({id:"ai.desc.seo_agent",defaultMessage:"Fetch top 10 Google Search results for given keywords."})},{name:e.formatMessage({id:"ai.roundtable_agent",defaultMessage:"Roundtable Agent"}),shortcut:"/roundtable",description:e.formatMessage({id:"ai.desc.roundtable_agent",defaultMessage:"Draw expert insights from a team of AI agents."})},{name:e.formatMessage({id:"ai.fix_spelling_grammar",defaultMessage:"Fix Spelling and Grammar"}),shortcut:"/fix",description:e.formatMessage({id:"ai.desc.fix_spelling_grammar",defaultMessage:"Improve the structure and flow of documents."})},{name:e.formatMessage({id:"ai.ai_prompt_templates",defaultMessage:"AI Prompt Templates"}),shortcut:"/prompt_templates",description:e.formatMessage({id:"ai.desc.ai_prompt_templates",defaultMessage:"Access the AI Prompt Templates Library to generate content from various places in Taskade."})}];return ev.createElement(ev.Fragment,null,t.map((e,t)=>ev.createElement("button",{key:t,className:"accordion flex flex-col text-left"},ev.createElement("div",{className:"flex w-full cursor-pointer items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300"},ev.createElement("div",{className:"flex-grow"},e.name),ev.createElement("div",{className:"ml-auto flex items-center"},ev.createElement(e1.Shortcut.Key,null,e.shortcut))),ev.createElement("div",{className:"child hidden cursor-text whitespace-normal px-3 py-2 text-sm text-appcolor-500"},e.description))))},_g=function(){let[e,t]=ev.useState(!1),a=(0,ev.useRef)(null),n=(0,ev.useRef)(null),l=(0,ev.useRef)(null),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:e});return ev.createElement(e1.Shortcut.Key,{...i,onMouseEnter:()=>{t(!0)},onMouseLeave:()=>{t(!1)}},"⇧",e&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},"Shift"))},_f=function(){let e=(0,eK.Z)(),t=[{name:e.formatMessage({id:"general.new_task",defaultMessage:"New Task"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"↵ Enter")},{name:e.formatMessage({id:"general.indent_task",defaultMessage:"Indent Task"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"⇥ tab")},{name:e.formatMessage({id:"general.outdent_task",defaultMessage:"Outdent Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"⇥ tab"))},{name:e.formatMessage({id:"general.complete_or_uncomplete_task",defaultMessage:"Complete/Uncomplete Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"↵ Enter"))},{name:e.formatMessage({id:"general.delete_task",defaultMessage:"Delete Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"del"))},{name:e.formatMessage({id:"general.fold_task",defaultMessage:"Fold Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"↑"))},{name:e.formatMessage({id:"general.unfold_task",defaultMessage:"Unfold Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"↓"))},{name:e.formatMessage({id:"general.mention",defaultMessage:"Mention"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"@")},{name:e.formatMessage({id:"general.tag",defaultMessage:"Tag"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"#")},{name:e.formatMessage({id:"general.navigate_up_down",defaultMessage:"Navigate Up/Down"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(e1.Shortcut.Key,null,"↑"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.or",defaultMessage:"or"})),ev.createElement(e1.Shortcut.Key,null,"↓"))},{name:e.formatMessage({id:"general.navigate_left_right",defaultMessage:"Navigate Left/Right"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(e1.Shortcut.Key,null,"←"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.or",defaultMessage:"or"})),ev.createElement(e1.Shortcut.Key,null,"→"))},{name:e.formatMessage({id:"general.duplicate",defaultMessage:"Duplicate"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"D"))},{name:e.formatMessage({id:"general.undo",defaultMessage:"Undo"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"Z"))},{name:e.formatMessage({id:"general.redo",defaultMessage:"Redo"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"Z"))},{name:e.formatMessage({id:"general.move_tasks",defaultMessage:"Move Tasks Up/Down"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"↑"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and",defaultMessage:"and"})),ev.createElement(e1.Shortcut.Key,null,"↓"))}];return ev.createElement(ev.Fragment,null,t.map((e,t)=>ev.createElement("div",{className:"flex items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300",key:t},e.name,ev.createElement("div",{className:"ml-auto flex items-center"},e.shortcuts))))},_h=function(){let e=(0,eK.Z)(),t=[{name:e.formatMessage({id:"general.jump_projects",defaultMessage:"Jump Projects"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"K"))},{name:e.formatMessage({id:"general.search_project",defaultMessage:"Search In Project"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"F"))},{name:e.formatMessage({id:"general.complete_or_uncomplete_task",defaultMessage:"Complete/Uncomplete Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"↵ Enter"))},{name:e.formatMessage({id:"general.indent_task",defaultMessage:"Indent Task"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"⇥ tab")},{name:e.formatMessage({id:"general.outdent_task",defaultMessage:"Outdent Task"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"⇥ tab"))},{name:e.formatMessage({id:"general.toggle_chat",defaultMessage:"Toggle Chat Box"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"\\"))},{name:e.formatMessage({id:"general.toggle_sidebar",defaultMessage:"Toggle Sidebar"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"."))},{name:e.formatMessage({id:"general.open_add_ons_menu",defaultMessage:"Open Add-ons Menu"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"/"))},{name:e.formatMessage({id:"general.open_slash_command_menu",defaultMessage:"Open Slash Command Menu"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"/")},{name:e.formatMessage({id:"general.open_format_menu",defaultMessage:"Open Format Menu"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,"’"))},{name:e.formatMessage({id:"general.next_or_previous_view",defaultMessage:"Next/Previous View"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,">"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and",defaultMessage:"and"})),ev.createElement(e1.Shortcut.Key,null,"<"))},{name:e.formatMessage({id:"general.next_or_previous_tab",defaultMessage:"Next/Previous Tab"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_m,null),ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"]"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and",defaultMessage:"and"})),ev.createElement(e1.Shortcut.Key,null,"["))}];return ev.createElement(ev.Fragment,null,t.map((e,t)=>ev.createElement("div",{className:"flex items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300",key:t},e.name,ev.createElement("div",{className:"ml-auto flex items-center"},e.shortcuts))))},_y=function(){let e=(0,eK.Z)(),t=[{name:e.formatMessage({id:"general.bold",defaultMessage:"Bold"}),shortcut:"B"},{name:e.formatMessage({id:"general.italic",defaultMessage:"Italic"}),shortcut:"I"},{name:e.formatMessage({id:"general.underline",defaultMessage:"Underline"}),shortcut:"U"},{name:e.formatMessage({id:"general.strikethrough_or_complete_task",defaultMessage:"Strikethrough/Complete Task"}),shortcut:"↵ Enter"},{name:e.formatMessage({id:"general.highlight",defaultMessage:"Highlight"}),shortcut:"E"}];return ev.createElement(ev.Fragment,null,t.map((e,t)=>ev.createElement("div",{className:"flex items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300",key:t},e.name,ev.createElement("div",{className:"ml-auto flex items-center"},ev.createElement(_m,null),ev.createElement(e1.Shortcut.Key,null,e.shortcut)))))},_b=function(){let e=(0,eK.Z)(),t=[{name:e.formatMessage({id:"general.input_slash_command",defaultMessage:"Input Slash Command"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"/")},{name:e.formatMessage({id:"general.assign_myself_task",defaultMessage:"Assign Myself Task"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_assign_myself",defaultMessage:"/assign myself"}))},{name:e.formatMessage({id:"general.keyboard_shortcuts_add_comment",defaultMessage:"Add Comment"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_add_comment",defaultMessage:"/comment"}))},{name:e.formatMessage({id:"general.embed_link",defaultMessage:"Embed Link"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_embed_link",defaultMessage:"/embed"}))},{headerTitle:e.formatMessage({id:"general.set_due_date",defaultMessage:"Set Due Date To"}),name:e.formatMessage({id:"general.today",defaultMessage:"Today"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_today_due_date",defaultMessage:"/today"}))},{name:e.formatMessage({id:"general.date_tomorrow",defaultMessage:"Tomorrow"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_tomorrow_due_date",defaultMessage:"/tomorrow"}))},{name:e.formatMessage({id:"general.next_week",defaultMessage:"Next Week"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_next_week_due_date",defaultMessage:"/next week"}))},{name:e.formatMessage({id:"general.today_9am",defaultMessage:"Today 9am"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_today_9am_due_date",defaultMessage:"/today 9am"}))},{name:e.formatMessage({id:"general.tomorrow_9am",defaultMessage:"Tomorrow 9am"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_tomorrow_9am_due_date",defaultMessage:"/tomorrow 9am"})),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.or",defaultMessage:"or"})),ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_tmr_9am_due_date",defaultMessage:"/tmr 9am"})))},{headerTitle:e.formatMessage({id:"general.upload",defaultMessage:"Upload"}),icon:"dd_file",name:e.formatMessage({id:"general.computer",defaultMessage:"Computer"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_computer",defaultMessage:"/computer"}))},{icon:"dd_upload_google_drive",name:e.formatMessage({id:"general.cloud_upload_googledrive",defaultMessage:"Google Drive"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_google_drive",defaultMessage:"/google drive"}))},{icon:"dd_upload_dropbox",name:e.formatMessage({id:"general.cloud_upload_dropbox",defaultMessage:"Dropbox"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_dropbox",defaultMessage:"/dropbox"}))},{icon:"dd_upload_instagram",name:e.formatMessage({id:"general.cloud_upload_instagram",defaultMessage:"Instagram"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_instagram",defaultMessage:"/instagram"}))},{icon:"dd_upload_box",name:e.formatMessage({id:"general.cloud_upload_box",defaultMessage:"Box"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_box",defaultMessage:"/box"}))},{headerTitle:e.formatMessage({id:"general.turn_to",defaultMessage:"Turn To"}),icon:"dd_format_paragraph",name:e.formatMessage({id:"general.paragraph",defaultMessage:"Paragraph"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_paragraph",defaultMessage:"/paragraph"}))},{icon:"dd_format_check1",name:e.formatMessage({id:"general.square_checklist",defaultMessage:"Check 1"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_check1",defaultMessage:"/check 1"}))},{icon:"dd_format_check2",name:e.formatMessage({id:"general.circle_checklist",defaultMessage:"Check 2"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_check2",defaultMessage:"/check 2"}))},{icon:"dd_format_check3",name:e.formatMessage({id:"general.heart_checklist",defaultMessage:"Check 3"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_check3",defaultMessage:"/check 3"}))},{icon:"dd_format_bullet1",name:e.formatMessage({id:"general.circle_bulletlist",defaultMessage:"Bullet 1"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_bullet1",defaultMessage:"/bullet 1"}))},{icon:"dd_format_bullet2",name:e.formatMessage({id:"general.triangle_bulletlist",defaultMessage:"Bullet 2"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_bullet2",defaultMessage:"/bullet 2"}))},{icon:"dd_format_bullet3",name:e.formatMessage({id:"general.square_bulletlist",defaultMessage:"Bullet 3"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_bullet3",defaultMessage:"/bullet 3"}))},{icon:"dd_format_number",name:e.formatMessage({id:"general.number_orderedlist",defaultMessage:"Number"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_number",defaultMessage:"/number"}))},{icon:"dd_format_order",name:e.formatMessage({id:"general.alpha_orderedlist",defaultMessage:"Letter"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_letter",defaultMessage:"/letter"}))},{headerTitle:e.formatMessage({id:"general.highlight",defaultMessage:"Highlight"}),highlightColor:"#FFF59E",name:e.formatMessage({id:"general.keyboard_shortcuts_highlight_yellow",defaultMessage:"Yellow"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_highlight_yellow",defaultMessage:"/highlight yellow"}))},{highlightColor:"#E9F5A3",name:e.formatMessage({id:"general.keyboard_shortcuts_highlight_green",defaultMessage:"Green"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_highlight_green",defaultMessage:"/highlight green"}))},{highlightColor:"#9FD7F9",name:e.formatMessage({id:"general.keyboard_shortcuts_highlight_blue",defaultMessage:"Blue"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_highlight_blue",defaultMessage:"/highlight blue"}))},{highlightColor:"#B5A9EF",name:e.formatMessage({id:"general.keyboard_shortcuts_highlight_purple",defaultMessage:"Purple"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_highlight_purple",defaultMessage:"/highlight purple"}))},{highlightColor:"#FB9DB1",name:e.formatMessage({id:"general.keyboard_shortcuts_highlight_red",defaultMessage:"Red"}),shortcuts:ev.createElement("div",{className:"text-appcolor-500"},ev.createElement(eY.Z,{id:"general.slash_commands_highlight_red",defaultMessage:"/highlight red"}))}];return ev.createElement("div",{className:"flex flex-col"},t.map((e,t)=>ev.createElement("div",{className:"flex flex-col items-center",key:t},e.headerTitle&&ev.createElement(e1.Overline,{className:"mb-2 mt-4 flex w-fit w-full cursor-pointer justify-start rounded-xl pl-3"},e.headerTitle),ev.createElement("div",{className:"flex w-full items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300"},e.icon&&ev.createElement("div",{className:"flex gap-3"},ev.createElement(tn.Icon,{className:"scale-80",icon:e.icon}),e.name),e.highlightColor&&ev.createElement("div",{className:"flex items-center gap-3"},ev.createElement("div",{className:"flex h-4 w-4 border-b-2 border-solid border-appcolor-500"},ev.createElement(tn.Icon,{icon:"dd_highlight"})),e.name),!e.icon&&!e.highlightColor&&e.name,ev.createElement("div",{className:"ml-auto flex items-center"},e.shortcuts)))))},_v=function(){let e=(0,eK.Z)(),[t,a]=(0,ev.useState)(0),n=[{name:e.formatMessage({id:"ai.taskade_ai",defaultMessage:"Meet Taskade AI"}),description:e.formatMessage({id:"ai.desc.meet_taskade_ai",defaultMessage:"Discover how Taskade AI can revolutionize your workflow and enhance team collaboration."}),videoUrl:"https://www.youtube-nocookie.com/embed/9kAoOotszug?rel=0&controls=1"},{name:e.formatMessage({id:"ai.customize_ai",defaultMessage:"Customize AI Agents"}),description:e.formatMessage({id:"ai.desc.customize_ai_agents",defaultMessage:"Tailor AI agents to fit your specific needs and preferences for a more personalized experience."}),videoUrl:"https://www.youtube-nocookie.com/embed/7-EOl0lW_4c?rel=0&controls=1"},{name:e.formatMessage({id:"ai.taskade_ai_chat",defaultMessage:"AI Chat and Generate Projects"}),description:e.formatMessage({id:"ai.desc.taskade_ai_chat",defaultMessage:"Streamline workflows and document analysis effortlessly. Create detailed projects and mind maps easily, and explore new insights with Media AI Chat."}),videoUrl:"https://www.youtube-nocookie.com/embed/R-l2k70K3pY?rel=0&controls=1"},{name:e.formatMessage({id:"ai.structure_hierarchy",defaultMessage:"Structure and Hierarchy"}),description:e.formatMessage({id:"ai.desc.structure_hierarchy",defaultMessage:"Learn about Taskade’s structured approach to managing projects and organizing tasks efficiently."}),videoUrl:"https://www.youtube-nocookie.com/embed/ITXyJivODnc?rel=0&controls=1"}],l=e=>{a(t===e?null:e)};return ev.createElement("div",{className:"flex h-full w-full flex-col gap-2 p-5 pb-10"},n.map((e,a)=>ev.createElement("div",{key:a,className:"w-full border-b border-solid border-appcolor-300"},ev.createElement("button",{className:"flex w-full px-3 py-2 pb-4 text-left hover:bg-appcolor-100",onClick:()=>l(a)},ev.createElement("div",{className:"flex w-full flex-col whitespace-normal"},ev.createElement("span",{className:"font-bold text-appcolor-800"},e.name),ev.createElement("span",{className:"text-sm text-appcolor-500"},e.description))),t===a&&ev.createElement("div",{className:"mb-5 mt-2 flex px-2"},ev.createElement("iframe",{key:`${a}-${t}`,className:"aspect-video w-full",src:e.videoUrl,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})))))},_k=function(){let e=(0,eK.Z)(),t=[{name:e.formatMessage({id:"general.zoom_in_or_out",defaultMessage:"Zoom In/Out"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(e1.Shortcut.Key,null,"+"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and",defaultMessage:"and"})),ev.createElement(e1.Shortcut.Key,null,"-"))},{name:e.formatMessage({id:"general.next_or_previous_view",defaultMessage:"Next/Previous View"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,">"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and",defaultMessage:"and"})),ev.createElement(e1.Shortcut.Key,null,"<"))},{name:e.formatMessage({id:"general.next_or_previous_tab",defaultMessage:"Next/Previous Tab"}),shortcuts:ev.createElement(ev.Fragment,null,ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"]"),ev.createElement("span",{className:"mx-2 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and",defaultMessage:"and"})),ev.createElement(e1.Shortcut.Key,null,"["))},{name:e.formatMessage({id:"general.toggle_chat",defaultMessage:"Toggle Chat Box"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,"\\")},{name:e.formatMessage({id:"general.toggle_sidebar",defaultMessage:"Toggle Sidebar"}),shortcuts:ev.createElement(e1.Shortcut.Key,null,".")}];return ev.createElement(ev.Fragment,null,t.map((e,t)=>ev.createElement("div",{className:"flex items-center rounded-lg px-3 py-1.5 hover:bg-appcolor-300",key:t},e.name,ev.createElement("div",{className:"ml-auto flex items-center"},ev.createElement(_m,null),e.shortcuts))))},_E=function(){let e=(0,eK.Z)(),[t,a]=ev.useState("ai"),[n,l]=ev.useState("shortcuts"),r=[{value:"ai",name:e.formatMessage({id:"general.taskade_ai",defaultMessage:"Taskade AI"}),icon:"dd_ai"},{value:"featured",name:e.formatMessage({id:"general.general",defaultMessage:"General"}),icon:"view_default"},{value:"editing",name:e.formatMessage({id:"general.editing",defaultMessage:"Editing"}),icon:"dd_edit"},{value:"formatting",name:e.formatMessage({id:"general.formatting",defaultMessage:"Formatting"}),icon:"dd_note"},{value:"add_ons",name:e.formatMessage({id:"general.add_ons_menu",defaultMessage:"Add-ons Menu"}),icon:"dd_date"},{value:"slash_commands",name:e.formatMessage({id:"general.slash_commands",defaultMessage:"Slash Commands"}),icon:"dd_slash_command"},{value:"views",name:e.formatMessage({id:"general.views",defaultMessage:"Views"}),icon:"dd_show_completed"}],o=e=>{a(e)},i=e=>{l(e)};return ev.createElement("div",{className:"flex h-full flex-col items-stretch"},ev.createElement("div",{className:"flex flex-col items-center border-b border-solid border-appcolor-300 text-sm"},ev.createElement("div",{className:"flex w-full items-center justify-between px-6 py-5 pb-2"},ev.createElement("div",{className:"text-md flex w-full items-center"},ev.createElement("span",{className:"text-lg"},ev.createElement(eY.Z,{id:"general.tips_and_tricks",defaultMessage:"Tips & Tricks"})),ev.createElement("div",{className:"ml-auto flex gap-1"},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ControlSymbol),ev.createElement(_g,null),ev.createElement(e1.Shortcut.Key,null,"/")))),ev.createElement("div",{className:"flex w-full gap-px px-5 pb-px text-appcolor-500"},ev.createElement("button",{className:og()("relative top-px flex items-center rounded-t-lg border-b border-solid border-transparent px-4 py-3 transition duration-150 ease-in-out hover:bg-appcolor-200 hover:text-appcolor-800",{"border-appcolor-600 bg-appcolor-200 font-medium text-appcolor-800":"shortcuts"===n}),onClick:()=>{i("shortcuts")}},ev.createElement(tn.Icon,{icon:"dd_shortcuts",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.keyboard_shortcuts",defaultMessage:"Keyboard shortcuts"})),ev.createElement("button",{className:og()("relative top-px flex items-center rounded-t-lg border-b border-solid border-transparent px-4 py-3 transition duration-150 ease-in-out hover:bg-appcolor-200 hover:text-appcolor-800",{"border-appcolor-600 bg-appcolor-200 font-medium text-appcolor-800":"tutorials"===n}),onClick:()=>{i("tutorials")}},ev.createElement(tn.Icon,{icon:"social_youtube",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.video_tutorials",defaultMessage:"Video tutorials"})))),ev.createElement("div",{className:"flex h-full w-full overflow-y-auto overflow-x-hidden"},"tutorials"===n?ev.createElement(_v,null):ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"w-md sticky top-0 flex shrink-0 flex-col gap-px overflow-y-auto p-4"},r.map(e=>ev.createElement("button",{key:e.value,className:og()("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm transition duration-150 ease-out hover:bg-appcolor-200 hover:ease-in",{"bg-appcolor-200":e.value===t}),onClick:()=>{o(`${e.value}`)}},ev.createElement(tn.Icon,{icon:e.icon,className:og()("scale-80",{"animate-color-rainbow":"ai"===e.value})}),ev.createElement("span",{className:og()({"text-moving-rainbow":"ai"===e.value})},e.name)))),ev.createElement("div",{className:"flex-grow flex-col"},ev.createElement("div",{className:"flex flex-col gap-2 p-4 text-sm"},"ai"===t&&ev.createElement(_p,null),"featured"===t&&ev.createElement(_h,null),"editing"===t&&ev.createElement(_f,null),"formatting"===t&&ev.createElement(_y,null),"add_ons"===t&&ev.createElement(_u,null),"slash_commands"===t&&ev.createElement(_b,null),"views"===t&&ev.createElement(_k,null))))))};function _x(e){return e?.modal?.shortcuts?.isOpen??!1}let __=function(){let e=(0,e$.useSelector)(_x),t=(0,e$.useDispatch)(),a=(0,ev.useCallback)(()=>{t(_c())},[t]),n=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),a()},[a]);return((0,ev.useEffect)(()=>(uS().bind("ctrl+shift+/",n),()=>{uS().unbind("ctrl+shift+/")}),[n]),e)?ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-3xl rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,isOpen:e,close:a,dialogBackdropValue:"second"},e=>{let{exit:t}=e;return ev.createElement(_E,{exit:t})}):null},_w=dw.z.enum(["uploadFileType"]),_N={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MyWorkspacesBillableMembersQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"actions"},value:{kind:"StringValue",value:"manage_billing",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"is_subspace"},value:{kind:"BooleanValue",value:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"billable_members"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]}}]}}]}}]},_C=function(e){let{handleClose:t,reason:a}=e,{data:n,loading:l}=(0,eB.a)(_N),r=n?.me?.memberships??[],o=eW().maxBy(r,e=>e.space?.billable_members?.totalCount??1),i=o?.space.billable_members?.totalCount??1;return l?ev.createElement(eI.Spinner,null):ev.createElement("div",{className:"flex h-full flex-col rounded-3xl bg-black dark:border dark:border-solid dark:border-appcolor-100"},ev.createElement("button",{onClick:t,className:"absolute right-5 top-4 flex h-9 w-9 items-center justify-center rounded-full bg-appcolor-900/90 text-appcolor-500 transition duration-150 ease-in-out hover:bg-appcolor-900 hover:text-white/80 dark:bg-appcolor-300 dark:hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"modal_close"})),a===_w.enum.uploadFileType&&ev.createElement("div",{className:"my-4 flex h-9 items-center justify-center gap-x-2 text-upgrade"},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement("p",{className:"text-base font-bold"},ev.createElement(eY.Z,{id:"paywall.upload_file_type",defaultMessage:"Upgrade to upload other file types."}))),ev.createElement("iframe",{src:`https://www.taskade.com/upgrade/embed?seats=${i}`,width:"100%",height:"100%",className:"border-none",allowFullScreen:!0},"Your browser does not support iframes."))},_M=(0,d9.oM)({name:"dialogs.upgradeDialog",initialState:{isOpen:!1},reducers:{toggleUpgradeDialog:(e,t)=>e.isOpen?{isOpen:!1}:null==t.payload?{isOpen:!0}:{isOpen:!0,spaceId:t.payload.spaceId,reason:t.payload.reason}}}),_S=(0,e$.connect)(function(e){return e.dialogs.upgradeDialog})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=ev.useCallback(()=>{a(_M.actions.toggleUpgradeDialog(null))},[a]);return t?ev.createElement(eI.ModalDialog,{className:"relative h-full max-h-upgrade_dialog w-4/5 max-w-6xl overflow-auto bg-black transition-transform duration-300 ease-in-out",backdropOpacity:eI.ModalDialogOpacity.Opaque,isOpen:t,close:n,autofocus:!1},t=>{let{exit:a,state:l}=t;return ev.createElement(ev.Fragment,null,ev.createElement(_C,{exit:a,state:l,handleClose:n,reason:e.reason}))}):null});var _I=a(42492);let _D=dw.z.object({code:dw.z.string().optional().nullish(),view:dw.z.string().min(1),message:dw.z.string().optional(),statusCode:dw.z.number(),statusMessage:dw.z.string().min(1)});function _T(e){return ev.useMemo(()=>{if(null==e)return;let t=_D.safeParse(e);return t.success?t.data:(uT(t.error,_I),{code:"UNKNOWN",view:"error",message:"Unknown Error",statusCode:520,statusMessage:"Unknown Error"})},[e])}function _$(e){return ec()(e,["session","siteID"])}function _P(e){return ec()(e,["session","spaceIsNew"],!1)}function _F(e){return ec()(e,["session","backendError"],null)}function _A(e){return ec()(e,["session","sideDrawerIsOpen"],!1)}function _R(e){return ec()(e,["session","firebaseNotificationPermission"],"")}var _j=a(83977),_O=a(33790);async function _U(e){if(!((0,_j.C6)().length>0)&&await (0,_O.Gb)())try{let t=(0,_j.ZF)({apiKey:"AIzaSyAc-R18K-TeG4QDZztsqo0XDGZ2m3BAUPk",authDomain:"taskade-183203.firebaseapp.com",databaseURL:"https://taskade-183203.firebaseio.com",projectId:"taskade-183203",storageBucket:"taskade-183203.appspot.com",messagingSenderId:"592361165850",appId:"1:592361165850:web:e9f9ca0ed14cf3eaf86da3"}),a=(0,_O.KL)(t);(0,_O.ps)(a,t=>{e.onMessage&&e.onMessage(t)});let n=await (0,_O.LP)(a,{vapidKey:"BJYhjiHXh_2GinuMU5uFMxL4CI24ERg1jEGVAPXEJ329OoZWc70CLo_SreJZHGTLVBESCVEMRg-NTKIAfe2J5mI"});e.onGetToken&&e.onGetToken(n)}catch(t){e.onRequestPermissionError&&e.onRequestPermissionError(t)}}let _Z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PublishDeviceTokenMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"platform"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"token"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishDeviceToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"platform"},value:{kind:"Variable",name:{kind:"Name",value:"platform"}}},{kind:"Argument",name:{kind:"Name",value:"token"},value:{kind:"Variable",name:{kind:"Name",value:"token"}}}]}]}}]},_L=eL.default.a.withConfig({displayName:"firebase-notification__ToastAnchor",componentId:"sc-d6f9a0dd-0"})` + display: flex; + flex-direction: row; + justify-items: center; + align-items: center; + padding: 10px 42px 10px 16px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,_B=eL.default.div.withConfig({displayName:"firebase-notification__Content",componentId:"sc-d6f9a0dd-1"})` + display: flex; + flex-direction: column; + word-break: break-all; +`,_z=eL.default.div.withConfig({displayName:"firebase-notification__ToastTitle",componentId:"sc-d6f9a0dd-2"})` + display: flex; + font-size: 15px; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; + word-break: break-word; +`,_V=eL.default.div.withConfig({displayName:"firebase-notification__ToastSubtitle",componentId:"sc-d6f9a0dd-3"})` + display: flex; + font-size: 15px; + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: 500; + word-break: break-word; +`,_q=eL.default.div.withConfig({displayName:"firebase-notification__ToastBody",componentId:"sc-d6f9a0dd-4"})` + display: flex; + font-size: 15px; + color: ${e=>e.theme.textColors.hex(10)}; + word-break: break-word; +`,_W=e=>{let{payload:t}=e,{notification_body:a,notification_title:n,notification_subtitle:l,notification_click_action:r}=t.data;return ev.createElement(_L,{href:r},ev.createElement(_B,null,ev.createElement(_z,null,n),null!=l&&ev.createElement(_V,null,l),ev.createElement(_q,null,a)))};_W.propTypes={payload:l7().shape({data:l7().shape({notification_body:l7().string.isRequired,notification_title:l7().string.isRequired,notification_subtitle:l7().string,notification_click_action:l7().string.isRequired}).isRequired}).isRequired};let _H=(0,e$.connect)(function(e){return{currentDocumentID:dP(e)??null,user:t7(e)}},function(e){return(0,ek.DE)({setFirebaseNotificationPermission:s_,success:l3.success},e)})(function(e){let{currentDocumentID:t,user:a,success:n,setFirebaseNotificationPermission:l}=e,[r]=(0,cs.D)(_Z),o=ev.useCallback(e=>{let t=cc()().valueOf();n({uid:`firebase-notification-${t}`,children:ev.createElement(_W,{payload:e}),position:"br",autoDismiss:!1})},[n]),i=ev.useRef({});ev.useEffect(()=>{i.current.onGetToken=e=>{e&&(r({variables:{platform:"browser",token:e}}),l("messaging/permission-granted"))}},[r,l]),ev.useEffect(()=>{i.current.onMessage=e=>{if(null==e.data)return;let{documentID:a,type:n}=e.data;switch(n){case"DOCUMENT_CHANGED":case"DOCUMENT_CHATTED":case"DOCUMENT_COMMENTED":a!==t&&o(e);break;case"DOCUMENT_CREATED":case"DOCUMENT_DUED":case"DOCUMENT_INVITE":case"DOCUMENT_ADDON_COUNTDOWN_TERMINATED":case"SPACE_JOINED":case"SPACE_MEMBER_ADDED":case"TEST_NOTIFICATION":o(e)}}},[t,o]),ev.useEffect(()=>{i.current.onRequestPermissionError=e=>{l(e.code)}},[l]);let s=a?.id;return ev.useEffect(()=>{null!=s&&_U(i.current)},[s]),null}),_G=(0,eL.createGlobalStyle)` + body { + background-color: ${e=>e.theme.appColors.hex(100)}; + height: auto; + min-height: 100%; + ${tM} + color-scheme: ${e=>e.theme.isNightMode?"dark":"inherit"}; + } + + @keyframes softdelay { + 0% { opacity: 0; } + 80% { opacity: 0; } + 100% { opacity: 1; } + } + + div[role='tooltip'] { + animation: softdelay 0.2s ease-in-out; + } + + .notification-message { + background: ${e=>e.theme.backgroundColorHex}; + border: 1px solid ${e=>e.theme.borderColorHex}; + color: ${e=>e.theme.textColors.hex("10")} + } +`,_K=(0,e$.connect)(function(e){return{backendError:_F(e),user:t7(e)}})(function(e){let{user:t}=e,a=(0,eF.TH)(),n=_T(e.backendError),l=ev.useCallback(()=>(e,t)=>{let{growl:a}=t();if(null==a)return;let{message:n,autodismiss:l}=a;n&&l>0&&(e((0,l3.success)({message:n,position:"tc",autodismiss:l,dismissible:!1})),e({type:l6,payload:{}}))},[]),r=(0,e$.useDispatch)();return ev.useEffect(()=>{r(l())},[r,l]),ev.createElement("div",{id:"app-main"},ev.createElement(_G,null),ev.createElement(_H,null),null!=n?ev.createElement(s2,{backendError:n}):e.children,ev.createElement(hx,null),ev.createElement(sd,{location:a}),ev.createElement(gD,null),ev.createElement(xW,null),ev.createElement(_r,null),ev.createElement(__,null),ev.createElement(EL,null),ev.createElement(E1,null),ev.createElement(pv,{isLoggedIn:null!=t}),ev.createElement(cB,null),ev.createElement(d5,null),ev.createElement(xt,null),ev.createElement(h$,null),ev.createElement(_s,null),ev.createElement(uC,null),ev.createElement(s8,null),ev.createElement(gU,null),ev.createElement(x0,null),ev.createElement(ci,null),ev.createElement(ct,null),ev.createElement(_S,null))}),_Y=(0,e$.connect)(function(e){return{backendError:_F(e)}})(e=>{let t=_T(e.backendError);return ev.createElement("div",{id:"app-main",className:"landing"},null!=t?ev.createElement(s2,{backendError:t}):e.children)});class _Q extends ev.Component{renderAppLayout=e=>{let{children:t}=this.props;return ev.createElement(_K,e,t)};renderLandingLayout=e=>{let{children:t}=this.props;return ev.createElement(_Y,e,t)};render(){return ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:eZ.index,render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.signIn,render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.mfaAuthenticate,render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.signUp,render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:"/forgot",render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.resetPassword,render:this.renderLandingLayout}),ev.createElement(eF.AW,{path:"/onboarding",render:this.renderLandingLayout}),ev.createElement(eF.AW,{path:"/getting-started",render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.verifyEmail,render:this.renderLandingLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.inboxNewList,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.inboxNewListFromDocumentID,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.inboxNewListWithDocumentType,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewTemplate,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewList,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewTemplateFromDocumentID,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewListFromDocumentID,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewTemplateWithDocumentType,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewListWithDocumentType,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.ssoDesktop,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.ssoMobile,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.newTemplate,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.newList,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.newTemplateFromDocumentID,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.newListFromDocumentID,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.newTemplateWithDocumentType,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.newListWithDocumentType,render:this.renderAppLayout}),ev.createElement(eF.AW,{exact:!0,path:eZ.search,render:this.renderAppLayout}),ev.createElement(eF.AW,{path:eZ.add,component:l0}),ev.createElement(eF.AW,{path:eZ.authFlowOAuth2Completing,component:l5}),ev.createElement(eF.AW,{render:this.renderAppLayout}))}}let _J=eL.default.div.withConfig({displayName:"ElectronDragRegion",componentId:"sc-886707b7-0"})` + display: block; + height: 30px; + -webkit-app-region: drag; +`,_X=(0,eL.default)(sC.rU).withConfig({displayName:"LogoLink__StyledLink",componentId:"sc-7c910da-0"})` + display: flex; + width: 100%; + height: 52px; + margin: 0px auto 20px; + justify-content: center; +`,_0=(0,eL.default)(lT.$V).withConfig({displayName:"LogoLink__Logo",componentId:"sc-7c910da-1"})` + width: 50px; + height: 50px; +`,_1=function(e){let{to:t}=e;return ev.createElement(_X,{to:t},ev.createElement(_0,null))},_2=(0,e$.connect)(function(e,t){return{headMetas:dG(e,t)}})(function(e){let{headMetas:t}=e;return eu()(e.ogTitle)||(t=gn(t,"property","og:title",e.ogTitle)),eu()(e.description)||(t=gn(t,"name","description",e.description),t=gn(t,"property","og:description",e.description)),eu()(e.fbAppID)||(t=gn(t,"property","fb:app_id",e.fbAppID)),ev.createElement(eT.ql,{meta:t},null!=e.title&&ev.createElement("title",null,e.title))}),_5=eL.default.div.withConfig({displayName:"Styled__Wrapper",componentId:"sc-351418d4-0"})` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(90)}; + min-height: 100vh; + min-height: 100dvh; +`,_3=eL.default.div.withConfig({displayName:"Styled__Container",componentId:"sc-351418d4-1"})` + display: flex; + flex-direction: column; + width: 100%; + max-width: 460px; + margin: 0 20px; +`,_4=eL.default.div.withConfig({displayName:"Styled__Body",componentId:"sc-351418d4-2"})` + display: flex; + flex-direction: column; + border: 20px; + padding: 30px 50px; + + background: ${e=>e.theme.appColors.hex(100)}; + border: 0.5px solid ${e=>e.theme.appColors.hex(70)}; + box-sizing: border-box; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border-radius: 20px; +`,_6=eL.default.div.withConfig({displayName:"Styled__Footer",componentId:"sc-351418d4-3"})` + display: flex; + flex-direction: column; +`,_8=eL.default.div.withConfig({displayName:"Styled__Heading",componentId:"sc-351418d4-4"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,_7=eL.default.h1.withConfig({displayName:"Styled__Title",componentId:"sc-351418d4-5"})` + ${e1.ArticleTypography.heading3} + color: ${e=>e.theme.appColors.hex(10)}; + margin: 0 0 2px; +`,_9=eL.default.h2.withConfig({displayName:"Styled__Subtitle",componentId:"sc-351418d4-6"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + font-weight: normal; + margin-bottom: 0; +`,we=eL.default.div.withConfig({displayName:"Styled__SSOWrapper",componentId:"sc-351418d4-7"})` + display: flex; + margin-bottom: 20px; + flex-direction: column; +`,wt=eL.default.div.withConfig({displayName:"Styled__NoAccount",componentId:"sc-351418d4-8"})` + display: flex; + ${e1.UiTypography.sm}; + margin-top: 20px; + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + justify-content: center; + padding-bottom: 20px; + + & > a { + padding: 0; + margin: 0 0 0 5px; + color: ${e=>e.theme.textColors.hex(50)}; + cursor: pointer; + border-bottom: 1px solid transparent; + + &:hover { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + &:active { + outline: 0; + } + } +`,wa=eL.default.div.withConfig({displayName:"Styled__HaveAccount",componentId:"sc-351418d4-9"})` + display: flex; + ${e1.UiTypography.sm}; + margin-top: 20px; + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + justify-content: center; + padding-bottom: 20px; + + & > a { + padding: 0; + margin: 0 0 0 5px; + color: ${e=>e.theme.textColors.hex(10)}; + cursor: pointer; + border-bottom: 1px solid transparent; + + &:hover { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + &:active { + outline: 0; + } + } +`;eL.default.button.withConfig({displayName:"Styled__SignUpWithEmail",componentId:"sc-351418d4-10"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: #ff2d60; + color: white; + margin-top: 5px; + font-weight: 500; + border: none; + cursor: pointer; + + &:hover { + color: white; + background: #ff5780; + } + + &:active { + outline: 0; + } +`;let wn=eL.default.div.withConfig({displayName:"Styled__HelpSummary",componentId:"sc-351418d4-11"})` + display: flex; + ${e1.UiTypography.md}; + background: ${e=>e.theme.isNightMode?"rgba(235, 100, 97, 0.10)":"#FAE5E5"}; + border: 1px solid ${eI.ThemeColors.danger}; + color: ${eI.ThemeColors.danger}; + padding: 0.5rem 0.75rem; + border-radius: 10px; + margin: 0 0 1.25rem; + + & ul { + margin: 0; + padding: 0.25rem 1.25rem; + } + & ul > li { + color: ${eI.ThemeColors.danger}; + margin-bottom: 0.25rem; + } +`;eL.default.a.withConfig({displayName:"Styled__ContinueSSO",componentId:"sc-351418d4-12"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 38px; + margin-top: 20px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + transition: border-color ease-in-out 200ms; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + &:active { + outline: 0; + } +`;let wl=eL.default.a.withConfig({displayName:"Styled__BackToAccountButton",componentId:"sc-351418d4-13"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(50)}; + border: 0; + cursor: pointer; + margin-top: 15px; + &:focus { + outline: 0; + } + &:hover { + color: ${e=>e.theme.textColors.hex(80)}; + background: ${e=>e.theme.appColors.hex(50)}; + } +`,wr=eL.default.div.withConfig({displayName:"Styled__VerificationText",componentId:"sc-351418d4-14"})` + color: ${e=>e.theme.textColors.hex(50)}; +`;var wo=a(69451);let wi={totp:"share_password",backup_code:"dd_note"},ws={totp:(0,te.Em)({id:"mfa.totp_label",defaultMessage:"Authenticator app"}),backup_code:(0,te.Em)({id:"mfa.backup_code_label",defaultMessage:"Backup code"})},wd={totp:(0,te.Em)({id:"mfa.totp_description",defaultMessage:"Use an authenticator app such as Google Authenticator or 1Password."}),backup_code:(0,te.Em)({id:"mfa.backup_code_description",defaultMessage:"Keep a set of recovery codes that can only be used once."})},wc=function(e){let{mfaSubset:t,onSelect:a}=e;return ev.createElement("div",{className:"flex items-center gap-x-2 rounded-lg border border-appcolor-300 px-4 py-2 hover:cursor-pointer hover:bg-appcolor-200",onClick:()=>{a(t)}},ev.createElement(tn.Icon,{icon:wi[t.method]}),t.name??ev.createElement(eY.Z,ws[t.method]))},wm=function(e){let{onItemPicked:t}=e,{data:a,isLoading:n,error:l}=(0,wo.a)({queryKey:["mfas"],async queryFn(){let e=await fetch("/mfa/list",{credentials:"same-origin",headers:{Accept:"application/json"}});return(0,ei.assert)(e.ok),await e.json()}}),r=ev.useMemo(()=>a?.data??[],[a]);return n?ev.createElement(eI.Spinner,null):null!=l?ev.createElement(ev.Fragment,null,ev.createElement("span",{className:"text-danger"},ev.createElement(eY.Z,{id:"general.generic_error_occurred",defaultMessage:"An error occurred."})),ev.createElement("a",{className:"mt-1 text-sm text-appcolor-500 underline",href:"/login"},ev.createElement(eY.Z,{id:"mfa.return_to_login_page",defaultMessage:"Return to login page"}))):ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"mb-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"mfa.label_pick_method",defaultMessage:"Pick a verification method below."})),ev.createElement("div",{className:"flex flex-col gap-y-2"},r.map(e=>ev.createElement(wc,{key:e.id,mfaSubset:e,onSelect:t}))))};var wu=a(64469);let wp=function(e){let{mfaSubset:t,onVerifySuccess:a,onTryAnotherMethodClick:n}=e,[l,r]=ev.useState(""),{mutate:o,isLoading:i,error:s}=(0,wu.D)({mutationKey:["mfaVerify",t.id],mutationFn:async e=>{let a=await fetch("/mfa/verify",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({mfaId:t.id,code:e})});if(!a.ok&&401===a.status)throw new ei.TaskadeError({code:"INCORRECT_CODE",message:"Incorrect code"});return(0,ei.assert)(a.ok),await a.json()},onSuccess(){a()}});return ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"text-sm text-appcolor-500"},"totp"===t.method&&ev.createElement(eY.Z,{id:"mfa.totp_enter_method_code_description",defaultMessage:"Enter the code from your authenticator app:"}),"backup_code"===t.method&&ev.createElement(eY.Z,{id:"mfa.backup_code_enter_method_code_description",defaultMessage:"Enter a backup code:"})),ev.createElement("input",{className:"mt-2 rounded-lg border border-appcolor-300 bg-appcolor-100 px-3 py-2 text-sm",type:"text",autoComplete:"one-time-code",value:l,onChange:e=>{r(e.target.value)},onKeyDown:e=>{e.key===eI.KeyboardKeys.Enter&&o(l)}}),null!=s&&ev.createElement(ev.Fragment,null,ev.createElement("span",{className:"text-sm text-danger"},s instanceof ei.TaskadeError&&"INCORRECT_CODE"===s.code?ev.createElement(eY.Z,{id:"mfa.incorrect_code",defaultMessage:"Incorrect code"}):ev.createElement(eY.Z,{id:"general.an_error_occurred",defaultMessage:"An error occurred"})),ev.createElement("a",{className:"mt-1 text-sm text-appcolor-500 underline",href:"/login"},ev.createElement(eY.Z,{id:"mfa.return_to_login_page",defaultMessage:"Return to login page"}))),i?ev.createElement(eI.Spinner,null):ev.createElement("button",{className:"text-textcolors-100 mt-3 flex items-center self-center rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase transition-colors hover:bg-primary/90",onClick:()=>{o(l)}},ev.createElement(eY.Z,{id:"mfa.totp_verify_code",defaultMessage:"Verify Code"})),ev.createElement("button",{className:"mt-4 text-sm text-textcolor-500 underline hover:text-textcolor-600",onClick:n},ev.createElement(eY.Z,{id:"mfa.try_another_method",defaultMessage:"Try another method"})))},wg=(0,lb.C)({initial:"idle",schema:{context:{},events:{},services:{}},tsTypes:{},states:{idle:{on:{PICK_MFA:{target:"mfaSelected",actions:(0,lv.assign)({mfaSubset:(e,t)=>t.mfaSubset})}}},mfaSelected:{on:{TRY_ANOTHER_METHOD:{target:"idle"},VERIFY_SUCCESS:{target:"finished"}}},finished:{type:"final",invoke:{src:"continueLogin"}}}}),wf=function(){let e=(0,eF.k6)(),t=ev.useCallback(async()=>{let t=new URLSearchParams(e.location.search).get("redirect");null==t?e.push("/"):window.location.href=`https://www.taskade.com${t}`},[e]),[a,n]=(0,ls.e)(wg,{services:{continueLogin:t}}),l=ev.useCallback(e=>{n({type:"PICK_MFA",mfaSubset:e})},[n]),r=ev.useCallback(()=>{n({type:"VERIFY_SUCCESS"})},[n]),o=ev.useCallback(()=>{n({type:"TRY_ANOTHER_METHOD"})},[n]);return ev.createElement(_5,null,ev.createElement(_2,{title:"Multi-Factor Authentication - Taskade",ogTitle:"Join Taskade"}),ev.createElement(_J,null),ev.createElement(_3,null,ev.createElement(_4,null,ev.createElement(_1,{to:"/"}),ev.createElement(_8,null,ev.createElement(_7,null,"Multi-Factor Authentication"),ev.createElement(_9,null,"Welcome back to Taskade \uD83D\uDC4B")),a.matches("idle")&&ev.createElement(wm,{onItemPicked:l}),a.matches("mfaSelected")&&ev.createElement(wp,{mfaSubset:a.context.mfaSubset,onVerifySuccess:r,onTryAnotherMethodClick:o}))))},wh=eL.default.button.withConfig({displayName:"reset-password-form__SubmitButton",componentId:"sc-9bcec476-0"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + border-radius: 10px; + background: #ff2d60; + color: #ffffff; + border: 0; + cursor: pointer; + margin-top: 15px; + + &:focus { + outline: 0; + } + + &:hover { + background: #ff5780; + } +`,wy=e=>ev.createElement(r$.l0,{onSubmit:(t,a,n)=>{let{password:l}=t;!l||l.length<6?n({password:["Password must be at least 6 characters."]}):e.handleSubmit(t,a,n)},initialValues:e.initialValues,render:e=>{let{handleSubmit:t,submitError:a,submitting:n}=e;return ev.createElement("form",{onSubmit:t,action:"/reset",method:"post",noValidate:!0,autoComplete:"no"},!n&&a&&ev.createElement(rO,{padding:"10px",margin:"0 0 10px",role:"alert"},a),ev.createElement(r$.gN,{component:o_,tag:ou,name:"path",type:"hidden",submitting:n,disabled:n}),ev.createElement(r$.gN,{component:o_,tag:ou,type:"password",id:"password",name:"password",label:"New Password",placeholder:"New Password",required:!0,submitting:n,disabled:n}),ev.createElement(wh,{type:"submit",disabled:n},n&&ev.createElement(eI.Spinner,null),!n&&"Reset Password"))}});wy.propTypes={handleSubmit:l7().func.isRequired,initialValues:l7().shape()},wy.defaultProps={initialValues:{}};let wb=function(e){let{children:t,image:a,title:n,url:l}=e,r=e.description??"Taskade is the unified workspace for you and your team. Get work done faster and smarter with structured task lists, outline notes, kanban boards, and mind maps.",o=e.type??"website";return ev.createElement(eT.ql,null,l&&ev.createElement("link",{ref:"canonical",href:l}),ev.createElement("meta",{name:"apple-itunes-app",content:"app-id=1264713923"}),r&&ev.createElement("meta",{name:"description",content:r}),ev.createElement("meta",{name:"google-play-app",content:"app-id=com.taskade.mobile"}),ev.createElement("meta",{property:"fb:app_id",content:"120910341911924"}),ev.createElement("meta",{name:"keywords",content:"notes, notepad, collaboration, outline, brainstorming, bullet journal, checklist, task list, todo list, mindmap, list maker, text editor"}),n&&ev.createElement("meta",{property:"og:title",content:n}),r&&ev.createElement("meta",{property:"og:description",content:r}),a&&ev.createElement("meta",{property:"og:image",content:a}),ev.createElement("meta",{property:"og:site_name",content:"Taskade"}),ev.createElement("meta",{property:"og:type",content:o}),l&&ev.createElement("meta",{property:"og:url",content:l}),ev.createElement("meta",{property:"twitter:card",content:"summary_large_image"}),r&&ev.createElement("meta",{property:"twitter:description",content:r}),ev.createElement("meta",{property:"twitter:site",content:"@taskade"}),a&&ev.createElement("meta",{property:"twitter:image",content:a}),n&&ev.createElement("meta",{property:"twitter:title",content:n}),t)},wv=function(){let e=(0,e$.useDispatch)(),t=(0,eF.TH)().pathname;return ev.createElement(_5,null,ev.createElement(wb,{title:"Reset Password - Taskade"},ev.createElement("meta",{name:"referrer",content:"no-referrer"})),ev.createElement(_J,null),ev.createElement(_3,null,ev.createElement(_4,null,ev.createElement(_1,{to:"/"}),ev.createElement(_8,null,ev.createElement(_7,null,"Reset Password"),ev.createElement(_9,null,"Enter your new password below.")),ev.createElement(wy,{initialValues:{path:t},handleSubmit:(t,a,n)=>{e({type:re,payload:{values:t,form:a,callback:n}})}}))))},wk=eL.default.div.withConfig({displayName:"sso__Wrapper",componentId:"sc-f032d7bf-0"})``,wE=eL.default.div.withConfig({displayName:"sso__Container",componentId:"sc-f032d7bf-1"})``,wx=eL.default.a.withConfig({displayName:"sso__AppleSSO",componentId:"sc-f032d7bf-2"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: black; + color: white; + margin-top: 5px; + ${e1.UiTypography.sm}; + + &:hover { + color: white; + } +`,w_=(0,eL.default)(lT.B0).withConfig({displayName:"sso__AppleIconStyled",componentId:"sc-f032d7bf-3"})` + margin-right: 4px; + transform: var(--menu-item-icon-scale); +`,ww=eL.default.a.withConfig({displayName:"sso__GoogleSSO",componentId:"sc-f032d7bf-4"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + transition: border-color ease-in-out 200ms; + margin-bottom: 4px; + ${e1.UiTypography.sm}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,wN=(0,eL.default)(sC.rU).withConfig({displayName:"sso__SamlSso",componentId:"sc-f032d7bf-5"})` + display: flex; + width: 100%; + margin-top: 4px; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 50px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + transition: border-color ease-in-out 200ms; + margin-bottom: 4px; + ${e1.UiTypography.sm}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,wC=(0,eL.default)(lT.vl).withConfig({displayName:"sso__GoogleIconStyled",componentId:"sc-f032d7bf-6"})` + transform: var(--menu-item-icon-scale); +`,wM=function(e){let{initialValues:t,googleText:a,samlText:n,appleText:l}=e,r=t?.redirect??null,o=t?.referral??null,i=oz({redirect:r,referral:o,list:t?.list??null,timezone:t?.timezone??null,copyAsTemplate:t?.copyAsTemplate??null});return ev.createElement(wk,null,ev.createElement(wE,null,ev.createElement(ww,{rel:"noopener noreferrer",target:"_blank",href:`/auth/google${i}`},ev.createElement(wC,null),a)),ev.createElement(wx,{rel:"noopener noreferrer",target:"_blank",href:`/auth/apple${i}`},ev.createElement(w_,null),l),ev.createElement(wN,{to:`/saml/sso${i}`},n))},wS="GROWL_SIGN_IN_INVITE_SPACE",wI="GROWL_SIGN_UP_INVITE_SPACE",wD="GROWL_EMAIL_VERIFIED",wT="GROWL_EMAIL_VERIFICATION_TOKEN_EXPIRED";function w$(e){return e.growl??null}let wP=(0,tB.P1)([w$],e=>null==e?null:0===e.autodismiss&&(e.type===wS||e.type===wI)?e:null),wF=(0,tB.P1)([w$],e=>null==e?null:0===e.autodismiss&&(e.type===wS||e.type===wI||e.type===wT||e.type===wD)?e:null);class wA extends ev.Component{static propTypes={clearAccountsErrors:l7().func.isRequired,growlState:l7().shape({type:l7().string,autodismiss:l7().number,data:l7().shape(),message:l7().string}),initialValues:l7().shape({list:l7().string,redirect:l7().string}).isRequired,ssoErrors:l7().arrayOf(l7().string).isRequired,submitSignInForm:l7().func.isRequired,user:l7().shape()};static defaultProps={growlState:null,user:null};constructor(e){super(e),this.state={timezone:null}}componentDidMount(){this.setState({timezone:eG().tz.guess()||""})}componentWillUnmount(){let{clearAccountsErrors:e,ssoErrors:t}=this.props;ts()(t)||e()}getOgTitle(){let{growlState:e}=this.props,t=ec()(e,["data","space"],null);return eu()(t)?"Join Taskade":`You've been invited to join ${t} on Taskade`}getTitle(){let{user:e}=this.props;return!eu()(e)&&this.hasEmailVerificationMessage()?"Email Verified - Taskade":"Login - Taskade"}hasEmailVerificationMessage=()=>{let{growlState:e}=this.props;if(e){let{message:t,type:a}=e;return t&&(a===wD||a===wT)}return!1};handleSubmit=(e,t,a)=>{this.props.submitSignInForm(e,t,a)};renderAccountErrors(){let{ssoErrors:e}=this.props;return ts()(e)?null:1===e.length?ev.createElement(wn,null,e[0]):ev.createElement(wn,null,ev.createElement("ul",null,e.map(e=>ev.createElement("li",{key:e},e))))}renderEmailAlert(){if(this.hasEmailVerificationMessage()){let{growlState:e}=this.props,{message:t}=e;return ev.createElement(wr,null,t)}return null}renderHeading(){let{growlState:e,user:t}=this.props,a=ec()(e,["data","space"],null),n=ec()(e,["data","referrer"],null),l=n?` by ${n}`:"";return e&&a?ev.createElement(_8,null,ev.createElement(_7,null,`You've been invited to join ${a}${l}`),ev.createElement(_9,null,"Sign in to join this workspace")):t?null:ev.createElement(_8,null,ev.createElement(_7,null,"Log in"),ev.createElement(_9,null,"Welcome back to Taskade \uD83D\uDC4B"))}renderSignInOrIndexLink(){let{initialValues:e,user:t}=this.props;if(!eu()(t)&&this.hasEmailVerificationMessage())return ev.createElement("div",null,ev.createElement(wl,{className:"back-to-account",href:"/"},"Back to Account"));let{timezone:a}=this.state;return ev.createElement(ev.Fragment,null,this.renderAccountErrors(),ev.createElement(we,null,ev.createElement(wM,{initialValues:{timezone:a,...e},googleText:"Sign in with Google",appleText:"Sign in with Apple",samlText:"Sign in with Single Sign-On",otherText:" ",isSignin:!0})),ev.createElement(oZ,{handleSubmit:this.handleSubmit,initialValues:e}))}render(){let{initialValues:e,user:t}=this.props,a=this.hasEmailVerificationMessage(),n=oz({list:ec()(e,["list"],null),redirect:ec()(e,["redirect"],null)});return eu()(t)||a?ev.createElement(_5,null,ev.createElement(_2,{title:this.getTitle(),ogTitle:this.getOgTitle()}),ev.createElement(_J,null),ev.createElement(_3,null,ev.createElement(_4,null,ev.createElement(_1,{to:"/"}),this.renderEmailAlert(),this.renderHeading(),this.renderSignInOrIndexLink()),ev.createElement(_6,null,ev.createElement(wt,null,"Don't have an account?"," ",ev.createElement(sC.rU,{to:`/signup${n}`},"Sign up"))))):ev.createElement(eF.l_,{to:eZ.index})}}let wR=(0,e$.connect)(function(e,t){return{growlState:wF(e,t),initialValues:aa(e,t),ssoErrors:ae(e,t),user:t7(e,t)}},function(e){return(0,ek.DE)({clearAccountsErrors:cy,submitSignInForm:rr},e)})(wA);class wj extends ev.Component{static propTypes={growlState:l7().shape({type:l7().string,autodismiss:l7().number,data:l7().shape()}),initialValues:l7().shape({email:l7().string,list:l7().string,redirect:l7().string,referral:l7().string}).isRequired,isLanding:l7().bool,submitSignUpForm:l7().func.isRequired,user:l7().shape()};static defaultProps={growlState:null,isLanding:!1,user:null};constructor(e){super(e),this.state={timezone:null}}componentDidMount(){let{initialValues:e}=this.props,t=e?.email;null!=t&&t.length>0?this.setState({timezone:eG().tz.guess()||"",showSignUpForm:!0}):this.setState({timezone:eG().tz.guess()||"",showSignUpForm:!1})}getDescription(){return this.props.isLanding?"Taskade is a simple checklist, outliner, and notepad for your team. Work together and edit live with our online collaborative editor.":null}getHeading(){return this.props.isLanding?"Welcome to Taskade":"Sign up"}getHeadingDescription(){return this.props.isLanding?"A friendly space for your lists.":null}getOgTitle(){let{growlState:e}=this.props,t=ec()(e,["data","space"],null);return eu()(t)?this.props.isLanding?"Taskade: Checklist, Outliner, Notepad, Free Online Collaborative Editor":"Join Taskade":`You've been invited to join ${t} on Taskade`}getTitle(){return this.props.isLanding?"Taskade - Checklist, Outliner, Notepad, Free Online Live Editor":"Sign Up - Taskade"}isCopyList(){return!eu()(ec()(this.props.initialValues,["list"],null))&&"true"===ec()(this.props.initialValues,["copy"],null)}handleSubmit=(e,t,a)=>{this.props.submitSignUpForm(e,t,a)};handleShowSignUpForm=()=>{this.setState({showSignUpForm:!0})};render(){let{growlState:e,initialValues:t,user:a}=this.props,n=ec()(e,["data","space"],null),l=ec()(e,["data","referrer"],null),r=l?` by ${l}`:"";if(!eu()(a))return ev.createElement(eF.l_,{to:eZ.index});let o=oz({list:ec()(t,["list"],null),redirect:ec()(t,["redirect"],null)}),{timezone:i}=this.state,s={timezone:i,...t};return ev.createElement(_5,null,ev.createElement(_2,{title:this.getTitle(),ogTitle:this.getOgTitle(),description:this.getDescription()}),ev.createElement(_J,null),ev.createElement(_3,null,ev.createElement(_4,null,ev.createElement(_1,{to:"/",alt:"Taskade"}),e&&n&&ev.createElement(_8,null,ev.createElement(_7,null,`Sign up to get access to ${n}`),ev.createElement(_9,null,"Taskade lets you chat, organize, and get work done.")),e&&!n&&l&&ev.createElement(_8,null,ev.createElement(_7,null,`You've been invited to Taskade ${r}`),ev.createElement(_9,null,"Taskade lets you chat, organize, and get work done.")),!e&&!n&&ev.createElement(_8,null,ev.createElement(_7,null,this.isCopyList()?"Sign up":this.getHeading()),ev.createElement(_9,null,this.isCopyList()?"Sign up to copy the project":"Create your free account \uD83D\uDE0E")),this.getHeadingDescription()&&ev.createElement("p",null,this.getHeadingDescription()),ev.createElement(we,null,ev.createElement(wM,{initialValues:s,googleText:"Sign up with Google",appleText:"Sign up with Apple",samlText:"Sign up with Single Sign-On"})),ev.createElement(o4,{handleSubmit:this.handleSubmit,initialValues:s}),ev.createElement("div",{className:"my-4 inline-flex w-full justify-center text-sm text-appcolor-500"},"By signing up you agree to our",ev.createElement("a",{className:"ml-1 border-b border-solid border-transparent text-appcolor-800 hover:border-appcolor-800",href:"/terms",target:"_blank",rel:"noopener noreferrer"},"Terms of Service."))),ev.createElement(_6,null,ev.createElement(wa,null,"Already have an account? ",ev.createElement(sC.rU,{to:`/login${o}`},"Log In")))))}}let wO=(0,e$.connect)(function(e,t){return{growlState:wP(e,t),initialValues:at(e,t),user:t7(e,t)}},function(e){return(0,ek.DE)({submitSignUpForm:rl},e)})(wj),wU=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-cb1d51ae-0"})` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(80)}; + height: 100vh; +`,wZ=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-cb1d51ae-1"})` + display: flex; + flex-direction: column; + width: 100%; + max-width: 460px; + margin: 0 20px; +`,wL=eL.default.div.withConfig({displayName:"styled__Body",componentId:"sc-cb1d51ae-2"})` + display: flex; + flex-direction: column; + padding: 30px 50px; + + background: ${e=>e.theme.appColors.hex(100)}; + border: 0.5px solid #e6e6e6; + border-radius: 20px; + box-sizing: border-box; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); +`;eL.default.div.withConfig({displayName:"styled__Footer",componentId:"sc-cb1d51ae-3"})` + display: flex; + flex-direction: column; +`;let wB=eL.default.button.withConfig({displayName:"styled__SubmitButton",componentId:"sc-cb1d51ae-4"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + border-radius: 10px; + background: #ff2d60; + color: #ffffff; + border: 0; + cursor: pointer; + margin-top: 15px; + + &:focus { + outline: 0; + } + + &:hover { + background: #ff5780; + } +`,wz=eL.default.div.withConfig({displayName:"styled__Heading",componentId:"sc-cb1d51ae-5"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,wV=eL.default.h1.withConfig({displayName:"styled__Title",componentId:"sc-cb1d51ae-6"})` + font-size: 24px; + font-weight: bold; + color: ${e=>e.theme.textColors.hex(10)}; +`,wq=eL.default.h2.withConfig({displayName:"styled__Subtitle",componentId:"sc-cb1d51ae-7"})` + font-size: 16px; + color: ${e=>e.theme.textColors.hex(50)}; + font-weight: normal; +`,wW=eL.default.div.withConfig({displayName:"styled__ErrorMessage",componentId:"sc-cb1d51ae-8"})` + display: flex; + /* todo (dionis@taskade.com) missing danger background color */ + background: ${e=>e.theme.isNightMode?"rgba(235, 100, 97, 0.10)":"#FAE5E5"}; + border: 1px solid ${eI.ThemeColors.danger}; + color: ${eI.ThemeColors.danger}; + padding: ${e=>e.$padding??"8px 12px"}; + font-size: 16px; + line-height: 22px; + border-radius: 10px; + margin: ${e=>e.$margin??"0px"}; +`,wH=function(e){let{appSumoState:t}=e,{email:a,activationCode:n}=t,[l,r]=(0,ev.useState)(null),o=(0,eK.Z)(),i=ev.useMemo(()=>({username:a,password:""}),[a]),{register:s,handleSubmit:d}=(0,sz.cI)({defaultValues:i}),c=async e=>{let t=await fetch("/appsumo/login",{method:"POST",body:JSON.stringify({...e,username:a,activationCode:n}),headers:{"Content-Type":"application/json"}}),l=await t.json();if(!t.ok){r(l.error);return}window.location.href=l.payload.redirect};return ev.createElement(ev.Fragment,null,ev.createElement("form",{onSubmit:d(c)},ev.createElement(ou,{...s("username"),type:"email",required:!0,readOnly:!0,disabled:!0}),ev.createElement(ou,{...s("password"),type:"password",required:!0,placeholder:o.formatMessage({id:"general.password",defaultMessage:"Password"})}),ev.createElement(wB,null,ev.createElement(eY.Z,{id:"general.log_in",defaultMessage:"Log in"}))),null!=l&&ev.createElement(wW,null,l))},wG=function(e){let{appSumoState:t}=e,{email:a,activationCode:n}=t,[l,r]=(0,ev.useState)(null),o=(0,eK.Z)(),i=ev.useMemo(()=>({email:a,username:"",password:""}),[a]),{register:s,handleSubmit:d}=(0,sz.cI)({defaultValues:i}),c=eG().tz.guess(),m=async e=>{r(null);let t=await fetch("/appsumo/signup",{method:"POST",body:JSON.stringify({...e,email:a,activationCode:n,timezone:c}),headers:{"Content-Type":"application/json"}}),l=await t.json();if(!t.ok){r(l.error);return}window.location.href=l.payload.redirect};return ev.createElement(ev.Fragment,null,ev.createElement("form",{onSubmit:d(m)},ev.createElement(ou,{...s("email"),type:"email",required:!0,readOnly:!0,disabled:!0}),ev.createElement(ou,{...s("username"),type:"text",required:!0,placeholder:o.formatMessage({id:"general.username",defaultMessage:"Username"})}),ev.createElement(ou,{...s("password"),type:"password",required:!0,placeholder:o.formatMessage({id:"general.password",defaultMessage:"Password"})}),ev.createElement(wB,null,ev.createElement(eY.Z,{id:"general.Sign up",defaultMessage:"Sign up"}))),null!=l&&ev.createElement(wW,null,l),ev.createElement("div",{className:"my-4 inline-flex w-full justify-center text-sm text-appcolor-500"},"By signing up you agree to our",ev.createElement("a",{className:"ml-1 border-b border-solid border-transparent text-appcolor-800 hover:border-appcolor-800",href:"/terms",target:"_blank",rel:"noopener noreferrer"},"Terms of Service.")))},wK=(0,e$.connect)(function(e){return{appSumoState:e.appsumo}})(function(e){let{appSumoState:t}=e;if(null==t)return null;let{isExistingUser:a}=t;return ev.createElement(wU,null,ev.createElement(_2,{title:"Sign Up (AppSumo) - Taskade",ogTitle:"Sign Up - Taskade"}),ev.createElement(_J,null),ev.createElement(wZ,null,ev.createElement(wL,null,ev.createElement(_1,{to:"/"}),ev.createElement(wz,null,ev.createElement(wV,null,a?ev.createElement(eY.Z,{id:"general.log_in",defaultMessage:"Log in"}):ev.createElement(eY.Z,{id:"general.sign_up",defaultMessage:"Sign up"})),ev.createElement(wq,null,ev.createElement(eY.Z,{id:"general.appsumo_welcome",defaultMessage:"Hi Sumo-ling, welcome to Taskade \uD83D\uDC4B"}))),a?ev.createElement(wH,{appSumoState:t}):ev.createElement(wG,{appSumoState:t}))))});class wY extends ev.Component{static propTypes={submitForgotPasswordForm:l7().func.isRequired,user:l7().shape()};static defaultProps={user:null};handleSubmit=(e,t,a)=>{this.props.submitForgotPasswordForm(e,t,a)};redirect(){return ev.createElement(eF.l_,{to:eZ.index})}render(){let{user:e}=this.props;eu()(e)||this.redirect();let t="Forgot Password - Taskade";return ev.createElement(_5,null,ev.createElement(_2,{title:t,ogTitle:t}),ev.createElement(_J,null),ev.createElement(_3,null,ev.createElement(_4,null,ev.createElement(_1,{to:"/"}),ev.createElement(_8,null,ev.createElement(_7,null,"Forgot Password?"),ev.createElement(_9,null,"Please enter the email your used when signing up to receive reset instructions.")),ev.createElement(oM,{handleSubmit:this.handleSubmit}))))}}let wQ=(0,e$.connect)(function(e,t){return{user:t7(e,t)}},function(e){return(0,ek.DE)({submitForgotPasswordForm:rn},e)})(wY),wJ=eL.default.div.withConfig({displayName:"AuthDesktop__Wrapper",componentId:"sc-7aa94845-0"})` + display: flex; + max-width: 600px; + flex-direction: column; + border-radius: 5px; + box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.1); + background: ${e=>e.theme.appColors.hex(100)}; + padding: 24px 30px; + margin: 20px auto 0; +`,wX=eL.default.h1.withConfig({displayName:"AuthDesktop__Title",componentId:"sc-7aa94845-1"})` + font-size: 20px; + font-weight: 500; + color: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333"}; +`,w0=eL.default.span.withConfig({displayName:"AuthDesktop__Body",componentId:"sc-7aa94845-2"})` + font-size: 16px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"}; + margin-bottom: 20px; +`,w1=eL.default.div.withConfig({displayName:"AuthDesktop__Actions",componentId:"sc-7aa94845-3"})` + display: flex; + flex-direction: row; + justify-content: flex-end; +`,w2=eL.default.button.withConfig({displayName:"AuthDesktop__RetryButton",componentId:"sc-7aa94845-4"})` + display: flex; + padding: 8px 16px; + cursor: pointer; + background: #5cc170; + border: 1px solid #5cc170; + margin-right: 5px; + border-radius: 5px; + font-weight: 500; + color: #fff; + + &:focus { + outline: 0; + } + + &:hover { + color: #fff; + background: #4da35e; + } +`,w5=(0,e$.connect)(function(e){return{accessToken:e.auth.accessToken}})(function(e){let{accessToken:t}=e,a=`taskade://login?accessToken=${t}`;return ev.useEffect(()=>{window.location.href=a},[t,a]),ev.createElement(wJ,null,ev.createElement(wX,null,"Logged in!"),ev.createElement(w0,null,"Please wait while we launch the desktop app, or press 'Launch Taskade' below."),ev.createElement(w1,null,ev.createElement(w2,{onClick:()=>{window.location.href=a}},"Launch Taskade")))}),w3=(0,e$.connect)(function(e){return{accessToken:e.auth.accessToken,showOnboarding:e.auth.showOnboarding}})(function(e){let{accessToken:t,showOnboarding:a}=e,[n,l]=ev.useState(!1);ev.useEffect(()=>{n&&setTimeout(()=>{l(!1)},5e3)},[n]);let{data:r}=(0,eB.a)(sN),o=ev.useCallback(()=>{if(null==t)return;let e=new URL("taskade://login");e.searchParams.set("accessToken",t),e.searchParams.set("showOnboarding",`${a??!1}`),window.location.href=e.toString()},[t,a]);return ev.createElement("div",{className:"mx-auto flex h-screen max-w-[300px] flex-col overflow-hidden bg-appcolor-0 pt-10 shadow"},ev.createElement(lT.$V,{className:"h-20 w-20 shrink-0 self-center"}),ev.createElement("span",{className:"mt-3 self-center text-[1.56rem] font-black text-textcolor-900"},"Logged in as"),r?.me!=null&&ev.createElement("div",{className:"text-md mt-2 flex items-center justify-center"},ev.createElement(ao,{avatars_v2:r.me.avatars_v2,handle:r.me.handle,userID:r.me.id,size:32}),ev.createElement("span",{className:"ml-3"},r.me.handle),ev.createElement("span",{className:"ml-1 truncate text-textcolor-500"},r.me.display_name)),ev.createElement("span",{className:"mt-2 text-center text-sm"},"Not you? ",ev.createElement("a",{className:"text-brand",href:"/logout/mobile"},"Log in with another account")),ev.createElement("button",{className:"text-md my-8 flex items-center justify-center gap-x-3 rounded-lg bg-brand px-3 py-2 font-bold text-white",onClick:()=>{l(!0),o()}},"Continue with mobile app",n&&ev.createElement("div",{className:"flex h-4 shrink-0 items-center justify-center"},ev.createElement(eI.Spinner,{color:"#ffffff"}))),ev.createElement("img",{className:"mt-auto",src:"/images/auth_mobile_sso_screenshot.png",alt:""}))}),w4=(0,la.ZP)` + mutation InvitationAccept($input: InvitationAcceptInput!) { + invitationAccept(input: $input) { + clientMutationId + invitation { + document { + id + } + space { + id + } + } + } + } +`,w6=(0,la.ZP)` + query InvitationQuery($token: String!) { + invitation(token: $token) { + id + space { + id + name + is_subspace + } + document { + id + info + } + inviter { + default_name + } + } + } +`,w8=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-4cf6ceaa-0"})` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(80)}; + height: 100vh; +`,w7=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-4cf6ceaa-1"})` + display: flex; + flex-direction: column; + width: 100%; + max-width: 500px; + margin: 0 20px; +`,w9=eL.default.div.withConfig({displayName:"styled__Body",componentId:"sc-4cf6ceaa-2"})` + display: flex; + flex-direction: column; + padding: 30px 50px; + + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 20px; + box-sizing: border-box; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); +`,Ne=eL.default.div.withConfig({displayName:"styled__Heading",componentId:"sc-4cf6ceaa-3"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; + align-items: center; +`,Nt=eL.default.div.withConfig({displayName:"styled__BodyText",componentId:"sc-4cf6ceaa-4"})` + display: block; + ${e1.UiTypography.md}; + color: ${e=>e.theme.textColors.hex(10)}; +`,Na=eL.default.span.withConfig({displayName:"styled__BoldText",componentId:"sc-4cf6ceaa-5"})` + font-weight: bold; + ${e1.UiTypography.md}; +`,Nn=eL.default.ul.withConfig({displayName:"styled__StyledList",componentId:"sc-4cf6ceaa-6"})` + margin-top: 10px; + margin-bottom: 40px; + ${e1.UiTypography.md}; +`,Nl=eL.default.li.withConfig({displayName:"styled__StyledListItem",componentId:"sc-4cf6ceaa-7"})` + ${e1.UiTypography.md}; + line-height: 24px; +`,Nr=eL.default.div.withConfig({displayName:"styled__ButtonContainer",componentId:"sc-4cf6ceaa-8"})` + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: flex-end; + + // padding-bottom: 20px; + // border-bottom: 1px solid; + // border-color: ${e=>e.theme.appColors.hex(70)}; +`,No=eL.default.button.withConfig({displayName:"styled__AcceptButton",componentId:"sc-4cf6ceaa-9"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + width: 120px; + + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(0)}; + color: ${e=>e.theme.appColors.hex(100)}; + border: 0; + cursor: pointer; + margin-left: 10px; + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(30)}; + } +`,Ni=eL.default.button.withConfig({displayName:"styled__DeclineButton",componentId:"sc-4cf6ceaa-10"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + width: 120px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(0)}; + cursor: pointer; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,Ns=eL.default.div.withConfig({displayName:"styled__Title",componentId:"sc-4cf6ceaa-11"})` + ${e1.ArticleTypography.heading3} + color: ${e=>e.theme.appColors.hex(0)}; + text-align: center; +`,Nd=eL.default.span.withConfig({displayName:"styled__TitleBold",componentId:"sc-4cf6ceaa-12"})` + ${e1.ArticleTypography.heading3} + font-weight: bold; +`,Nc=(0,eL.default)(sC.rU).withConfig({displayName:"styled__StyledLink",componentId:"sc-4cf6ceaa-13"})` + display: flex; + width: 100%; + height: 52px; + margin: 0px auto 20px; + justify-content: center; +`,Nm=(0,eL.default)(lT.nV).withConfig({displayName:"styled__Logo",componentId:"sc-4cf6ceaa-14"})` + height: 52px; + width: 190px; +`,Nu=(0,eL.default)(lT.Ng).withConfig({displayName:"styled__DarkModeLogo",componentId:"sc-4cf6ceaa-15"})` + height: 52px; + width: 190px; +`,Np=function(){let e=(0,eL.useTheme)(),{token:t}=(0,eF.UO)(),a=(0,eF.k6)(),[n,l]=ev.useState(""),{loading:r,data:o,error:i}=(0,eB.a)(w6,{variables:{token:t}}),[s,{data:d,loading:c}]=(0,cs.D)(w4),m=ev.useCallback(async()=>{try{let e=(0,ld.Z)();await s({variables:{input:{clientMutationId:e,token:t}}})}catch(e){e instanceof ea.cA?l(e.message):l("Unknown error")}},[s,t]);return(ev.useEffect(()=>{null!=i&&l(i.message)},[i,l]),d?.invitationAccept?.invitation?.document?.id!=null?a.push(`/d/${d.invitationAccept.invitation.document.id}`):d?.invitationAccept?.invitation?.space?.id!=null&&a.push(`/spaces/${d.invitationAccept.invitation.space.id}`),""!==n||null==t)?"Unauthorized"===n?(a.push(`/signup?redirect=/invitations/${t}`),null):ev.createElement(w8,null,ev.createElement(Nc,{to:"/"},e.isNightMode?ev.createElement(Nu,null):ev.createElement(Nm,null)),ev.createElement(w9,null,ev.createElement(Nt,null,ev.createElement(Na,null,ev.createElement(eY.Z,{id:"general.errors.invalid_invitation",defaultMessage:"Invalid Invitation"}))),ev.createElement(Nr,null,ev.createElement(Ni,{onClick:()=>a.push("/"),type:"button"},"Back to Home")))):ev.createElement(w8,null,ev.createElement(_2,{title:`Invitation from ${o?.invitation?.inviter?.default_name}`,ogTitle:`Invitation from ${o?.invitation?.inviter?.default_name}`}),ev.createElement(w7,null,ev.createElement(Nc,{to:"/"},e.isNightMode?ev.createElement(Nu,null):ev.createElement(Nm,null)),ev.createElement(w9,null,r&&ev.createElement("div",{className:"mx-auto text-textlight-400"},ev.createElement(eI.Spinner,null)),ev.createElement(Ne,null,ev.createElement(Ns,null,ev.createElement(Nd,null,o?.invitation?.inviter?.default_name)," invited you to join")),ev.createElement(Nt,null,o?.invitation?.space?.name!=null&&ev.createElement(ev.Fragment,null,ev.createElement(Na,null,o?.invitation?.space?.is_subspace?"Folder":"Workspace"),ev.createElement(Nn,null,ev.createElement(Nl,null,o?.invitation?.space?.name))),o?.invitation?.document?.info?.title!=null&&ev.createElement(ev.Fragment,null,ev.createElement(Na,null,"Project"),ev.createElement(Nn,null,ev.createElement(Nl,null,o?.invitation?.document?.info?.title||"Untitled Project")))),ev.createElement(Nr,null,ev.createElement(Ni,{onClick:()=>a.push("/"),type:"button"},"Decline"),ev.createElement(No,{disabled:c,onClick:m},c?ev.createElement(eI.Spinner,{color:"#ffffff",delay:0,height:26}):"Accept")))))},Ng="INITIAL",Nf="SYNCED",Nh="WILL_SYNC",Ny="SYNCING",Nb="SYNC_FAILED";function Nv(e){return"new"===ec()(e,["params","isNewDocument"],null)||e.url===eZ.index}function Nk(e){let t=ec()(e,["params","documentPathType"],null),a=ec()(e,["params","documentViewOrEditID"],null),n=ec()(e,["params","documentID"],null);return!eu()(t)&&!eu()(a)||!eu()(n)}let NE=(0,eL.default)(sC.rU).withConfig({displayName:"new-list__FloatLink",componentId:"sc-ea1b4826-0"})` + display: flex; + align-items: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + white-space: nowrap; + transition: color ease-in-out 0.2s; + ${e1.UiTypography.sm}; + transform: var(--global-icon-scale); + & svg { + margin-right: 0.25rem; + } + + & span { + display: none; + } + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } + + @media (min-width: 992px) { + & span { + display: inherit; + } + } + + @media print { + display: none; + } +`,Nx=function(e){let{onClick:t}=e,a=e?.url??"/new";return ev.createElement(NE,{to:a,onClick:e=>{t?.(e)}},ev.createElement(tn.Icon,{icon:"header_new"}),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.new",defaultMessage:"New"})))},N_=eL.default.div.withConfig({displayName:"Styled__FlexContainer",componentId:"sc-19d70ea4-0"})` + display: flex; + align-items: center; + flex: 1; + &:last-child { + justify-content: flex-end; + } +`,Nw=eL.default.button.withConfig({displayName:"Styled__SignUpButton",componentId:"sc-19d70ea4-1"})` + display: flex; + align-items: center; + justify-content: center; + border-radius: 10px; + padding: 0 ${eI.UiSpacing.getPx(3)}; + font-weight: 500; + min-height: ${eI.UiSpacing.getPx(8)}; + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(70)}; + white-space: nowrap; + ${e1.UiTypography.sm}; + transition: color ease-in-out 0.2s, background-color ease-in-out 0.2s; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.base}; + } +`,NN=eL.default.div.withConfig({displayName:"Styled__Separator",componentId:"sc-19d70ea4-2"})` + width: 2px; + height: 16px; + margin-right: ${eI.UiSpacing.getPx(2)}; + margin-left: ${eI.UiSpacing.getPx(2)}; + border-left: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,NC=eL.default.button.withConfig({displayName:"Styled__SearchButton",componentId:"sc-19d70ea4-3"})` + display: flex; + align-items: center; + + margin-right: ${eI.UiSpacing.getPx(2)}; + + color: ${e=>e.theme.appColors.hex(10)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } +`,NM=eL.default.div.withConfig({displayName:"WebGuestLeftHeader__Logo",componentId:"sc-675e95cf-0"})` + margin-right: 20px; + + & svg { + height: 34px; + transform: var(--global-icon-scale); + } + + & svg path#taskade { + fill: ${e=>e.theme.appColors.hex(0)}; + } +`,NS=eL.default.div.withConfig({displayName:"WebGuestLeftHeader__Container",componentId:"sc-675e95cf-1"})` + display: flex; + align-items: center; + ${e1.UiTypography.md} + color: ${e=>e.theme.textColors.hex(10)}; +`,NI=(0,eL.default)(tn.Icon).withConfig({displayName:"WebGuestLeftHeader__StyledIcon",componentId:"sc-675e95cf-2"})` + height: 19px; + width: 19px; + color: ${e=>e.theme.textColors.hex(50)}; + margin-bottom: 1px; + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,ND=(0,eL.default)(tn.Icon).attrs({icon:"dd_project"}).withConfig({displayName:"WebGuestLeftHeader__DefaultProjectIcon",componentId:"sc-675e95cf-3"})` + margin-left: ${eI.UiSpacing.getPx(1)}; + margin-right: ${eI.UiSpacing.getPx(2)}; + transform: var(--menu-item-icon-scale); +`,NT=eL.default.div.withConfig({displayName:"WebGuestLeftHeader__Avatar",componentId:"sc-675e95cf-4"})` + ${e1.UiTypography.lg} + margin-left: ${eI.UiSpacing.getPx(1)}; + margin-right: ${eI.UiSpacing.getPx(2)}; +`,N$=function(e){let{documentId:t,documentTitle:a}=e,{search:n}=(0,eF.TH)(),l=s4(n),{data:r,loading:o,error:i}=(0,eB.a)(s3,null!=t?{variables:{documentId:t,shareToken:l}}:{skip:!0});if(null==t)return ev.createElement(N_,null);if(o)return ev.createElement(eI.Spinner,null);let s=r?.document;if(null!=i||null==s||null==a)return ev.createElement(N_,null,ev.createElement("a",{href:"/"},ev.createElement(NM,null,ev.createElement(lT.nV,null))),ev.createElement(Nx,null));let d=nQ(s);return ev.createElement(NS,null,ev.createElement(sC.rU,{to:"/"},ev.createElement(NI,{icon:"caret_prev"})),null!=d?ev.createElement(NT,null,d):ev.createElement(ND,{icon:"dd_project"}),ev.createElement("span",{className:"truncate max-md:w-[30vw] md:max-lg:w-[60vw] lg:w-[30vw]"},a))},NP=(0,eL.default)(sC.rU).withConfig({displayName:"BackButton__FloatLink",componentId:"sc-4bb21d3b-0"})` + display: inline-flex; + align-items: center; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + transition: ease-in-out color 0.2s; + margin-right: 0.5rem; + border-radius: 0.625rem; + padding: 0.125rem 0.5rem 0.125rem 0.125rem; + + & > .workspace-icon { + width: 26px; + height: 26px; + margin-right: 0.25rem; + transition: transform 0.2s ease-in-out; + transform: var(--menu-item-icon-scale); + } + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } +`,NF=eL.default.span.withConfig({displayName:"BackButton__SpaceTitle",componentId:"sc-4bb21d3b-1"})` + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + display: -webkit-box; +`,NA=eL.default.div.withConfig({displayName:"BackButton__InviteOnly",componentId:"sc-4bb21d3b-2"})` + display: flex; + color: ${e=>e.theme.appColors.hex(50)}; + margin-left: 0.25rem; +`,NR=function(e){let{doc:t,routerSpace:a,user:n}=e,{pathname:l,search:r,hash:o}=(0,eF.TH)(),i=new URLSearchParams(r).get("from")??null,s=t?.space??a,d=null,c=null,m=null,u=ev.useMemo(()=>null==s?"":s.is_subspace?null!=s.parent_membership?`/spaces/${s.parent_membership.space.id}/subspaces/${s.id}`:`/subspaces/${s.id}`:`/spaces/${s.id}`,[s]);if("starred"===i?(d="/lists/starred",c="Starred",m="starred"):"recent"===i?(d="/recent",c="Recent",m="recent"):"shared"===i?(d="/shared",c="Shared",m="shared"):null!=s?(null==t?(c=s.name,d=u):"tasks"===i?(c="Tasks",d=`${u}/tasks`):null!=t.archived_at?(c="Completed",d=`${u}/archive`,m="archive"):null!=t.templated_at?(c="Templates",d=`${u}/templates`,m="templates"):(c=t.space?.name??s.name,d=u),l&&((0,eF.LX)(l,{path:eZ.spaceNewTemplate,exact:!0})||(0,eF.LX)(l,{path:eZ.spaceNewTemplateFromDocumentID,exact:!0})||(0,eF.LX)(l,{path:eZ.spaceNewTemplateWithDocumentType,exact:!0}))&&(c="Templates",d=`${u}/templates`,m="templates")):t&&null!=t.starred_at?(d="/lists/starred",c="Starred",m="starred"):null==s&&null!=n&&null!=t?(d="/shared",c="Shared",m="shared"):null!=l&&(0,eF.LX)(l,{path:eZ.newList})&&(d=eZ.index,c="Workspace"),d&&c)switch(m){case"shared":case"search":case"recent":case"activity":case"starred":case"tasks":return ev.createElement(NP,{to:d},c);case"calendar":return ev.createElement(NP,{to:d});default:return ev.createElement(NP,{to:d},null!=s?ev.createElement(pJ,{className:"workspace-icon",space:s,size:"small"}):ev.createElement(pY,{className:"workspace-icon",name:c}),ev.createElement(NF,null,c),null!=s&&null!=s.parent_membership&&s.is_subspace&&null==s.visibility&&ev.createElement(NA,null,ev.createElement(tn.Icon,{icon:"access_invite"})))}return null},Nj=(0,d9.oM)({name:"dialogs.aiCreateProject",initialState:{isOpen:!1},reducers:{toggleAiCreateProjectDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{isOpen:!0,spaceId:t.payload.spaceId}}}),NO="@@taskade/dialogs/TOGGLE_IMPORT_MODAL_DIALOG";function NU(e){return{type:NO,payload:{platform:e}}}let NZ=(0,eL.default)(cF).withConfig({displayName:"MenuItem__MenuButton",componentId:"sc-8a4485d4-0"})` + line-height: ${eI.UiSpacing.getPx(4)}; +`,NL=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(NZ,o.props,t)},NB=eL.default.div.withConfig({displayName:"NewButtonDropdown__Button",componentId:"sc-aec43302-0"})` + display: none; + align-items: center; + cursor: pointer; + color: ${e=>e.theme.primaryColorScheme?.base}; + white-space: nowrap; + transition: color ease-in-out 0.2s; + ${e1.UiTypography.sm}; + transform: var(--global-icon-scale); + & svg { + margin-right: 0.25rem; + } + + & span { + display: none; + } + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } + + @media (min-width: 992px) { + & span { + display: inherit; + } + } + @media (min-width: 768px) { + display: flex; + } + + @media print { + display: none; + } +`,Nz=(0,eL.default)(eI.Menu).withConfig({displayName:"NewButtonDropdown__StyledMenu",componentId:"sc-aec43302-1"})` + display: none; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + @media (min-width: 768px) { + display: flex; + } +`,NV=function(e){let{url:t,spaceId:a}=e,n=(0,eF.k6)(),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,e$.useDispatch)(),d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"bottom"}),c=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),m=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:l}=e.payload;"ai"===l?s(Nj.actions.toggleAiCreateProjectDialog({spaceId:a})):"new"===l?n.push(t):"import"===l&&s(NU()),r({type:"Collapse",payload:"none"});break}case"Dismiss":r({type:"Collapse"})}},[s,n,a,t]);return ev.createElement(ev.Fragment,null,ev.createElement(NB,c.props,ev.createElement(tn.Icon,{icon:"header_new"}),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.new",defaultMessage:"New"}))),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:m},ev.createElement(Nz,null,ev.createElement(NL,{name:"ai"},ev.createElement("div",{className:"animate-color-rainbow"},ev.createElement(tn.Icon,{icon:"dd_ai"})),ev.createElement("div",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ai_project_studio",defaultMessage:"AI Project Studio"}))),ev.createElement(NL,{name:"new"},ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement(eY.Z,{id:"general.start_blank",defaultMessage:"Start Blank"})),ev.createElement(NL,{name:"import"},ev.createElement(tn.Icon,{icon:"dd_import"}),ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"}))))))},Nq=(0,la.ZP)` + query DocumentQuery($documentID: ID!) { + document(id: $documentID) { + id + archived_at + templated_at + starred_at + role { + project + workspace + } + space { + id + name + color + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + } + } + default { + hdpi { + url + } + } + } + } + } + is_subspace + parent_membership { + id + space { + id + } + } + visibility + } + } + } +`,NW=(0,eL.default)(sC.rU).withConfig({displayName:"DocumentHeaderLeft__FloatLink",componentId:"sc-d2af8e35-0"})` + display: inline-flex; + align-items: center; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + transition: ease-in-out color 0.2s; + margin-right: 0.5rem; + border-radius: 0.625rem; + padding: 0.125rem 0.5rem 0.125rem 0.125rem; + + & > .workspace-icon { + width: 26px; + height: 26px; + margin-right: 0.25rem; + transition: transform 0.2s ease-in-out; + transform: var(--menu-item-icon-scale); + } + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } +`,NH=eL.default.span.withConfig({displayName:"DocumentHeaderLeft__SpaceTitle",componentId:"sc-d2af8e35-1"})` + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + display: -webkit-box; +`,NG=eL.default.div.withConfig({displayName:"DocumentHeaderLeft__Container",componentId:"sc-d2af8e35-2"})` + display: flex; +`,NK=function(e){let t;let{routerSpace:a}=e,n=(0,e$.useSelector)(dP),{data:l}=(0,eB.a)(Nq,null!=n?{variables:{documentID:n}}:{skip:!0}),r=(0,e$.useSelector)(t7),o=l?.document,i=o?.space??a,s=ev.useMemo(()=>null==i?"":i.is_subspace?null!=i.parent_membership?`/spaces/${i.parent_membership.space.id}/subspaces/${i.id}`:`/subspaces/${i.id}`:`/spaces/${i.id}`,[i]);return(Eu({role:o?.role?.workspace,action:"create_project"})&&null!=i&&null!=r?t=`/spaces/${i.id}/new`:null==r&&(t="/new"),null==r)?null:null!=n?ev.createElement(NG,null,ev.createElement(NR,{...e,doc:o,user:r}),null!=t&&i?.id!=null&&ev.createElement(NV,{url:t,spaceId:i.id})):null==i?null:ev.createElement(NW,{to:s},ev.createElement(pJ,{className:"workspace-icon",space:i,size:"small"}),ev.createElement(NH,null,i.name))},NY=function(){let e=(0,e$.useDispatch)();return ev.createElement("button",{className:"mr-1",type:"button",onClick:()=>{e(sE())}},ev.createElement(tn.Icon,{icon:"header_sidebar"}))},NQ=function(e){let{space:t}=e;return null!=_T(e.backendError)?ev.createElement(N_,null,ev.createElement(Nx,null)):ev.createElement(N_,null,ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:eZ.editor,render:e=>ev.createElement(NK,{...e,routerSpace:t})}),ev.createElement(eF.AW,{exact:!0,path:eZ.document,render:e=>ev.createElement(NK,{...e,routerSpace:t})}),ev.createElement(eF.AW,{exact:!0,path:eZ.embed,render:e=>ev.createElement(NK,{...e,routerSpace:t})}),ev.createElement(eF.AW,{path:eZ.spaceNewList,render:e=>ev.createElement(NK,{...e,routerSpace:t})}),ev.createElement(eF.AW,{path:eZ.newList,render:e=>ev.createElement(NK,{...e,routerSpace:t})}),ev.createElement(eF.AW,{component:NY})))};function NJ(e){return{backendError:_F(e),documentId:dP(e),user:t7(e),documentTitle:dB(e)}}(0,e$.connect)(NJ);let NX=(0,e$.connect)(NJ)(function(e){let{backendError:t,documentId:a,space:n,user:l,documentTitle:r}=e;return null!=l?ev.createElement(NQ,{backendError:t,space:n}):ev.createElement(N$,{documentId:a,documentTitle:r})}),N0="SET_SEARCH_QUERY",N1="TOGGLE_SEARCH_QUERY_ITEM",N2="TOGGLE_COLLAPSE_IN_SEARCH",N5="TOGGLE_SEARCH_BAR";function N3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{type:N0,payload:{query:e}}}function N4(){return{type:N5}}function N6(e){return{type:N1,payload:{queryItem:e}}}let N8=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-8dabce75-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,N7=function(e){let{value:t,name:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,value:t,name:a});return ev.createElement(N8,r.props,n)},N9=function(e){let{editorStatus:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"left",visible:r});if(null==t)return null;let{createdBy:c,updatedBy:m,updatedAt:u}=t;return null==u?null:ev.createElement(ev.Fragment,null,ev.createElement(Ct,null),ev.createElement(Ce,{...d,onMouseLeave:()=>{o(!1)},onMouseEnter:()=>{o(!0)}},ev.createElement(eY.Z,{id:"general.project_updated_timestamp",defaultMessage:"Updated by {handle} {br} {on} {at}",values:{on:ev.createElement(te.Ji,{value:new Date(u),month:"short",day:"numeric"}),at:ev.createElement(te.qN,{value:new Date(u)}),handle:m,br:ev.createElement("br",null)}}),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.project_created_by",defaultMessage:"Created by {handle}",values:{handle:c}}))))},Ce=eL.default.div.withConfig({displayName:"TimestampFooter__Container",componentId:"sc-c1a522c7-0"})` + display: flex; + flex-direction: column; + column-gap: var(--menu-item-gap); + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(4)}; + ${e1.UiTypography.xs}; + line-height: 18px; + color: ${e=>e.theme.textColors.hex(50)}; + gap: ${eI.UiSpacing.getPx(1.5)}; + align-items: flex-start; + text-align: left; + cursor: pointer; +`,Ct=eL.default.div.withConfig({displayName:"TimestampFooter__Separator",componentId:"sc-c1a522c7-1"})` + width: 100%; + background: ${e=>e.theme.appColors.hex(70)}; + height: 1px; + margin: var(--menu-item-divider-margin); +`,Ca=(0,eL.default)(eI.Menu).withConfig({displayName:"ActionsDropdownMenu__StyledMenu",componentId:"sc-3294f5db-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.backgroundColorHex}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,Cn=(0,eL.default)(tn.Icon).withConfig({displayName:"ActionsDropdownMenu__StyledIcon",componentId:"sc-3294f5db-1"})` + margin-right: var(--menu-item-gap); + transform: var(--menu-item-icon-scale); +`,Cl=eL.default.span.withConfig({displayName:"ActionsDropdownMenu__ShortcutKey",componentId:"sc-3294f5db-2"})` + margin-left: 3px; + text-transform: uppercase; +`,Cr=eL.default.span.withConfig({displayName:"ActionsDropdownMenu__Shortcut",componentId:"sc-3294f5db-3"})` + flex-grow: 1; + margin-left: 2px; + ${e1.UiTypography.xxs}; + text-align: right; + color: ${e=>e.theme.textColors.hex("50")}; +`,Co=eL.default.div.withConfig({displayName:"ActionsDropdownMenu__Separator",componentId:"sc-3294f5db-4"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,Ci=(0,e$.connect)(function(e){return{hideCompleted:dT(e),doc:dV(e),isAllCompleted:sr(e),isAllCollapsed:sn(e),isCollapsible:sl(e),editorStatus:dL(e)}})(function(e){let{initialFocus:t,popupDispatch:a,hideCompleted:n,isAllCompleted:l,isCollapsible:r,isAllCollapsed:o,editorStatus:i,doc:s}=e,d=(0,e$.useDispatch)(),c=s?.id,m=e0(),u=ev.useCallback(()=>{d(rh({isOpen:!0,activeView:rI,enableCopyList:!1,copyAsTemplate:!1}))},[d]),p=ev.useCallback(e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"hide_completed":u();break;case"complete_all":lm({role:s?.role,action:{project:"check"}})?d(mF()):u();break;case"fold_all":lm({role:s?.role,action:{project:"edit"}})?d(mR()):u();break;case"search":d(N4());break;case"copy_project":d(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!1}));break;case"add_to_templates":case"print":d(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!0}));break;case"present":{let e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen();break}case"open_in_desktop_app":null!=c&&window.open(`taskade://open?url=/d/${c}`,"_blank","noopener,noreferrer")}a({type:"Collapse"})}},[d,s?.role,c,a,u]);return ev.createElement(eI.MenuGroupContext.Provider,{value:p},ev.createElement(Ca,{initialFocus:t,loop:!0},ev.createElement(N7,{name:"hide_completed"},n?ev.createElement(ev.Fragment,null,ev.createElement(Cn,{icon:"dd_show_completed"}),ev.createElement(eY.Z,{id:"general.show_completed",defaultMessage:"Show completed"})):ev.createElement(ev.Fragment,null,ev.createElement(Cn,{icon:"dd_hide_completed"}),ev.createElement(eY.Z,{id:"general.hide_completed",defaultMessage:"Hide completed"}))),ev.createElement(N7,{name:"complete_all"},ev.createElement(Cn,{icon:"dd_checkall"}),l?ev.createElement(eY.Z,{id:"general.uncomplete_all",defaultMessage:"Uncomplete all"}):ev.createElement(eY.Z,{id:"general.complete_all",defaultMessage:"Complete all"})),r?o?ev.createElement(N7,{name:"fold_all"},ev.createElement(Cn,{icon:"dd_unfoldall"}),ev.createElement(eY.Z,{id:"general.unfold_all",defaultMessage:"Unfold all"})):ev.createElement(N7,{name:"fold_all"},ev.createElement(Cn,{icon:"dd_foldall"}),ev.createElement(eY.Z,{id:"general.fold_all",defaultMessage:"Fold all"})):null,ev.createElement(Co,null),ev.createElement(N7,{name:"search"},ev.createElement(Cn,{icon:"dd_search"}),ev.createElement(eY.Z,{id:"general.search",defaultMessage:"Search"}),ev.createElement(Cr,null,ev.createElement(Cl,null,eI.ModifierKeys.ModSymbol),ev.createElement(Cl,null,"F"))),ev.createElement(N7,{name:"copy_project"},ev.createElement(Cn,{icon:"dd_copy"}),ev.createElement(eY.Z,{id:"general.copy_project",defaultMessage:"Copy Project"})),ev.createElement(N7,{name:"add_to_templates"},ev.createElement(Cn,{icon:"dd_addtotemplates"}),ev.createElement(eY.Z,{id:"general.add_to_templates",defaultMessage:"Add to Templates"})),ev.createElement(Co,null),ev.createElement(N7,{name:"print"},ev.createElement(Cn,{icon:"dd_print"}),ev.createElement(eY.Z,{id:"general.print",defaultMessage:"Print"})),ev.createElement(N7,{name:"present"},ev.createElement(Cn,{icon:"dd_present"}),ev.createElement(eY.Z,{id:"general.present",defaultMessage:"Present"})),!(null!=m)&&ev.createElement(N7,{name:"open_in_desktop_app"},ev.createElement(Cn,{icon:"dd_desktop"}),ev.createElement(eY.Z,{id:"general.open_in_desktop_app",defaultMessage:"Open in desktop app"})),ev.createElement(N9,{editorStatus:i})))}),Cs=eL.default.button.withConfig({displayName:"GuestActionsButton__Button",componentId:"sc-b4fd04f5-0"})` + color: ${e=>e.theme.appColors.hex(10)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } +`,Cd=function(){let e=ev.useRef(null),t=ev.useRef(null),[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),l=(0,eI.usePopup)({referenceElementRef:e,popupElementRef:t,state:a,placement:"bottom-start"}),r=(0,eI.useMenuButton)({ref:e,state:a,dispatch:n});return ev.createElement(ev.Fragment,null,ev.createElement(Cs,r.props,ev.createElement(tn.Icon,{icon:"header_more"})),a.expanded&&ev.createElement(eI.Popup,{...l.props,dispatch:n,modal:!0},ev.createElement(Ci,{initialFocus:l.initialFocus,popupDispatch:n})))},Cc=function(){let e=(0,e$.useDispatch)(),t=()=>{e(N4())},a=()=>ev.createElement(ev.Fragment,null,ev.createElement(NC,{onClick:t},ev.createElement(tn.Icon,{icon:"dd_search"})),ev.createElement(Cd,null),ev.createElement(NN,null));return ev.createElement(N_,null,ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:eZ.editor,component:a}),ev.createElement(eF.AW,{exact:!0,path:eZ.document,component:a})),ev.createElement(Nw,{type:"button",onClick:()=>{e(rh({isOpen:!0,activeView:rI,enableCopyList:!1,copyAsTemplate:!1}))}},ev.createElement(eY.Z,{id:"general.signup",defaultMessage:"Sign up"})))};function Cm(e){let{session:t}=e;return t.fetchStatus}let Cu=(0,la.ZP)` + query DocumentAtPathQuery($path: String!) { + document: documentAtPath(path: $path) { + id + info + edit_path + view_path + archived_at + pinned_at + preferences { + view + } + shared_preferences + role { + project + workspace + } + space { + id + color + type + is_subspace + taskadePlanType + } + space_type + starred_at + members(first: 3) { + edges { + cursor + node { + ...ProjectMemberParts + } + } + totalCount + } + } + } + ${yC} +`,Cp=(0,la.ZP)` + query DocumentPathQuery($id: ID!, $shareToken: ShareTokenInput) { + document(id: $id, shareToken: $shareToken) { + id + edit_path + color + space { + id + color + type + is_subspace + taskadePlanType + } + space_type + role { + project + workspace + } + archived_at + pinned_at + preferences { + view + } + shared_preferences + members(first: 3) { + edges { + cursor + node { + ...ProjectMemberParts + } + } + totalCount + } + starred_at + } + } + ${yC} +`,Cg=eL.default.button.withConfig({displayName:"ResetButton",componentId:"sc-2d2e04c8-0"})` + background: none; + margin: 0; + padding: 0; + box-shadow: none; + cursor: pointer; + outline: 0 !important; + border: 0; + white-space: nowrap; +`,Cf=(0,eL.default)(Cg).withConfig({displayName:"Collaborator__UserAvatar",componentId:"sc-8a1c129d-0"})` + display: block; + width: 32px; + height: 32px; + border-radius: 50px; + overflow: hidden; + margin-left: 4px; + outline: 0 !important; + overflow: visible; + + &:disabled { + cursor: inherit; + } +`,Ch=function(e){let{allow:t,onClick:a,placement:n,user:l}=e,{arrowProps:r,popperProps:o,referenceProps:i,setVisible:s,visible:d}=(0,eI.useTooltip)({placement:n});return ev.createElement(ev.Fragment,null,ev.createElement(Cf,{...i,onClick:e=>{t&&(a?.(e),s(!1))},onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},disabled:!t,type:"button"},ev.createElement(ao,{avatars_v2:l.avatars_v2,handle:l.handle,userID:parseInt(l.id,10),alt:l.initials,size:32})),d&&ev.createElement(eI.Tooltip,{popperProps:o,arrowProps:r},l.handle))},Cy=eL.default.div.withConfig({displayName:"MemberCount__Wrapper",componentId:"sc-4b8c50e8-0"})` + display: flex; + align-items: center; + justify-content: center; + transform: scale(0.95); +`,Cb=eL.default.div.withConfig({displayName:"MemberCount__CollaboratorWrapper",componentId:"sc-4b8c50e8-1"})` + display: none; + + @media (min-width: 992px) { + display: flex; + } +`,Cv=function(e){let{allow:t,users:a,onClick:n,onInviteClick:l}=e,r=e.placement??"top",o=(0,ev.useMemo)(()=>a?.slice(0,2)??[],[a]),i=(0,eL.useTheme)(),s=ev.useMemo(()=>gW()(i.primaryColor??eI.Colors.BRAND).rgb().join(" "),[i.primaryColor]);return ev.createElement(Cy,{style:{"--color-primary":s}},ev.createElement(Cb,null,o.map(e=>ev.createElement(Ch,{allow:t,key:`user-${e.id}`,onClick:n,placement:r,user:e}))),t&&ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"cursor-pointer rounded-lg text-sm text-appcolor-900 hover:text-primary md:ml-2.5 md:h-8 md:w-auto md:whitespace-nowrap md:rounded-3xl md:border-0 md:bg-primary/10 md:px-4 md:py-2 md:text-sm md:font-medium md:text-primary md:outline-0 md:transition-colors md:delay-200 md:ease-in-out md:hover:bg-primary md:hover:text-white md:focus:outline-none",onClick:l??n},ev.createElement("span",{className:"hidden md:block"},ev.createElement(eY.Z,{id:"general.invite",defaultMessage:"Share"})),ev.createElement(tn.Icon,{className:"block md:hidden",icon:"share_permission",width:22,height:22}))))};function Ck(e){let{role:t,action:a}=e;return lm({role:t,action:a})}let CE=function(e){let{presenceState:t}=e,a=(0,e$.useDispatch)(),n=(0,eF.UO)(),{data:l,loading:r}=(0,eB.a)(sN),o=(0,ev.useMemo)(()=>null==n.documentPathType||null==n.documentViewOrEditID?null:`/${n.documentPathType}/${n.documentViewOrEditID}`,[n.documentPathType,n.documentViewOrEditID]),[i,s]=(0,ev.useMemo)(()=>null!=n.documentID?[Cp,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",variables:{id:n.documentID}}]:[Cu,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",variables:null!=o?{path:o}:void 0,skip:null==o}],[n.documentID,o]),{data:d}=(0,eB.a)(i,s),c=d?.document?.space?.color,m=(0,ev.useMemo)(()=>eu()(c)?void 0:{primaryColor:c},[c]),u=Ck({role:d?.document?.role,action:{project:"add_user",workspace:"add_user"}}),p=pW({role:d?.document?.role?.workspace,action:"add_user"}),g=d?.document?.members,f=(0,ev.useMemo)(()=>{if(r)return;let e=l?.me;return g?.edges?.map(e=>e.node.user).filter(a=>{if(null==a||e?.id===a.id)return!1;let n=parseInt(a.id,10);return t.users.has(n)})},[l?.me,r,g?.edges,t.users]),h=d?.document?.id,y=eu()(d?.document?.edit_path),b=(0,ev.useCallback)(()=>{if(!y&&null!=h)return a(fP(h))},[a,h,y]),v=(0,ev.useCallback)(()=>{if(!y&&null!=h)return a(Ez.actions.toggleInvitePickerDialog(h))},[a,h,y]);return ev.createElement(eI.ThemeProvider,{theme:m},ev.createElement(Cv,{allow:u,onClick:b,onInviteClick:p?v:void 0,placement:"bottom",users:f}))},Cx=(0,e$.connect)(function(e){return{editorFetchStatus:Cm(e),presenceState:e?.presence??{}}})(function(e){let{editorFetchStatus:t,presenceState:a}=e;return t!==uk?ev.createElement("div",null):ev.createElement(CE,{presenceState:a})}),C_=(0,d9.oM)({name:"dialogs.historyRevert",initialState:{isOpen:!1},reducers:{toggleHistoryRevertDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0}}}),Cw={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpacePlanQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlan"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"state"}},{kind:"Field",name:{kind:"Name",value:"usage"}}]}}]}}]}}]}}]};function CN(e){return e?.extensions?.code==="TASKADE_UNLIMITED_REQUIRED_ERROR"}var CC=a(20556),CM=a.n(CC),CS=a(28895),CI=a.n(CS),CD=a(8804),CT=a.n(CD),C$=a(10928),CP=a.n(C$);function CF(e,t){if(!e)throw Error(`Assertion Failed: ${t}`)}function CA(e,t,a){let n=t.added?"added":t.completed?"completed":t.edited?"edited":t.removed?"removed":null;if(null==n||null==t.timestamp)return;let l=n,r=t.authors?.sort().join(",")||"";r&&(l=`${r}:${l}`);let o=e.serialize(),i=a.get(l);null==i?i={items:[],authors:t.authors,guests:t.guests,timestamp:t.timestamp,type:n}:(null!=t.authors&&(null!=i.authors?i.authors=Array.from(new Set([...i.authors,...t.authors])):i.authors=t.authors),null!=t.guests&&(null!=i.guests?i.guests=Array.from(new Set([...i.guests,...t.guests])):i.guests=t.guests));let{id:s,...d}=o;i.items.push({...d,nodeId:s}),a.set(l,i)}function CR(e,t){let a=eG()(e);return null!=t&&(a=a.tz(t)),a.calendar(eG()(),{sameDay:"[Today]",nextDay:"LL",nextWeek:"LL",lastDay:"[Yesterday]",lastWeek:"LL",sameElse:"LL"})}function Cj(e){let{date:t,time:a}=e;if(eu()(t))throw Error("Invalid datetime desc. Date must not be null.");let n=`${m0}THH:mm:ss`,l=`${t}T${a||"00:00:00"}`,r=e.timezone||"Etc/UTC",o=eG().tz(l,n,!0,r);if(o.isValid())return o;throw Error("Invalid datetime desc.")}let CO=eL.default.div.withConfig({displayName:"LogChangeItem__Wrapper",componentId:"sc-b8035e84-0"})` + display: flex; + flex-direction: column; + width: 100%; + margin-top: 2px; + cursor: pointer; +`,CU=eL.default.div.withConfig({displayName:"LogChangeItem__Item",componentId:"sc-b8035e84-1"})` + display: flex; + margin-bottom: 5px; + align-items: center; + transition: transform ease-in-out 200ms; + + &:hover { + transform: translateX(5px); + } +`,CZ=eL.default.div.withConfig({displayName:"LogChangeItem__Sideline",componentId:"sc-b8035e84-2"})` + display: flex; + flex-shrink: 0; + min-height: 19px; + height: 100%; + border-radius: 20px; + min-width: 3px; + background: ${e=>{switch(e.diff){case"added":return"#43BC6A";case"deleted":case"removed":return"#EB6461";case"edited":return"#FFDD28";default:return e.theme.isNightMode?"#666":"#ccc"}}}; +`,CL=eL.default.div.withConfig({displayName:"LogChangeItem__Body",componentId:"sc-b8035e84-3"})` + display: flex; + flex-wrap: wrap; + white-space: break-spaces; + padding-left: 8px; + color: ${e=>e.theme.textColors.hex(60)}; + + & a { + display: inline !important; + padding: 0; + word-break: break-all; + } + + &:empty { + &:after { + content: 'Untitled'; + color: ${e=>(e.theme.isNightMode,"#999")}; + } + } +`,CB=eL.default.span.withConfig({displayName:"LogChangeItem__Span",componentId:"sc-b8035e84-4"})` + display: inline; + white-space: inherit; + word-break: break-word; + padding: 2px 2px; + border-radius: 2px; + font-weight: ${e=>e.bold?"bold":"normal"}; + font-style: ${e=>e.italic?"italic":"normal"}; + line-height: 23px; + text-decoration: ${e=>{let t=[];return(("completed"===e.type||"removed"===e.type)&&t.push("line-through"),e.underline&&t.push("underline"),0===t.length)?"none":t.join(" ")}}; + color: ${e=>{switch(e.type){case"removed":return e.theme.isNightMode,"#EB6461";case"completed":return e.theme.isNightMode?"#666":"#999";default:return e.theme.isNightMode?"#ccc":"#333"}}}; + border-bottom: ${e=>{switch(e.highlight){case!0:case"yellow":return"2px solid #FFEF62";case"red":return"2px solid #FA88A1";case"green":return"2px solid #E7F4A1";case"blue":return"2px solid #B0DFFA";case"purple":return"2px solid #CDC5F4";default:return"none"}}}; + background-color: ${e=>{if("completed"!==e.type)switch(e.diff){case"added":return e.theme.isNightMode?"#2F603F":"#E8F7ED";case"deleted":case"removed":return e.theme.isNightMode?"#72303C":"#FDE9EC";case"edited":return"inherit";default:return}}}; +`,Cz=function(e){let{item:t,type:a}=e,n=(0,li.makeTextDeltaIterable)(t.text,{captureException:e=>{er.$e(t=>{let a=e.scope?.extras;null!=a&&t.setExtras(a),er.Tb(e)})}});return ev.createElement(CO,null,ev.createElement(CU,null,ev.createElement(CZ,{diff:a}),ev.createElement(CL,null,Array.from(n,(e,t)=>{let n,l;let{insert:r,attributes:o}=e;if(null!=o){let{link:e,...t}=o;l=t,null!=e&&(n="a",l.href=e)}return ev.createElement(CB,{as:n,key:`${t}`,type:a,...l},r)}))))},CV=eL.default.div.withConfig({displayName:"LogChange__Row",componentId:"sc-ca18fa5b-0"})` + line-height: 18px; + padding-bottom: 3px; + white-space: break-spaces; +`,Cq=eL.default.div.withConfig({displayName:"LogChange__Avatar",componentId:"sc-ca18fa5b-1"})` + display: flex; + width: 30px; + min-width: 30px; + height: 30px; + border-radius: 30px; + overflow: hidden; + justify-content: center; + align-items: center; + + & > img { + width: 30px; + height: 30px; + image-rendering: -webkit-optimize-contrast; + } + & > span { + width: 30px; + height: 30px; + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + line-height: 30px; + font-size: 18px; + font-weight: bold; + text-align: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,CW=eL.default.div.withConfig({displayName:"LogChange__StyledHistoryChange",componentId:"sc-ca18fa5b-2"})` + position: relative; + display: grid; + grid-template-columns: 42px 1fr; + justify-items: start; + padding: 5px 20px; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + + & a { + display: flex; + } +`,CH=eL.default.div.withConfig({displayName:"LogChange__StyledMessage",componentId:"sc-ca18fa5b-3"})` + display: inline; + white-space: normal; + word-break: break-word; +`,CG=eL.default.time.withConfig({displayName:"LogChange__StyledTimestamp",componentId:"sc-ca18fa5b-4"})` + font-size: 13px; + color: #999; + padding-left: 5px; +`,CK=eL.default.div.withConfig({displayName:"LogChange__RowContainer",componentId:"sc-ca18fa5b-5"})` + display: flex; + flex-direction: column; + width: 100%; +`,CY=function(e){let{documentId:t,logChange:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({stopRef:n}),r=(0,ll.x)(),o=(0,eK.Z)(),i=(0,ev.useMemo)(()=>{let e=a.authors??[];return(0,eo.compactMap)(e,e=>r.readFragment({id:`User:${e}`,fragment:up,fragmentName:"BasicUserFields"})??void 0)},[r,a.authors]),s=i[0],d=i.map(e=>e.handle),c=cc()(a.timestamp);return null!=a.guests&&a.guests.length>0&&d.push(o.formatMessage({id:"general.guest_count",defaultMessage:"{number, plural, one {# guest} other {# guests}}"},{number:a.guests.length})),ev.createElement("button",{...l.props,className:"w-full text-left"},ev.createElement(CW,null,ev.createElement(Cq,null,null!=s?ev.createElement("img",{src:s.avatars_v2?.small?.ldpi.url}):ev.createElement("span",null,"G")),ev.createElement(CK,null,ev.createElement(CV,null,ev.createElement(CH,null,function(e,t,a){switch(e.type){case"edited":return a.formatMessage({id:"history_dropdown.edited",defaultMessage:"{authors} edited {number, plural, one {# item} other {# items}}"},{b:e=>ev.createElement("b",null,e),authors:t?a.formatList(t,{style:"long",type:"conjunction"}):a.formatMessage({id:"general.guest",defaultMessage:"Guest"}),number:e.items.length});case"added":return a.formatMessage({id:"history_dropdown.added",defaultMessage:"{authors} added {number, plural, one {# item} other {# items}}"},{b:e=>ev.createElement("b",null,e),authors:t.length>0?a.formatList(t,{style:"long",type:"conjunction"}):a.formatMessage({id:"general.guest",defaultMessage:"Guest"}),number:e.items.length});case"removed":return a.formatMessage({id:"history_dropdown.removed",defaultMessage:"{authors} deleted {number, plural, one {# item} other {# items}}"},{b:e=>ev.createElement("b",null,e),authors:t?a.formatList(t,{style:"long",type:"conjunction"}):a.formatMessage({id:"general.guest",defaultMessage:"Guest"}),number:e.items.length});case"completed":return a.formatMessage({id:"history_dropdown.completed",defaultMessage:"{authors} completed {number, plural, one {# item} other {# items}}"},{b:e=>ev.createElement("b",null,e),authors:t?a.formatList(t,{style:"long",type:"conjunction"}):a.formatMessage({id:"general.guest",defaultMessage:"Guest"}),number:e.items.length});default:return null}}(a,d,o)),null!=a.timestamp&&ev.createElement(CG,{title:c.format("lll"),dateTime:c.toISOString()},c.fromNow())),a.items.map((e,n)=>ev.createElement(sC.rU,{to:`/d/${t}#node-${e.nodeId}`,key:n},ev.createElement(Cz,{item:e,type:a.type}))))))},CQ=eL.default.div.withConfig({displayName:"LogGroup__Container",componentId:"sc-fd0449f3-0"})` + display: flex; + flex-direction: column-reverse; +`,CJ=function(e){let{documentId:t,logGroup:a}=e;return ev.createElement(CQ,null,a.map((e,a)=>ev.createElement(CY,{key:`${a}`,documentId:t,logChange:e})))},CX=eL.default.div.withConfig({displayName:"DayLog__Container",componentId:"sc-1add8a00-0"})` + display: flex; + flex-direction: column-reverse; +`,C0=eL.default.div.withConfig({displayName:"DayLog__DateSeparator",componentId:"sc-1add8a00-1"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + padding: 5px 20px; +`,C1=function(e){let{dayLog:t,documentId:a}=e,n=(0,ev.useMemo)(()=>CR(t.day),[t.day]);return ev.createElement(CX,null,t.groups.map((e,t)=>ev.createElement(CJ,{key:`${t}`,documentId:a,logGroup:e})),ev.createElement(C0,null,n))},C2=eL.default.div.withConfig({displayName:"HistoryPageData__Container",componentId:"sc-c4834fc5-0"})` + display: flex; + flex-direction: column-reverse; +`,C5=function(e){let{pageData:t,documentId:a}=e,n=(0,ev.useMemo)(()=>(function(e){let t=function(e,t){let a=new Map,n=null;for(let t of e){if(null!=n){let e=CP()(n);if(CF(null!=e,"Expected last commit to not be nullish"),t.createdOn-e.createdOn>300){let e=CT()(n);CF(null!=e,"Expected first commit edge to not be nullish"),a.set(e.createdOn,n),n=null}}null==n?n=[t]:n.push(t)}if(null!=n){let e=CT()(n);CF(null!=e,"Expected first commit edge to not be nullish"),a.set(e.createdOn,n),n=null}return a}(e.commits,0),a=new Map;for(let[e,n]of t.entries()){let t=cc().unix(e).format(cc().HTML5_FMT.DATE),l=a.get(t);null==l&&(l=[],a.set(t,l)),l.push(n)}let n=[],l=e.contents;for(let[e,t]of a.entries()){let a={day:e,groups:[]};for(let e of t){let[t,n]=function(e,t){let a=t.map(e=>e.changeset),n=(0,li.compactChangesets)(a),l=(0,li.changelog)(n),r=e.apply(l.changeset),o=new Map;r.traverse(t=>{let a=l.changes.get(t.id);if(null==a)return!0;if(a.removed&&a.added){let n=e.findNodeByID(t.id);if(null==n)return a.removed=!1,CA(t,a,o),!0;if(a.removed=!1,a.added=!1,0===new(CI())(t.text).diff(n.text).length())return!0;a.edited=!0}return CA(t,a,o),!0}),e.traverse(e=>{let t=l.changes.get(e.id);return null==t||(t.removed&&(t.added&&(t.added=!1),CA(e,t,o)),!0)});let i=[];for(let[,e]of o.entries()){let t=CM()(i,e,e=>e.timestamp);i.splice(t,0,e)}return[e.apply(n),i]}(l,e);n.length>0&&a.groups.push(n),l=t}a.groups.length>0&&n.push(a)}return n})(t),[t]);return ev.createElement(C2,null,n.map((e,t)=>ev.createElement(C1,{key:`${t}`,dayLog:e,documentId:a})))},C3=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)();return ev.createElement("div",{className:"m-4 flex gap-x-1 rounded-md border border-appcolor-300 px-4 py-5 text-sm"},ev.createElement(eY.Z,{id:"general.upgrade_to_unlock_longer_project_history",defaultMessage:"Upgrade to unlock longer project history."}),ev.createElement("div",{className:"flex w-32 cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75",onClick:()=>{a(d4(t))}},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))},C4=eL.default.div.withConfig({displayName:"HistoryPage__Note",componentId:"sc-44f27d5f-0"})` + padding: 10px 20px 20px; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 15px; +`,C6=eL.default.button.withConfig({displayName:"HistoryPage__StyledLoadMoreButton",componentId:"sc-44f27d5f-1"})` + width: 100%; + padding: 15px; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(10)}; + background-color: ${e=>e.theme.appColors.hex(100)}; + cursor: pointer; + text-align: center; + + &:hover, + &:focus { + color: ${e=>e.theme.textColors.hex(10)}; + } + + &:focus { + outline: 0; + } +`,C8=eL.default.div.withConfig({displayName:"HistoryPage__EmptyWrapper",componentId:"sc-44f27d5f-2"})` + text-align: center; + padding: 1em; +`,C7=eL.default.div.withConfig({displayName:"HistoryPage__EmptyDescription",componentId:"sc-44f27d5f-3"})` + color: ${e=>e.theme.textColors.hex(60)}; + ${e1.UiTypography.sm} +`,C9=eL.default.div.withConfig({displayName:"HistoryPage__EmptyImageWrapper",componentId:"sc-44f27d5f-4"})` + margin-bottom: 24px; + height: 62px; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; + + & > svg { + height: 64px; + } +`,Me=function(e){let{dispatch:t,documentId:a,id:n,page:l}=e,{data:r,loading:o,error:i}=(0,eB.a)(l.query,l.options),s=r?.document;if((0,ev.useEffect)(()=>{o||null==s||t({type:"LOADED",payload:{id:n,document:s}})},[t,s,n,o]),l.options.skip)return ev.createElement(C6,{onClick:e=>{e.preventDefault(),e.stopPropagation(),t({type:"LOAD",payload:{id:n}})}},"Load More ");if(o)return ev.createElement(C4,null,ev.createElement(eI.Spinner,null));if(null!=i){let e=i.graphQLErrors[0];if(null!=e&&CN(e)){let t=e.extensions.spaceId;if(null!=t)return ev.createElement(C3,{spaceId:t})}return ev.createElement(C4,null,ev.createElement(eY.Z,{id:"history_dropdown.error_loading",defaultMessage:"There's an error loading history. Please try again later."}))}return null==l.data?ev.createElement(C4,null,ev.createElement(eY.Z,{id:"history_dropdown.project_not_found",defaultMessage:"Project not found."})):0===l.data.commits.length?ev.createElement(C4,null,ev.createElement(C8,null,ev.createElement(C9,null,ev.createElement(lT.O8,null)),ev.createElement(C7,null,ev.createElement(eY.Z,{id:"history_dropdown.no_history",defaultMessage:"There's no history for this project"})))):ev.createElement(C5,{documentId:a,pageData:l.data})};class Mt extends ev.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){er.$e(a=>{if(null!=e.scope){if(null!=e.scope.contexts)for(let[t,n]of Object.entries(e.scope.contexts))a.setContext(t,n);if(null!=e.scope.extras)for(let[t,n]of Object.entries(e.scope.extras))a.setExtra(t,n);if(null!=e.scope.tags)for(let[t,n]of Object.entries(e.scope.tags))a.setTag(t,n)}a.setContext("errorInfo",t),er.Tb(e)})}render(){return null!=this.state.error?ev.createElement(C4,null,ev.createElement(eY.Z,{id:"history_dropdown.error_loading",defaultMessage:"There's an error loading history. Please try again later."})):this.props.children}}let Ma=function(){let e=(0,e$.useDispatch)();return ev.createElement("div",{className:"mx-4 mb-3 flex gap-x-1 rounded-md border border-appcolor-300 px-4 py-5 text-sm"},ev.createElement(eY.Z,{id:"general.access_full_project_version_history",defaultMessage:"Upgrade to access the full project and version history."}),ev.createElement("div",{className:"flex cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade px-4 py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75",onClick:()=>{e(d4())}},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))};var Mn=a(7145),Ml=a.n(Mn);function Mr(e,t){let a=e.revision;for(let a of(0,eo.makeReverseIterable)(t)){if(e.revision!==a.revision)throw Error("Mismatch revision");let t=a.changeset.from;if(null==t){if(0===a.changeset.to.revision)break;throw Error("Disjointed project log")}let n=(0,li.invertChangeset)(a.changeset);e.contents=e.contents.apply(n),e.revision=t.revision}let n=e.revision;console.log(`Reverted project ${e.id} from ${a} to ${n}…`)}let Mo=(0,la.ZP)` + query ProjectLatestCommitsQuery($documentId: ID!, $last: Int!) { + document(id: $documentId) { + id + revision + contents + commits(last: $last) { + edges { + node { + id + document_id + revision + changeset + created_at + createdOn + author { + ...BasicUserFields + } + } + cursor + } + pageInfo { + hasPreviousPage + endCursor + } + } + } + } + ${up} +`,Mi=(0,la.ZP)` + query ProjectCommitsQuery($documentId: ID!, $last: Int!, $before: String!) { + document(id: $documentId) { + id + commits(last: $last, before: $before) { + edges { + node { + id + document_id + revision + changeset + created_at + createdOn + author { + ...BasicUserFields + } + } + cursor + } + pageInfo { + hasPreviousPage + endCursor + } + } + } + } + ${up} +`,Ms=function(e,t){let a=e.pages[t.payload.id];return null!=a&&a.options.skip?Ml()(e,{pages:{[t.payload.id]:{options:{skip:{$set:!1}}}}}):e},Md=function(e,t){let{id:a,document:n}=t.payload,l=e.pages[a];if(null==l||null!=l.data||n.id!==e.documentId)return e;if(0===a){let t=n.contents,l=n.revision;if(null==t||null==l)return e;let r=n.commits,o=[];for(let e of(0,eo.makeReverseIterable)(r.edges))o.push(e.node);let i=li.Contents.deserialize(t),s={id:e.documentId,contents:i,revision:l};Mr(s,o);{let t=e;if(t=Ml()(t,{pages:{[a]:{data:{$set:{commits:o,contents:s.contents,revision:s.revision}}}}}),r.pageInfo.hasPreviousPage&&null!=r.pageInfo.endCursor){let e={query:Mi,options:{skip:!0,variables:{documentId:t.documentId,last:100,before:r.pageInfo.endCursor}},data:null};t=Ml()(t,{pages:{$push:[e]}})}return t}}{let t=e.pages[a-1].data;if(null==t)return e;let l=t.contents,r=t.revision;if(null==l||null==r)return e;let o=n.commits,i=[];for(let e of(0,eo.makeReverseIterable)(o.edges))i.push(e.node);let s={id:e.documentId,contents:l,revision:r};Mr(s,i);{let t=e;if(t=Ml()(t,{pages:{[a]:{data:{$set:{commits:i,contents:s.contents,revision:s.revision}}}}}),o.pageInfo.hasPreviousPage&&null!=o.pageInfo.endCursor){let e={query:Mi,options:{skip:!0,variables:{documentId:t.documentId,last:100,before:o.pageInfo.endCursor}},data:null};t=Ml()(t,{pages:{$push:[e]}})}return t}}},Mc=function(e,t){if(0===e.pages.length||e.pages.length-t.payload.id!=1)return e;{let a={query:Mi,options:{skip:!0,variables:{documentId:e.documentId,last:100,before:t.payload.before}},data:null};return Ml()(e,{pages:{$push:[a]}})}},Mm=function(e,t){switch(t.type){case"LOAD":return Ms(e,t);case"LOADED":return Md(e,t);case"ADD_PAGE":return Mc(e,t);default:return e}},Mu=function(e){return{documentId:e.documentId,pages:[{query:Mo,options:{skip:!1,variables:{documentId:e.documentId,last:100,before:null},fetchPolicy:"network-only"},data:null}]}},Mp=eL.default.div.withConfig({displayName:"HistoryBody__Wrapper",componentId:"sc-16d0b24d-0"})` + overflow-x: auto; + width: 100%; + ${tS} +`,Mg=function(e){let{documentId:t}=e,[a,n]=ev.useReducer(Mm,e,Mu);return ev.createElement(Mp,null,a.pages.map((e,a)=>ev.createElement(Me,{dispatch:n,documentId:t,key:`${a}`,id:a,page:e})))},Mf=eL.default.div.withConfig({displayName:"HistoryMenu__EventPropagationTrap",componentId:"sc-4e6e4ad3-0"})` + display: flex; + overflow: hidden; +`,Mh=eL.default.div.withConfig({displayName:"HistoryMenu__StyledHeader",componentId:"sc-4e6e4ad3-1"})` + display: grid; + grid-template-columns: 1fr auto; + padding: 15px 20px 10px; + color: ${e=>e.theme.textColors.hex(10)}; + + h3 { + margin: 0; + ${e1.UiTypography.md}; + font-weight: 500; + } +`,My=eL.default.div.withConfig({displayName:"HistoryMenu__Description",componentId:"sc-4e6e4ad3-2"})` + display: inline; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm} + padding: 0 1.25em; + margin-bottom: 0.5em; + + & button { + color: ${e=>e.theme.primaryColorScheme?.base}; + font-weight: 500; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,Mb=function(e){let{documentId:t,isReadOnly:a,initialFocus:n,menuGroupDispatch:l,spaceId:r}=e,{data:o,loading:i}=(0,eB.a)(Cw,r?{variables:{spaceID:r}}:{skip:!0}),s=ev.useMemo(()=>!i&&"free"===(o?.membership?.space?.taskadePlan?.type??"free"),[o?.membership?.space?.taskadePlan?.type,i]);(0,ev.useEffect)(()=>{var e;u$?.track("Project Opened History",{version:2},{context:{projectId:t,groupId:e}})},[t]);let d=(0,ev.useCallback)(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),c=(0,e$.useDispatch)(),m=()=>{c(C_.actions.toggleHistoryRevertDialog({documentId:t}))};return ev.createElement(eI.MenuGroupContext.Provider,{value:l},ev.createElement(eI.Menu,{className:"flex max-h-[80vh] w-96 flex-col overflow-hidden rounded-xl border border-appcolor-300 bg-appcolor-0 shadow",initialFocus:n},ev.createElement(Mh,{onClick:d},ev.createElement("h3",null,ev.createElement(eY.Z,{id:"general.project_history",defaultMessage:"Project History"}),s&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:()=>{c(d4())}}))),!a&&ev.createElement(My,null,ev.createElement(eY.Z,{id:"general.see_changes_made_to_this_project_or_restore_to_a_previous_state_with_version_history",defaultMessage:"See changes made to this project or restore to a previous state with .",values:{button:e=>ev.createElement("button",{onClick:m},e)}})),ev.createElement(Mf,{onClick:d},ev.createElement(Mt,null,ev.createElement(Mg,{documentId:t}))),s&&ev.createElement(Ma,null)))},Mv=function(e){let{documentId:t,isReadOnly:a,spaceId:n}=e,[l,r]=ev.useState(!1),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),{referenceProps:d,arrowProps:c,popperProps:m}=(0,eI.useControlledTooltip)({referenceElementRef:o,popperElementRef:s,arrowElementRef:i,visible:l,placement:"bottom"}),[u,p]=ev.useReducer(eI.popupReducer,{expanded:!1}),g=ev.useRef(null),f=ev.useCallback(()=>{o.current?.focus()},[]);(0,eI.usePopupEvents)({state:u,onCollapse:f});let h=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:g,state:u,placement:"bottom-end"}),y=(0,eI.useMenuButton)({dispatch:p,ref:o,state:u}),b=ev.useCallback(e=>{e.type,p({type:"Collapse"})},[]),v=ev.useCallback(()=>{u.expanded||r(!0)},[u.expanded,r]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"duration-250 flex h-7 w-7 items-center justify-center transition ease-in-out hover:text-appcolor-500",...y.props,...d,onMouseEnter:v,onMouseLeave:()=>{r(!1)}},ev.createElement(tn.Icon,{icon:"header_project_history",className:"scale-90"})),u.expanded&&ev.createElement(eI.Popup,{...h.props,dispatch:p,modal:!0},ev.createElement(Mb,{documentId:t,spaceId:n,isReadOnly:a,initialFocus:h.initialFocus,menuGroupDispatch:b})),l&&ev.createElement(eI.Tooltip,{arrowProps:c,popperProps:m},ev.createElement(eY.Z,{id:"general.project_history",defaultMessage:"Project History"})))},Mk=(0,d9.oM)({name:"dialogs.print",initialState:{isOpen:!1},reducers:{togglePrintDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{isOpen:!0,projectId:t.payload.projectId}}}),ME={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PinDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pinned"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pinDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pinned"},value:{kind:"Variable",name:{kind:"Name",value:"pinned"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"pinned_at"}}]}}]}}]},Mx={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StarDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"starred"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"starDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"starred"},value:{kind:"Variable",name:{kind:"Name",value:"starred"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"starred_at"}}]}}]}}]};function M_(e){let{onApprove:t=null,onDecline:a=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};confirm(e)?t&&t():a&&a()}function Mw(e,t){let{onApprove:a=null,onDecline:n=null}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};M_(`Are you sure you want to delete ${t}?`,{onApprove:a,onDecline:n})}let MN={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"LeaveDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"leaveDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}]}]}}]},MC=function(e){let{className:t,name:a,value:n,onClick:l,children:r}=e,o=ev.useRef(null),i=(0,eI.useMenuItem)({stopRef:o,name:a,value:n,onClick:l});return ev.createElement("div",{className:og()("flex select-none items-center px-3 py-1 text-sm hover:cursor-pointer",{"bg-appcolor-300":i.navigated},t),...i.props},r)},MM=eL.default.div.withConfig({displayName:"BottomSection__Separator",componentId:"sc-f52ee623-0"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; +`,MS=function(e){let{doc:t,isLoggedIn:a,allowGuest:n}=e,l=(0,ll.x)(),r=(0,eF.k6)(),o=lm({role:t.role,action:{project:"archive",workspace:"archive_project"}}),i=lm({role:t.role,action:{project:"delete",workspace:"delete_project"}}),s=ev.useMemo(()=>{if(lm({role:t.role,action:{project:"leave"}}))return()=>{var e;e=t.title,M_(`Are you sure you want to leave ${e}?`,{onApprove:()=>{l.mutate({mutation:MN,variables:{id:t.id}}).then(e=>{let{data:t}=e;t?.leaveDocument&&r.push("/")})}})}},[l,t.id,t.role,t.title,r]),d=t.isTemplate,c=(o||n&&!a)&&null!=t.space,m=i&&!1,u=null!=s,p=ev.useContext(eI.MenuGroupContext),g=ev.useCallback(e=>{"Activate"===e.type&&("leave"===e.payload.name?s?.():p?.(e))},[s,p]);return ev.createElement(eI.MenuGroupContext.Provider,{value:g},(c||u||m)&&ev.createElement(MM,null),c&&ev.createElement(MC,{name:"archive_toggle"},ev.createElement(tn.Icon,{icon:"dd_complete",className:"mr-2 scale-90"}),t.isArchived?ev.createElement(eY.Z,{id:"general.restore",defaultMessage:"Restore"}):ev.createElement(eY.Z,{id:"general.complete",defaultMessage:"Complete"})),u&&ev.createElement(MC,{name:"leave",className:"text-danger"},ev.createElement(tn.Icon,{icon:"dd_leave",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.leave_project",defaultMessage:"Leave Project"})),m&&ev.createElement(MC,{name:"delete",className:"text-danger"},ev.createElement(tn.Icon,{icon:"dd_delete",className:"mr-2 scale-90"}),d?ev.createElement(eY.Z,{id:"general.delete_template",defaultMessage:"Delete Template"}):ev.createElement(eY.Z,{id:"general.delete_project",defaultMessage:"Delete Project"})))};var MI=a(46020),MD=a.n(MI);function MT(e,t,a){u$?.track("Project Exported",{fileType:e,version:2},{context:{projectId:t,groupId:a}})}let M$=(0,la.ZP)` + query DocumentQuery($id: ID!) { + document(id: $id) { + id + info + view_path + } + } +`;async function MP(e,t,a,n){return a===dl?MD()(e,{useCORS:!0,backgroundColor:n,width:t.getBoundingClientRect().width}):MD()(e,{useCORS:!0,backgroundColor:n})}async function MF(e,t,a){let n=document.getElementById("data-export-image-capture");if(null==n)throw Error("Export image: capture element should not be null or undefined.");let l=n.querySelector(":scope > .children");if(null==l)throw Error("Export image: capture element should not be null or undefined.");let r=function(e,t){if(t)return"#111111";switch(e){case ds:case dd:return"#F8F8F8";default:return"#FFFFFF"}}(e,t),o=await MP(n,l,e,r);window.scrollTo(0,0),o.getContext("2d");let i=o.toDataURL("image/jpeg"),s=document.createElement("a");s.download=a?`${a}.jpeg`:"taskade.jpeg",s.href=i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}let MA=(0,e$.connect)(function(e){return{documentView:dA(e),contents:iL(e),user:t7(e),documentId:dP(e),spaceId:dU(e)}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{initialFocus:a,user:n,spaceId:l,documentId:r,documentView:o,contents:i}=e,s=gV(),d=(0,eL.useTheme)(),c=d?.isNightMode??!0,m=(0,e$.useDispatch)(),{data:u}=(0,eB.a)(M$,{variables:{id:r}}),p=n?.id,g=i.rootNode?.textString??"",f=g.length>0?g.trim().replace(/\s+/g,"_"):null,h=(0,ev.useCallback)(async()=>{if(null==p){m(rh({isOpen:!0,activeView:rT,enableCopyList:void 0}));return}if(s.isPaywallEnabled){null!=s.id&&m(d4(s.id));return}try{await MF(o,c,f),null!=p&&MT("image",r,l)}catch(e){er.Tb(e)}},[m,s.id,s.isPaywallEnabled,o,c,p,l,r,f]),y=(0,ev.useCallback)(()=>{if(null==p){m(rh({isOpen:!0,activeView:rT,enableCopyList:void 0}));return}try{(function(e,t){let a=document.createElement("a");a.download=t?`${t}.txt`:"taskade.txt";let n=e.toST(),l=(0,lo.taskastToMdast)(n),r=(0,lo.mdastToMarkdownText)(l);a.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),document.body.appendChild(a),a.click(),document.body.removeChild(a)})(i,f),MT("text",r,l)}catch(e){er.Tb(e)}},[i,p,r,l,m,f]),b=(0,ev.useCallback)(()=>{if(null==p){m(rh({isOpen:!0,activeView:rT,enableCopyList:void 0}));return}try{(function(e,t){let a=document.createElement("a");a.download=t?`${t}.md`:"taskade.md";let n=e.toST(),l=(0,lo.taskastToMdast)(n),r=(0,lo.mdastToMarkdownText)(l);a.setAttribute("href","data:text/markdown;charset=utf-8,"+encodeURIComponent(r)),document.body.appendChild(a),a.click(),document.body.removeChild(a)})(i,f),MT("markdown",r,l)}catch(e){er.Tb(e)}},[i,p,r,l,m,f]),v=(0,ev.useCallback)(()=>{if(null==p){m(rh({isOpen:!0,activeView:rT,enableCopyList:void 0}));return}m(Mk.actions.togglePrintDialog({projectId:r}))},[m,p,r]),k=ev.useContext(eI.MenuGroupContext),E=ev.useCallback(e=>{if("Activate"===e.type&&"export"===e.payload.name)switch(e.payload.value){case"image":h();break;case"text":y();break;case"markdown":b();break;case"pdf":v()}k?.(e)},[h,b,v,y,k]);return ev.createElement(eI.MenuGroupContext.Provider,{value:E},ev.createElement(eI.Menu,{className:"flex flex-col overflow-hidden rounded-lg border border-appcolor-300 bg-appcolor-100 shadow-lg",initialFocus:a,ref:t},ev.createElement(MC,{name:"export",value:"image"},ev.createElement(tn.Icon,{icon:"dd_export_image",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.export_as_image",defaultMessage:"Export as Image"}),s.isPaywallEnabled&&ev.createElement(MR,null,ev.createElement(e1.UpgradeBadge,null))),ev.createElement(MC,{name:"export",value:"text"},ev.createElement(tn.Icon,{icon:"dd_export_text",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.export_as_txt",defaultMessage:"Export as Text"})),ev.createElement(MC,{name:"export",value:"markdown"},ev.createElement(tn.Icon,{icon:"dd_export_markdown",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.export_as_markdown",defaultMessage:"Export as Markdown"})),ev.createElement(MC,{name:"export",value:"pdf"},ev.createElement(tn.Icon,{icon:"dd_export_pdf",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.export_as_pdf",defaultMessage:"Export as PDF"}))))})),MR=eL.default.div.withConfig({displayName:"ExportDropdownMenu__Wrapper",componentId:"sc-74f6b851-0"})` + margin-left: auto; + & svg { + margin-right: 2px; + transform: none; + align-self: center; + } +`,Mj=function(){let e=ev.useRef(null),t=ev.useRef(null),[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),l=(0,eI.usePopup)({referenceElementRef:e,popupElementRef:t,state:a,placement:"left-start"}),r=ev.useRef(null),o=ev.useCallback(()=>{a.expanded?r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):n({type:"Expand",payload:"first"})},[a.expanded]),i=ev.useCallback(()=>{a.expanded?e.current?.focus():n({type:"Expand"})},[a.expanded]),s=(0,eI.useMenuItem)({stopRef:e,name:"export",submenuPopupState:a,onClick:o,onMouseEnter:i}),d=ev.useCallback(()=>{s.navigated&&e.current?.focus()},[s.navigated]);return(0,eI.usePopupEvents)({state:a,onCollapse:d}),ev.useEffect(()=>{a.expanded&&!s.navigated&&n({type:"Collapse"})},[a.expanded,s.navigated]),ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex w-full items-center px-3 py-1 text-sm",{"bg-appcolor-300":s.navigated}),...s.props},ev.createElement(tn.Icon,{icon:"export",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.export",defaultMessage:"Export"})),a.expanded&&ev.createElement(eI.Popup,{...l.props,dispatch:n},ev.createElement(MA,{initialFocus:l.initialFocus,ref:r})))},MO=function(e){let t=e0(),a=ev.useCallback(e=>{e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},[]),n=ev.useCallback(()=>{a(document.documentElement)},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(MC,{name:"print"},ev.createElement(tn.Icon,{icon:"dd_print",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.print",defaultMessage:"Print"})),ev.createElement(MC,{name:"present",onClick:n},ev.createElement(tn.Icon,{icon:"dd_present",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.present",defaultMessage:"Present"})),ev.createElement(MC,{name:"notifications"},ev.createElement(tn.Icon,{icon:"dd_notifications",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.notifications",defaultMessage:"Notifications"})),!(null!=t)&&ev.createElement(MC,{name:"open_in_desktop"},ev.createElement(tn.Icon,{icon:"dd_desktop",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.open_in_desktop_app",defaultMessage:"Open in desktop app"})))},MU=function(e){let{allowGuest:t,role:a,isLoggedIn:n}=e;return lm({role:a,action:{project:"move",workspace:"move_project"}})||t&&!n?ev.createElement(MC,{name:"move"},ev.createElement(tn.Icon,{icon:"dd_move",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.move",defaultMessage:"Move"})):null},MZ=function(e){let{doc:t}=e,a=Eu({role:t.role?.workspace,action:"pin_project"}),n=null!=t.templated_at,l=null!=t.pinned_at;return!a||n?null:ev.createElement(MC,{name:"pin"},ev.createElement(tn.Icon,{icon:"dd_pin",className:"mr-2 scale-90"}),l?ev.createElement(eY.Z,{id:"general.unpin",defaultMessage:"Unpin"}):ev.createElement(eY.Z,{id:"general.pin",defaultMessage:"Pin"}))},ML=function(e){let{doc:t}=e,a=null!=t.starred_at;return ev.createElement(MC,{name:"star"},ev.createElement(tn.Icon,{icon:"dd_star",className:"mr-2 scale-90"}),a?ev.createElement(eY.Z,{id:"general.unstar",defaultMessage:"Unstar"}):ev.createElement(eY.Z,{id:"general.star",defaultMessage:"Star"}))},MB=function(e){let{doc:t}=e,a=t.isTemplate;return ev.createElement(MC,{name:"templates"},ev.createElement(tn.Icon,{icon:a?"dd_copy":"dd_addtotemplates",className:"mr-2 scale-90"}),a?ev.createElement(eY.Z,{id:"general.copy_template",defaultMessage:"Copy Template"}):ev.createElement(eY.Z,{id:"general.add_to_templates",defaultMessage:"Add to Templates"}))},Mz=function(e){let{editorStatus:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"left",visible:r});if(null==t)return null;let{createdBy:c,updatedBy:m,updatedAt:u}=t;return null==u?null:ev.createElement(ev.Fragment,null,ev.createElement(Mq,null),ev.createElement(MV,{...d,onMouseLeave:()=>{o(!1)},onMouseEnter:()=>{o(!0)}},ev.createElement(eY.Z,{id:"general.project_updated_timestamp",defaultMessage:"Updated by {handle} {br} {on} {at}",values:{on:ev.createElement(te.Ji,{value:new Date(u),month:"short",day:"numeric"}),at:ev.createElement(te.qN,{value:new Date(u)}),handle:m,br:ev.createElement("br",null)}}),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.project_created_by",defaultMessage:"Created by {handle}",values:{handle:c}}))))},MV=eL.default.div.withConfig({displayName:"TimestampFooter__Container",componentId:"sc-c1a522c7-0"})` + display: flex; + flex-direction: column; + column-gap: var(--menu-item-gap); + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(4)}; + ${e1.UiTypography.xs}; + line-height: 18px; + color: ${e=>e.theme.textColors.hex(50)}; + gap: ${eI.UiSpacing.getPx(1.5)}; + align-items: flex-start; + text-align: left; + cursor: pointer; +`,Mq=eL.default.div.withConfig({displayName:"TimestampFooter__Separator",componentId:"sc-c1a522c7-1"})` + width: 100%; + background: ${e=>e.theme.appColors.hex(70)}; + height: 1px; + margin: var(--menu-item-divider-margin); +`,MW=eL.default.div.withConfig({displayName:"TogglesSection__Separator",componentId:"sc-8eb6075e-0"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; +`,MH=function(e){let{hideCompleted:t,isLoggedIn:a,role:n}=e,l=(0,e$.useSelector)(sr),r=(0,e$.useSelector)(sn),o=(0,e$.useSelector)(sl),i=lm({role:n,action:{project:"check",workspace:"check_project"}});return ev.createElement(ev.Fragment,null,ev.createElement(MC,{name:"hide_completed_toggle"},ev.createElement(tn.Icon,{icon:t?"dd_show_completed":"dd_hide_completed",className:"mr-2 scale-90"}),t?ev.createElement(eY.Z,{id:"general.show_completed",defaultMessage:"Show completed"}):ev.createElement(eY.Z,{id:"general.hide_completed",defaultMessage:"Hide completed"})),(i||!a)&&ev.createElement(MC,{name:"complete_all_toggle"},ev.createElement(tn.Icon,{icon:"dd_checkall",className:"mr-2 scale-90"}),l?ev.createElement(eY.Z,{id:"general.uncheck_all",defaultMessage:"Uncheck all"}):ev.createElement(eY.Z,{id:"general.check_all",defaultMessage:"Check all"})),ev.createElement(MC,{name:"fold_all_toggle"},r&&o?ev.createElement(tn.Icon,{icon:"dd_unfoldall",className:"mr-2 scale-90"}):ev.createElement(tn.Icon,{icon:"dd_foldall",className:"mr-2 scale-90"}),r&&o?ev.createElement(eY.Z,{id:"general.unfold_all",defaultMessage:"Unfold all"}):ev.createElement(eY.Z,{id:"general.fold_all",defaultMessage:"Fold all"})),ev.createElement(MW,null))},MG=eL.default.div.withConfig({displayName:"ActionsDropdown__Separator",componentId:"sc-a59e7ffa-0"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,MK=eL.default.div.withConfig({displayName:"ActionsDropdown__Wrapper",componentId:"sc-a59e7ffa-1"})` + margin-left: auto; + + & svg { + margin-right: 2px; + transform: none; + align-self: center; + } +`,MY=eL.default.span.withConfig({displayName:"ActionsDropdown__Shortcut",componentId:"sc-a59e7ffa-2"})` + flex-grow: 1; + margin-left: 2px; + ${e1.UiTypography.xxs}; + text-align: right; + color: ${e=>e.theme.textColors.hex("50")}; +`,MQ=eL.default.span.withConfig({displayName:"ActionsDropdown__ShortcutKey",componentId:"sc-a59e7ffa-3"})` + margin-left: 3px; + text-transform: uppercase; +`,MJ=function(e){let{doc:t,docV2:a,allowGuest:n,isLoggedIn:l,hideCompleted:r,isReadOnly:o,editorStatus:i,onClickToggleHideCompleted:s,onClickToggleCompleteAll:d,onClickToggleCollapseAll:c,onClickSearch:m,onClickShare:u,onClickPin:p,onClickStar:g,onClickCopy:f,onClickMove:h,onClickCopyAsTemplate:y,onClickPrint:b,onClickNotifications:v,onClickArchive:k,onClickDeleteForever:E,onClickDuplicate:x,onClickOpenDesktopApp:_}=e,w=(0,e$.useDispatch)(),[N,C]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),M=ev.useRef(null),S=ev.useRef(null),I=(0,eI.usePopup)({referenceElementRef:M,popupElementRef:S,state:N,placement:"bottom-end"}),D=(0,eI.useMenuButton)({state:N,dispatch:C,ref:M}),T=gV(),$=d6()&&!hA(T.type),P=!l||!o,F=ev.useCallback(()=>{if(!l){w(rh({isOpen:!0,activeView:rI}));return}w(C_.actions.toggleHistoryRevertDialog({documentId:t.id}))},[w,t.id,l]),A=ev.useCallback(e=>{if("Activate"===e.type)switch(e.payload.name){case"hide_completed_toggle":s?.();break;case"complete_all_toggle":d?.();break;case"fold_all_toggle":c?.();break;case"search":m?.();break;case"duplicate":x?.();break;case"copy":f?.();break;case"version_history":F();break;case"share":u?.();break;case"pin":p?.();break;case"star":g?.();break;case"move":h?.();break;case"templates":y?.();break;case"print":b?.();break;case"presentation":break;case"notifications":v?.();break;case"open_in_desktop":_?.();break;case"archive_toggle":k?.();break;case"delete":E?.()}C({type:"Collapse"})},[F,k,f,y,E,x,h,v,_,p,b,m,u,g,c,d,s]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"duration-250 flex h-7 w-7 items-center justify-center transition ease-in-out hover:text-appcolor-500",...D.props},ev.createElement(tn.Icon,{icon:"header_more"})),N.expanded&&ev.createElement(eI.Popup,{...I.props,dispatch:C,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:A},ev.createElement(eI.Menu,{initialFocus:I.initialFocus,className:"rounded-lg border border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement(MH,{hideCompleted:r,isLoggedIn:l,role:t.role}),m&&ev.createElement(MC,{name:"search"},ev.createElement(tn.Icon,{icon:"dd_search",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.search",defaultMessage:"Search"}),ev.createElement(MY,null,ev.createElement(MQ,null,eI.ModifierKeys.ModSymbol),ev.createElement(MQ,null,"F"))),u&&lm({role:t.role,action:{project:"edit",workspace:"edit_project"}})&&ev.createElement(MC,{name:"share"},ev.createElement(tn.Icon,{icon:"dd_share",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.share",defaultMessage:"Share"})),null!=p&&null!=a&&ev.createElement(MZ,{doc:a}),null!=g&&null!=a&&ev.createElement(ML,{doc:a}),x&&ev.createElement(MC,{name:"duplicate"},ev.createElement(tn.Icon,{icon:"dd_duplicate",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.duplicate",defaultMessage:"Duplicate"})),f&&ev.createElement(MC,{name:"copy"},ev.createElement(tn.Icon,{icon:"dd_copy",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"})),h&&ev.createElement(MU,{role:t.role,isLoggedIn:l,allowGuest:n}),y&&ev.createElement(MB,{doc:t}),ev.createElement(MG,null),P&&ev.createElement(MC,{name:"version_history"},ev.createElement(tn.Icon,{icon:"dd_version_history",className:"mr-2 scale-90"}),ev.createElement(eY.Z,{id:"general.version_history",defaultMessage:"Version history"}),$&&ev.createElement(MK,{className:"pl-2"},ev.createElement(e1.UpgradeBadge,null))),ev.createElement(Mj,null),ev.createElement(MO,null),ev.createElement(MS,{doc:t,isLoggedIn:l,allowGuest:n}),ev.createElement(Mz,{editorStatus:i})))))},MX=new Set(["manage_settings"]);function M0(e,t){return!!MX.has(t)&&null!=e&&!!(null!=e.project&&lc.Y8.can(e.project,t,"project")||null!=e.workspace&&lc.Y8.can(e.workspace,t,"project"))}let M1=(0,d9.oM)({name:"dialogs.projectSettings",initialState:{isOpen:!1},reducers:{toggleProjectSettingsDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0}}}),M2=function(e){let{projectId:t}=e,a=(0,e$.useDispatch)(),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useState(!1),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"top",visible:o});return ev.createElement(ev.Fragment,null,ev.createElement("button",{...c,onClick:()=>{a(M1.actions.toggleProjectSettingsDialog({projectId:t,page:"appearance"}))},onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},className:"duration-250 flex h-7 w-7 items-center justify-center transition ease-in-out hover:text-appcolor-500"},ev.createElement(tn.Icon,{icon:"header_project_settings",className:"scale-90"})),o&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"project.settings",defaultMessage:"Project Settings"})))},M5=function(){let e=(0,eF.$B)().params.documentID,{search:t}=(0,eF.TH)(),a=s4(t),{data:n}=(0,eB.a)(s3,null!=e?{variables:{documentId:e,shareToken:a}}:{skip:!0});return null==e?null:M0(n?.document?.role,"manage_settings")?ev.createElement(M2,{projectId:e}):null},M3=function(e){let{doc:t,editorStatus:a,hideCompleted:n,readOnly:l,setLoginSignupModalState:r,startCopyDocument:o,toggleArchiveDocumentEntity:i,toggleCollapseAll:s,toggleCompleteAll:d,toggleDocumentMoveV2Modal:c,toggleDocumentHideCompleted:m,toggleDocumentInviteModal:u,toggleSearchBar:p,toggleDocumentNotificationModal:g,togglePrintDialog:f,user:h}=e,y=!eu()(t)&&(!t.isTemplate||eu()(h)),b=t?.isOwner??!1,v=null!=h,k=null==h&&!b,E=null!=t&&(v||k),x=(0,ll.x)(),{loading:_,data:w}=function(){let{documentID:e,documentPathType:t,documentViewOrEditID:a}=(0,eF.UO)(),{search:n}=(0,eF.TH)(),l=ev.useMemo(()=>null==t||null==a?null:`/${t}/${a}`,[t,a]),[r,o]=ev.useMemo(()=>null==e?[Cu,{variables:null!=l?{path:l}:void 0,skip:null==l}]:[Cp,{variables:{id:e,shareToken:s4(n)}}],[e,l,n]),{loading:i,error:s,data:d}=(0,eB.a)(r,o);return{loading:i,error:s,data:d}}(),N=w?.document,C=ev.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r({isOpen:!0,activeView:rI,enableCopyList:e,copyAsTemplate:t})},[r]),M=ev.useCallback(()=>{h?i(t.id):C()},[t,C,i,h]),S=ev.useCallback(()=>{null!=h?o(t.id,{redirect:!0,spaceID:t.space?.id}):C(!0)},[t,C,o,h]),I=ev.useCallback(()=>{h?o(t.id,{isTemplate:!0,redirect:!0,spaceID:t.space?.id}):C(!0,!0)},[t,C,o,h]),D=ev.useCallback(()=>{null!=h?g():C()},[C,g,h]),T=ev.useCallback(()=>{h?c(t.id,{spaceID:t.space?.id}):C()},[t,C,c,h]),$=ev.useCallback(()=>{if(h){if(null!=N){let e=null!=N.pinned_at;x.mutate({mutation:ME,variables:{id:N.id,pinned:!e},optimisticResponse:{__typename:"Mutation",pinDocument:{__typename:"Document",id:N.id,pinned_at:e?null:new Date().toString()}}})}}else C()},[x,N,C,h]),P=ev.useCallback(()=>{if(null!=h){if(null!=N){let e=null!=N.starred_at;x.mutate({mutation:Mx,variables:{id:N.id,starred:!e},optimisticResponse:{__typename:"Mutation",starDocument:{__typename:"Document",id:N.id,starred_at:e?null:new Date().toString()}}})}}else C()},[x,N,C,h]),F=ev.useCallback(()=>{f({projectId:t.id})},[t,f]),A=ev.useCallback(()=>{m(t.id)},[t,m]),R=ev.useCallback(()=>{null!=h?u(t.id):C()},[t,C,u,h]),j=ev.useCallback(()=>{window.open(`taskade://open?url=/d/${t.id}`,"_blank","noopener,noreferrer")},[t]),O=eu()(h)?C:void 0;return _?null:ev.createElement("div",{className:"step4 flex items-center gap-0.5"},ev.createElement(eF.rs,null,ev.createElement(eF.AW,{path:eZ.document,component:Cx}),ev.createElement(eF.AW,{path:eZ.embed,component:Cx})),t&&ev.createElement(ev.Fragment,null,h&&ev.createElement(Mv,{documentId:t.id,isReadOnly:l,spaceId:t.space?.id}),h&&ev.createElement(M5,null),ev.createElement(MJ,{doc:t,docV2:N,allowGuest:!0,isLoggedIn:!eu()(h),isReadOnly:l,hideCompleted:n,editorStatus:a,onClickToggleHideCompleted:h?A:O,onClickToggleCompleteAll:l?O:d,onClickToggleCollapseAll:l?O:s,onClickSearch:p,onClickShare:R,onClickPin:$,onClickStar:t.isTemplate?void 0:P,onClickCopy:y?S:void 0,onClickMove:T,onClickCopyAsTemplate:E?I:void 0,onClickPrint:F,onClickNotifications:D,onClickArchive:t.space?M:void 0,onClickOpenDesktopApp:j})))};M3.propTypes={doc:l7().shape({editPath:l7().string,id:l7().string.isRequired,isOwner:l7().bool.isRequired,isTemplate:l7().bool,space:l7().shape({id:l7().string.isRequired}),viewPath:l7().string.isRequired}),hideCompleted:l7().bool.isRequired,readOnly:l7().bool.isRequired,startCopyDocument:l7().func.isRequired,toggleArchiveDocumentEntity:l7().func.isRequired,toggleCollapseAll:l7().func.isRequired,toggleCompleteAll:l7().func.isRequired,toggleDocumentHideCompleted:l7().func.isRequired,toggleDocumentInviteModal:l7().func.isRequired,toggleDocumentMoveV2Modal:l7().func.isRequired,toggleSearchBar:l7().func.isRequired,toggleDocumentNotificationModal:l7().func.isRequired,togglePrintDialog:l7().func.isRequired,user:l7().shape(),setLoginSignupModalState:l7().func.isRequired,editorStatus:l7().shape({createdBy:l7().string.isRequired,updatedBy:l7().string.isRequired,updatedAt:l7().string.isRequired})},M3.defaultProps={doc:null,user:null};let M4=(0,e$.connect)(function(e,t){return{doc:dV(e,t),hideCompleted:dT(e,t),readOnly:dq(e),user:t7(e,t),editorStatus:dL(e,t)}},function(e){return(0,ek.DE)({startCopyDocument:p_,toggleDocumentMoveV2Modal:xl,toggleArchiveDocumentEntity:xF,toggleCompleteAll:mF,toggleCollapseAll:mR,toggleDocumentHideCompleted:xE,toggleDocumentInviteModal:fP,toggleSearchBar:N4,toggleDocumentNotificationModal:rk,setLoginSignupModalState:rh,togglePrintDialog:Mk.actions.togglePrintDialog},e)})(M3),M6=(0,la.ZP)` + mutation ActivitiesMarkAllAsRead($input: ActivitiesMarkAllAsReadInput!) { + activitiesMarkAllAsRead(input: $input) { + clientMutationId + activities { + id + read_at + } + projectIds + } + } +`,M8={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UnreadActivityCountQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"unread_activity_count"}}]}}]}}]},M7=(0,la.ZP)` + query ActivityQuery($first: Int, $after: String) { + activity(first: $first, after: $after) { + edges { + cursor + node { + id + type + data + read_at + created_at + user { + ...BasicUserFields + } + } + } + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + totalCount + } + } + ${up} +`;function M9(e){let{data:t,error:a,loading:n,refetch:l}=(0,eB.a)(M7,{variables:e,fetchPolicy:"cache-and-network"});return(0,ev.useMemo)(()=>n?{activity:null,error:null,loading:n}:null!=a?{activity:null,error:a,loading:n,refetch:l}:{activity:t?.activity??null,error:a,loading:n,refetch:l},[t,a,n,e.first,e.after])}let Se=eL.default.div.withConfig({displayName:"ActivityDateSeparator__DateSeparator",componentId:"sc-424101a9-0"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + padding: 5px 20px; +`,St=ev.memo(function(e){let{unixTimestampMs:t,timezone:a}=e,n=(0,ev.useMemo)(()=>CR(t,a),[t,a]);return ev.createElement(Se,null,n)}),Sa=(0,la.ZP)` + mutation ActivitiesMarkAsRead($input: ActivitiesMarkAsReadInput!) { + activitiesMarkAsRead(input: $input) { + clientMutationId + activities { + id + read_at + } + } + } +`,Sn="user",Sl="space",Sr="calendar",So="changed",Si="credit";var Ss=a(6767),Sd=a.n(Ss);function Sc(e){let t=Sd()(e);return{base:t.hex(),darker10:t.darken(.1).hex(),alpha5:t.alpha(.05).rgb(),alpha10:t.alpha(.1).rgb(),alpha20:t.alpha(.2).rgb(),alpha30:t.alpha(.3).rgb(),alpha50:t.alpha(.5).rgb(),alpha80:t.alpha(.8).rgb(),alpha90:t.alpha(.9).rgb()}}let Sm=new Map([["brand",Sc("#ff2d60")],["red",Sc("#FC8D8C")],["blue",Sc("#54C4FA")],["green",Sc("#62E163")],["purple",Sc("#C89CFF")],["pink",Sc("#F899DA")],["yellow",Sc("#F9D600")]]);function Su(e){let t=Sm.get(e);return eu()(t)?t=Sc(e):t}let Sp=eL.default.div.withConfig({displayName:"ActivityAvatar__Avatar",componentId:"sc-86f159cb-0"})` + color: #fff; + display: flex; + width: 30px; + min-width: 30px; + height: 30px; + border-radius: 30px; + overflow: hidden; + justify-content: center; + align-items: center; + background: ${e=>e.backgroundColor?Su(e.backgroundColor).base:"none"}; + + & > img { + width: 30px; + height: 30px; + image-rendering: -webkit-optimize-contrast; + } + + & > span { + width: 30px; + height: 30px; + } +`,Sg=(0,eL.default)(lT.ND).withConfig({displayName:"ActivityAvatar__CalendarIcon",componentId:"sc-86f159cb-1"})` + & path { + stroke: #fff; + } +`,Sf=(0,eL.default)(lT.Ph).withConfig({displayName:"ActivityAvatar__ChangedIcon",componentId:"sc-86f159cb-2"})` + & path { + fill: #fff; + } +`;function Sh(e){let{avatar:t}=e,{type:a,user:n,space:l}=t||{};switch(a){case Sn:return ev.createElement(Sp,null,ev.createElement("img",{src:n?.avatars_v2?.default?.mdpi?.url}));case Sr:return ev.createElement(Sp,{backgroundColor:"blue"},ev.createElement(Sg,null));case Sl:return ev.createElement(Sp,null,ev.createElement(eI.ThemeProvider,{theme:{primaryColor:l.color}},ev.createElement(pJ,{space:{__typename:"Space",...l},size:"small"})));case So:return ev.createElement(Sp,{backgroundColor:l.color},ev.createElement(Sf,null));case Si:return ev.createElement(Sp,{backgroundColor:"blue"},ev.createElement(tn.Icon,{icon:"dd_referral"}));default:return ev.createElement(Sp,null)}}Sh.propTypes={avatar:l7().shape({type:l7().oneOf([Sn,Sl,Sr,So,Si]),user:l7().shape(),space:l7().shape()})},Sh.defaultProps={avatar:void 0};let Sy=eL.default.div.withConfig({displayName:"ActivityInfo__ActivityWrapper",componentId:"sc-84a49ac7-0"})` + display: flex; + flex-direction: column; + margin-top: 5px; +`,Sb=eL.default.div.withConfig({displayName:"ActivityInfo__Activity",componentId:"sc-84a49ac7-1"})` + display: flex; + margin-bottom: 5px; +`,Sv=eL.default.div.withConfig({displayName:"ActivityInfo__ActivitySideline",componentId:"sc-84a49ac7-2"})` + display: flex; + flex: 1 0 auto; + width: 3px; + max-width: 3px; + background: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + border-radius: 10px; +`,Sk=eL.default.div.withConfig({displayName:"ActivityInfo__ActivityBody",componentId:"sc-84a49ac7-3"})` + padding-left: 8px; + text-decoration: line-through; + color: ${e=>e.theme?.isNightMode?"#999":"#666"}; +`,SE=function(e){let{activity:t}=e;if("document-node-completed"===t.type){let{nodes:e}=t.data;return null!=e?ev.createElement(ev.Fragment,null,ev.createElement(Sy,null,e.map(e=>ev.createElement(Sb,{key:`activity-node-${t.id}-${e.id}`},ev.createElement(Sv,null),ev.createElement(Sk,null,e.text||"Untitled"))))):null}return null},Sx=(0,eL.default)(Cg).withConfig({displayName:"ActivityItem__CheckIconWrapper",componentId:"sc-addd9517-0"})` + display: none; + justify-self: end; + justify-content: center; + align-items: center; + height: 28px; + width: 28px; + border-radius: 10px; + background: none; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + svg path { + stroke: ${e=>e.theme.appColors.hex(10)}; + } +`,S_=eL.default.div.withConfig({displayName:"ActivityItem__StyledActivityItem",componentId:"sc-addd9517-1"})` + position: relative; + display: grid; + grid-template-columns: 42px 1fr 42px; + justify-items: start; + padding: 8px 12px 8px 20px; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(10)}; + cursor: pointer; + font-weight: ${e=>e.read?400:500}; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + ${Sx} { + display: flex; + } + } + + &.activity-page { + padding: 10px 30px; + + & > .unread-dot { + left: 16px; + } + } +`,Sw=eL.default.div.withConfig({displayName:"ActivityItem__StyledUnreadDot",componentId:"sc-addd9517-2"})` + display: ${e=>e.read?"none":"block"}; + position: absolute; + top: 25px; + left: 8px; + width: 6px; + height: 6px; + border-radius: 6px; + background: #ff2d60; +`,SN=eL.default.div.withConfig({displayName:"ActivityItem__StyledMessage",componentId:"sc-addd9517-3"})` + white-space: normal; + word-break: break-word; +`,SC=eL.default.span.withConfig({displayName:"ActivityItem__StyledTimestamp",componentId:"sc-addd9517-4"})` + font-size: 13px; + color: #999; +`,SM=function(e){let{activity:t,className:a}=e,n=(0,eK.Z)(),[l]=(0,cs.D)(Sa),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useState(!1),{arrowProps:m,popperProps:u,referenceProps:p}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:i,popperElementRef:s,placement:"top",visible:d}),g=ev.useMemo(()=>(function(e){let t=e?.data?.node?.id||e?.data?.nodes?.[0]?.id,a=e?.data?.document?.id,n=e?.data?.space?.id,l=e?.data?.referredUser;switch(!0){case!ts()(a)&&!ts()(t):return`/d/${a}#node-${t}`;case!ts()(a):return`/d/${a}`;case!ts()(n):return`/spaces/${n}`;case!ts()(l):return"/settings/credits";default:return}})(t),[t]),f=(0,eI.useMenuItem)({stopRef:o,name:"activity",value:g});ev.useEffect(()=>{f.navigated&&o.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[f.navigated]);let h=(0,ev.useCallback)((e,a)=>{c(!1),e.preventDefault(),e.stopPropagation(),l({variables:{input:{clientMutationId:(0,ld.Z)(),activityId:a}},update:e=>{e.writeFragment({id:`Document:${t.data.document.id}`,fragment:(0,la.ZP)` + fragment documentFragment on Document { + is_unread + } + `,data:{is_unread:!1,__typename:"Document"}});let a=e.readQuery({query:M8}),n=a?.me;null!=n&&e.writeQuery({query:M8,data:{me:{...n,unread_activity_count:n.unread_activity_count-1}}})}})},[l,t]);return ev.createElement(ev.Fragment,null,ev.createElement(S_,{className:a,...f.props,read:t.read_at},ev.createElement(Sw,{className:"unread-dot",read:t.read_at}),ev.createElement(Sh,{avatar:function(e){let{data:t,type:a}=e;switch(a){case"document-assigned":case"document-node-assigned":return{user:t.assigner,type:Sn};case"document-completed":case"document-node-completed":return{user:t.editor,type:Sn};case"document-commented":return{user:t.commenter,type:Sn};case"document-dued":return{type:Sr};case"document-invite":return{user:t.inviter,type:Sn};case"document-created":return{user:t.creator,type:Sn};case"space-joined":return{user:t.joiner,type:Sn};case"document-changed":return{space:t.space,type:So};case"space-member-added":return{space:t.space,type:Sl};case"credit-referred":return{space:t.space,type:Si};default:return null}}(t)}),ev.createElement("div",null,ev.createElement(SN,null,function(e,t){let{data:a}=e;switch(e.type){case"document-assigned":return t.formatMessage({id:"activity.document_assigned",defaultMessage:"{assigner} assigned {assignee} to {documentTitle} in {workspaceName}."},{b:e=>ev.createElement("b",null,e),assigner:a?.assigner?.defaultName,assignee:a?.assignee?.defaultName,documentTitle:a?.document?.title,workspaceName:a?.space?.name});case"document-changed":return t.formatMessage({id:"activity.document_changed",defaultMessage:"{documentTitle} in {workspaceName} has been updated."},{b:e=>ev.createElement("b",null,e),documentTitle:a?.document?.title,workspaceName:a?.space?.name});case"document-commented":return t.formatMessage({id:"activity.document_commented",defaultMessage:'{commenterName} added a comment "{comment}" to "{nodeText}" in {documentTitle}.'},{b:e=>ev.createElement("b",null,e),commenterName:a?.commenter?.defaultName||a?.commenter?.name,comment:a?.comment,nodeText:a?.node?.text,documentTitle:a?.document?.title});case"document-completed":return t.formatMessage({id:"activity.document_completed",defaultMessage:"{editor} completed {documentTitle}"},{documentTitle:a?.document?.title,editor:a?.editor?.defaultName});case"document-dued":return t.formatMessage({id:"activity.document_dued",defaultMessage:"You have {nodesLength} {taskOrTasks} due today in {documentTitle}."},{b:e=>ev.createElement("b",null,e),nodesLength:a?.nodes?.length??0,taskOrTasks:a?.nodeCounter,documentTitle:a?.document?.title});case"document-invite":return t.formatMessage({id:"activity.document_invite",defaultMessage:"{inviterName} invited you to project {documentTitle}."},{b:e=>ev.createElement("b",null,e),inviterName:a?.inviter?.defaultName,documentTitle:a?.document?.title});case"document-created":return t.formatMessage({id:"activity.document_created",defaultMessage:"{creatorName} created {documentTitle} in {workspaceName}."},{b:e=>ev.createElement("b",null,e),creatorName:a?.creator?.defaultName,documentTitle:a?.document?.title,workspaceName:a?.space?.name});case"document-node-assigned":return t.formatMessage({id:"activity.document_node_assigned",defaultMessage:'{assignerName} assigned you to the task "{nodeText}" in {documentTitle}.'},{b:e=>ev.createElement("b",null,e),assignerName:a?.assigner?.defaultName,nodeText:a?.node?.text,documentTitle:a?.document?.title});case"document-node-completed":{let e=a?.nodes?.length??0;return t.formatMessage({id:"activity.document_node_completed",defaultMessage:'{editor} completed {taskCount, plural, =0 {no tasks} one {a task} other {# tasks}} in "{documentTitle}"'},{documentTitle:a?.document?.title,editor:a?.editor?.defaultName,taskCount:e})}case"space-joined":return t.formatMessage({id:"activity.space_joined",defaultMessage:"{joinerName} has joined your workspace {workspaceName}."},{b:e=>ev.createElement("b",null,e),joinerName:a?.joiner?.defaultName,workspaceName:a?.space?.name});case"space-member-added":return t.formatMessage({id:"activity.space_member_added",defaultMessage:`You’ve been added to a workspace {workspaceName}.`},{b:e=>ev.createElement("b",null,e),workspaceName:a?.space?.name});case"credit-referred":return t.formatMessage({id:"activity.credit_referred",defaultMessage:"You've earned ${amount} credit by inviting {referredUser} to Taskade."},{b:e=>ev.createElement("b",null,e),referredUser:a?.referredUser?.defaultName,amount:a?.amount});default:return null}}(t,n)),ev.createElement(SE,{activity:t}),ev.createElement(SC,null,cc()(t.created_at).fromNow())),t.read_at?null:ev.createElement(Sx,{onClick:e=>h(e,t.id),...p,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},ev.createElement(lT.eY,null))),d&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(eY.Z,{id:"activity.mark_as_read",defaultMessage:"Mark as Read"})))};function SS(e,t){let a=null;return null!=e&&(null!=e.created_at&&(a=eG()(e.created_at)),null!=a&&null!=t&&(a=a.tz(t))),a}function SI(e,t,a,n){let l=a(t,n);if(null==l)return null;if(null==e)return l.startOf("day").valueOf();let r=a(e,n);return null==r||r.isSame(l,"day")?null:l.startOf("day").valueOf()}let SD=eL.default.div.withConfig({displayName:"ActivityItems__Wrapper",componentId:"sc-e96b8122-0"})` + max-height: 80vh; + overflow-y: scroll; + ${tS} +`,ST=(0,eL.default)(SM).withConfig({displayName:"ActivityItems__StyledActivityItem",componentId:"sc-e96b8122-1"})` + padding: 8px 12px 8px 20px; + margin-left: 0; +`,S$=function(e){let{activity:t}=e,a=t.edges,n=(0,ev.useMemo)(()=>{let e;let t=[];for(let n of a){let a=n.node,l=SI(e,a,SS);null!=l&&t.push(ev.createElement(St,{key:`activity-separator-${a.id}`,unixTimestampMs:l})),t.push(ev.createElement(ST,{key:a.id,activity:a})),e=a}return t},[a]);return ev.createElement(SD,null,n)},SP=eL.default.button.withConfig({displayName:"MarkAllAsReadMenuItem__Container",componentId:"sc-88425ed5-0"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + + color: ${e=>e.theme.appColors.hex(40)}; + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(2)}; + + &:hover, + &:focus { + color: ${e=>e.theme.textColors.hex(10)}; + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,SF=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({name:"mark_all_as_read",stopRef:e});return ev.createElement(SP,t.props,ev.createElement(eY.Z,{id:"general.mark_all_as_read",defaultMessage:"Mark all as Read"}))},SA=eL.default.button.withConfig({displayName:"ViewAllMenuItem__Container",componentId:"sc-1dc0bb21-0"})` + ${e1.UiTypography.sm}; + + width: 100%; + padding: ${eI.UiSpacing.getPx(2)}; + border-top: 1px solid ${e=>e.theme.borderColorHex}; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,SR=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({name:"view_all",stopRef:e});return ev.createElement(SA,t.props,ev.createElement(eY.Z,{id:"general.view_all",defaultMessage:"View All"}))},Sj=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-1bb45611-0"})` + width: 320px; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: 8px 0; +`,SO=eL.default.div.withConfig({displayName:"styled__StyledHeader",componentId:"sc-1bb45611-1"})` + display: grid; + grid-template-columns: 1fr auto; + align-items: center; + + padding: 15px 20px 10px; + color: ${e=>e.theme.textColors.hex(10)}; + + h3 { + ${e1.UiTypography.md}; + margin: 0; + font-weight: 500; + } +`,SU=eL.default.div.withConfig({displayName:"styled__Note",componentId:"sc-1bb45611-2"})` + padding: 10px 20px 20px; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; +`,SZ=eL.default.div.withConfig({displayName:"styled__EventPropagationTrap",componentId:"sc-1bb45611-3"})` + display: grid; + overflow: hidden; +`,SL=function(e){let{initialFocus:t,menuGroupDispatch:a}=e,n=ev.useRef(null),{activity:l,error:r,loading:o}=M9({first:10}),i=l?.edges?.length??0,s=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return ev.useEffect(()=>{o||n.current?.dispatch({type:aK.ActionTypes.First})},[o]),ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{initialFocus:t,loop:!0,ref:n},ev.createElement(Sj,null,ev.createElement(SO,{onClick:s},ev.createElement("h3",null,ev.createElement(eY.Z,{id:"general.activity",defaultMessage:"Activity"})),i>0&&ev.createElement(SF,null)),ev.createElement(SZ,{onClick:s},o&&ev.createElement(eI.Spinner,{height:60}),r&&ev.createElement(SU,null,ev.createElement(eY.Z,{id:"activity.error_loading",defaultMessage:"There's an error loading activity. Please try again later."})),!o&&null==r&&ev.createElement(ev.Fragment,null,0===i&&ev.createElement(SU,null,ev.createElement(eY.Z,{id:"activity.no_activity",defaultMessage:"There is no activity."})),null!=l&&ev.createElement(S$,{activity:l})),l?.pageInfo?.hasNextPage===!0&&ev.createElement(SR,null)))))},SB=eL.default.span.withConfig({displayName:"ActivityDropdown__UnreadBadge",componentId:"sc-79e66bbe-0"})` + /* todo (dionis@taskade.com) missing space theme for tailwind */ + background: ${e=>e.theme.primaryColorScheme?.base}; +`,Sz=function(){let{data:e}=(0,eB.a)(M8,{fetchPolicy:"cache-first",nextFetchPolicy:"cache-first",pollInterval:6e5}),t=e?.me?.unread_activity_count??0,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useState(!1),{arrowProps:s,popperProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:l,popperElementRef:r,placement:"bottom",visible:o}),[c,m]=ev.useReducer(eI.popupReducer,{expanded:!1}),u=(0,eI.usePopup)({referenceElementRef:a,popupElementRef:n,state:c,placement:"bottom-end",computeModifiersCallback:tr}),p=ev.useCallback(()=>{a.current?.focus()},[]);(0,eI.usePopupEvents)({state:c,onCollapse:p});let g=(0,eI.useMenuButton)({dispatch:m,ref:a,state:c}),[f]=(0,cs.D)(M6),h=ev.useCallback(()=>{f({variables:{input:{clientMutationId:(0,ld.Z)()}},update:(e,t)=>{for(let a of t.data?.activitiesMarkAllAsRead.projectIds??[])e.writeFragment({id:e.identify({__typename:"Document",id:a}),fragment:(0,la.Ps)` + fragment documentFragment on Document { + is_unread + } + `,data:{is_unread:!1}});let a=e.readQuery({query:M8}),n=a?.me;null!=n&&e.writeQuery({query:M8,data:{me:{...n,unread_activity_count:0}}})}})},[f]),y=(0,eF.k6)(),b=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:a}=e.payload;switch(t){case"view_all":y.push("/activity");break;case"mark_all_as_read":h();break;case"activity":null!=a&&y.push(a)}m({type:"Collapse"})}},[h,y]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...g.props,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},className:"duration-250 relative flex h-7 w-7 items-center justify-center transition ease-in-out hover:text-appcolor-500"},ev.createElement(tn.Icon,{icon:"header_activity",className:"scale-90"}),t>0&&ev.createElement(SB,{className:"absolute -right-1 -top-1 flex h-5 items-center justify-center rounded-full px-1 text-xs font-medium text-white"},t)),c.expanded&&ev.createElement(eI.Popup,{dispatch:m,...u.props,modal:!0},ev.createElement(SL,{initialFocus:c.initialFocus,menuGroupDispatch:b})),o&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"general.activity",defaultMessage:"Activity"})))},SV=function(e){return ev.useMemo(()=>{let t=e.period??14;return cc()().diff(e.date,"days",!0)>=t},[e.date,e.period])?null:ev.createElement(Sq,null,ev.createElement(eY.Z,{id:"general.new",defaultMessage:"New"}))},Sq=eL.default.span.withConfig({displayName:"NewBadge__Badge",componentId:"sc-ab4f2996-0"})` + display: flex; + color: #ffffff; + border-radius: 20px; + text-transform: uppercase; + margin-left: 8px; + font-size: 10px; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(2)}; + font-weight: 600; + user-select: none; + background: ${e=>e.theme.primaryColorScheme?.alpha20}; + color: ${e=>e.theme.primaryColorScheme?.base}; +`,SW=eL.default.div.withConfig({displayName:"styled__AppIcon",componentId:"sc-6b9b7051-0"})` + color: ${e=>e.theme.textColors.hex("50")}; + :not(:last-child) { + margin-right: var(--menu-item-gap); + } + transform: var(--menu-item-icon-scale); +`,SH=eL.default.img.withConfig({displayName:"styled__Avatar",componentId:"sc-6b9b7051-1"})` + grid-area: avatar; + height: 30px; + border-radius: 50px; +`,SG=eL.default.div.withConfig({displayName:"styled__CaretIconWrapper",componentId:"sc-6b9b7051-2"})` + margin-left: auto; + svg { + margin: 0 !important; + } +`,SK=eL.default.button.withConfig({displayName:"styled__DropdownToggle",componentId:"sc-6b9b7051-3"})` + display: flex; + flex-shrink: 0; + margin: 0 0 0 0.5rem; + border-radius: 50px; + cursor: pointer; +`,SY=eL.default.span.withConfig({displayName:"styled__Email",componentId:"sc-6b9b7051-4"})` + grid-area: email; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex("50")}; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + text-align: start; +`,SQ=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__Subtitle",componentId:"sc-6b9b7051-5"})` + color: ${e=>e.theme.textColors.hex("50")}; + padding: 0 20px; +`,SJ=eL.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-6b9b7051-6"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.borderColorHex}; +`,SX=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-6b9b7051-7"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.backgroundColorHex}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,S0=(0,eL.default)(cF).withConfig({displayName:"styled__StyledMenuButton",componentId:"sc-6b9b7051-8"})` + svg { + align-self: center; + } +`,S1=eL.default.button.withConfig({displayName:"styled__StyledUser",componentId:"sc-6b9b7051-9"})` + padding: 4px 20px; + display: grid; + grid-template: + 'avatar username' + 'avatar email' + / auto 1fr; + grid-gap: 0 10px; + justify-items: start; + align-items: center; + max-width: 260px; + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,S2=eL.default.span.withConfig({displayName:"styled__Username",componentId:"sc-6b9b7051-10"})` + grid-area: username; + ${e1.UiTypography.sm}; + font-weight: 500; + width: 100%; + color: ${e=>e.theme.textColors.hex("10")}; + text-align: start; +`,S5=eL.default.div.withConfig({displayName:"DownloadAppsItem__AppLinkWrapper",componentId:"sc-972b4c7a-0"})` + display: flex; + align-items: center; + align-items: center; + padding: 2px 20px 6px; + line-height: 20px; +`,S3=eL.default.a.withConfig({displayName:"DownloadAppsItem__Wrapper",componentId:"sc-972b4c7a-1"})` + margin-top: 2px; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,S4=function(){return ev.createElement(S3,{target:"_blank",href:"/downloads",rel:"noopener noreferrer"},ev.createElement(SQ,null,ev.createElement(eY.Z,{id:"general.download_apps",defaultMessage:"Download apps"})),ev.createElement(S5,null,ev.createElement(SW,null,ev.createElement(tn.Icon,{icon:"logo_apple"})),ev.createElement(SW,null,ev.createElement(tn.Icon,{icon:"logo_chrome"})),ev.createElement(SW,null,ev.createElement(tn.Icon,{icon:"logo_windows_marketplace"})),ev.createElement(SW,null,ev.createElement(tn.Icon,{icon:"logo_app_store"})),ev.createElement(SW,null,ev.createElement(tn.Icon,{icon:"logo_google_play"}))))},S6=JSON.parse('[["en-US",{"langtag":"en-US","language":"en","region":"US","name":"English (US)","emoji":"🇺🇸","locale":"en-US"}],["en-GB",{"langtag":"en-GB","language":"en","region":"GB","name":"English (UK)","emoji":"🇬🇧","locale":"en-GB"}],["ru",{"langtag":"ru","language":"ru","name":"Русский","locale":"ru"}],["de",{"langtag":"de","language":"de","name":"Deutsch","locale":"de"}],["es",{"langtag":"es","language":"es","name":"Español","locale":"es"}],["fr",{"langtag":"fr","language":"fr","name":"Français","locale":"fr"}],["it",{"langtag":"it","language":"it","name":"Italiano","locale":"it"}],["ja",{"langtag":"ja","language":"ja","name":"日本語","locale":"ja"}],["ko",{"langtag":"ko","language":"ko","name":"한국어","locale":"ko"}],["nl",{"langtag":"nl","language":"nl","name":"Nederlands","locale":"nl"}],["pl",{"langtag":"pl","language":"pl","name":"Polski","locale":"pl"}],["pt",{"langtag":"pt","language":"pt","name":"Português","locale":"pt"}],["sv",{"langtag":"sv","language":"sv","name":"Svenska","locale":"sv"}],["tr",{"langtag":"tr","language":"tr","name":"Türk","locale":"tr"}],["vi",{"langtag":"vi","language":"vi","name":"Tiếng Việt","locale":"vi"}],["zh-Hans",{"langtag":"zh-Hans","language":"zh","script":"Hans","name":"中文 (简体)","locale":"zh-Hans"}],["zh-Hant",{"langtag":"zh-Hant","language":"zh","script":"Hant","name":"中文 (繁體)","locale":"zh-Hant"}],["ar",{"langtag":"ar","language":"ar","name":"اَلْعَرَبِيَّة","locale":"ar"}],["fi",{"langtag":"fi","language":"fi","name":"Suomi","locale":"fi"}],["he",{"langtag":"he","language":"he","name":"עברית","locale":"he"}],["no",{"langtag":"no","language":"no","name":"Norsk","locale":"no"}],["fa",{"langtag":"fa","language":"fa","name":"فارسی","locale":"fa"}],["ro",{"langtag":"ro","language":"ro","name":"Românește","locale":"ro"}],["ta",{"langtag":"ta","language":"ta","name":"தமிழ்","locale":"ta"}],["th",{"langtag":"th","language":"th","name":"ภาษาไทย","locale":"th"}],["uk",{"langtag":"uk","language":"uk","name":"українська мова","locale":"uk"}],["id",{"langtag":"id","language":"id","name":"Bahasa Indonesia","locale":"id"}],["cs",{"langtag":"cs","language":"cs","name":"Czech","locale":"cs"}],["sk",{"langtag":"sk","language":"sk","name":"Slovak","locale":"sk"}],["hu",{"langtag":"hu","language":"hu","name":"Hungarian","locale":"hu"}],["da",{"langtag":"da","language":"da","name":"Danish","locale":"da"}]]'),S8=(0,la.ZP)` + mutation MeLocaleUpdate($locale: String!) { + updateMe(input: { locale: $locale }) { + id + locale + } + } +`,S7=function(e){let{name:t,value:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,name:t,value:a});return ev.createElement(S0,r.props,n)},S9=function(e){let{initialFocus:t}=e,a=(0,e$.useDispatch)(),{locale:n}=(0,eK.Z)(),l=(0,ll.x)(),r=ev.useCallback(async e=>{let t=l.readQuery({query:sN}),n=t?.me??null;if(null!=n)try{await l.mutate({mutation:S8,optimisticResponse:{__typename:"Mutation",updateMe:{__typename:"CurrentUser",id:n.id,locale:e}},variables:{locale:e}})}catch(e){a(l3.error({uid:"change-user-locale-error",message:"Failed to change your language.",position:"br",autoDismiss:2,dismissible:!1}))}},[l,a]),o=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:a}=e.payload;"change_language"===t&&r(a)}},[r]),i=ev.useMemo(()=>S6.map(e=>{let[t,a]=e,{name:l,locale:r}=a;return ev.createElement(S7,{key:t,name:"change_language",value:r},l,r===n&&ev.createElement(SG,null,ev.createElement(tn.Icon,{icon:"dd_check"})))}),[n]);return ev.createElement(eI.MenuGroupContext.Provider,{value:o},ev.createElement(SX,{initialFocus:t,isSubmenu:!0,loop:!0},i))},Ie=function(){let[e,t]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),a=ev.useRef(null),n=ev.useRef(null),l=(0,eI.usePopup)({referenceElementRef:a,popupElementRef:n,state:e,placement:"left-start"}),r=ev.useCallback(a=>{a.stopPropagation(),e.expanded||t({type:"Expand",payload:"first"})},[e.expanded,t]),o=ev.useCallback(()=>{e.expanded?a.current?.focus():t({type:"Expand"})},[e.expanded,t]),i=(0,eI.useMenuItem)({stopRef:a,onClick:r,onMouseEnter:o,submenuPopupState:e}),s=ev.useCallback(()=>{i.navigated&&a.current?.focus()},[i.navigated]);return(0,eI.usePopupEvents)({state:e,onCollapse:s}),ev.useEffect(()=>{e.expanded&&!i.navigated&&t({type:"Collapse"})},[i.navigated,e.expanded]),ev.createElement(ev.Fragment,null,ev.createElement(S0,i.props,ev.createElement(tn.Icon,{icon:"dd_language"}),ev.createElement(eY.Z,{id:"general.language",defaultMessage:"Language"}),ev.createElement(SG,null,ev.createElement(tn.Icon,{icon:"dd_caret"}))),e.expanded&&ev.createElement(eI.Popup,{...l.props,dispatch:t},ev.createElement(S9,{initialFocus:l.initialFocus})))},It=e=>null==e?tn.IconNames.MODE_AUTO:e?tn.IconNames.DD_DARK:tn.IconNames.DD_LIGHT,Ia=(0,la.ZP)` + mutation UpdateMeMutation($input: UserInput!) { + updateMe(input: $input) { + id + preferences { + isNightMode + } + } + } +`,In=function(e){let t=(0,e$.useDispatch)(),{initialFocus:a,isNightMode:n,userId:l}=e,[r]=(0,cs.D)(Ia),o=ev.useCallback(e=>{if(null==l){t(rh({isOpen:!0,activeView:rI}));return}r({variables:{input:{preferences:{isNightMode:e}}},optimisticResponse:{__typename:"Mutation",updateMe:{__typename:"CurrentUser",id:l,preferences:{__typename:"CurrentUserPreferences",isNightMode:e}}}})},[t,r,l]),i=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:a}=e.payload;if("toggle_theme"===t)switch(a){case"theme_light":o(!1);break;case"theme_dark":o(!0);break;case"theme_auto":o(null)}}},[o]);return ev.createElement(eI.MenuGroupContext.Provider,{value:i},ev.createElement(SX,{initialFocus:a,isSubmenu:!0,loop:!0},ev.createElement(S7,{name:"toggle_theme",value:"theme_light"},ev.createElement(eY.Z,{id:"general.light_theme",defaultMessage:"Light theme"}),!1===n&&ev.createElement(SG,null,ev.createElement(tn.Icon,{icon:"dd_check"}))),ev.createElement(S7,{name:"toggle_theme",value:"theme_dark"},ev.createElement(eY.Z,{id:"general.dark_theme",defaultMessage:"Dark theme"}),!0===n&&ev.createElement(SG,null,ev.createElement(tn.Icon,{icon:"dd_check"}))),ev.createElement(S7,{name:"toggle_theme",value:"theme_auto"},ev.createElement(eY.Z,{id:"general.device_theme",defaultMessage:"Device theme (Automatic)"}),null==n&&ev.createElement(SG,null,ev.createElement(tn.Icon,{icon:"dd_check"})))))},Il=function(){let{data:e}=(0,eB.a)(sW),[t,a]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),n=ev.useRef(null),l=ev.useRef(null),r=e?.me?.preferences.isNightMode??null,o=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:t,placement:"left-start"}),i=ev.useCallback(e=>{e.stopPropagation(),t.expanded||a({type:"Expand",payload:"first"})},[t.expanded,a]),s=ev.useCallback(()=>{t.expanded?n.current?.focus():a({type:"Expand"})},[t.expanded,a]),d=(0,eI.useMenuItem)({stopRef:n,onClick:i,onMouseEnter:s,submenuPopupState:t}),c=ev.useCallback(()=>{d.navigated&&n.current?.focus()},[d.navigated]);return(0,eI.usePopupEvents)({state:t,onCollapse:c}),ev.useEffect(()=>{t.expanded&&!d.navigated&&a({type:"Collapse"})},[d.navigated,t.expanded]),ev.createElement(ev.Fragment,null,ev.createElement(S0,d.props,ev.createElement(tn.Icon,{icon:It(r)}),ev.createElement(eY.Z,{id:"general.appearance",defaultMessage:"Appearance"}),ev.createElement(SG,null,ev.createElement(tn.Icon,{icon:"dd_caret"}))),t.expanded&&ev.createElement(eI.Popup,{...o.props,dispatch:a},ev.createElement(In,{initialFocus:o.initialFocus,isNightMode:r,userId:e?.me?.id??null})))},Ir=function(e){let{isPaywallAllowed:t}=e,{data:a,loading:n}=(0,eB.a)(ED);return n||"free"!==(a?.me?.appSumo?.taskadePlanType??"free")?null:ev.createElement(ev.Fragment,null,t&&ev.createElement(S7,{name:"upgrade"},ev.createElement(tn.Icon,{icon:"sidebar_upgrade",className:"text-upgrade"}),ev.createElement("span",{className:"!overflow-visible text-upgrade"},ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))),ev.createElement(S7,{name:"referral"},ev.createElement(tn.Icon,{icon:"dd_referral"}),ev.createElement(eY.Z,{id:"general.refer_and_earn",defaultMessage:"Refer and earn"})))},Io=function(e){let{user:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,name:"settings"});return ev.createElement(S1,n.props,ev.createElement(SH,{src:t.smallAvatar,alt:t.handle}),ev.createElement(S2,null,t.handle),ev.createElement(SY,null,t.email))},Ii=function(){let e=(0,e$.useDispatch)(),t=(0,e$.useSelector)(t7),a=(0,eF.k6)(),n=d6(),l=(0,eF.TH)(),r=ev.useMemo(()=>null==(0,eF.LX)(l.pathname,{path:eZ.document,exact:!0}),[l.pathname]),o=ev.useRef(null),i=ev.useRef(null),[s,d]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),c=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:s,placement:"bottom-end"}),m=(0,eI.useMenuButton)({ref:o,state:s,dispatch:d}),u=ev.useCallback(t=>{if("Activate"===t.type){let{name:n}=t.payload;switch(n){case"settings":a.push("/settings");break;case"notifications":a.push("/settings/notifications");break;case"upgrade":e(d4());break;case"referral":window.open("https://partners.taskade.com/","_blank","noopener,noreferrer");break;case"ai_assistant":e(sw()),d({type:"Collapse"});break;case"ai_prompt_templates":e(co.actions.toggleAiPromptTemplatesDialog()),d({type:"Collapse"});break;case"help_center":window.open("https://help.taskade.com","_blank","noopener,noreferrer");break;case"keyboard_shortcuts":e(_c()),d({type:"Collapse"});break;case"whats_new":window.open("https://www.taskade.com/blog/updates/","_blank","noopener,noreferrer");break;case"templates":window.open("/templates","_blank","noopener,noreferrer");break;case"contact":window.open("/contact","_blank","noopener,noreferrer");break;case"logout":window.open("/logout","_self","noopener,noreferrer")}}},[e,a]);return null==t?null:ev.createElement(ev.Fragment,null,ev.createElement(SK,m.props,ev.createElement(SH,{src:t.smallAvatar,alt:t.handle})),s.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:d,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:u},ev.createElement(SX,{initialFocus:c.initialFocus,loop:!0},ev.createElement(Io,{user:t}),ev.createElement(SJ,null),ev.createElement(Ir,{isPaywallAllowed:n}),ev.createElement(S7,{name:"keyboard_shortcuts"},ev.createElement(tn.Icon,{icon:"dd_shortcuts"}),ev.createElement(eY.Z,{id:"general.keyboard_shortcuts",defaultMessage:"Keyboard shortcuts"})),ev.createElement(Il,null),ev.createElement(Ie,null),ev.createElement(S7,{name:"notifications"},ev.createElement(tn.Icon,{icon:"sidebar_notification"}),ev.createElement(eY.Z,{id:"general.notifications",defaultMessage:"Notifications"})),ev.createElement(S7,{name:"settings"},ev.createElement(tn.Icon,{icon:"dd_settings"}),ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"}),ev.createElement(SV,{date:"2022-09-20"})),ev.createElement(SJ,null),r&&ev.createElement(S7,{name:"ai_assistant"},ev.createElement(tn.Icon,{icon:"dd_chat"}),ev.createElement(eY.Z,{id:"general.taskade_ai",defaultMessage:"Taskade AI"}),ev.createElement(SV,{date:"2023-04-20"})),ev.createElement(S7,{name:"ai_prompt_templates"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates"}),ev.createElement(eY.Z,{id:"general.ai_prompt_templates",defaultMessage:"AI Prompt Templates"})),ev.createElement(S7,{name:"templates"},ev.createElement(tn.Icon,{icon:"dd_templates"}),ev.createElement(eY.Z,{id:"general.browse_templates",defaultMessage:"Browse templates"})),ev.createElement(SJ,null),ev.createElement(S7,{name:"whats_new"},ev.createElement(tn.Icon,{icon:"dd_whatsnew"}),ev.createElement(eY.Z,{id:"general.whats_new",defaultMessage:"What's new"})),ev.createElement(S7,{name:"help_center"},ev.createElement(tn.Icon,{icon:"dd_help"}),ev.createElement(eY.Z,{id:"general.help_center",defaultMessage:"Help center"})),ev.createElement(S7,{name:"contact"},ev.createElement(tn.Icon,{icon:"dd_contact"}),ev.createElement(eY.Z,{id:"general.contact",defaultMessage:"Contact"})),ev.createElement(S7,{name:"logout"},ev.createElement(tn.Icon,{icon:"dd_logout"}),ev.createElement(eY.Z,{id:"general.logout",defaultMessage:"Log out"})),n&&ev.createElement(ev.Fragment,null,ev.createElement(SJ,null),ev.createElement(S4,null))))))},Is=function(){return ev.createElement(N_,null,ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:eZ.editor,component:M4}),ev.createElement(eF.AW,{exact:!0,path:eZ.document,component:M4}),ev.createElement(eF.AW,{exact:!0,path:eZ.embed,component:M4}),ev.createElement(eF.AW,{path:eZ.spaceNewList,component:M4}),ev.createElement(eF.AW,{path:eZ.inboxNewList,component:M4}),ev.createElement(eF.AW,{path:eZ.newList,component:M4})),ev.createElement(Sz,null),ev.createElement(Ii,null))},Id=(0,e$.connect)(function(e){return{user:t7(e)}})(function(e){let{user:t}=e;return null!=t?ev.createElement(Is,{user:t}):ev.createElement(Cc,null)});function Ic(){return"undefined"!=typeof window&&window.navigator.userAgent.toLowerCase().indexOf(" electron/")>-1}function Im(e,t,a,n){u$?.track("Project Switched View",{documentView:e,isKeyboardEvent:t,version:2},{context:{projectId:a,groupId:n}})}let Iu=(0,la.ZP)` + mutation ProjectDefaultViewUpdateMutation($input: ProjectDefaultViewUpdateInput!) { + projectDefaultViewUpdate(input: $input) { + clientMutationId + document { + id + preferences { + view + } + shared_preferences + } + } + } +`,Ip=function(e){let{documentView:t,isActive:a,isDefault:n}=e,l=a?"_active":"";if(n)return ev.createElement(tn.Icon,{icon:`view_default${l}`});switch(t){case dl:return ev.createElement(tn.Icon,{icon:`view_board${l}`});case dr:return ev.createElement(tn.Icon,{icon:`view_calendar${l}`});case di:return ev.createElement(tn.Icon,{icon:`view_actionsheet${l}`});case ds:return ev.createElement(tn.Icon,{icon:`view_mindmap${l}`});case dd:return ev.createElement(tn.Icon,{icon:`view_orgchart${l}`});case dc:return ev.createElement(tn.Icon,{icon:`view_gantt${l}`});default:return ev.createElement(tn.Icon,{icon:`view_list${l}`})}},Ig=function(e){let{documentView:t}=e;switch(t){case dr:return ev.createElement(eY.Z,{id:"general.calendar",defaultMessage:"Calendar"});case dl:return ev.createElement(eY.Z,{id:"general.board",defaultMessage:"Board"});case di:return ev.createElement(eY.Z,{id:"general.action",defaultMessage:"Action"});case ds:return ev.createElement(eY.Z,{id:"general.mindmap",defaultMessage:"Mind Map"});case dd:return ev.createElement(eY.Z,{id:"general.org_chart",defaultMessage:"Org Chart"});case dc:return ev.createElement(eY.Z,{id:"general.gantt",defaultMessage:"Gantt Chart"});default:return ev.createElement(eY.Z,{id:"general.list",defaultMessage:"List"})}},If=(0,eL.default)(e1.Tab).withConfig({displayName:"ViewTab__StyledTab",componentId:"sc-71542d8b-0"})` + padding: 0 12px; + transition: color 0.2s ease-in-out; + color: ${e=>e.theme.appColors.hex(10)}; + min-height: 34px; + transform: var(--global-icon-scale); +`,Ih=eL.default.div.withConfig({displayName:"ViewTab__StyledTabContent",componentId:"sc-71542d8b-1"})` + display: flex; + align-items: center; + justify-content: flex-start; + ${e1.UiTypography.sm}; + line-height: 34px; + overflow: hidden; + max-width: ${e=>e.$isActive?"200px":"20px"}; + transition: color 0.2s ease-in-out; + color: ${e=>e.$isActive?e.theme.primaryColorScheme?.base:e.theme.appColors.hex(10)}; + + svg { + flex-shrink: 0; + } + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,Iy=(0,e$.connect)(function(e){return{documentView:dA(e)}})(function(e){let{value:t,defaultView:a,documentView:n,document:l,onClick:r,...o}=e,[i,s]=(0,ev.useState)(!1),d=(0,ev.useRef)(null),c=(0,ev.useRef)(null),m=(0,ev.useRef)(null),{arrowProps:u,popperProps:p,referenceProps:g}=(0,eI.useControlledTooltip)({referenceElementRef:d,arrowElementRef:c,popperElementRef:m,placement:"top",visible:i}),f=ev.useMemo(()=>lm({role:l?.role,action:{project:"manage_settings"}}),[l?.role]),h=(0,ev.useCallback)(()=>{s(!0)},[]),y=(0,ev.useCallback)(()=>{s(!1)},[]),b=t===a,v=t===n,[k]=(0,cs.D)(Iu),E=(0,ev.useCallback)(e=>{if(!v){r?.(e);return}f&&k({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:l?.id??"",view:b?void 0:t}}})},[f,l?.id,v,b,r,k,t]);return ev.createElement(If,{value:t,onClick:E,...o,onMouseEnter:h,onMouseLeave:y},ev.createElement(Ih,{...g,$isActive:v},ev.createElement(Ip,{documentView:t,isActive:v,isDefault:b})),i&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},v&&f?b?ev.createElement(eY.Z,{id:"general.unset_default_view",defaultMessage:"Unset as Default View"}):ev.createElement(eY.Z,{id:"general.set_default_view",defaultMessage:"Set as Default View"}):ev.createElement(Ig,{documentView:t})))}),Ib=(0,la.ZP)` + query ToggleViewQuery($pathname: String!) { + document: documentAtPath(path: $pathname) { + id + preferences { + view + } + shared_preferences + role { + project + workspace + } + space { + id + color + } + } + } +`,Iv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectUserViewUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectUserViewUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectUserViewUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"view"}}]}}]}}]}}]}}]};function Ik(e){let{oldDocumentView:t,projectId:a}=e,n=(0,ll.x)(),l=(0,e$.useDispatch)(),r=(0,eF.k6)(),{pathname:o,search:i,hash:s}=(0,eF.TH)(),d=async function(e){let d=!0;if(null!=a){l(xA({view:e}));try{let t=await n.query({query:sW});if(null!=t.data.me){let t=(0,ld.Z)();await n.mutate({mutation:Iv,variables:{input:{clientMutationId:t,projectId:a,view:e}},optimisticResponse:{__typename:"Mutation",projectUserViewUpdate:{__typename:"ProjectUserViewUpdatePayload",clientMutationId:t,document:{__typename:"Document",id:a,preferences:{__typename:"DocumentPreferences",view:e}}}}})}}catch(e){l(xA({view:t})),d=!1}}if(d){let t=new URLSearchParams(i),n=t.get("as"),l=null;null!=a&&null!=n?(t.delete("as"),l=t.toString()):null==a&&(t.set("as",e),l=t.toString()),null!=l&&r.replace({pathname:o,search:l,hash:s})}};return{setProjectUserView:ev.useCallback(d,[n,l,s,r,t,o,a,i])}}let IE=(0,eL.default)(e1.TabList).withConfig({displayName:"ToggleView__StyledTabList",componentId:"sc-b98f2aff-0"})` + & > div { + margin-right: -4px; + } + position: absolute; + left: 50%; + transform: translateX(-120px); +`,Ix=(0,e$.connect)(function(e){return{documentView:dA(e)}})(function(e){let{documentView:t}=e,{documentPathType:a,documentViewOrEditID:n,documentID:l}=(0,eF.UO)(),{search:r}=(0,eF.TH)(),{setProjectUserView:o}=Ik({projectId:l,oldDocumentView:t}),i=(0,ev.useMemo)(()=>null==a||null==n?null:`/${a}/${n}`,[a,n]),[s,d]=(0,ev.useMemo)(()=>null==l?[Ib,{variables:null!=i?{pathname:i}:void 0,skip:null==i}]:[Cp,{variables:{id:l,shareToken:s4(r)}}],[l,i,r]),{data:c}=(0,eB.a)(s,d),m=c?.document,u=m?.shared_preferences.view;!function(e,t){let a=null!=t,n=t?.id,{setProjectUserView:l}=Ik({projectId:n,oldDocumentView:e}),r=(0,ev.useCallback)(t=>{if(null==n)return;t.preventDefault(),t.stopPropagation();let a=(dm.indexOf(e)+1)%dm.length,r=dm[a];Im(r,!0,n),l(r)},[n,e,l]),o=(0,ev.useCallback)(t=>{if(null==n)return;t.preventDefault(),t.stopPropagation();let a=dm.indexOf(e);a<=0?a=dm.length-1:a-=1;let r=dm[a];Im(r,!0,n),l(r)},[n,e,l]);(0,ev.useEffect)(()=>{if(a)return uS().bind("mod+shift+,",o),uS().bind("mod+shift+.",r),()=>{uS().unbind("mod+'"),uS().unbind("mod+shift+,"),uS().unbind("mod+shift+.")}},[a,o,r])}(t,m);let p=e=>{Im(t,!1,m?.id),o(e)};return ev.createElement(IE,{type:"pill",value:t,onChange:e=>p(e),className:"step2"},ev.createElement(Iy,{value:dn,defaultView:u,document:m}),ev.createElement(Iy,{value:dl,defaultView:u,document:m}),ev.createElement(Iy,{value:dr,defaultView:u,document:m}),ev.createElement(Iy,{value:di,defaultView:u,document:m}),ev.createElement(Iy,{value:ds,defaultView:u,document:m}),ev.createElement(Iy,{value:dd,defaultView:u,document:m}),!1)}),I_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"IsSidebarClosedQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isSidebarClosed"}}]}}]}}]}}]},Iw=(0,la.ZP)` + mutation UpdateSidebarClosedMutation($input: UserInput!) { + updateMe(input: $input) { + id + preferences { + isSidebarClosed + } + } + } +`,IN=eL.default.div.withConfig({displayName:"TooltipWithShortcut",componentId:"sc-3776a74-0"})` + display: flex; + flex-direction: column; + align-items: center; + + > ${eI.Shortcut.Combo}, > ${eI.Shortcut.Key} { + margin-top: 4px; + } +`,IC=eL.default.button.withConfig({displayName:"ToggleSidebarButton__Button",componentId:"sc-e7b6962b-0"})` + background: none; + border: none; + color: ${e=>e.theme.textColors.hex("30")}; + cursor: pointer; + display: flex; + padding: 0.3125rem; + transform: var(--global-icon-scale); + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } + + &:focus { + outline: none; + } + ${e=>e.$desktopHidden&&(0,eL.css)` + @media (${e.$editorView?"min-width: 991px":"min-width: 992px"}) { + display: none; + } + `} + ${e=>e.$mobileHidden&&(0,eL.css)` + @media (${e.$editorView?"min-width: 992px":"min-width: 991px"}) { + display: none; + } + `} +`,IM=(0,eL.default)(tn.Icon).withConfig({displayName:"ToggleSidebarButton__StyledIcon",componentId:"sc-e7b6962b-1"})` + ${e=>e.$close&&(0,eL.css)` + @media screen and (min-width: 991px) { + transform: scaleX(-1); + } + `} +`,IS=function(e){let{desktopHidden:t=!1,mobileHidden:a=!1,editorView:n=!1}=e,l=(0,e$.useDispatch)(),{data:r}=(0,eB.a)(I_),[o]=(0,cs.D)(Iw),i=r?.me?.preferences.isSidebarClosed??!1,s=window.matchMedia("(min-width: 991px)").matches,d=ev.useCallback(()=>{null!=r&&null!=r.me&&(s?o({variables:{input:{preferences:{isSidebarClosed:!i}}},optimisticResponse:{__typename:"Mutation",updateMe:{__typename:"CurrentUser",id:r.me.id,preferences:{__typename:"CurrentUserPreferences",isSidebarClosed:!i}}}}):l(sE()))},[l,r,i,o,s]),[c,m]=ev.useState(!1),u=ev.useRef(null),p=ev.useRef(null),g=ev.useRef(null),{arrowProps:f,popperProps:h,referenceProps:y}=(0,eI.useControlledTooltip)({referenceElementRef:u,arrowElementRef:p,popperElementRef:g,placement:"bottom",visible:c});return ev.useEffect(()=>(uS().bind("mod+.",d),()=>{uS().unbind("mod+.")}),[d]),ev.createElement(IC,{onClick:d,$desktopHidden:t,$mobileHidden:a,$editorView:n,...y,onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)}},ev.createElement(IM,{icon:"header_sidebar_open",$close:!i}),c&&ev.createElement(eI.Tooltip,{arrowProps:f,popperProps:h},ev.createElement(IN,null,!s||i?ev.createElement(eY.Z,{id:"general.open_sidebar",defaultMessage:"Open Sidebar"}):ev.createElement(eY.Z,{id:"general.close_sidebar",defaultMessage:"Close Sidebar"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,".")))))};function II(e){if(ts()(e))return null;let t=(0,eF.LX)(e,{path:"/:type(spaces|subspaces)/:spaceId/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents|flows)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents|flows)?",exact:!0});return null==t?null:null!=t.params.subspaceId?t.params.subspaceId:t.params.spaceId}let ID=eL.default.button.withConfig({displayName:"AppNavigation__NavigateBack",componentId:"sc-43c9fa08-0"})` + display: none; + width: 30px; + height: 30px; + color: ${e=>e.theme.appColors.hex(10)}; + align-items: center; + justify-content: center; + transform: var(--menu-item-icon-scale); + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } + @media (min-width: 768px) { + display: flex; + } +`,IT=eL.default.button.withConfig({displayName:"AppNavigation__NavigateForward",componentId:"sc-43c9fa08-1"})` + display: none; + width: 30px; + height: 30px; + color: ${e=>e.theme.appColors.hex(10)}; + align-items: center; + justify-content: center; + transform: var(--menu-item-icon-scale); + margin-right: 0.25rem; + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } + @media (min-width: 768px) { + display: flex; + } +`,I$=function(){let e=(0,eF.k6)();return ev.createElement(ev.Fragment,null,ev.createElement(ID,{onClick:()=>{e.goBack()}},ev.createElement(tn.Icon,{icon:"header_nav_back"})),ev.createElement(IT,{onClick:()=>{e.goForward()}},ev.createElement(tn.Icon,{icon:"header_nav_forward"})))};function IP(e,t){if("unlimited"===t)return{usage:e,remaining:"unlimited",limit:t,percentage:1};let a=Math.max(t-e,0);return{usage:e,remaining:a,limit:t,percentage:a/t}}let IF=function(e){let{membership:t}=e,[a,n]=(0,ev.useState)(!0),l=(0,e$.useDispatch)(),{data:r}=(0,eB.a)(ED);if(null==t)return null;let o=r?.me?.appSumo?.taskadePlanType??"free",i=e0(),s=t.space.taskadePlan,d=s.type,c=t.role,m=fR.Vl.getFeature("ai.generation.fair-use").plans[d],u=IP(s.usage["ai.generation.fair-use"]??0,m);if("mac_app_store"===i||"windows_app_store"===i||"owner"!==c||"free"!==d||"unlimited"===u.remaining||u.remaining>0||!a)return null;let p=()=>{l(d4())};return ev.createElement("div",{className:"flex w-full items-center bg-upgrade px-3 py-2 text-sm text-black"},ev.createElement("span",{className:"inline"},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"-mt-1 mr-1 scale-80"}),"free"!==o?ev.createElement(eY.Z,{id:"paywall.please_activate_this_workspace",defaultMessage:"Please activate this workspace to unlock all premium features.",values:{link:e=>ev.createElement("a",{className:"border-b border-solid border-black font-medium transition duration-150 ease-in-out hover:opacity-70",href:"/settings/plans"},e)}}):ev.createElement(eY.Z,{id:"paywall.you_are_out_of_credits_for_the_month",defaultMessage:"You are out of credits for this month. Upgrade now to get unlimited AI credits.",values:{link:e=>ev.createElement("button",{className:"border-b border-solid border-black font-medium transition duration-150 ease-in-out hover:opacity-70",onClick:p},e)}})),ev.createElement("button",{className:"ml-auto flex items-center justify-center transition duration-150 ease-in-out hover:opacity-50",onClick:()=>{n(!1)}},ev.createElement(tn.Icon,{icon:"modal_close"})))},IA={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"HeaderSpaceQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]},IR=eL.default.div.withConfig({displayName:"WebHeader__HeaderWrapper",componentId:"sc-155bef9d-0"})` + display: flex; + flex: 0 0 auto; + flex-direction: column; + justify-content: center; + position: sticky; + top: 0; + width: 100%; + z-index: 5; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + user-select: none; + + backdrop-filter: blur(10px); + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.90)":"rgba(255,255,255,0.90)"}; + + @media print { + display: none; + } +`,Ij=eL.default.div.withConfig({displayName:"WebHeader__Header",componentId:"sc-155bef9d-1"})` + display: flex; + width: 100%; + height: 48px; + justify-content: space-between; + align-items: center; + padding: 0 16px; + z-index: 5; +`,IO=(0,eL.default)(_J).withConfig({displayName:"WebHeader__StyledElectronDragRegion",componentId:"sc-155bef9d-2"})` + position: absolute; + top: 0; + left: 0; + right: 0; + height: 18px; +`,IU=eL.default.div.withConfig({displayName:"WebHeader__FlexRow",componentId:"sc-155bef9d-3"})` + display: flex; + flex-direction: column; + width: 100%; + align-items: center; +`,IZ=eL.default.div.withConfig({displayName:"WebHeader__WebCenterHeader",componentId:"sc-155bef9d-4"})` + display: none; + align-items: center; + + @media (min-width: 992px) { + display: flex; + } +`,IL=(0,e$.connect)(function(e){return{metaSpaceId:dU(e)}})(function(e){let{userLoggedIn:t,membership:a}=e,n=e.match.params.spaceID,l=(0,eF.TH)(),r=ev.useMemo(()=>e.metaSpaceId??n??II(l.pathname),[l.pathname,n,e.metaSpaceId]),o=ev.useMemo(()=>!!l.pathname.startsWith("/embed/"),[l.pathname]),i=ev.useMemo(()=>!!o&&"hidden"===new URLSearchParams(l.search).get("views"),[o,l.search]),{data:s}=(0,eB.a)(IA,null!=r?{variables:{spaceID:r}}:{skip:!0}),d=s?.membership?.space,c=(0,ev.useMemo)(()=>eu()(d)?null:{primaryColor:d?.color},[d]);return o?i?null:ev.createElement(eI.ThemeProvider,{theme:c},ev.createElement(IR,null,ev.createElement(Ij,null,ev.createElement(Ix,null)))):ev.createElement(eI.ThemeProvider,{theme:c},ev.createElement(IR,null,ev.createElement(IU,null,ev.createElement(IO,null),ev.createElement(IF,{membership:a}),ev.createElement(Ij,{className:"web-header"},!e.newDoc&&t&&ev.createElement(ev.Fragment,null,ev.createElement(IS,{editorView:!0}),Ic()&&ev.createElement(I$,null)),ev.createElement(NX,{space:d}),ev.createElement(IZ,null,ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:eZ.editor,component:Ix}),ev.createElement(eF.AW,{exact:!0,path:eZ.document,component:Ix}),ev.createElement(eF.AW,{exact:!0,path:eZ.embed,component:Ix}),ev.createElement(eF.AW,{path:eZ.spaceNewList,component:Ix}),ev.createElement(eF.AW,{path:eZ.inboxNewList,component:Ix}),ev.createElement(eF.AW,{path:eZ.newList,component:Ix}))),ev.createElement(Id,null)))))}),IB="@@taskade/editor/MOVE_NODES_ADJACENT_TO",Iz="@@taskade/editor/RESET_EDITOR",IV="@@taskade/editor/INDENT_NODES",Iq="@@taskade/editor/INSERT_FRAGMENT",IW="@@taskade/editor/OUTDENT_NODES",IH="@@taskade/editor/TOGGLE_SELECTION_MARK",IG="@@taskade/editor/PRESS_BACKSPACE",IK="@@taskade/editor/PRESS_DELETE",IY="@@taskade/editor/PRESS_ENTER",IQ="@@taskade/editor/REDO",IJ="@@taskade/editor/UNDO",IX="@@taskade/editor/PASTE_ON_EMPTY_NODE",I0="@@taskade/editor/MULTISELECT_ENTER",I1="@@taskade/editor/MULTISELECT_DOWN",I2="@@taskade/editor/MULTISELECT_UP",I5="@@taskade/editor/UNFOLD_ANCESTORS",I3="@@taskade/editor/SORT_NODE_CHILDREN",I4="@@taskade/editor/HISTORY_REVERT",I6="@@taskade/editor/QUICK_FORMAT",I8="@@taskade/editor/REPLACE_NODE_WITH_FRAGMENT";function I7(){return{type:IJ,payload:{}}}function I9(){return{type:IQ,payload:{}}}function De(e,t){return{type:IV,payload:{nodeIds:e,parentId:t}}}function Dt(e){return{type:IW,payload:{nodeIds:e}}}function Da(e,t){return{type:Iq,payload:{fragment:t,target:e}}}function Dn(e,t,a){return{type:IX,payload:{fragment:e,nodeId:t,ancestors:a}}}function Dl(e,t){return{type:IG,payload:{nodeId:e,ancestors:t}}}function Dr(e,t){return{type:IY,payload:{nodeId:e,ancestors:t}}}function Do(e,t){return{type:IK,payload:{nodeId:e,ancestors:t}}}function Di(e,t){return{type:IB,payload:{source:e,target:t}}}function Ds(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:IH,payload:{selectedIds:e,type:t,data:a}}}function Dd(e){return{type:I0,payload:{selectedIds:e}}}function Dc(e){return{type:I1,payload:{selectedIds:e}}}function Dm(e){return{type:I2,payload:{selectedIds:e}}}function Du(e,t){return{type:I3,payload:{nodeId:e,sortBy:t}}}function Dp(e,t,a){return{type:I8,payload:{nodeId:e,fragment:t,parentId:a}}}!function(e){e.CompleteAsc="complete-asc",e.CompleteDesc="complete-desc",e.DueDate="due-date",e.AlphabeticalAsc="a-z",e.AlphabeticalDesc="z-a",e.Tag="tag",e.Mention="mention",e.DateCreated="date-created"}(O||(O={}));var Dg=a(60358),Df=a(20637);function Dh(e,t,a){return function(n,l){let{slate:r,contents:o,attachments:i}=l();if(null==a.rootNode){uT(new ei.HttpError({code:"BAD_REQUEST",message:"Paste content has no root node.",scope:{extras:{pasteContents:JSON.stringify(a.toST())}}}),uI);return}let s=a.extractFragment(a.rootNode.children.toArray());if(0===s.children.length)return;let d=s.children[0];if(1===s.children.length&&0===d.children.length){let t=r.getIn([e,"text"]);if(null==t)return;!function(e,t,a,n){let{document:l}=(0,Df.MS)(new(CI())(e.text));t(mN(n,a.change().insertFragment(l)))}(d,n,t,e);return}if(0===t.length){n(Da({id:null,position:"afterbegin"},s));return}let c=o.findNodeByID(e);if(null==c)return;let m=c.format?.node;if(null!=m&&(s=(0,es.ZP)(s,e=>(function(e,t){let a=e=>(0,es.ZP)(e,e=>(e.format?.node==null&&(e.format=e.format??{},e.format.node=t),e));return(0,es.ZP)(e,e=>(e.children=e.children.map(a),e))})(e,m))),c.children.size>0){n(Da({id:e,parentId:CP()(t),position:"beforebegin"},s));return}if(0===c.textString.length&&null==ec()(i,e)){n(Dn(s,e,t));return}n(Da({id:e,parentId:CP()(t),position:"afterend"},s))}}function Dy(e,t,a,n){let{document:l}=(0,Df.MS)(new(CI())(e.text));t(mN(n,a.change().insertFragment(l)))}function Db(e,t,a){return function(n,l){let{slate:r,contents:o,attachments:i}=l(),s=o.findNodeByID(e);if(null==s)return;let d=a.children[0];if(1===a.children.length&&0===d.children.length&&s.textString.length>0){let t=r.getIn([e,"text"]);if(null==t)return;Dy(d,n,t,e);return}if(1===a.children.length&&(d.format?.node??"text")==="text"&&0===d.children.length){let t=r.getIn([e,"text"]);if(null==t)return;Dy(d,n,t,e);return}if(0===t.length){n(Da({id:null,position:"afterbegin"},a));return}if(s.children.size>0){n(Da({id:e,parentId:CP()(t),position:"beforebegin"},a));return}if(0===s.textString.length&&null==ec()(i,e)){n(Dn(a,e,t));return}n(Da({id:e,parentId:CP()(t),position:"afterend"},a))}}function Dv(e,t,a){return function(n,l){let r;let o=l(),i=iL(o),s=iG(o);r=s.hideCompleted?function(e,t,a){if(a===e.rootID)return null;let n=e.findPreviousNodeID(a);for(;null!=n;){if(n===e.rootID)return e.rootID;if(t.isNodeIDVisible(n))break;n=e.findPreviousNodeID(n)}return n}(i,s,e):i.findPreviousNodeID(e,t),(0,Dg.isNil)(r)||r===e||n(mI(r,a,e))}}function Dk(e,t,a){return function(n,l){let r;let o=l(),i=iL(o),s=iG(o);r=s.hideCompleted?function(e,t,a){let n=e.findNextNodeID(a);for(;null!=n&&!t.isNodeIDVisible(n);)n=e.findNextNodeID(n);return n}(i,s,e):i.findNextNodeID(e,t),(0,Dg.isNil)(r)||r===e||n(mI(r,a,e))}}function DE(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(a,n){let{contents:l,search:r}=n();l.findNodeByID(e).children.isEmpty()||a(r.isActive?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:N2,payload:{nodeID:e,collapse:t}}}(e,t):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:c0,payload:{currentID:e,collapse:t}}}(e,t))}}var Dx=a(19718);let D_=(e,t)=>new to.Z(t,{keys:["values"],threshold:.2}).search(e).map(e=>e.item),Dw=function(e){let{morseChildProps:t}=e,{command:a}=t.data,n=ev.useRef(null);return ev.useEffect(()=>{t.focused&&n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:n,onClick:t.activate,className:og()("mx-2 mb-[1px] flex h-7 items-center rounded-md px-2 py-[1px] text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement("span",{className:"pl-2.5"},t.label),a.agentBadge&&ev.createElement("span",{className:"ml-1.5 rounded-xl border border-appcolor-400 bg-appcolor-0 px-2 py-0.5 text-2xs font-medium uppercase text-textcolor-600"},ev.createElement(eY.Z,{id:"general.agent",defaultMessage:"AI Agent"})),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},DN="CommandItem",DC="CommandSection",DM={[DN]:e=>ev.createElement(Dw,{morseChildProps:e})},DS={[DC]:e=>ev.createElement(ev.Fragment,null)},DI=eL.default.div.withConfig({displayName:"Options__Container",componentId:"sc-fcbb7d3d-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,DD=function(e){var t;let{isReadyForFocus:a,menuItems:n,shouldSearchInputFilterOptions:l,onCommandActivated:r,onExit:o,onTextChange:i}=e,s=ev.useRef(null),d=(t=e=>{if(l){r(e);return}0!==c.trim().length&&(i(c),r(e))},ev.useCallback(e=>{t(e.data.command)},[t])),[c,m]=ev.useState(""),u=(0,eK.Z)(),p=ev.useRef(null),g=ev.useRef(null);ev.useEffect(()=>{a&&p.current?.focus()},[a]);let f=()=>{i(c),r({type:"ask"})};return ev.createElement(DI,{className:"w-full bg-applight-0 dark:bg-appdark-0/95",onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s.current?.activateCurrentItem(),s.current?.getVisibleItemCount()===0&&f();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o()}},ref:g,tabIndex:0},ev.createElement("div",null,ev.createElement("div",{className:"flex justify-between border-b border-appcolor-300 px-6 py-3 pr-5"},ev.createElement("div",{className:"flex w-full items-center"},ev.createElement(tn.Icon,{className:"mr-3 shrink-0",icon:"dd_ai"}),ev.createElement(Dx.Z,{ref:p,className:"w-full resize-none bg-appcolor-100 bg-transparent",placeholder:l?u.formatMessage({id:"general.editor_ai_assistant_search_placeholder",defaultMessage:"Ask me anything or choose an option below"}):u.formatMessage({id:"general.editor_ai_assistant_empty_node_search_placeholder",defaultMessage:"Type a prompt and choose an option below"}),value:c,onChange:e=>{m(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},minRows:1,maxRows:4}),ev.createElement("button",{className:"ml-2 flex items-center text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s.current?.getVisibleItemCount()===0?i(c):s.current?.activateCurrentItem()}},ev.createElement(tn.Icon,{icon:"message_send"})))),ev.createElement("div",{className:"flex h-60 w-full flex-col overflow-y-auto px-2 pt-4 text-sm leading-relaxed"},ev.createElement(tT,{ref:s,term:l?c:"",data:n,search:l?D_:(e,t)=>t,renderMap:DM,onActivate:d,sectionRenderMap:DS,renderEmptyState:ev.createElement("div",null,ev.createElement("div",{onClick:f,className:"mx-2 rounded-md bg-appcolor-200 py-1"},ev.createElement("span",{className:"pl-2.5"},`${u.formatMessage({id:"general.ask",defaultMessage:"Ask"})} Taskade AI: "${c}"`)))})),ev.createElement("div",{className:"flex h-14 w-full items-center justify-between border-t border-appcolor-300 px-4"},ev.createElement("div",{className:"flex cursor-pointer rounded-lg border border-appcolor-400 px-4 py-1 text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{o()}},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"}),ev.createElement("span",{className:"ml-1 mt-0.5 flex items-center justify-center text-xs text-appcolor-600"},"ESC")),ev.createElement("div",{className:"group flex cursor-pointer items-center",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/12067565458067--Taskade-AI","_blank","noopener,noreferrer")}},ev.createElement("span",{className:"mr-0.5 text-sm text-appcolor-500 group-hover:text-appcolor-800"},ev.createElement(eY.Z,{id:"general.ai_dialog_learn_more",defaultMessage:"Learn more"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 group-hover:fill-appcolor-800",icon:"dd_help"})))))},DT=(0,d9.oM)({name:"dialogs.aiAssistant",initialState:{isOpen:!1},reducers:{toggleAiAssistantDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0},setCommand(e,t){if(null==t.payload)return{...e,command:void 0};let{command:a}=t.payload;return{...e,command:a}}}});function D$(e){let{error:t,onError:a}=e,n=(0,e$.useDispatch)();ev.useEffect(()=>{let e;if(null!=t){if(t instanceof ea.cA){let a=t.graphQLErrors[0];e=a.extensions?.statusCode??a.extensions?.exception?.status?.code}else e=(0,ei.getStatusCodeFromError)(t)}402===e&&(n(ce.actions.toggleAiCreditLimitDialog({error:t})),null!=a&&a())},[n,t,a])}var DP=a(54649);let DF={h1:e=>ev.createElement("h1",{...e,className:"my-4 text-lg font-bold"},e.children),h2:e=>ev.createElement("h2",{...e,className:"my-3 text-base font-bold"},e.children),h3:e=>ev.createElement("h3",{...e,className:"my-3 text-sm font-bold"},e.children),h4:e=>ev.createElement("h4",{...e,className:"my-3 text-xs font-bold"},e.children),h5:e=>ev.createElement("h5",{...e,className:"my-3 text-xs font-bold"},e.children),h6:e=>ev.createElement("h6",{...e,className:"my-3 text-xs font-bold"},e.children),ul:e=>ev.createElement("ul",{...e,className:"my-2 ml-6 list-disc text-sm"},e.children),ol:e=>ev.createElement("ol",{...e,className:"my-2 ml-6 list-decimal text-sm"},e.children),li:e=>ev.createElement("li",{className:"my-2",...e},e.children),p:e=>ev.createElement("p",{...e,className:"my-4 break-words text-sm"},e.children),blockquote:e=>ev.createElement("blockquote",{...e,className:"border-l-4 border-primary px-2 pl-3"},e.children),input:e=>ev.createElement("input",{...e,className:"mr-2 h-4 w-4 align-text-bottom"},e.children),pre:e=>ev.createElement("div",{...e,className:"text-sm"},e.children),code:e=>ev.createElement("div",{...e,className:"whitespace-break-spaces pr-2 text-sm"},e.children),a:e=>ev.createElement("a",{...e,className:"text-primary no-underline transition duration-300 ease-in-out hover:border-b-2 hover:text-primary/80",rel:"noopener noreferrer",target:"_blank"},e.children)},DA=function(e){let{value:t}=e,a=e.shouldRemoveCodeFence??!1,n=e.renderMap??{},l={...DF,...n},r=ev.useMemo(()=>{let e=(0,lo.markdownTextToMdast)(t);if(a){let t=[];for(let a of e.children){if("code"===a.type&&"markdown"===a.lang){let e=(0,lo.markdownTextToMdast)(a.value);t.push(...e.children);continue}t.push(a)}let a={...e,children:t};return(0,DP.sanitizeHast)((0,DP.mdastToHast)(a))}return(0,DP.sanitizeHast)((0,DP.mdastToHast)(e))},[a,t]);return ev.createElement("div",null,function e(t,a){let n=[];if("element"!==a.type&&"root"!==a.type)return[];for(let l=0;l0?ev.createElement(l,o,i):ev.createElement(l,o):i.length>0?ev.createElement(r,o,i):ev.createElement(r,o)}(t,r,l);null!=a&&n.push(a);continue}"text"===r.type&&!function(e){let t=e&&"object"==typeof e&&"text"===e.type?e.value||"":e;return"string"==typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}(r)&&n.push(ev.createElement("span",{key:l},r.value))}return n}({options:{renderMap:l}},r))};function DR(e,t){return function(a,n){let{slate:l}=n(),r=l.getIn([e,"text"]);null!=r&&a(mN(e,r.change().collapseToStartOf(r.document).selectAll().insertText(t)))}}function Dj(e,t,a){let{projectId:n,nodeId:l}=a;switch(t.type){case"ask":return{projectId:n,nodeId:l,data:{type:"ask",question:e}};case"expand":return{projectId:n,nodeId:l,data:{type:"expand",topic:e}};case"outline":return{projectId:n,nodeId:l,data:{type:"outline",topic:e}};case"rewrite":return{projectId:n,nodeId:l,data:{type:"rewrite",content:e}};case"brainstorm":return{projectId:n,nodeId:l,data:{type:"brainstorm",topic:e}};case"subtask":return{projectId:n,nodeId:l,data:{type:"subtask",task:e}};case"generate_questions":return{projectId:n,nodeId:l,data:{type:"generate_questions",topic:e}};case"summarize":return{projectId:n,nodeId:l,data:{type:"summarize",content:e}};case"translate":return{projectId:n,nodeId:l,data:{type:"translate",language:t.language??"Spanish",content:e}};case"fix_spelling_grammar":return{projectId:n,nodeId:l,data:{type:"fix_spelling_grammar",content:e}};case"research":return{projectId:n,nodeId:l,data:{type:"research",topic:e}};case"roundtable":return{projectId:n,nodeId:l,data:{type:"roundtable",topic:e}};case"seo":return{projectId:n,nodeId:l,data:{type:"seo",topic:e}};case"custom":return{projectId:n,nodeId:l,data:{type:"custom",text:e,agentId:t.agentId,commandName:t.commandName}};default:throw new ei.HttpError({code:"NOT_IMPLEMENTED"})}}function DO(e,t,a){let{projectId:n,nodeId:l}=a,{agentId:r,commandId:o}=t;if(null==r||null==o)throw new ei.HttpError({code:"NOT_IMPLEMENTED"});return{projectId:n,nodeId:l,data:{type:t.type,text:e,agentId:r,commandId:o}}}let DU="insert",DZ="replace",DL="regenerate",DB=function(e){let t;let{label:a,isFocused:n,itemType:l,activate:r}=e,o=ev.useRef(null);switch(ev.useEffect(()=>{n&&o.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[n]),l){case DU:t="dd_new";break;case DZ:t="ai_replace";break;case DL:t="dd_ai_rewrite";break;default:t="dd_ai"}return ev.createElement("button",{ref:o,onClick:r,className:og()("flex h-7 w-full items-center px-3 py-2 text-sm text-appcolor-500")},ev.createElement("div",{className:og()("flex h-7 w-full items-center rounded-md px-1 hover:bg-appcolor-200 hover:text-appcolor-800",n&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{className:"scale-90",icon:t}),ev.createElement("span",{className:"pl-3"},a),n&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"})))},Dz=(e,t)=>new to.Z(t,{keys:["label"],threshold:.2}).search(e).map(e=>e.item),DV=eL.default.div.withConfig({displayName:"Actions__RainbowContainer",componentId:"sc-b8e7618d-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,Dq=ev.forwardRef(function(e,t){let{term:a,onActivate:n}=e,[l,r]=ev.useState(0),o=ev.useRef(0),i=ev.useRef(new Map),s=ev.useRef(null),d=function(){let e=(0,eK.Z)();return[{label:e.formatMessage({id:"general.insert",defaultMessage:"Insert"}),itemType:DU},{label:e.formatMessage({id:"general.replace",defaultMessage:"Replace"}),itemType:DZ},{label:e.formatMessage({id:"general.regenerate",defaultMessage:"Regenerate"}),itemType:DL}]}(),c=ev.useMemo(()=>{let e=0,t=0===a.length?d:Dz(a,d);for(let a of t)i.current.set(e,a),e+=1;return o.current=e-1,t},[d,a]);return(ev.useImperativeHandle(t,()=>({focusPrevItem(){r(e=>Math.max(0,e-1)),l<=1&&null!=s.current&&(s.current.scrollTop=0)},focusNextItem(){r(e=>Math.min(o.current,e+1))},activateCurrentItem(){let e=i.current.get(l);null!=e&&n(e)},getVisibleItemCount:()=>c.length})),0===c.length)?null:ev.createElement(DV,{className:"mt-2 flex flex-col items-center bg-applight-0 py-3 dark:bg-appdark-0/60"},c.map((e,t)=>ev.createElement(DB,{key:t,isFocused:l===t,label:e.label,itemType:e.itemType,activate:()=>{r(t),n(e)}})))}),DW=e=>"string"==typeof e?e.trim():e,DH=dw.z.object({type:dw.z.literal("ask"),question:dw.z.preprocess(DW,dw.z.string().min(1))}),DG=dw.z.object({type:dw.z.literal("expand"),topic:dw.z.preprocess(DW,dw.z.string().min(1))}),DK=dw.z.object({type:dw.z.literal("rewrite"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),DY=dw.z.object({type:dw.z.literal("summarize"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),DQ=dw.z.object({type:dw.z.literal("outline"),topic:dw.z.preprocess(DW,dw.z.string().min(1))}),DJ=dw.z.object({type:dw.z.literal("translate"),language:dw.z.enum(["English","Chinese","Japanese","Spanish","Czech","German","Slovak","Brazilian Portuguese","Portugal Portuguese","Italian","Vietnamese","Korean","French"]),content:dw.z.preprocess(DW,dw.z.string().min(1))}),DX=dw.z.object({type:dw.z.literal("subtask"),task:dw.z.preprocess(DW,dw.z.string().min(1))}),D0=dw.z.object({type:dw.z.literal("brainstorm"),topic:dw.z.preprocess(DW,dw.z.string().min(1))}),D1=dw.z.object({type:dw.z.literal("generate_questions"),topic:dw.z.preprocess(DW,dw.z.string().min(1))}),D2=dw.z.object({type:dw.z.literal("add_block"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),D5=dw.z.object({type:dw.z.literal("generate_action_items"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),D3=dw.z.object({type:dw.z.literal("prioritize"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),D4=dw.z.object({type:dw.z.literal("continue_writing"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),D6=dw.z.object({type:dw.z.literal("fix_spelling_grammar"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),D8=dw.z.object({type:dw.z.literal("reprompt"),previousMessage:dw.z.preprocess(DW,dw.z.string().min(1)),content:dw.z.preprocess(DW,dw.z.string().min(1))}),D7=dw.z.object({type:dw.z.literal("research"),topic:dw.z.preprocess(DW,dw.z.string().min(1)),country:dw.z.string().default("us")}),D9=dw.z.object({type:dw.z.literal("roundtable"),topic:dw.z.preprocess(DW,dw.z.string().min(1)),country:dw.z.string().default("us")}),Te=dw.z.object({type:dw.z.literal("seo"),topic:dw.z.preprocess(DW,dw.z.string().min(1)),country:dw.z.string().default("us")}),Tt=dw.z.object({type:dw.z.literal("agent"),content:dw.z.preprocess(DW,dw.z.string().min(1))}),Ta=dw.z.discriminatedUnion("type",[DH,DG,DK,DX,D0,DY,DQ,DJ,D2,D1,D5,D3,D4,D6,D8,D7,D9,Te,Tt]),Tn=dw.z.object({text:dw.z.string()}),Tl=dw.z.object({projectId:dw.z.string(),nodeId:dw.z.string(),data:Ta}),Tr=eL.default.div.withConfig({displayName:"Result__RainbowContainer",componentId:"sc-51baf8e-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,To=(0,lb.C)({context:{result:"",error:null,pastResults:[],currentIndex:0},schema:{context:{},events:{}},tsTypes:{},id:"request",initial:"idle",states:{idle:{on:{MAKE_REQUEST:{actions:"clearResult",target:"#request.streaming"},TOGGLE_PREV:{actions:"handleTogglePrev"},TOGGLE_NEXT:{actions:"handleToggleNext"}}},streaming:{invoke:{src:(e,t)=>async e=>{if("MAKE_REQUEST"!==t.type)return;let{input:a}=t.payload,n="custom"===a.data.type?"/web-api/ai/custom-command":"/web-api/ai",l=await fetch(n,{method:"POST",credentials:"same-origin",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}});if(!l.ok){let e=new ei.FetchError(l);throw await e.toTaskadeError()??e}if(null==l.body)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"response body is null"});let r=l.body.getReader(),o=new TextDecoder;function i(t){if(t)try{let a=JSON.parse(t),n=Tn.safeParse(a);if(!n.success)return;e({type:"UPDATE_RESULT",payload:{chunk:n.data.text}})}catch(e){throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Error parsing line"})}}let s=!1,d="";for(;!s;){let e=await r.read();if(s=e.done,e.value){d+=o.decode(e.value);for(let e=d.indexOf("\n");e>=0;e=d.indexOf("\n")){let t=d.slice(0,e);d=d.slice(e+1),i(t)}}}if(d){let e=d;d="",i(e)}e({type:"STREAM_FINISHED"})},onError:[{actions:"handleError",target:"#request.failed"}]},on:{UPDATE_RESULT:{actions:"updateResult"},STREAM_FINISHED:{actions:"handleStreamFinished",target:"#request.idle"}}},failed:{}}}),Ti=function(e){let{inputText:t,insertNodeId:a,projectId:n,command:l,shouldInsertPromptIntoNode:r,onExit:o,onBackButtonClick:i,onReplaceText:s,onInsertFragment:d,updatePopperPosition:c}=e,m=(0,e$.useDispatch)(),[u,p]=(0,ls.e)(To,{actions:{updateResult:(0,lv.assign)((e,t)=>{let{chunk:a}=t.payload;return(0,es.ZP)(e,e=>{e.result=e.result+a})}),handleStreamFinished:(0,lv.assign)(e=>(c(),(0,es.ZP)(e,e=>{e.currentIndex=e.pastResults.length,e.pastResults=[...e.pastResults,e.result]}))),clearResult:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.result=""})),handleError:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleTogglePrev:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{currentIndex:t,pastResults:a}=e;if(0===t)return e;let n=t-1;e.currentIndex=n,e.result=a[n]})),handleToggleNext:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{currentIndex:t,pastResults:a}=e,n=t+1;if(n>=a.length)return e;e.currentIndex=n,e.result=a[n]}))}}),g=u.context.result,f=(0,eL.useTheme)(),h=(0,eF.k6)(),[y,b]=ev.useState(null),v=ev.useRef(null),k=ev.useRef(null),E=(0,eK.Z)(),[x,_]=ev.useState(""),w=ev.useMemo(()=>"custom"===l.type?DO(t,l,{projectId:n,nodeId:a}):Dj(t,l,{projectId:n,nodeId:a}),[l,a,t,n]),N=ev.useCallback(()=>{p({type:"MAKE_REQUEST",payload:{input:w}})},[w,p]);ev.useEffect(()=>{N()},[N]),D$({error:u.context.error,onError:()=>{m(DT.actions.toggleAiAssistantDialog())}});let C=ev.useCallback(e=>{let n=u.context.error;if(null!=n){402===(0,ei.getStatusCodeFromError)(n)&&("ACTIVATION_REQUIRED"===(0,ei.getCodeFromError)(n)?h.push("/settings/plans"):m(d4())),o();return}if(null!=g){if("insert"===e){let{markdownText:e}=(0,lo.plainTextToMarkdownText)(g),n=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});if((0,lr.isFragmentEmpty)(n))return;d(n),r&&m(DR(a,t))}else{let{markdownText:e}=(0,lo.plainTextToMarkdownText)(g),t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});if((0,lr.isFragmentEmpty)(t))return;s(t)}o()}},[m,h,t,a,u.context.error,o,d,s,r,g]),M=()=>{N()},S=()=>{0!==x.length&&(_(""),p({type:"MAKE_REQUEST",payload:{input:{projectId:n,nodeId:a,data:{type:"reprompt",content:x,previousMessage:g}}}}))};ev.useEffect(()=>{let e=v.current;null!=e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[g]);let I=e=>{null==g||u.matches("streaming")||(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),k.current?.getVisibleItemCount()===0?S():k.current?.activateCurrentItem())};return ev.useEffect(()=>{y?.focus()},[y]),ev.createElement("div",null,ev.createElement(Tr,{className:"w-full bg-applight-0 dark:bg-appdark-0/60",onKeyDownCapture:e=>{if((0,eV.ZP)("shift+enter")(e)){if(null==g||u.matches("streaming"))return;e.preventDefault(),C("replace");return}switch(e.key){case eI.KeyboardKeys.Enter:I(e);break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),k.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),k.current?.focusNextItem();break;case eI.KeyboardKeys.Escape:o()}}},ev.createElement("div",{className:"flex h-64 w-full overflow-y-scroll px-6 py-4 text-sm leading-relaxed",ref:v,tabIndex:0},u.matches("failed")?ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},u.context?.error?.message):null!=g&&ev.createElement("div",null,ev.createElement(DA,{value:g,shouldRemoveCodeFence:!0}))),ev.createElement("div",{className:"w-full"},ev.createElement("div",{className:"flex h-full w-full items-center justify-between border-t border-appcolor-300 px-4 py-1"},u.matches("streaming")?ev.createElement("div",{className:"ml-auto"},ev.createElement(eI.Spinner,{color:f.primaryColor})):ev.createElement(ev.Fragment,null,u.matches("idle")&&null!=g&&ev.createElement("div",{className:"flex w-full flex-col"},ev.createElement("div",{className:"flex w-full items-center gap-x-3 py-2"},ev.createElement(tn.Icon,{className:"-mt-1 shrink-0 scale-90",icon:"dd_ai"}),ev.createElement(Dx.Z,{ref:b,className:"w-full resize-none bg-transparent pr-4 text-sm",placeholder:E.formatMessage({id:"general.ai_assistant_reprompt_placeholder",defaultMessage:"Instruct Taskade AI on what to do next...."}),value:x,onChange:e=>{_(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},minRows:1}),ev.createElement("button",{className:"flex items-center text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:I},ev.createElement(tn.Icon,{icon:"message_send"})),u.context.pastResults.length>1&&ev.createElement("div",{className:"mr-2 flex min-w-fit items-center text-sm text-appcolor-500"},ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_prev",onClick:()=>{p({type:"TOGGLE_PREV"})}}),ev.createElement("p",null,`${u.context.currentIndex+1} of ${u.context.pastResults.length}`),ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_next",onClick:()=>{p({type:"TOGGLE_NEXT"})}})))),u.matches("failed")&&null!=u.context.error&&ev.createElement(ev.Fragment,null,ev.createElement("div",null,ev.createElement("div",{className:"flex cursor-pointer rounded-lg border border-appcolor-400 px-4 py-1 text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{i()}},ev.createElement(eY.Z,{id:"general.back",defaultMessage:"Back"}),ev.createElement("span",{className:"ml-1 mt-0.5 flex items-center justify-center text-xs text-appcolor-600"},"B"))),ev.createElement("div",{className:"flex"},402===(0,ei.getStatusCodeFromError)(u.context.error)&&ev.createElement("div",{className:"flex"},ev.createElement("div",{className:" flex cursor-pointer rounded-lg bg-upgrade px-4 py-1 text-[#0c0500] hover:bg-upgrade/80",onClick:()=>{C("insert")}},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1 mt-0.5"}),"ACTIVATION_REQUIRED"===(0,ei.getCodeFromError)(u.context.error)?ev.createElement(eY.Z,{id:"general.activate",defaultMessage:"Activate"}):ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))))))))),u.matches("idle")&&g.length>0&&ev.createElement("div",null,ev.createElement(Dq,{ref:k,term:x,onActivate:e=>{switch(e.itemType){case DU:C("insert");break;case DZ:C("replace");break;case DL:M()}}})))},Ts={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentRunsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentRunFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentRuns"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"document_id"}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"goal"}},{kind:"Field",name:{kind:"Name",value:"result"}},{kind:"Field",name:{kind:"Name",value:"isCompleted"}},{kind:"Field",name:{kind:"Name",value:"spaceAgent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]};function Td(e,t,a){var n;let{id:l,mimetype:r,namespace:o,extension:i}=e,s=(0,cx.getThumbnailMimeTypeDesc)(r);if(null==s)return null;let d=s.extensions[0];return(0,ei.assert)("string"==typeof i),n=function(e,t,a,n,l){let r=function(e){if(ts()(e))throw Error("namespace must not be empty!");return"production"!==e?`${e}/`:""}(e);return a?`${r}${t}/${a}/${n}.${l}`:`${r}${t}/${n}.${l}`}(o,l,t,a,d),`https://files.taskade.com/${n}`}let Tc=function(e){let{agent:t,size:a}=e;if(null==t.data.avatar)return ev.createElement(tn.Icon,{icon:"dd_ai"});if("emoji"===t.data.avatar.type)return ev.createElement(e1.AgentAvatar,{name:t.data.avatar.data.value,size:"sm"});if("custom"!==t.data.avatar.type)return ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_ai"});let n=Td(t.data.avatar.data.file,"h_100,w_100","hdpi");return null==n?ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_ai"}):ev.createElement(e1.AgentAvatar,{src:n,size:a})},Tm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentRunCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentRunCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentRunCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"spaceAgentRun"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]},Tu={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentRunDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentRunDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentRunDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},Tp={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentRunQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentRun"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"goal"}},{kind:"Field",name:{kind:"Name",value:"isCompleted"}},{kind:"Field",name:{kind:"Name",value:"result"}},{kind:"Field",name:{kind:"Name",value:"spaceAgent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]}}]},Tg="ActionItem",Tf="insert",Th="replace",Ty=function(e){let t;let{morseChildProps:a}=e,n=ev.useRef(null);switch(ev.useEffect(()=>{a.focused&&n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[a.focused]),a.data.action.itemType){case"create_project":t="dd_newtemplate";break;case Tf:t="dd_new";break;case Th:t="ai_replace";break;default:t="dd_ai_outline"}return ev.createElement("button",{ref:n,onClick:a.activate,className:og()("flex h-7 w-full items-center px-3 py-2 text-sm text-appcolor-500")},ev.createElement("div",{className:og()("flex h-7 w-full items-center rounded-md px-3 hover:bg-appcolor-200 hover:text-appcolor-800",a.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{className:"scale-90",icon:t}),ev.createElement("span",{className:"pl-3"},a.label),a.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"})))},Tb={[Tg]:e=>ev.createElement(Ty,{morseChildProps:e})},Tv=(e,t)=>new to.Z(t,{keys:["values"],threshold:.2}).search(e).map(e=>e.item),Tk=eL.default.div.withConfig({displayName:"ResultAgent__RainbowContainer",componentId:"sc-643daff1-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,TE=function(e){var t;let{spaceAgentRunId:a,inputText:n,insertNodeId:l,projectId:r,command:o,onExit:i,shouldInsertPromptIntoNode:s}=e,[d,c]=ev.useState(null),[m,u]=ev.useState(a??null),[p,g]=ev.useState(""),f=(0,e$.useDispatch)(),h=ev.useRef(null),y=[{type:"section",label:"actions",items:[{label:"Insert",itemType:Tf},{label:"Replace",itemType:Th}].map(e=>{let{label:t,itemType:a}=e;return{label:t,values:[t],data:{action:e},itemType:a,render:Tg}})}],[b]=(0,cs.D)(Tm),[v,{loading:k}]=(0,cs.D)(Tu),E=(0,eB.a)(Tp,null!=m?{variables:{id:m},pollInterval:5e3}:{skip:null==m});ev.useEffect(()=>{if(!E.loading){if(null!=E.data){let e=E.data.spaceAgentRun;null!=e&&e.isCompleted&&E.stopPolling();return}(async function(){if(null!=o.agentId&&null!=o.commandId)try{let e=await b({variables:{input:{clientMutationId:(0,ld.Z)(),spaceAgentId:o.agentId,projectId:r,nodeId:l,goal:n,commandId:o.commandId}},refetchQueries:[Ts]});e.data?.spaceAgentRunCreate?.spaceAgentRun?.id!=null&&u(e.data.spaceAgentRunCreate.spaceAgentRun.id),E.startPolling(5e3)}catch(e){if(e instanceof ea.cA){let t=e.graphQLErrors[0];402===(t.extensions?.statusCode??t.extensions?.exception?.status?.code)?(i(),f(ce.actions.toggleAiCreditLimitDialog({error:e}))):g((0,ei.getMessageFromError)(bH(e,["spaceAgentRunCreate"])??e)??"Unknown error")}else g((0,ei.getMessageFromError)(e)??"Unknown error")}})()}},[o.agentId,o.commandId,f,n,l,i,r,E,b]),ev.useEffect(()=>{null!=d&&d.scrollTo({top:d.scrollHeight,behavior:"smooth"})},[E.data,d,l]),ev.useEffect(()=>{d?.focus()},[d]);let x=E.data?.spaceAgentRun,_=async()=>{if(x?.id==null||(await v({variables:{input:{clientMutationId:(0,ld.Z)(),id:x.id}},refetchQueries:[Ts],update:e=>{let t=e.readQuery({query:Ts,variables:{filterby:{projectId:r}}});null!=t&&e.writeQuery({query:Ts,variables:{filterby:{projectId:r}},data:(0,es.ZP)(t,e=>{let t=e.spaceAgentRuns.edges.filter(e=>e.node.id!==x.id);e.spaceAgentRuns.edges=t})})}}),x?.result?.content==null||0===x.result.content.length))return;let e="";for(let t of x.result.content)e=`${e} +# ${t.step} +${t.response}`;let t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});(0,lr.isFragmentEmpty)(t)||(f(Dp(l,t)),f(mZ(l,li.FORMAT_TYPE_NODE,li.FORMAT_HEADING1)),i())},w=(t=async()=>{if(x?.id==null||(await v({variables:{input:{clientMutationId:(0,ld.Z)(),id:x.id}},refetchQueries:[Ts],update:e=>{let t=e.readQuery({query:Ts,variables:{filterby:{projectId:r}}});null!=t&&e.writeQuery({query:Ts,variables:{filterby:{projectId:r}},data:(0,es.ZP)(t,e=>{let t=e.spaceAgentRuns.edges.filter(e=>e.node.id!==x.id);e.spaceAgentRuns.edges=t})})}}),x?.result?.content==null||0===x.result.content.length))return;let e="";for(let t of x.result.content)e=`${e} +# ${t.step} +${t.response}`;let t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});(0,lr.isFragmentEmpty)(t)||(f(Da({id:l,position:"afterbegin"},t)),f(DE(l,!1)),s&&f(DR(l,n)),i())},ev.useCallback(async e=>{switch(e.data.action.itemType){case Tf:await t();break;case Th:await _()}},[t,_]));if(null==x)return ev.createElement(Tk,{className:"w-full bg-applight-0 dark:bg-appdark-0/80"},ev.createElement("div",{className:"w-full"},ev.createElement("div",{className:"flex justify-between border-b border-appcolor-300 px-6 py-3"},ev.createElement("div",{className:"flex"},ev.createElement(tn.Icon,{icon:"dd_ai"}),ev.createElement("span",{className:"ml-3"},"Agent"))),ev.createElement("div",{className:"flex h-60 w-full flex-col overflow-y-scroll px-4 py-3 text-sm leading-relaxed"},(0,sX.isStringNotBlank)(p)?p:ev.createElement(eI.Spinner,null))));let N=hR.YY.safeParse(x?.result);if(!N.success)return ev.createElement(Tk,{className:"w-full bg-applight-0 dark:bg-appdark-0/80"},ev.createElement("div",{className:"w-full"},ev.createElement("div",{className:"flex justify-between border-b border-appcolor-300 px-6 py-3"},ev.createElement("div",{className:"flex"},ev.createElement(tn.Icon,{icon:"dd_ai"}),ev.createElement("span",{className:"ml-3"},"Agent"))),ev.createElement("div",{className:"flex h-60 w-full flex-col overflow-y-scroll px-4 py-3 text-sm leading-relaxed"},N.error.message)));let{content:C,plans:M}=N.data;return ev.createElement(Tk,{className:"w-full bg-applight-0 dark:bg-appdark-0/80"},ev.createElement("div",{className:"w-full"},ev.createElement("div",{className:"flex items-center justify-between border-b border-appcolor-300 px-6 py-3"},ev.createElement("div",{className:"flex"},ev.createElement(Tc,{agent:x.spaceAgent,size:"xs"}),ev.createElement("span",{className:"ml-3"},x.spaceAgent.name))),ev.createElement("div",{className:"flex h-60 w-full flex-col overflow-y-scroll px-4 py-3 text-sm leading-relaxed",ref:c,onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),h.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),h.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),h.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i()}},tabIndex:0},ev.createElement("div",{className:"rounded-xl border border-solid border-appcolor-300 bg-appcolor-200 p-3 text-sm"},ev.createElement("div",{className:"flex"},ev.createElement("strong",{className:"mr-1"},"\uD83C\uDFAF Goal:"),x.goal)),ev.createElement("div",{className:"mt-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-200 p-3 text-sm"},ev.createElement("strong",{className:"mr-1"},"✅ Tasks:"),0===M.length&&ev.createElement("div",{className:"mt-2"},ev.createElement(eI.Spinner,null)),ev.createElement("div",{className:"mt-3 flex flex-col"},M.map((e,t)=>ev.createElement("div",{key:t},t+1,". ",e)))),ev.createElement("ul",null,M.map((e,t)=>{if(x.result.content.lengtht&&ev.createElement("div",{className:"mt-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-200 px-3 text-sm"},ev.createElement(DA,{value:C[t].reasoning,shouldRemoveCodeFence:!0})),!a&&ev.createElement("div",{className:"mt-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-200 p-3 text-sm"},ev.createElement("strong",{className:"mr-1"},"⚡️ Executing:"),`"${e}"…`),C.length<=t&&!x.isCompleted&&!a&&ev.createElement("div",{className:"mt-2"},ev.createElement(eI.Spinner,null)),C.length>t&&ev.createElement("div",{className:"mt-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-200 px-3"},ev.createElement(DA,{value:C[t].response,shouldRemoveCodeFence:!0})))}))),x?.isCompleted&&ev.createElement("div",{className:"w-full border-t border-appcolor-300 pb-3"},k?ev.createElement(eI.Spinner,null):ev.createElement(tT,{ref:h,term:"",data:y,renderMap:Tb,onActivate:w,search:Tv}))))},Tx=function(e){let{command:t,menuItems:a,insertNodeId:n,inputText:l,projectId:r,isReadyForFocus:o,onReplaceText:i,onInsertFragment:s,onBackButtonClick:d,onCommandActivated:c,updatePopperPosition:m,spaceAgentRunId:u,onExit:p}=e,g=(0,eL.useTheme)(),[f,h]=ev.useState(l),y=ev.useMemo(()=>gW()(g.primaryColor??eI.Colors.BRAND).rgb().join(" "),[g.primaryColor]),b=()=>{h(l),d()},v=l.trim().length>0,k=0===l.trim().length;return t?.type==="custom"?ev.createElement("div",{style:{"--color-primary":y},className:"h-min-fit w-full min-w-[32rem]"},ev.createElement(Ti,{insertNodeId:n,inputText:f,projectId:r,command:t,onExit:p,onReplaceText:i,onInsertFragment:s,onBackButtonClick:b,shouldInsertPromptIntoNode:k,updatePopperPosition:m})):t?.type==="custom_background"?ev.createElement("div",{style:{"--color-primary":y},className:"h-min-fit w-full min-w-[32rem]"},ev.createElement(TE,{insertNodeId:n,inputText:f,spaceAgentRunId:u,projectId:r,command:t,isReadyForFocus:o,onExit:p,onReplaceText:i,onInsertFragment:s,onBackButtonClick:b,shouldInsertPromptIntoNode:k})):ev.createElement("div",{style:{"--color-primary":y},className:"h-min-fit w-full min-w-[32rem]"},t?.type==null||0===f.trim().length?ev.createElement(DD,{menuItems:a,isReadyForFocus:o,onCommandActivated:c,onExit:p,onTextChange:e=>{h(e)},shouldSearchInputFilterOptions:v}):ev.createElement(Ti,{insertNodeId:n,inputText:f,projectId:r,command:t,onExit:p,onReplaceText:i,onInsertFragment:s,onBackButtonClick:b,shouldInsertPromptIntoNode:k,updatePopperPosition:m}))};function T_(e){return ev.useMemo(()=>({"--color-primary":gW()(e.primaryColor??eI.Colors.BRAND).rgb().join(" ")}),[e.primaryColor])}let Tw={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AiAssistantSpaceAgentsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]},TN=(0,d9.oM)({name:"dialogs.createSpaceAgent",initialState:{isOpen:!1},reducers:{toggleCreateSpaceAgentDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{isOpen:!0,spaceId:t.payload.spaceId}}}),TC=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)();return ev.createElement("button",{className:"group mt-8 flex items-center gap-3 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm font-semibold transition duration-150 ease-in-out hover:border-appcolor-400",onClick:()=>{a(TN.actions.toggleCreateSpaceAgentDialog({spaceId:t}))}},ev.createElement(tn.Icon,{icon:"ai_add",className:"text-appcolor-400 transition duration-150 ease-in-out group-hover:text-appcolor-800"}),ev.createElement(eY.Z,{id:"agent.create_agent",defaultMessage:"Create agent"}))},TM={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MePreferencesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emojiSkin"}}]}}]}}]}}]},TS=(0,d9.oM)({name:"dialogs.editSpaceAgent",initialState:{isOpen:!1},reducers:{toggleEditSpaceAgentDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{isOpen:!0,agentId:t.payload.agentId,tab:t.payload.tab}}}),TI=function(e){let{morseChildProps:t}=e,{agentId:a}=t.data,n=(0,e$.useDispatch)(),l=ev.useRef(null);return ev.useEffect(()=>{t.focused&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:l,className:og()("group flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":t.focused}),onClick:t.activate},ev.createElement(tn.Icon,{className:"scale-80",icon:"dd_ai"}),ev.createElement("div",{className:"flex items-center"},t.label),ev.createElement("button",{className:"ml-auto text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),n(TS.actions.toggleEditSpaceAgentDialog({agentId:a,tab:"commands"}))}},ev.createElement(tn.Icon,{className:"scale-80 opacity-0 group-hover:opacity-100",icon:"agent_edit"})))},TD=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{className:og()("flex items-center gap-x-[var(--menu-item-gap)] p-[var(--menu-item-padding)] text-sm text-textcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200",t.focused&&"bg-appcolor-200"),ref:a,onClick:t.activate},ev.createElement(tn.Icon,{icon:"dd_ai",className:"scale-80"}),ev.createElement("div",{className:"flex items-center"},t.label))},TT="SpaceAgentItem",T$="HideSection",TP="create_space_agent",TF="CreateSpaceAgentItem",TA="space_agent",TR={[TT]:e=>ev.createElement(TI,{morseChildProps:e}),[TF]:e=>ev.createElement(TD,{morseChildProps:e})},Tj={CommandSection:e=>ev.createElement(ev.Fragment,null),[T$]:e=>ev.createElement(ev.Fragment,null)},TO=eL.default.div.withConfig({displayName:"CustomAgentsOptions__Container",componentId:"sc-45cff269-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,TU=(e,t)=>new to.Z(t,{keys:["values"],threshold:.2}).search(e).map(e=>e.item),TZ=function(e){let{spaceId:t,isReadyForFocus:a,menuItems:n,onCommandActivated:l,onExit:r}=e,[o,i]=ev.useState(""),{data:s}=(0,eB.a)(TM),d=s?.me??null,c=(0,e$.useDispatch)(),m=ev.useCallback(e=>{l(e)},[l]),u=ev.useCallback(()=>{c(rh({isOpen:!0,activeView:rI,enableCopyList:void 0}))},[c]),p=ev.useCallback(e=>{if(null==d){u(),r();return}if(e.itemType===TA){m({type:e.data.isBackgroundJob?"custom_background":"custom",agentId:e.data.agentId,commandId:e.data.commandId});return}if(e.itemType===TP){if(null==t)return;c(TN.actions.toggleCreateSpaceAgentDialog({spaceId:t})),r()}},[d,c,u,m,r,t]),g=ev.useRef(null),f=(0,eK.Z)(),h=ev.useRef(null),y=ev.useRef(null);ev.useEffect(()=>{a&&h.current?.focus()},[a]);let b=()=>{l({type:"ask"})};return ev.createElement(TO,{className:"w-full rounded-xl bg-applight-0 dark:bg-appdark-0/95",onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),g.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),g.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),g.current?.activateCurrentItem(),g.current?.getVisibleItemCount()===0&&b();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r()}},ref:y,tabIndex:0},ev.createElement("div",null,ev.createElement("div",{className:"flex justify-between border-b border-appcolor-300 px-6 py-3 pr-5"},ev.createElement("div",{className:"flex w-full items-center"},ev.createElement(tn.Icon,{className:"mr-3 shrink-0",icon:"dd_ai"}),ev.createElement(Dx.Z,{ref:h,className:"w-full resize-none bg-appcolor-100 bg-transparent",value:o,onChange:e=>{i(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},minRows:1,maxRows:4,placeholder:f.formatMessage({id:"general.editor_ai_assistant_custom_agents_placeholder",defaultMessage:"Choose a command"})}),ev.createElement("button",{className:"ml-2 flex items-center text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),g.current?.activateCurrentItem()}},ev.createElement(tn.Icon,{icon:"message_send"})))),ev.createElement("div",{className:"flex h-60 w-full flex-col overflow-y-auto px-2 pt-4 text-sm leading-relaxed"},ev.createElement(tT,{ref:g,term:o,data:n,search:TU,renderMap:TR,onActivate:p,sectionRenderMap:Tj})),ev.createElement("div",{className:"flex h-14 w-full items-center justify-between border-t border-appcolor-300 px-4"},ev.createElement("div",{className:"flex cursor-pointer rounded-lg border border-appcolor-400 px-4 py-1 text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{r()}},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"}),ev.createElement("span",{className:"ml-1 mt-0.5 flex items-center justify-center text-xs text-appcolor-600"},"ESC")),ev.createElement("div",{className:"group flex cursor-pointer items-center",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/12067565458067--Taskade-AI","_blank","noopener,noreferrer")}},ev.createElement("span",{className:"mr-0.5 text-sm text-appcolor-500 group-hover:text-appcolor-800"},ev.createElement(eY.Z,{id:"general.ai_dialog_learn_more",defaultMessage:"Learn more"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 group-hover:fill-appcolor-800",icon:"dd_help"})))))},TL=eL.default.div.withConfig({displayName:"CustomAgents__Container",componentId:"sc-b46edf1d-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,TB=function(e){let{doc:t,spaceId:a,isReadyForFocus:n,onCommandActivated:l,onExit:r}=e,o=(0,eK.Z)(),i=T_((0,eL.useTheme)()),{data:s,loading:d}=(0,eB.a)(Tw,null!=a?{variables:{filterby:{spaceId:a}}}:{skip:!0}),c=Eu({role:t?.role?.workspace,action:"create_space_agent"}),m=ev.useMemo(()=>{let e=[{type:"section",label:"default",render:T$,items:[{itemType:TP,label:o.formatMessage({id:"general.create_agent",defaultMessage:"Create Agent"}),values:[],data:{},render:TF}]}],t=[];if(null==d||null==s||0===s.spaceAgents.totalCount)return e;for(let e of s.spaceAgents.edges){let a=hR.Sx.safeParse(e.node.data);a.success&&t.push({id:e.node.id,name:e.node.name,data:a.data})}return e.push(...t.map(e=>({type:"section",label:e.name,items:e.data.commands.map(t=>({itemType:TA,label:t.name,values:[e.name,t.name],data:{agentId:e.id,commandId:t.id,isBackgroundJob:t.isBackgroundJob},render:TT}))}))),e},[s,o,d]);return d?ev.createElement(TL,{className:"flex h-64 w-full min-w-[32rem] items-center"},ev.createElement(eI.Spinner,null)):1===m.length?ev.createElement(TL,{className:"flex w-full min-w-[32rem] items-center overflow-clip",style:i},ev.createElement("div",{className:"m-4 flex h-full w-full flex-col items-center justify-center rounded-xl border border-appcolor-300 bg-applight-0 px-5 py-10 text-center dark:bg-appdark-0/60"},ev.createElement(lT.H7,{className:"mb-8 shrink-0 text-appcolor-500"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.create_your_first_agent",defaultMessage:"Create your first agent!"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.build_an_agent_and_personalize",defaultMessage:"Build and train your virtual workforce and team: Craft personas, enrich with knowledge, build custom AI commands, select tools like web browsing, and more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}})),null!=a&&c&&ev.createElement(TC,{spaceId:a}))):ev.createElement("div",{className:"flex min-h-fit w-full min-w-[32rem] items-center rounded-xl"},ev.createElement(TZ,{spaceId:a,menuItems:m,isReadyForFocus:n,onCommandActivated:l,onExit:r}))},Tz=ev.forwardRef(function(e,t){let{nodeId:a,sendExitEvent:n,children:l}=e,[r]=ev.useState(()=>({getBoundingClientRect:()=>{let e=document.getElementById(`node-${a}`);if(null==e)return n(),DOMRect.fromRect();let t=e.getElementsByClassName("node-editor")?.[0];if(null==t)return n(),DOMRect.fromRect();let l=t.getBoundingClientRect();return DOMRect.fromRect({x:l.x,y:l.y,width:l.width,height:l.height-12})}})),o=ev.useRef(r),i=ev.useRef(null),s=(0,eI.usePopper)({referenceElementRef:o,popperElementRef:i,visible:!0,placement:"bottom-start"});ev.useImperativeHandle(t,()=>({updatePopperPositioning(){s.instanceRef.current?.update()}}));let d=ev.useMemo(()=>{if(null==s.state)return{ref:i,style:{visibility:"hidden"}};let{attributes:e,styles:t}=s.state;return{...e.popper,ref:i,style:t.popper}},[s.state]);return ev.useEffect(()=>{s.instanceRef.current?.forceUpdate()},[s.instanceRef]),ev.createElement("div",d,l)}),TV={brainstorm:(0,te.Em)({id:"general.brainstorm",defaultMessage:"Brainstorm"}),subtask:(0,te.Em)({id:"general.subtask",defaultMessage:"Subtask"}),generate_questions:(0,te.Em)({id:"general.generate_questions",defaultMessage:"Generate Questions"}),outline:(0,te.Em)({id:"general.outline",defaultMessage:"Outline"}),expand:(0,te.Em)({id:"general.expand",defaultMessage:"Expand"}),rewrite:(0,te.Em)({id:"general.rewrite",defaultMessage:"Rewrite"}),summarize:(0,te.Em)({id:"general.summarize",defaultMessage:"Summarize"}),ask:(0,te.Em)({id:"general.ask",defaultMessage:"Ask"}),translate:(0,te.Em)({id:"general.translate",defaultMessage:"Translate"}),fix_spelling_grammar:(0,te.Em)({id:"general.fix_spelling_grammar",defaultMessage:"Fix Spelling and Grammar"}),research:(0,te.Em)({id:"general.research",defaultMessage:"Research"}),roundtable:(0,te.Em)({id:"general.roundtable",defaultMessage:"Roundtable"}),seo:(0,te.Em)({id:"general.seo",defaultMessage:"SEO"})},Tq={English:(0,te.Em)({id:"general.translate_to_english",defaultMessage:"Translate to English"}),"Brazilian Portuguese":(0,te.Em)({id:"general.translate_to_brazilian_portuguese",defaultMessage:"Translate to Brazilian Portuguese"}),Chinese:(0,te.Em)({id:"general.translate_to_chinese",defaultMessage:"Translate to Chinese"}),Czech:(0,te.Em)({id:"general.translate_to_czech",defaultMessage:"Translate to Czech"}),French:(0,te.Em)({id:"general.translate_to_french",defaultMessage:"Translate to French"}),German:(0,te.Em)({id:"general.translate_to_german",defaultMessage:"Translate to German"}),Italian:(0,te.Em)({id:"general.translate_to_italian",defaultMessage:"Translate to Italian"}),Japanese:(0,te.Em)({id:"general.translate_to_japanese",defaultMessage:"Translate to Japanese"}),Korean:(0,te.Em)({id:"general.translate_to_korean",defaultMessage:"Translate to Korean"}),"Portugal Portuguese":(0,te.Em)({id:"general.translate_to_portugal_portuguese",defaultMessage:"Translate to Portugal Portuguese"}),Slovak:(0,te.Em)({id:"general.translate_to_slovak",defaultMessage:"Translate to Slovak"}),Spanish:(0,te.Em)({id:"general.translate_to_spanish",defaultMessage:"Translate to Spanish"}),Vietnamese:(0,te.Em)({id:"general.translate_to_vietnamese",defaultMessage:"Translate to Vietnamese"})},TW=[{type:"subtask"},{type:"brainstorm"},{type:"research",agentBadge:!0},{type:"outline"},{type:"seo",agentBadge:!0},{type:"roundtable",agentBadge:!0},{type:"fix_spelling_grammar"},{type:"expand"},{type:"rewrite"},{type:"summarize"},{type:"ask"},{type:"generate_questions"},{type:"translate",language:"Chinese"},{type:"translate",language:"English"},{type:"translate",language:"Japanese"},{type:"translate",language:"Spanish"},{type:"translate",language:"French"},{type:"translate",language:"Czech"},{type:"translate",language:"German"},{type:"translate",language:"Slovak"},{type:"translate",language:"Brazilian Portuguese"},{type:"translate",language:"Portugal Portuguese"},{type:"translate",language:"Italian"},{type:"translate",language:"Vietnamese"},{type:"translate",language:"Korean"}],TH=eL.default.div.withConfig({displayName:"AiAssistantDialog__Backdrop",componentId:"sc-d2bd965a-0"})` + pointer-events: auto; + position: fixed; + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; + display: flex; + align-items: center; + justify-content: center; +`,TG=(0,eL.keyframes)` + from { + transform: scale(0.9); + } + to { + transform: scale(1.0); + } +`,TK=eL.default.div.withConfig({displayName:"AiAssistantDialog__Container",componentId:"sc-d2bd965a-1"})` + .entering & { + animation: ${TG} ${200}ms ease-in-out 1 normal forwards; + } + .exiting & { + animation: ${TG} ${200}ms ease-in-out 1 reverse forwards; + } +`,TY=(0,e$.connect)(function(e){return{dialogState:e.dialogs.aiAssistant,spaceId:dU(e),doc:dV(e)}}),TQ="backdrop",TJ=function(e){let t={id:e?.id??"modal-dialog",initial:e?.initial??"exited",context:{blocklist:[],timeout:e?.timeout??300},states:{entering:{entry:["open"],invoke:{src:(e,t)=>a=>{if("ENTER"===t.type&&t.payload?.force){a("ENTERED");return}let n=setTimeout(()=>{a("ENTERED")},e.timeout);return()=>{clearTimeout(n)}}},on:{ENTERED:"entered"}},entered:{on:{EXIT:[{cond:(e,t)=>{let a=t.payload?.source;return null==a||!e.blocklist.includes(a)},target:"exiting"}],BLOCK:{actions:(0,lv.assign)((e,t)=>{let{blocklist:a}=e,{source:n}=t.payload;return -1===a.findIndex(e=>e===n)?{blocklist:[...a,n]}:{}})},UNBLOCK:{actions:(0,lv.assign)((e,t)=>{let{blocklist:a}=e,{source:n}=t.payload,l=a.findIndex(e=>e===n);if(-1!==l){let e={blocklist:[...a]};return e.blocklist.splice(l,1),e}return{}})}}},exiting:{exit:["close"],invoke:{src:(e,t)=>a=>{if("EXIT"===t.type&&t.payload?.force){a("EXITED");return}let n=setTimeout(()=>{a("EXITED")},e.timeout);return()=>{clearTimeout(n)}}},on:{EXITED:"exited"}},exited:{on:{ENTER:"entering"}}}};return(0,lb.J)(t)}({id:"ai-assistant-dialog",initial:"exited",timeout:200}),TX=TY(function(e){let{dialogState:t,spaceId:a,doc:n}=e,[l,r]=ev.useState(!1),{isOpen:o,nodeId:i,nodeText:s,projectId:d,command:c,spaceAgentRunId:m}=t,u=t.shouldShowCustomAgentOptions??!1,p=ev.useContext(eI.LayersContext),g=ev.useRef(null),f=(0,e$.useDispatch)(),h=function(){let e=(0,eK.Z)();return[{type:"section",label:"ai",items:TW.map(t=>{let a="translate"!==t.type?TV[t.type]:null!=t.language?Tq[t.language]:TV[t.type],n=e.formatMessage(a);return{label:n,values:[t.type,n],data:{command:t},render:DN}}),render:DC}]}(),[y,b]=(0,ls.e)(TJ,{actions:{close:()=>{f(DT.actions.toggleAiAssistantDialog()),null!=i&&f(mI(i,null))}}});ev.useEffect(()=>{o&&b("ENTER")},[o,b]);let v=ev.useCallback(()=>{b({type:"EXIT"})},[b]),k=e=>{f(DT.actions.setCommand({command:e}))};if(!o||null==i||null==s||null==d)return null;let E=p?.overlay??("undefined"!=typeof document?document.body:void 0);if(null==E)return null;let x="entered"===y.value,_=u&&null==c;return ep.createPortal(ev.createElement(TH,{className:y.value,"data-dialog":TQ,onMouseUp:e=>{0===e.button&&e.target instanceof Element&&e.target.getAttribute("data-dialog")===TQ&&l&&b({type:"EXIT",payload:{source:"backdrop"}})},onMouseDown:e=>{0===e.button&&e.target instanceof Element&&e.target.getAttribute("data-dialog")===TQ&&r(!0)},onMouseDownCapture:e=>{0===e.button&&r(!1)}},ev.createElement(Tz,{ref:g,nodeId:i,sendExitEvent:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];b({type:"EXIT",payload:{force:!0===e}})}},ev.createElement(TK,{className:"min-h-fit w-[660px] rounded-xl"},ev.createElement("div",{className:"w-full rounded-xl p-4"},_?ev.createElement(TB,{doc:n,spaceId:a,isReadyForFocus:x,onCommandActivated:k,onExit:v}):ev.createElement(Tx,{spaceAgentRunId:m,command:c,menuItems:h,insertNodeId:i,inputText:s,projectId:d,isReadyForFocus:x,onReplaceText:e=>{f(Dp(i,e))},onInsertFragment:e=>{f(Da({id:i,position:"afterbegin"},e)),f(DE(i,!1))},onBackButtonClick:()=>{f(DT.actions.setCommand())},onCommandActivated:k,updatePopperPosition:()=>{g.current?.updatePopperPositioning()},onExit:v}))))),E)}),T0=(0,la.ZP)` + query DocumentNotificationsSettingsQuery($documentID: ID!) { + document(id: $documentID) { + id + info + notificationsSettings { + browser + email + mobile + } + } + } +`,T1=(0,la.ZP)` + mutation ProjectNotificationUpdateMutation($input: ProjectNotificationUpdateInput!) { + projectNotificationUpdate(input: $input) { + clientMutationId + document { + id + notificationsSettings { + browser + email + mobile + } + } + } + } +`,T2=eL.default.div.withConfig({displayName:"Radio__Container",componentId:"sc-9a10f428-0"})` + display: flex; + flex-direction: row; + align-items: center; +`,T5=eL.default.input.withConfig({displayName:"Radio__BaseRadio",componentId:"sc-9a10f428-1"})` + position: absolute; + opacity: 0; + cursor: pointer; + height: 0; + width: 0; +`,T3=(0,eL.default)(lT.Hm).withConfig({displayName:"Radio__StyledCheckmark",componentId:"sc-9a10f428-2"})` + display: none; + & path { + fill: #fff; + } +`,T4=eL.default.div.withConfig({displayName:"Radio__CheckmarkContainer",componentId:"sc-9a10f428-3"})` + display: flex; + justify-content: center; + align-items: center; + width: 24px; + height: 24px; + border-radius: 50%; + cursor: pointer; + ${e=>e.checked?(0,eL.css)` + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + ${T3} { + display: block; + } + `:(0,eL.css)` + border: 1px solid ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; + :hover { + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; + + ${T3} { + display: block; + & path { + fill: ${e=>e.theme?.primaryColorScheme?.base}; + } + } + `} +`;eL.default.div.withConfig({displayName:"Radio__SelectedCheckmarkContainer",componentId:"sc-9a10f428-4"})` + display: flex; + justify-content: center; + align-items: center; + width: 24px; + height: 24px; + border-radius: 50%; + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + ${T3} { + display: block; + } +`;let T6=function(e){let{onClick:t,name:a,checked:n,value:l}=e;return ev.createElement(T2,null,ev.createElement(T4,{checked:n,onClick:t,value:l},ev.createElement(T3,null)),ev.createElement(T5,{type:"radio",checked:n,name:a,value:l}))},T8=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__FlexContainer",componentId:"sc-73fa93b3-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 5px; + padding: 40px 60px; + background: ${e=>e.theme.appColors.hex(100)}; +`,T7=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__BodyContainer",componentId:"sc-73fa93b3-1"})` + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-bottom: 40px; +`,T9=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__Row",componentId:"sc-73fa93b3-2"})` + width: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + margin 10px 0; +`,$e=(0,eL.default)(T9).withConfig({displayName:"DocumentNotificationDialogBody__TopRow",componentId:"sc-73fa93b3-3"})` + margin 0; +`,$t=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__PlatformCell",componentId:"sc-73fa93b3-4"})` + flex-basis: 40%; +`,$a=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__Cell",componentId:"sc-73fa93b3-5"})` + display: flex; + justify-content: flex-end; + align-items: center; + flex-basis: 20%; +`,$n=(0,eL.default)($a).withConfig({displayName:"DocumentNotificationDialogBody__RadioCell",componentId:"sc-73fa93b3-6"})` + margin-right: 7px; +`,$l=eL.default.h1.withConfig({displayName:"DocumentNotificationDialogBody__HeaderTitle",componentId:"sc-73fa93b3-7"})` + font-weight: 500; + font-size: 24px; + line-height: 32px; + margin-bottom: 4px; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,$r=eL.default.p.withConfig({displayName:"DocumentNotificationDialogBody__HeaderSubtitle",componentId:"sc-73fa93b3-8"})` + text-align: center; + margin-bottom: 30px; + font-size: 16px; + line-height: 22px; + color: ${e=>e.theme.isNightMode?"#cccccc":"#666666"}; +`,$o=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__Column",componentId:"sc-73fa93b3-9"})` + display: flex; + flex-direction: column; + justify-content: flex-start; +`,$i=eL.default.p.withConfig({displayName:"DocumentNotificationDialogBody__HeaderText",componentId:"sc-73fa93b3-10"})` + margin: 0; + font-size: 1rem; + color: #999999; + font-weight: 400; +`,$s=(0,eL.default)($i).withConfig({displayName:"DocumentNotificationDialogBody__TitleText",componentId:"sc-73fa93b3-11"})` + font-weight: 500; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,$d=eL.default.p.withConfig({displayName:"DocumentNotificationDialogBody__SubtitleText",componentId:"sc-73fa93b3-12"})` + margin: 0; + font-size: 0.8125rem; + color: ${e=>e.theme.isNightMode?"#cccccc":"#666666"}; +`,$c=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__HorizontalRule",componentId:"sc-73fa93b3-13"})` + width: 100%; + height: 1px; + background-color: ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; + margin-bottom: 10px; + margin-top: 8px; +`,$m=eL.default.button.withConfig({displayName:"DocumentNotificationDialogBody__StyledButton",componentId:"sc-73fa93b3-14"})` + width: 100%; + font-size: 18px; + line-height: 24px; + font-weight: 500; + padding: 14px 16px; + color: #fff; + cursor: pointer; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + border: none; + border-radius: 12px; + transition: background-color 120ms ease-in-out; + &:hover { + background-color: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } + &:focus { + outline: 0; + } +`,$u=eL.default.div.withConfig({displayName:"DocumentNotificationDialogBody__Footer",componentId:"sc-73fa93b3-15"})` + position: absolute; + text-align: center; + width: 100%; + height: 40px; + left: 0; + bottom: -60px; + font-weight: 500; + color: #fff; + ${e1.UiTypography.sm} + padding: 0 1.875rem; +`,$p=eL.default.a.withConfig({displayName:"DocumentNotificationDialogBody__Anchor",componentId:"sc-73fa93b3-16"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + &:visited { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,$g=function(e){let t=e.doc.id,[a]=(0,cs.D)(T1),{loading:n,error:l,data:r}=(0,eB.a)(T0,{fetchPolicy:"cache-and-network",variables:{documentID:t}}),[o,i]=(0,ev.useState)(""),[s,d]=(0,ev.useState)(""),[c,m]=(0,ev.useState)(""),u=r?.document,p=ev.useMemo(()=>{if(null==u)return"";let{info:e}=u;return null==e.title||""===e.title?"Untitled":e.title},[u]);(0,ev.useEffect)(()=>{if(null!=u){let{notificationsSettings:e}=u;m(e?.email??"watched"),i(e?.mobile??"watched"),d(e?.browser??"watched")}},[u]);let g=(0,ev.useCallback)(e=>{m(e.currentTarget.getAttribute("value"))},[]),f=(0,ev.useCallback)(e=>{d(e.currentTarget.getAttribute("value"))},[]),h=(0,ev.useCallback)(e=>{i(e.currentTarget.getAttribute("value"))},[]);return n?ev.createElement(T8,null,ev.createElement(eI.Spinner,null)):null!=l?ev.createElement(T8,null,l.message):ev.createElement(T8,null,ev.createElement($l,null,ev.createElement(eY.Z,{id:"general.notifications.project_notifications",defaultMessage:"Project Notifications"})),ev.createElement($r,null,ev.createElement(eY.Z,{id:"general.notifications.notification_preferences_for_doc",defaultMessage:"Notification Preferences for {title}",values:{strong:e=>ev.createElement("strong",null,e),title:p}})),ev.createElement(T7,null,ev.createElement($e,null,ev.createElement($t,null,ev.createElement($s,null,ev.createElement(eY.Z,{id:"general.notifications.platform",defaultMessage:"Platform"}))),ev.createElement($a,null,ev.createElement($i,null,ev.createElement(eY.Z,{id:"general.notifications.browser",defaultMessage:"Browser"}))),ev.createElement($a,null,ev.createElement($i,null,ev.createElement(eY.Z,{id:"general.notifications.mobile",defaultMessage:"Mobile"}))),ev.createElement($a,null,ev.createElement($i,null,ev.createElement(eY.Z,{id:"general.notifications.email",defaultMessage:"Email"})))),ev.createElement($c,null),ev.createElement(T9,null,ev.createElement($t,null,ev.createElement($o,null,ev.createElement($s,null,ev.createElement(eY.Z,{id:"general.notifications.watch",defaultMessage:"Watch"})),ev.createElement($d,null,ev.createElement(eY.Z,{id:"general.notifications.all_project_updates",defaultMessage:"All project updates."})))),ev.createElement($n,null,ev.createElement(T6,{name:"browser",checked:"watched"===s,value:"watched",onClick:f})),ev.createElement($n,null,ev.createElement(T6,{name:"mobile",checked:"watched"===o,value:"watched",onClick:h})),ev.createElement($n,null,ev.createElement(T6,{name:"email",checked:"watched"===c,value:"watched",onClick:g}))),ev.createElement(T9,null,ev.createElement($t,null,ev.createElement($o,null,ev.createElement($s,null,ev.createElement(eY.Z,{id:"general.notifications.mention",defaultMessage:"Mention"})),ev.createElement($d,null,ev.createElement(eY.Z,{id:"general.notifications.mentions_only",defaultMessage:"Mentions only."})))),ev.createElement($n,null,ev.createElement(T6,{name:"browser",checked:"mentioned"===s,value:"mentioned",onClick:f})),ev.createElement($n,null,ev.createElement(T6,{name:"mobile",checked:"mentioned"===o,value:"mentioned",onClick:h})),ev.createElement($n,null,ev.createElement(T6,{name:"email",checked:"mentioned"===c,value:"mentioned",onClick:g}))),ev.createElement(T9,null,ev.createElement($t,null,ev.createElement($o,null,ev.createElement($s,null,ev.createElement(eY.Z,{id:"general.notifications.ignore",defaultMessage:"Ignore"})),ev.createElement($d,null,ev.createElement(eY.Z,{id:"general.notifications.no_notifications",defaultMessage:"No notifications."})))),ev.createElement($n,null,ev.createElement(T6,{name:"browser",checked:"ignored"===s,value:"ignored",onClick:f})),ev.createElement($n,null,ev.createElement(T6,{name:"mobile",checked:"ignored"===o,value:"ignored",onClick:h})),ev.createElement($n,null,ev.createElement(T6,{name:"email",checked:"ignored"===c,value:"ignored",onClick:g})))),ev.createElement($m,{onClick:()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:t,changes:[{key:"mobile",value:o},{key:"browser",value:s},{key:"email",value:c}]}}}),e.exit()}},ev.createElement(eY.Z,{id:"general.notifications.save",defaultMessage:"Save"})),ev.createElement($u,null,ev.createElement(eY.Z,{id:"general.notifications.footer",defaultMessage:"Manage all your notification preferences from one page, click here to access global notifications.",values:{link:e=>ev.createElement($p,{href:"/settings/notifications"},e)}})))},$f=function(e){let{doc:t}=e,a=(0,e$.useDispatch)(),n=(0,e$.useSelector)(si);return ev.createElement(eI.ModalDialog,{isOpen:n,close:()=>{a(rk())}},e=>{let{exit:a}=e;return ev.createElement($g,{doc:t,exit:a})})},$h={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceMediaSearchQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMediaSearchInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceMediaSearch"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]}}]};var $y=a(819);let $b={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]},$v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceMediaTrainMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMediaTrainInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceMediaTrain"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"spaceMedia"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMediaParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]};function $k(e){return e.s3KeyOriginal.split("/").pop()}let $E=dw.z.object({filePath:dw.z.string().min(1),spaceId:dw.z.string().min(1),question:dw.z.string().min(1),k:dw.z.number(),messages:dw.z.array(hR.gh).optional()});dw.z.object({filePath:dw.z.string().min(1),question:dw.z.string().min(1),k:dw.z.number()});let $x=dw.z.object({text:dw.z.string()});function $_(e){return e instanceof DOMException&&"AbortError"===e.name}let $w=(e,t)=>{switch(t.type){case"LOADING_START":return{loading:!0,error:null};case"ERROR_OCCURRED":return{loading:!1,error:t.error};case"FINISH":return{loading:!1,error:null}}return e};function $N(e,t){let[a,n]=ev.useReducer($w,{loading:!1,error:null});return[ev.useCallback((a,l)=>{n({type:"LOADING_START"}),(async function(){let r=await fetch(a,l);if(!r.ok){let e=new ei.FetchError(r);n({type:"ERROR_OCCURRED",error:await e.toTaskadeError()??e});return}if(null==r.body){n({type:"ERROR_OCCURRED",error:new ei.HttpError({code:"UNKNOWN_ERROR",message:"response body is null"})});return}let o=r.body.getReader(),i=new TextDecoder;function s(t){if(t)try{let a=JSON.parse(t);e?.(a)}catch(e){n({type:"LINE_ERROR",error:e})}}let d=!1,c="",m="";for(;!d;){let e=await o.read();if(d=e.done,e.value){c+=i.decode(e.value);for(let e=c.indexOf("\n");e>=0;e=c.indexOf("\n")){let t=c.slice(0,e);c=c.slice(e+1),s(t),m=t}}}if(c){let e=c;c="",s(e)}if(n({type:"FINISH"}),""!==m){let e=JSON.parse(m);t?.(e)}else t?.()})().catch(e=>{n({type:"ERROR_OCCURRED",error:e})})},[e,t]),a]}let $C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MemberRoleQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}}]}}]}}]},$M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectsCreateWithTaskastMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectsCreateWithTaskastInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectsCreateWithTaskast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"trees"}},{kind:"Field",name:{kind:"Name",value:"spaceId"}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]}}]},$S=eL.default.div.withConfig({displayName:"styled__MarkdownFormatting",componentId:"sc-2b2a859b-0"})` + & .paragraph { + margin-bottom: 12px; + line-height: 19px; + &:only-child { + margin-bottom: 0; + } + } +`,$I=function(e){let{hideCreateProject:t,onCopy:a,onCreateProject:n,projectCreationLoading:l}=e,[r,o]=ev.useState(!1);return ev.createElement("div",{className:"flex gap-x-2"},ev.createElement("div",{onClick:()=>{a(),o(!0),setTimeout(()=>{o(!1)},1e3)},className:"mt-1 flex w-14 cursor-pointer justify-center rounded-xl border border-appcolor-400 p-2 text-xs text-textcolor-900 hover:bg-appcolor-300"},r?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"})),!l&&!t&&ev.createElement("div",{onClick:n,className:"w-34 mt-1 flex cursor-pointer justify-center rounded-xl border border-appcolor-400 p-2 text-xs text-textcolor-900 hover:bg-appcolor-300"},ev.createElement(eY.Z,{id:"general.create_project",defaultMessage:"Create project"})),l&&ev.createElement("div",{className:"mt-1 flex"},ev.createElement(eI.Spinner,{height:20})))},$D=function(e){let{avatarUrl:t,content:a,displayName:n,disableProjectCreation:l,fileName:r,isAllowedToCreate:o,loading:i,onExit:s,spaceId:d,toggleProjectCreation:c}=e,m=(0,eF.k6)(),[u,{data:p,loading:g}]=(0,cs.D)($M);ev.useEffect(()=>{if(null==p)return;let e=p.projectsCreateWithTaskast?.documents.edges?.[0]?.node?.id;if(null==e){c();return}s(),m.push(`/d/${e}`)},[m,s,p,c]);let f=l||!o||g;return ev.createElement("div",{className:"rounded-xl bg-appcolor-200 py-5"},ev.createElement("div",{className:"flex px-4"},ev.createElement("img",{className:"h-6 w-6 rounded-full",src:t,alt:n}),ev.createElement("div",{className:"ml-3 flex-1"},ev.createElement("div",{className:"flex text-sm"},ev.createElement("span",{className:"flex-1 font-medium text-textcolor-900"},n)),ev.createElement($S,{className:"mt-1 text-sm text-textcolor-900"},ev.createElement(DA,{value:a,shouldRemoveCodeFence:!0})),!i&&ev.createElement($I,{content:a,hideCreateProject:f,onCopy:()=>{navigator.clipboard.writeText(a)},onCreateProject:()=>{if(null==a)return;let e=(0,lo.markdownTextToTaskastFragment)(a,{shouldRemoveCodeFence:!0}),t=null==r?(0,lo.fragmentToRoot)(e):{type:"root",children:[{type:"text",text:{ops:[{insert:r},{insert:"\n",attributes:{paragraph:!0}}]},children:[...e.children]}]};c(),u({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:d,trees:[JSON.stringify(t)]}}})},projectCreationLoading:g}))))};var $T=a(20053),$$=a.n($T),$P=a(78718),$F=a.n($P),$A=a(44778);let $R=$A.N1;$R.add("@",{validate(e,t,a){let n=e.slice(t),l=n.search(a.re.src_Z);return -1!==l&&(n=n.slice(0,l)),-1!==(l=n.search(/[_.-]{2}/))&&(n=n.slice(0,l)),!(0===n.length||/^[_.-]/.test(n))&&((a.re.twitter||(a.re.twitter=RegExp(`^[a-zA-Z0-9_.-]*[a-zA-Z0-9](?=$|${a.re.src_ZPCc})`)),a.re.twitter.test(n))?(!(t>=2)||"@"!==n[t-2])&&n.match(a.re.twitter)[0].length:0)},normalize(e){e.url="javascript:void(0)"}}),$R.add("#",{validate(e,t,a){let n=(0,sX.extractHashtagsWithIndices)(e)[0];return null!=n&&n.hashtag.length}}),$A.ZP;let $j=eL.default.blockquote.withConfig({displayName:"BlockQuote",componentId:"sc-4027b245-0"})` + border-left: 4px solid ${e=>e.theme.primaryColorScheme?.base}; + padding: 2px 0px 2px 10px; + word-break: break-word; +`,$O=eL.default.pre.withConfig({displayName:"CodeBlock__Wrapper",componentId:"sc-631b975a-0"})` + margin-bottom: 0; + color: inherit; +`,$U=function(e){let{lang:t,children:a}=e,n=t?`language-${t}`:void 0;return ev.createElement($O,null,ev.createElement("code",{className:n},a))},$Z="@@taskade/dialogs/TOGGLE_NODE_COMMENTS_DIALOG";function $L(e){return{type:$Z,payload:e}}let $B=eL.default.a.withConfig({displayName:"Hashtag__Link",componentId:"sc-ba2cf3a9-0"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + cursor: pointer; + } +`,$z=function(e){let{children:t}=e,a=(0,e$.useDispatch)();return ev.createElement($B,{href:"#",onClick:e=>{e.preventDefault(),a(N6(`${t}`)),a($L())}},t)},$V=eL.default.code.withConfig({displayName:"InlineCode",componentId:"sc-34dc03c9-0"})` + color: inherit; +`,$q=(0,la.ZP)` + query($id: ID!) { + document(id: $id) { + id + info + shared_preferences + } + } +`,$W=eL.default.div.withConfig({displayName:"styled__ProjectLinkWrapper",componentId:"sc-1961fdc7-0"})` + display: inline-flex; + align-items: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + line-height: 18px; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,$H=eL.default.div.withConfig({displayName:"styled__SpaceLinkWrapper",componentId:"sc-1961fdc7-1"})` + display: inline-flex; + color: ${e=>e.theme.primaryColorScheme?.base}; + align-items: center; + font-size: 15px; + line-height: 17px; + > span { + width: 16px; + height 16px; + margin-right: 5px; + border-radius: 5px; + > span { + font-size: 15px !important; + transform: translateY(-1px) scale(1) !important; + } + } + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,$G=eL.default.div.withConfig({displayName:"styled__IconWrapper",componentId:"sc-1961fdc7-2"})` + margin-right: 5px; + width: 18px; + height: 18px; +`,$K=(0,eL.default)(tn.Icon).attrs({icon:"dd_project"}).withConfig({displayName:"styled__DefaultProjectIcon",componentId:"sc-1961fdc7-3"})` + color: ${e=>e.theme.textColors.hex("50")}; + transform: scale(0.8) translateY(-2px); +`,$Y=eL.default.a.withConfig({displayName:"styled__Anchor",componentId:"sc-1961fdc7-4"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + cursor: pointer; + } +`,$Q=(0,eL.default)(pJ).withConfig({displayName:"styled__StyledSpaceAvatar",componentId:"sc-1961fdc7-5"})` + img { + width: 16px; + height: 16px; + } +`,$J=function(e){let{projectId:t,url:a}=e,n=`${a.pathname}${a.hash}${a.search}`,l=(0,ev.useMemo)(()=>s4(a.search),[a.search]),{data:r}=(0,eB.a)($q,{variables:{id:t,shareToken:l},fetchPolicy:"cache-first"}),o=r?.document??null;if(null==o)return ev.createElement(sC.rU,{to:n},ev.createElement($W,null,ev.createElement($G,null,ev.createElement($K,null)),"Project"));let i=o.info.title,s=nQ(o);return ev.createElement(sC.rU,{to:n},ev.createElement($W,null,ev.createElement($G,null,null!=s?ev.createElement("span",null,s):ev.createElement($K,null)),i))},$X=(0,la.ZP)` + query MembershipSpaceQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + space { + id + name + color + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + } + } + } + } + } + } + } + } +`,$0=function(e){let{spaceId:t}=e,{data:a}=(0,eB.a)($X,{variables:{spaceId:t},fetchPolicy:"cache-first"}),n=a?.membership?.space??null,l=(0,ev.useMemo)(()=>{if(null!=n)return{primaryColor:n.color}},[n]);return ev.createElement(eI.ThemeProvider,{theme:l},ev.createElement(sC.rU,{to:`/spaces/${t}`},ev.createElement($H,null,null!=n&&ev.createElement($Q,{space:n,size:"small"}),n?.name??"Space")))},$1=function(e){let{href:t,children:a}=e,n=function(e){try{let t=new URL("https://www.taskade.com"),a=new URL(e);if(t.host.toLowerCase()!==a.host.toLowerCase())return null;let{pathname:n}=a;if(n.startsWith("/d/"))return{type:"d",documentID:n.substring(3),url:a};if(n.startsWith("/v/"))return{type:"v",viewPath:n.substring(3),url:a};if(n.startsWith("/e/"))return{type:"e",editPath:n.substring(3),url:a};if(n.includes("/subspaces/")){let e=n.indexOf("/subspaces/");return{type:"subspace",spaceID:n.substring(e+11),url:a}}else if(n.startsWith("/spaces/"))return{type:"space",spaceID:n.substring(8),url:a};return null}catch(e){return null}}(t);if(null!=n)switch(n.type){case"d":return ev.createElement($J,{projectId:n.documentID,url:n.url});case"v":case"e":break;case"space":case"subspace":return ev.createElement($0,{spaceId:n.spaceID})}let l=t;try{let e=new URL(l);if("mailto:"===e.protocol)return ev.createElement($Y,{target:"_blank",href:l,rel:"noopener noreferrer"},e.pathname)}catch(e){l=`http://${t}`}return ev.createElement($Y,{target:"_blank",rel:"noopener noreferrer nofollow",href:l},a??t)},$2=(0,eL.css)` + padding-left: 1.2rem; +`,$5=eL.default.ol.withConfig({displayName:"List__OrderedList",componentId:"sc-4fc76a09-0"})` + ${$2} + word-break: break-word; + list-style-type: decimal; +`,$3=eL.default.ul.withConfig({displayName:"List__UnorderedList",componentId:"sc-4fc76a09-1"})` + ${$2} + word-break: break-word; + list-style-type: disc; +`,$4=function(e){let{ordered:t,children:a}=e;return ev.createElement(t?$5:$3,null,a)},$6=eL.default.li.withConfig({displayName:"ListItem",componentId:"sc-b307c6e4-0"})` + &::marker { + color: ${e=>e.theme.textColors.hex(40)}; + } +`,$8=eL.default.a.withConfig({displayName:"Mention__Link",componentId:"sc-4c37801f-0"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + cursor: pointer; + } +`,$7=function(e){let{children:t}=e,a=(0,e$.useDispatch)();return ev.createElement($8,{href:"#",onClick:e=>{e.preventDefault(),a(N6(`${t}`))}},t)},$9={...$F()($$().defaultRules,["paragraph","strong","em","u","text","url","del"]),linkify:{order:$$().defaultRules.text.order-.5,match:e=>{let t=$R.match(e);if(null==t||0===t.length||0!==t[0].index)return null;let a=t[0];return[a.raw,a.schema,a.text,a.url]},parse:e=>({content:{type:"text",content:e[2]},schema:e[1],url:e[3]}),react:(e,t,a)=>{let n=t(e.content,a);switch(e.schema){case"@":return ev.createElement($7,{key:a.key},n);case"#":return ev.createElement($z,{key:a.key},n);default:return ev.createElement($1,{key:a.key,href:$$().sanitizeUrl(e.url)??"#"},n)}}},blockQuote:{...$$().defaultRules.blockQuote,react:function(e,t,a){let n=t(e.content,a);return ev.createElement($j,{key:a.key},n)}},text:{...$$().defaultRules.text,match:(e,t,a)=>{let n=$R.match(e),l=e.length;return null!=n&&n.length>0&&(l=n[0].index),$$().defaultRules.text.match(e.slice(0,l),t,a)}},link:{...$$().defaultRules.link,react:(e,t,a)=>ev.createElement($1,{key:a.key,href:e.target})},codeBlock:{order:$$().defaultRules.codeBlock.order,match:$$().defaultRules.codeBlock.match,parse:e=>{let t=e[1],a=e[2];return null==a?{content:a,lang:t}:{content:a.replace(/^ {4}/gm,"").replace(/\n+$/,""),lang:t}},react:(e,t,a)=>ev.createElement($U,{key:a.key,lang:e.lang},e.content)},inlineCode:{...$$().defaultRules.inlineCode,react:(e,t,a)=>ev.createElement($V,{key:a.key},e.content)},list:{...$$().defaultRules.list,react:(e,t,a)=>ev.createElement($4,{ordered:e.ordered,key:a.key},e.items.map((e,n)=>ev.createElement($6,{key:n},t(e,a))))}},Pe=$$().parserFor($9),Pt=$$().outputFor($9,"react"),Pa=ev.memo(function(e){let{value:t}=e;return(0,ev.useMemo)(()=>Pt(Pe(t)),[t])}),Pn=function(e){let{message:t}=e,a=t.contents[0].content,n=(0,eB.a)(sW),l=n.data?.me,r=l?.default_name??"",o=l?.avatars_v2.small?.mdpi.url??"";return ev.createElement("div",{className:"flex px-4"},ev.createElement("img",{className:"h-6 w-6 rounded-full",src:o,alt:r}),ev.createElement("div",{className:"ml-3 flex-1"},ev.createElement("div",{className:"flex text-sm"},ev.createElement("span",{className:"flex-1 font-medium text-textcolor-900"},r)),ev.createElement($S,{className:"mt-1 text-sm text-textcolor-900"},ev.createElement(Pa,{value:a}))))},Pl=eL.default.div.withConfig({displayName:"Conversation__MessageContainer",componentId:"sc-97111308-0"})` + ${tS} +`,Pr=ev.forwardRef(function(e,t){let{className:a,fileName:n,isAllowedToCreate:l,messages:r,onExit:o,spaceId:i}=e,[s,d]=ev.useState(!1),c=ev.useCallback(()=>{d(e=>!e)},[d]);return 0===r.length?ev.createElement("div",{ref:t,className:"flex h-full flex-col items-center justify-center py-16"},ev.createElement("div",{className:"flex max-w-md flex-col items-center text-center"},ev.createElement(lT.fJ,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"media.ask_ai",defaultMessage:"Ask AI"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"media.get_quick_summaries_detailed_insights_and_answers_from_your_files",defaultMessage:"Get quick summaries, detailed insights, and answers from your files. Try our examples or ask something in your own words."})))):ev.createElement("div",{ref:t,className:"max-h-dialog overflow-y-auto px-5 py-4"},ev.createElement(Pl,{className:og()(a,"flex flex-col-reverse gap-4")},Array.from((0,eo.makeReverseIterable)(r),e=>"human"===e.role||"user"===e.role?ev.createElement(Pn,{key:e.id,message:e}):ev.createElement($D,{key:e.id,avatarUrl:"/images/logo.svg",displayName:"Taskade AI",disableProjectCreation:s,fileName:n,content:e.contents[0].content,isAllowedToCreate:l,loading:null==e.id,onExit:o,spaceId:i,toggleProjectCreation:c}))))}),Po=[(0,te.Em)({id:"general.summarize_the_key_points",defaultMessage:"Summarize the key points"}),(0,te.Em)({id:"general.identify_any_actionable_steps",defaultMessage:"Identify any actionable steps"}),(0,te.Em)({id:"general.explain_the_main_concepts_simply",defaultMessage:"Explain the main concepts simply"}),(0,te.Em)({id:"general.highlight_any_critical_data_or_trends",defaultMessage:"Highlight any critical data or trends"}),(0,te.Em)({id:"general.outline_the_takeaways_and_implications",defaultMessage:"Outline the takeaways and implications"})],Pi="PromptSection",Ps="PromptItem",Pd=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-3 mb-[1px] flex h-7 items-center rounded-md px-2 py-[1px] text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{icon:"dd_ai_spark"}),ev.createElement("span",{className:"pl-3"},t.label),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},Pc={[Ps]:e=>ev.createElement(Pd,{morseChildProps:e})},Pm={[Pi]:()=>ev.createElement(ev.Fragment,null)},Pu=(e,t)=>((0,ei.assert)(null!=e),e.length>32)?[]:new to.Z(t,{keys:["values"],threshold:0}).search(e).map(e=>e.item),Pp=ev.forwardRef(function(e,t){var a;let{loading:n,onExit:l,submitPrompt:r,isEmptyState:o,onAbortClick:i}=e,[s,d]=ev.useState(""),c=ev.useRef(null),m=(0,e$.useDispatch)();ev.useEffect(()=>{c.current?.focus()},[]),ev.useImperativeHandle(t,()=>({focusInput:()=>{c.current?.focus()},resetInput:()=>{d("")}}),[]);let u=ev.useRef(null),p=function(){let e=(0,eK.Z)();return[{type:"section",label:"prompts",items:Po.map(t=>{let a=e.formatMessage(t);return{label:a,values:[a],data:{prompt:{label:a,value:a}},render:Ps}}),render:Pi}]}(),g=(a=e=>{d(`${e.value} `),c?.current?.focus()},ev.useCallback(e=>{a(e.data.prompt)},[a])),f=(0,eK.Z)();return ev.createElement("div",{onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),0===(u.current?.getVisibleItemCount()??0)?r(s):u.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l()}},className:"relative mx-5 rounded-xl border border-solid border-appcolor-400 bg-appcolor-100"},ev.createElement("div",{className:"flex w-full flex-col gap-1 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{ref:c,className:"w-full bg-transparent p-4",placeholder:f.formatMessage({id:"general.ai_media_qa_ask_a_question",defaultMessage:"What would you like to know?"}),value:s,onChange:e=>{d(e.target.value)},disabled:n,minRows:2,maxRows:4}),ev.createElement("div",{className:"flex px-4 pb-3"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>{m(co.actions.toggleAiPromptTemplatesDialog())}},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"})),n?ev.createElement("button",{type:"button",className:"ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-appcolor-200 text-textcolor-700 hover:bg-appcolor-300",onClick:e=>{e.preventDefault(),i()}},ev.createElement(tn.Icon,{icon:"dd_stop",className:"h-5 w-5"})):ev.createElement("button",{className:"ml-auto flex items-center text-appcolor-500 hover:text-primary",onClick:()=>{r(s)}},ev.createElement(tn.Icon,{icon:"message_send"}))),o&&ev.createElement("div",{className:"border-t border-solid border-appcolor-300"},ev.createElement(tT,{ref:u,term:s,data:p,renderMap:Pc,onActivate:g,sectionRenderMap:Pm,search:Pu,renderEmptyState:ev.createElement("div",{className:"hidden"})}))))}),Pg=function(e){let{className:t,spaceMedia:a,onExit:n}=e,l=a.space_id,r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useState([]),d=a.data.fileDesc.s3KeyOriginal,c=$k(a.data.fileDesc),{data:m}=(0,eB.a)($C,{variables:{spaceID:l}}),u=Eu({role:m?.membership?.role,action:"create_project"});ev.useEffect(()=>{null!=r.current&&(r.current.scrollTop=r.current.scrollHeight)},[i]);let p=ev.useCallback(e=>{let t=$x.safeParse(e);if(!t.success)return;let a={id:null,conversationId:`file-conversation-${d}`,role:"assistant",contents:[{content:t.data.text}]};s(e=>{let t=e.findLastIndex(e=>null==e.id);return -1===t?[...e,a]:Ml()(e,{[t]:{$set:a}})})},[d]),g=ev.useCallback(()=>{s(e=>{let t=e.findLastIndex(e=>null==e.id);return -1!==t?Ml()(e,{[t]:{id:{$set:(0,ld.Z)()}}}):e})},[]),[f,{loading:h,error:y}]=$N(p,ev.useCallback(()=>{g(),o.current?.focusInput()},[g]));D$({error:y,onError:n});let b=ev.useRef(null),v=ev.useCallback(e=>{if(0===e.trim().length||h)return;o.current?.resetInput(),s([...i,{id:(0,ld.Z)(),conversationId:`file-conversation-${d}`,role:"user",contents:[{content:e.trim()}]}]);let t=new AbortController;b.current=t,f("/web-api/ai/qa-file",{method:"POST",credentials:"same-origin",body:JSON.stringify($E.parse({filePath:d,spaceId:l,question:e,k:90,messages:i.slice(-8)})),headers:{"Content-Type":"application/json"},signal:t.signal})},[d,h,f,i,o,s,l]),k=eW().isEmpty(i),E=ev.useCallback(()=>{b.current?.abort(),g()},[g]);return ev.createElement("div",{className:t},null==y||$_(y)?ev.createElement(ev.Fragment,null,ev.createElement(Pr,{ref:r,fileName:c,isAllowedToCreate:u,messages:i,onExit:n,spaceId:l}),ev.createElement(Pp,{ref:o,loading:h,onExit:n,isEmptyState:k,submitPrompt:v,onAbortClick:E})):ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},y.message))},Pf=function(e){let{className:t,spaceMedia:a}=e,[n,{loading:l,error:r}]=(0,cs.D)($v);return(ev.useEffect(()=>{n({variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:a.id}}})},[a.id,n]),l)?ev.createElement("div",{className:t},ev.createElement(eI.Spinner,null)):null!=r?ev.createElement("div",{className:t},ev.createElement("span",{className:"text-sm"},(0,ei.getMessageFromError)(r)??ev.createElement(eY.Z,{id:"general.media_ai_chat.error",defaultMessage:"Error"}))):null},Ph=function(e){let{className:t,spaceMedia:a,onExit:n}=e;return a.canAskAi?a.transcriptEmbeddingStatus!==ei.StatusCode.OK?ev.createElement(Pf,{className:og()(t,"flex place-content-center pt-5"),spaceMedia:a}):ev.createElement(Pg,{className:t,spaceMedia:a,onExit:n}):ev.createElement("div",{className:og()(t,"flex place-content-center pt-5")},ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.media_ai_chat.unsupport_media",defaultMessage:"AI chat is unavailable for the media"})))},Py=function(e){let{className:t,spaceMedia:a}=e,n=(0,eK.Z)(),l=Td(a.data.fileDesc,"h_200,w_200","xhdpi")??"/images/file-placeholder2.png",r=$k(a.data.fileDesc)??n.formatMessage({id:"general.untitled",defaultMessage:"Untitled"}),o=cc()(a.created_at).format("MM/DD/YY");return ev.createElement("div",{className:t},ev.createElement("div",{className:"flex items-center gap-x-3"},ev.createElement("img",{className:"h-7 w-7 rounded-lg object-cover",alt:r,title:r,src:l}),ev.createElement("div",null,ev.createElement("p",{className:"text-sm"},r),ev.createElement("p",{className:"text-xs text-appcolor-500"},null!=a.user?ev.createElement(eY.Z,{id:"general.space_media_created_at_with_user",defaultMessage:"Added by {handle} on {createdAt}",values:{createdAt:o,handle:a.user.handle}}):ev.createElement(eY.Z,{id:"general.space_media_created_at",defaultMessage:"Added on {createdAt}",values:{createdAt:o}})))))},Pb=function(e){let{className:t,spaceMedia:a}=e,{s3KeyOriginal:n}=a.data.fileDesc,l=(0,wo.a)(["ogp",n],async()=>{let e=`https://files.taskade.com/${n}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),r=l.data?.ogTitle,o=ev.useMemo(()=>{if(null!=r)return r;let e=(0,cx.getMediaLocationDesc)(a.data.fileDesc.id);return null==e?"Youtube (Unknown)":"youtube"!==e.type?"Unknown":`Youtube (${e.id})`},[r,a.data.fileDesc.id]),i=l.data?.ogImage?.[0]?.url??"/images/file-placeholder2.png",s=cc()(a.created_at).format("MM/DD/YY");return ev.createElement("div",{className:t},ev.createElement("div",{className:"flex-none"},ev.createElement("img",{className:"h-8 w-8 rounded-lg object-cover",alt:o,title:o,src:i})),ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1"},ev.createElement("p",{className:"truncate text-sm font-semibold text-appcolor-900"},o),ev.createElement("p",{className:"text-xs text-appcolor-500"},null!=a.user?ev.createElement(eY.Z,{id:"general.space_media_created_at_with_user",defaultMessage:"Added by {handle} on {createdAt}",values:{createdAt:s,handle:a.user.handle}}):ev.createElement(eY.Z,{id:"general.space_media_created_at",defaultMessage:"Added on {createdAt}",values:{createdAt:s}}))))},Pv=function(e){let{className:t,spaceMedia:a}=e;switch((0,cx.computeMediaKind)(a.data.fileDesc.mimetype)){case"webpage":case"youtube":return ev.createElement(Pb,{className:t,spaceMedia:a});default:return ev.createElement(Py,{className:t,spaceMedia:a})}},Pk=eL.default.div.withConfig({displayName:"MediaAiDialogBody__Container",componentId:"sc-28354ac3-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + background: ${e=>e.theme.isNightMode?"rgba(23, 25, 28)":"#fff"}; + + backdrop-filter: blur(7px); + + @media (min-width: 768px) { + width: 40rem; + } + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,PE=function(e){let{onExit:t}=e,a=T_((0,eI.useTheme)()),n=(0,$y.J)({from:{__typename:"SpaceMedia",id:e.spaceMedia.id},fragment:$b}),l=n.complete?n.data:e.spaceMedia;return ev.createElement(Pk,{className:"w-full max-w-3xl rounded-xl bg-appcolor-0 md:w-192",style:a},ev.createElement("div",{className:"w-full rounded-xl"},ev.createElement(Pv,{className:"border-bottom flex items-center gap-4 border-b border-appcolor-300 py-5 pl-8 pr-5",spaceMedia:l}),ev.createElement(Ph,{className:"w-full overflow-clip pb-5",spaceMedia:l,onExit:t})))},Px=eL.default.div.withConfig({displayName:"EditorMediaAiDialogBody__Container",componentId:"sc-755fbacf-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + background: ${e=>e.theme.isNightMode?"rgba(23, 25, 28)":"#fff"}; + + backdrop-filter: blur(7px); + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,P_=function(e){let{documentId:t,attachment:a,onExit:n}=e,{data:l,loading:r,error:o}=(0,eB.a)($h,{variables:{input:{fileId:a.data.file.id,documentId:t}}});if(r)return ev.createElement(Px,null,ev.createElement("div",{className:"w-full rounded-xl p-5"},ev.createElement("div",{className:"align-center h-30 relative flex animate-color-rainbow justify-center"},ev.createElement(tn.Icon,{icon:"dd_project",className:"absolute top-8 mt-1 scale-150"}),ev.createElement(eI.Spinner,{size:94})),ev.createElement("div",{className:"text-md mt-8 flex justify-center text-appcolor-800"},ev.createElement(eY.Z,{id:"general.analyzing_file",defaultMessage:"Analyzing file..."}))));if(null!=o)return ev.createElement(Px,null,ev.createElement("p",{className:"p-5 text-center text-sm"},(0,ei.getMessageFromError)(o)));let i=l?.spaceMediaSearch;return null==i?ev.createElement(Px,null,ev.createElement("p",{className:"p-5 text-center text-sm"},ev.createElement(eY.Z,{id:"general.space_media_not_available",defaultMessage:"Media not Available…"}))):ev.createElement(PE,{spaceId:i.space_id,spaceMedia:i,onExit:n})},Pw=(0,d9.oM)({name:"dialogs.mediaAi",initialState:{isOpen:!1},reducers:{toggleMediaAiDialog(e,t){if(e.isOpen||null==t.payload)return{isOpen:!1};let{spaceId:a,spaceMedia:n}=t.payload;return{isOpen:!0,type:"SpaceMedia",spaceId:a,spaceMedia:n}},toggleEditorMediaAiDialog(e,t){if(e.isOpen||null==t.payload)return{isOpen:!1};let{documentId:a,attachment:n}=t.payload;return{isOpen:!0,type:"NodeFileAttachment",documentId:a,attachment:n}}}}),PN=function(){let e=(0,e$.useDispatch)(),t=(0,e$.useSelector)(e=>e.dialogs.mediaAi),a=ev.useCallback(()=>{e(Pw.actions.toggleMediaAiDialog())},[e]);return t.isOpen?"SpaceMedia"===t.type?ev.createElement(eI.ModalDialog,{isOpen:t.isOpen,close:a,autofocus:!1,disableBackground:!0},e=>{let{exit:a}=e;return ev.createElement(PE,{spaceId:t.spaceId,spaceMedia:t.spaceMedia,onExit:a})}):"NodeFileAttachment"===t.type?ev.createElement(eI.ModalDialog,{isOpen:t.isOpen,close:a,autofocus:!1,disableBackground:!0},e=>{let{exit:a}=e;return ev.createElement(P_,{documentId:t.documentId,attachment:t.attachment,onExit:a})}):null:null};function PC(e){let t=[];for(let a of e.getTexts().toArray()){let e=a.text,n=(0,sX.extractHashtagsWithIndices)(e),l=(0,sX.extractUrlsWithIndices)(e),r=(0,sX.extractEmailsWithIndices)(e);for(let e of n){let{indices:n}=e,[l,r]=n,o={anchorKey:a.key,anchorOffset:l,focusKey:a.key,focusOffset:r,marks:[{type:"hashtag",data:{name:e.hashtag}}]};t.push(o)}for(let e of l){let{indices:n}=e,[l,r]=n,o={anchorKey:a.key,anchorOffset:l,focusKey:a.key,focusOffset:r,marks:[{type:"url",data:{url:e.url}}]};a.characters.slice(l,r).every(e=>e.marks.some(e=>"link"===e.type))||t.push(o)}for(let e of r){let{indices:n}=e,[l,r]=n,o={anchorKey:a.key,anchorOffset:l,focusKey:a.key,focusOffset:r,marks:[{type:"email",data:{url:`mailto:${e.email}`}}]};t.push(o)}}return t}let PM=/^\/(spaces|d|v|e)\//i;function PS(e){if(null==e)return null;try{let t=new URL("https://www.taskade.com"),a=new URL(e);if(0!==t.host.localeCompare(a.host,"en",{sensitivity:"accent"}))return null;let n=a.pathname.match(PM);if(null==n)return null;let l=a.pathname.split("/");switch(l[1]){case"d":{if(l.length<3)return null;let e=l[2];if(ts()(e))return null;return{type:"document",id:e,url:a}}case"e":{if(l.length<3)return null;let e=l[2];if(ts()(e))return null;return{type:"edit",id:e,url:a}}case"v":{if(l.length<3)return null;let e=l[2];if(ts()(e))return null;return{type:"view",id:e,url:a}}case"spaces":{if(l.length<3)return null;let e=l[2];if(ts()(e))return null;return{type:"space",id:e,url:a}}default:return null}}catch(t){return er.$e(a=>{a.setLevel("info"),a.setExtra("urlString",e),er.Tb(t)}),null}}let PI=eL.default.div.withConfig({displayName:"styled__StyledWrapper",componentId:"sc-622ef547-0"})` + display: flex; + align-items: center; +`,PD=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-622ef547-1"})` + height: 15px; + width: 15px; +`,PT=eL.default.span.withConfig({displayName:"styled__StyledTooltipText",componentId:"sc-622ef547-2"})` + display: inline-block; + max-width: 300px; + margin-left: 8px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 13px; +`,P$=function(e){let{url:t}=e;return ev.createElement(PI,null,ev.createElement(PD,{icon:"link"}),ev.createElement(PT,null,t))},PP=(0,la.ZP)` + query ProjectAnchorQuery($id: ID!) { + document(id: $id) { + id + info + shared_preferences + } + } +`,PF=function(e){let{documentId:t,onResolve:a,url:n}=e,{data:l}=(0,eB.a)(PP,{variables:{id:t},fetchPolicy:"cache-first"}),r=l?.document??null;if(ev.useEffect(()=>{null!=r&&a()},[r,a]),null==r)return ev.createElement(P$,{url:n});let{avatar:o}=r.shared_preferences;return ev.createElement(PI,null,null!=o?ev.createElement("span",null,o.value):ev.createElement(PD,{icon:"dd_project"}),ev.createElement(PT,null,r?.info.title||"Untitled"))},PA=(0,la.ZP)` + query ProjectAtPathAnchorQuery($path: String!) { + document: documentAtPath(path: $path) { + id + info + shared_preferences + } + } +`,PR=function(e){let{path:t,onResolve:a,url:n}=e,{data:l}=(0,eB.a)(PA,{variables:{path:t},fetchPolicy:"cache-first"}),r=l?.document??null;if(ev.useEffect(()=>{null!=r&&a()},[r,a]),null==r)return ev.createElement(P$,{url:n});let{avatar:o}=r.shared_preferences;return ev.createElement(PI,null,null!=o?ev.createElement("span",null,o.value):ev.createElement(PD,{icon:"dd_project"}),ev.createElement(PT,null,r?.info.title))},Pj=function(e){let{arrowProps:t,popperProps:a,onResolve:n,url:l}=e,r=ev.useMemo(()=>PS(l),[l]);return ev.createElement(eI.Tooltip,{arrowProps:t,popperProps:a},null==r?ev.createElement(P$,{url:l}):"document"===r.type?ev.createElement(PF,{documentId:r.id,url:l,onResolve:n}):"view"===r.type||"edit"===r.type?ev.createElement(PR,{path:r.url.pathname,url:l,onResolve:n}):ev.createElement(P$,{url:l}))};function PO(e){return!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&(null==e.buttons||0===e.buttons||1===e.buttons)&&(null!=e.button?0===e.button:1===e.which)}let PU=function(e){let{attributes:t,mark:a,target:n,children:l,detectInternalLinks:r}=e,o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useState(!1),{arrowProps:m,popperProps:u,referenceProps:p,popper:g}=(0,eI.useControlledTooltip)({referenceElementRef:o,arrowElementRef:i,popperElementRef:s,placement:"bottom",visible:d}),f=(0,eF.k6)(),h=ev.useMemo(()=>{let e=a?.data?.get("url");if(e)return(0,sX.normalizeUrl)(e)??void 0},[a]),y=e=>{if(e.preventDefault(),null==h)return;if(r&&PO(e)){let e=function(e){let t=PS(e);if(null==t)return null;let{url:a}=t;return`${a.pathname}${a.search}${a.hash}`}(h);if(null!=e){f.push(e);return}}let t=window.open(h,n,"noopener,noreferrer");eu()(t)||(window.opener=null)},b=ev.useCallback(()=>{c(!0)},[]),v=ev.useCallback(()=>{c(!1)},[]),k=ev.useCallback(()=>{g.instanceRef.current?.update()},[g.instanceRef]);return ev.createElement(ev.Fragment,null,ev.createElement("a",{...t,className:"anchor",href:h,rel:"nofollow noopener noreferrer",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{1===e.button&&y(e)},onMouseEnter:b,onMouseLeave:v,onClick:y,target:n,...p},l),d&&ev.createElement(Pj,{arrowProps:m,popperProps:u,onResolve:k,url:h}))},PZ=function(e){let{attributes:t,children:a}=e;return ev.createElement("span",{...t,className:"bold"},a)},PL=function(e){let{attributes:t,mark:a,children:n}=e,l=(0,e$.useDispatch)(),r=a?.data?.get("name")??void 0;return ev.createElement("span",{...t,className:"hashtag",role:"link",onClick:()=>{null!=r&&l(N6(`#${r}`))},onMouseDown:e=>{e.preventDefault()},"data-hashtag-text":r},n)},PB=[eI.ColorNames.Yellow,eI.ColorNames.Green,eI.ColorNames.Blue,eI.ColorNames.Purple,eI.ColorNames.Red],Pz=[eI.ColorNames.Yellow,eI.ColorNames.Gold,eI.ColorNames.Amber,eI.ColorNames.Orange,eI.ColorNames.Ruby,eI.ColorNames.Red,eI.ColorNames.Purple,eI.ColorNames.Sapphire,eI.ColorNames.Blue,eI.ColorNames.Aqua,eI.ColorNames.Emerald,eI.ColorNames.Green],PV={[eI.ColorNames.Yellow]:(0,te.Em)({id:"general.highlight_yellow",defaultMessage:"Highlight Yellow"}),[eI.ColorNames.Green]:(0,te.Em)({id:"general.highlight_green",defaultMessage:"Highlight Green"}),[eI.ColorNames.Blue]:(0,te.Em)({id:"general.highlight_blue",defaultMessage:"Highlight Blue"}),[eI.ColorNames.Purple]:(0,te.Em)({id:"general.highlight_purple",defaultMessage:"Highlight Purple"}),[eI.ColorNames.Red]:(0,te.Em)({id:"general.highlight_red",defaultMessage:"Highlight Red"})},Pq=new Set(Pz),PW=eL.default.span.withConfig({displayName:"Highlight__StyledSpan",componentId:"sc-9978b2f8-0"})` + border-bottom: 3px solid ${e=>e.$color}; + transition: color cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s; + -webkit-transition: color cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s; +`,PH=function(e){let{attributes:t,children:a,mark:n}=e,l=ev.useMemo(()=>{var e;let t=n?.data?.get("colorName")||PB[0];return null!=(e=t)&&Pq.has(e)&&(t=(0,eI.getHslColorScale)(t).hex("80")),t},[n]);return ev.createElement(PW,{...t,$color:l,className:"highlight"},a)},PG=function(e){let{attributes:t,children:a}=e;return ev.createElement("span",{...t,className:"italic"},a)},PK=function(e){let{attributes:t,text:a,children:n}=e,l=(0,e$.useDispatch)();return ev.createElement("span",{...t,className:"mention",role:"link",onClick:()=>{l(N6(a))},onMouseDown:e=>{e.preventDefault()},"data-mention-text":a},n)},PY=function(e){let{attributes:t,children:a}=e;return ev.createElement("span",{className:"bg-primary/20",...t},a)},PQ=function(e){let{attributes:t,children:a}=e;return ev.createElement("span",{...t,className:"underline"},a)},PJ={};function PX(e){let{mark:t}=e;switch(t.type){case"bold":return ev.createElement(PZ,e);case"italic":return ev.createElement(PG,e);case"underline":return ev.createElement(PQ,e);case"highlight":return ev.createElement(PH,e);case"hashtag":return ev.createElement(PL,e);case"mention":return ev.createElement(PK,e);case"url":case"link":return ev.createElement(PU,{...e,detectInternalLinks:!0});case"email":return ev.createElement(PU,e);case"search":return ev.createElement(PY,e);default:{if(!PJ[t.type]){PJ[t.type]=!0;let e=new ei.TaskadeError({message:"Unknown Mark",scope:{extras:{mark:t.toJSON()},level:"debug"}});er.$e(t=>{null!=e.scope&&null!=e.scope.extras&&t.setExtras(e.scope.extras),er.Tb(e)})}let{attributes:a,children:n}=e;return ev.createElement("span",{...a,className:"unknown"},n)}}}function P0(e){return(t,a)=>{let n=a(),l=dV(n),r=dq(n),o=t7(n);(null!=l&&lm({role:l.role,action:{project:"check",workspace:"check_project"}})||null==o&&!r||null==l)&&t(mP(e))}}let P1=(0,eL.css)` + &:after { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + white-space: nowrap; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } +`,P2=(0,eL.css)` + ${P1} + + &:after { + counter-increment: nodeCounter; + content: counter(nodeCounter, decimal) '.'; + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,P5=(0,eL.css)` + ${P1}; + + &:after { + counter-increment: nodeCounter; + content: counter(nodeCounter, lower-alpha) '.'; + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,P3=(0,eL.css)` + ${P1} + + &:after { + margin-top: 2px; + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + border-radius: 6px; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected3.svg":"/../images/check_hover3.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected3.svg'); + } + } +`,P4=(0,eL.css)` + ${P3} + + &:after { + border-radius: 25px; + } +`,P6=(0,eL.css)` + ${P1} + + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_heart2.svg'); + margin-top: 5px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_heart2.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_heart_selected2.svg'); + opacity: 1; + transform: scale(1); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_heart_selected2.svg'); + } +`,P8=(0,eL.css)` + ${P1} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border-radius: 25px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,P7=(0,eL.css)` + ${P1} + + &:after { + border-radius: 25px; + content: ''; + } + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_triangle.svg'); + margin-left: -2px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_triangle.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_triangle.svg'); + opacity: 1; + transform: scale(1.4); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_triangle_selected.svg'); + } +`,P9=(0,eL.css)` + ${P1} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + border-radius: 1px; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,Fe=eL.default.div.withConfig({displayName:"NodeBullet__Wrapper",componentId:"sc-caf96bc9-0"})` + display: flex; + margin-right: 8px; + align-self: flex-start; +`,Ft=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"NodeBullet__Checkbox",componentId:"sc-caf96bc9-1"})` + width: 1.125rem; + height: 1.125rem; + -webkit-appearance: none; + + ${e=>e.$format===li.FORMAT_ALPHA&&P5} + ${e=>e.$format===li.FORMAT_NUMBER&&P2} + ${e=>e.$format===li.FORMAT_CHECKBOX&&P3} + ${e=>e.$format===li.FORMAT_CIRCLE_CHECK&&P4} + ${e=>e.$format===li.FORMAT_HEART&&P6} + ${e=>e.$format===li.FORMAT_BULLET&&P8} + ${e=>e.$format===li.FORMAT_TRIANGLE&&P7} + ${e=>e.$format===li.FORMAT_SQUARE&&P9} +`,Fa=function(e){let{nodeID:t,nodeFormat:a,completed:n}=e,l=(0,e$.useDispatch)(),r=ev.useCallback(()=>{l(P0(t))},[l,t]);return a===li.FORMAT_TEXT?null:ev.createElement(Fe,null,ev.createElement(Ft,{$format:a,id:`checkbox-${t}`,className:"left",checked:n,onClick:r}))},Fn="DOCUMENT_CREATED",Fl="SET_SYNC_STATE",Fr="UPDATE_META",Fo="APPLY_CHANGESET",Fi="@@taskade/Project/CREATE_DOCUMENT";function Fs(e){return{type:Fl,payload:{syncState:e}}}function Fd(){return{type:Fi,payload:{}}}function Fc(e){return{type:Fr,payload:{meta:e}}}let Fm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectAddonsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shareToken"}},type:{kind:"NamedType",name:{kind:"Name",value:"ShareTokenInput"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"shareToken"},value:{kind:"Variable",name:{kind:"Name",value:"shareToken"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"addons"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"assignees"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}},{kind:"Field",name:{kind:"Name",value:"assignee"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"assigner"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"countdowns"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"last_used_duration"}},{kind:"Field",name:{kind:"Name",value:"creator"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"states"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"end"}},{kind:"Field",name:{kind:"Name",value:"actor"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"removed"}}]}},{kind:"Field",name:{kind:"Name",value:"dates"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}},{kind:"Field",name:{kind:"Name",value:"author"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"addonDate"}}]}},{kind:"Field",name:{kind:"Name",value:"reactionCollections"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"emojis"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"users"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"skin"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},Fu={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectNodesAssignmentUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectNodesAssignmentUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectNodesAssignmentUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}},{kind:"Field",name:{kind:"Name",value:"assigneesAdded"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}}]}},{kind:"Field",name:{kind:"Name",value:"assigneesRemoved"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}}]}}]}}]}}]};function Fp(e){let t=(0,ll.x)(),{search:a}=(0,eF.TH)(),n=ev.useMemo(()=>s4(a),[a]);return ev.useCallback((a,l)=>{if(null==e)return;let r=(0,ld.Z)(),o=t.readQuery({query:Fm,variables:{id:e,shareToken:n}}),i=(o?.document?.addons.assignees??[]).some(e=>e.assignee.id===l);t.mutate({mutation:Fu,variables:{input:{clientMutationId:r,projectId:e,nodeIds:a,assigneeId:l}},optimisticResponse:{projectNodesAssignmentUpdate:{clientMutationId:r,ok:!0,assigneesAdded:i?[]:a.map(e=>({id:l,nodeId:e})),assigneesRemoved:i?a.map(e=>({id:l,nodeId:e})):[]}},update(t,a){let l=t.readQuery({query:Fm,variables:{id:e,shareToken:n}});if(null==l||null==a.data)return;let{assigneesAdded:r,assigneesRemoved:o}=a.data.projectNodesAssignmentUpdate,i=(0,es.ZP)(l,e=>{if(null==e.document)return;let{assignees:t}=e.document.addons;if(null==t)return;for(let e of r)t.push(e);let a=new Set(o.map(e=>e.id));for(let e=t.length-1;e>=0;e--){let n=t[e];a.has(n.id)&&t.splice(e,1)}});t.writeQuery({query:Fm,variables:{id:e,shareToken:n},data:i})}})},[t,e,n])}let Fg=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__StyledOverline",componentId:"sc-8abb0b25-0"})` + padding: 6px 16px 6px 20px; +`;(0,eL.default)(e1.Notice).attrs({$type:"upgrade"}).withConfig({displayName:"styled__StyledNotice",componentId:"sc-8abb0b25-1"})` + ${e1.UiTypography.sm}; + margin: 0 12px 8px; + max-width: 280px; + cursor: pointer; +`;let Ff=(0,eL.default)(e1.Notice).attrs({$type:"danger"}).withConfig({displayName:"styled__StyledErrorNotice",componentId:"sc-8abb0b25-2"})` + margin: 8px 12px; + max-width: 280px; +`;eL.default.span.withConfig({displayName:"styled__StyledPaywallUpgradeLink",componentId:"sc-8abb0b25-3"})` + color: ${eI.ThemeColors.upgrade}; + &:hover { + text-decoration: underline; + } +`;let Fh=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"styled__StyledCheckIcon",componentId:"sc-8abb0b25-4"})` + margin-left: auto; + & path { + fill: ${e=>e.theme.primaryColorScheme?.base}; + } +`,Fy=eL.default.span.withConfig({displayName:"styled__StyledUserHandle",componentId:"sc-8abb0b25-5"})` + margin-left: var(--menu-item-gap); + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + user-select: none; +`,Fb=eL.default.span.withConfig({displayName:"styled__StyledUserDisplayName",componentId:"sc-8abb0b25-6"})` + margin-left: 4px; + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + user-select: none; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`,Fv=eL.default.span.withConfig({displayName:"styled__StyledMenuButton",componentId:"sc-8abb0b25-7"})` + display: flex; + align-items: center; + background: none; + border: 0; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + cursor: pointer; + + &:hover, + &:focus { + background: ${e=>e.theme.isNightMode?"#272C30":"#f8f8f8"}; + } + + &:focus { + outline: 0; + } +`,Fk=function(e){let{assignees:t,documentID:a,nodeID:n,...l}=e,r=Fp(a),{data:o,loading:i,error:s}=(0,eB.a)(bA,null!=a?{variables:{document_id:a,projectMembersLimit:30}}:{skip:!0}),d=ev.useCallback(e=>{null!=a&&r([n],"number"==typeof e.id?e.id.toString():e.id)},[a,n,r]),c=ev.useMemo(()=>{let e=[],t=o?.document.space?.memberships?.map(e=>e.user??null)??[],a=o?.document.members?.edges?.map(e=>e.node?.user??null)??[];for(let n of tu()([...t,...a],e=>e?.id))null!=n&&e.push(n);return e},[o]),m=o?.me?.id??null,{assignees:u,nonMemberAssignees:p}=ev.useMemo(()=>{let e=[],a=[],n=aR()(c,"id");for(let l of t){let t=l.id.toString();if(t in n){let a=n[t];e.push(a)}else a.push(l)}return{assignees:e,nonMemberAssignees:a}},[c,t]);return null!=s?ev.createElement(av,null,ev.createElement(Ff,null,ev.createElement(eY.Z,{id:"general.generic_error_occurred",defaultMessage:"An error occurred."}))):i?ev.createElement(av,null,ev.createElement(eI.Spinner,{size:36})):ev.createElement(a_,{assignees:u,nonMemberAssignees:p,members:c,currentUserId:m,onUserSelect:d,...l})};eL.default.div.withConfig({displayName:"styled__BodyWrapper",componentId:"sc-60bc356f-0"})` + width: 240px; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: 8px 0; +`,eL.default.div.withConfig({displayName:"styled__Header",componentId:"sc-60bc356f-1"})` + margin: 5px 20px 5px 20px; + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 12px; + text-transform: uppercase; +`,eL.default.div.withConfig({displayName:"styled__ErrorMessage",componentId:"sc-60bc356f-2"})` + padding: 0 20px 0 20px; + color: ${e=>e.theme.textColors.hex(10)}; +`;let FE=eL.default.button.withConfig({displayName:"styled__AddonButton",componentId:"sc-60bc356f-3"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + & img { + filter: grayscale(1); + } + + &:hover { + color: ${e.theme.appColors.hex(10)}; + border-color: ${e.theme.appColors.hex(60)}; + + & img { + filter: grayscale(0); + } + } + `} +`,Fx=(0,eL.default)(e1.UserAvatar).attrs({size:"xs",shape:"circle"}).withConfig({displayName:"styled__Avatar",componentId:"sc-60bc356f-4"})` + margin-left: -5px; + + &:first-child { + margin-left: 0; + } +`,F_=eL.default.span.withConfig({displayName:"styled__Assignees",componentId:"sc-60bc356f-5"})` + margin: 0 5px; + white-space: nowrap; +`,Fw=eL.default.div.withConfig({displayName:"styled__AssignIconWrapper",componentId:"sc-60bc356f-6"})` + display: flex; + width: 16px; + height: 20px; + overflow: hidden; +`,FN=(0,eL.default)(tn.Icon).attrs({icon:"addon_assign"}).withConfig({displayName:"styled__AssignIcon",componentId:"sc-60bc356f-7"})` + flex-shrink: 0; + color: ${e=>e.theme.textColors.hex(10)}; +`,FC=ev.forwardRef(function(e,t){let{assignees:a,readOnly:n,nodeCompleted:l,...r}=e,o=a.attachments,i=ev.useRef(null),s=ev.useRef(null),d=ev.useRef(null),[c,m]=ev.useState(!1),{arrowProps:u,popperProps:p,referenceProps:g}=(0,eI.useControlledTooltip)({referenceElementRef:i,arrowElementRef:s,popperElementRef:d,placement:"top",visible:c}),f=ev.useMemo(()=>{if(!n)return()=>{m(!0)}},[n]),h=ev.useMemo(()=>{if(!n)return()=>{m(!1)}},[n]),y=ev.useMemo(()=>{if(0===o.length)return ev.createElement(Fw,null,ev.createElement(FN,null));let e=[],t=[];for(let a of o){let n=a.assignee;e.push(n.handle),t.push(ev.createElement(Fx,{key:a.id,src:n.avatars_v2.small.mdpi.url,alt:n.handle,$nodeCompleted:l}))}let a=e.length>1?"assignees multi":"assignees single";return ev.createElement(ev.Fragment,null,t,ev.createElement(F_,{className:a,$nodeCompleted:l},e.join(", ")))},[o,l]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...g,onMouseEnter:f,onMouseLeave:h},ev.createElement(FE,{ref:t,type:"button",$nodeCompleted:l,...r},y)),c&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},ev.createElement(eY.Z,{id:"general.assign",defaultMessage:"Assign"})))}),FM=function(e){let{assignees:t,nodeID:a,documentID:n,popupState:l,popupDispatch:r,nodeCompleted:o}=e,i=(0,e$.useDispatch)(),s=e.readOnly??!1,d=ev.useRef(null),c=ev.useRef(null),m=ev.useMemo(()=>t?.attachments.map(e=>e.assignee)??[],[t]),u=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:l,placement:"bottom",computeModifiersCallback:tr}),p=(0,eI.useMenuButton)({dispatch:r,ref:d,state:l,onClick:e=>{null==n&&(e.preventDefault(),i(Fd()))}}),g=ev.useCallback(()=>{r({type:"Collapse"})},[r]),f=ev.useCallback(e=>{e.relatedTarget===c.current&&e.target instanceof HTMLElement&&e.target.focus()},[]);return s?ev.createElement(FC,{assignees:t??{total:0,attachments:[]},readOnly:s,nodeCompleted:o}):ev.createElement(ev.Fragment,null,ev.createElement(FC,{assignees:t??{total:0,attachments:[]},readOnly:s,...p.props,nodeCompleted:o}),l.expanded&&null!=n&&ev.createElement(eI.Popup,{...u.props,dispatch:r,modal:!0},ev.createElement(Fk,{assignees:m,documentID:n,nodeID:a,onPopupClose:g,onPopupBlur:f})))};function FS(e){let{search:t}=(0,eF.TH)(),a=ev.useMemo(()=>s4(t),[t]),n=(0,eB.a)(sW),l=n?.data?.me??null,r=ev.useMemo(()=>null==l?null:{id:l.id,default_name:l.default_name,display_name:l.display_name,handle:l.handle,initials:l.initials,avatars_v2:l.avatars_v2},[l]),[o]=(0,cs.D)(lp);return{setDueDate:ev.useCallback((t,n)=>{if(null==e)return;let l=(0,ld.Z)();o({variables:{input:{clientMutationId:l,projectId:e,nodeIds:t,dateAttachment:n}},optimisticResponse:{projectNodesDueDateUpdate:{clientMutationId:l,ok:!0,added:t.map(t=>({id:`${e}:${t}:date`,nodeId:t,addonDate:n,author:r})),removed:[]}},update(t,n){let l=t.readQuery({query:Fm,variables:{id:e,shareToken:a}});if(null==l)return null;let r=(0,es.ZP)(l,e=>{if(null==e.document||null==n.data)return;let t=e.document.addons;if(null==t.dates){t.dates=n.data.projectNodesDueDateUpdate.added;return}for(let e of n.data.projectNodesDueDateUpdate.added){let a=t.dates.findIndex(t=>t.nodeId===e.nodeId);-1===a?t.dates.push(e):t.dates[a]=e}});t.writeQuery({query:Fm,data:r,variables:{id:e,shareToken:a}})}})},[r,e,o,a]),removeDueDate:ev.useCallback(t=>{if(null==e)return;let n=(0,ld.Z)();o({variables:{input:{clientMutationId:n,projectId:e,nodeIds:t,dateAttachment:null}},optimisticResponse:{projectNodesDueDateUpdate:{clientMutationId:n,ok:!0,added:[],removed:t.map(t=>({id:`${e}:${t}:date`,nodeId:t}))}},update(t,n){let l=t.readQuery({query:Fm,variables:{id:e,shareToken:a}});if(null==l)return null;let r=(0,es.ZP)(l,e=>{if(null==e.document||null==n.data)return;let t=e.document.addons;if(null==t.dates)return;let a=new Set(n.data.projectNodesDueDateUpdate.removed.map(e=>e.id));for(let e=t.dates.length-1;e>=0;e--){let n=t.dates[e];a.has(n.id)&&t.dates.splice(e,1)}});t.writeQuery({query:Fm,data:r,variables:{id:e,shareToken:a}})}})},[e,o,a])}}function FI(){return[{name:"flip",options:{fallbackPlacements:["top-start"]}}]}let FD=(0,eL.css)` + scrollbar-width: thin; + scrollbar-color: transparent transparent; + &:hover { + scrollbar-color: ${e=>e.theme.isNightMode?"#333":"#f4f4f4"} transparent; + } + &::-webkit-scrollbar { + height: 11px; + width: 11px; + } + &::-webkit-scrollbar-track { + background: transparent; + } + &::-webkit-scrollbar-thumb { + border: 2px solid ${e=>e.theme.isNightMode?"#1C1C1C":"#fff"}; + background-color: ${e=>e.theme.isNightMode?"#333":"#f4f4f4"}; + border-radius: 10px; + visibility: visible; + } + ::-webkit-scrollbar-corner { + background: rgba(0, 0, 0, 0); + } +`,FT=eL.default.label.withConfig({displayName:"Select__Container",componentId:"sc-ba015d03-0"})` + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + display: flex; + position: relative; + ${e1.UiTypography.md}; + + &:focus, + &:focus-within { + color: #3d454b; + outline: none; + } +`,F$=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"Select__CaretIcon",componentId:"sc-ba015d03-1"})` + transform: var(--global-icon-scale); + color: ${e=>e.theme.appColors.hex(50)}; + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } + + ${FT}:focus-within & { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,FP=eL.default.div.withConfig({displayName:"Select__CaretContainer",componentId:"sc-ba015d03-2"})` + align-items: center; + display: flex; + padding: 0 0.4375rem; + cursor: pointer; +`,FF=eL.default.div.withConfig({displayName:"Select__Text",componentId:"sc-ba015d03-3"})` + position: absolute; + top: 0; + bottom: 0; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + display: flex; + align-items: center; + color: ${e=>e.theme.textColors.hex(e.$placeholder?50:10)}; + ${e1.UiTypography.sm}; +`,FA=(0,eL.default)(eI.Popup).withConfig({displayName:"Select__ListContainer",componentId:"sc-ba015d03-4"})` + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: var(--menu-border-radius); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + margin-top: ${eI.UiSpacing.getPx(1.5)}; + padding: var(--menu-padding); + position: absolute; + z-index: 1; + box-sizing: border-box; + cursor: pointer; + width: ${e=>e.$width?e.$width+"px":"auto"}; + height: ${e=>e.$height?e.$height+"px":"auto"}; + overflow: auto; + ${FD}; +`,FR=eL.default.input.attrs({type:"text"}).withConfig({displayName:"Select__Input",componentId:"sc-ba015d03-5"})` + font-family: inherit; + background: transparent; + border: none; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + position: relative; + flex: 1; + cursor: ${e=>e.$search?"text":"default"}; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.md} + &:focus { + outline: none; + } + width: 100%; + cursor: pointer; +`,Fj=eL.default.div.withConfig({displayName:"Select__EmptyText",componentId:"sc-ba015d03-6"})` + color: ${e=>e.theme.textColors.hex(10)}; + padding: 0.625rem 1.25rem; +`,FO=eL.default.div.withConfig({displayName:"Select__Item",componentId:"sc-ba015d03-7"})` + display: flex; + align-items: center; + cursor: pointer; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + ${e=>e.selected&&"font-weight: bold;"} + ${e=>e.active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,FU=eL.default.div.withConfig({displayName:"Select__ItemSpanWrapper",componentId:"sc-ba015d03-8"})` + height: 20px; + display: flex; + align-items: center; + white-space: nowrap; +`,FZ=function(e,t){return t.label.toLowerCase().includes(e.toLowerCase())},FL=function(e){let{options:t,loop:a=!1,search:n=!1,placeholder:l,onChange:r,selected:o,className:i,filterFunc:s,itemComponent:d}=e,[c,m]=ev.useState(""),[u,p]=ev.useReducer(eI.popupReducer,{expanded:!1}),g=ev.useRef(null),f=ev.useRef(null),h=ev.useRef(null),y=ev.useRef(null),b=ev.useCallback(()=>{g.current&&g.current.focus()},[]),[v,k]=ev.useState(void 0),[E,x]=ev.useState(void 0),[_,w]=ev.useState(null),N=void 0!==o?o:_;(0,eI.usePopupEvents)({state:u,onCollapse:b});let C=(0,eI.usePopup)({referenceElementRef:g,popupElementRef:f,state:u,placement:"bottom-start",computeModifiersCallback:FI}),M=ev.useMemo(()=>{let e=s??FZ;return c?t.filter(t=>e(c,t)):t},[c,t,s]),{options:S,onKeyDownHandler:I,activeIndex:D,resetActiveIndex:T}=(0,eI.useSelect)({options:M,loop:a,selectedIndex:null!=N?M.indexOf(N):void 0}),$=()=>{m(""),p({type:"Collapse"})},P=e=>{r(e),w(e),$()},F=()=>{let e=f.current?.getBoundingClientRect();e&&e.height-(window.innerHeight-e.top)>0&&x(window.innerHeight-e.top)};function A(){let e=y.current,t=e?.parentElement;null!=e&&null!=t&&(e.offsetTop+e.offsetHeight>=t.offsetHeight+t.scrollTop?e.scrollIntoView(!1):e.offsetTop(u.expanded?(k(g.current?.offsetWidth??void 0),requestAnimationFrame(()=>{F(),y.current?.scrollIntoView(!1)})):T(),()=>x(void 0)),[u.expanded,T]),ev.createElement(ev.Fragment,null,ev.createElement(FT,{className:i,onClick:()=>p({type:"Expand"}),onFocus:()=>h.current?.focus(),onKeyDown:function(e){if(e.key!==eI.KeyboardKeys.Backspace||c||P(null),u.expanded){switch(e.key){case eI.KeyboardKeys.ArrowUp:case eI.KeyboardKeys.ArrowDown:requestAnimationFrame(A);break;case eI.KeyboardKeys.Escape:$();break;case eI.KeyboardKeys.Enter:P(S[D].value);break;case eI.KeyboardKeys.Space:if(0!==c.length)return;P(S[D].value),e.preventDefault()}I(e)}else[eI.KeyboardKeys.ArrowUp,eI.KeyboardKeys.ArrowDown,eI.KeyboardKeys.Enter,eI.KeyboardKeys.Space].includes(e.key)&&p({type:"Expand"})},ref:g,tabIndex:-1},ev.createElement(FF,{$placeholder:!N},""===c.trim()?N?.label||l:""),ev.createElement(FR,{readOnly:!n,value:c,$search:n,role:"combobox","aria-expanded":u.expanded,"aria-controls":"select-listbox","aria-activedescendant":"active-option",onChange:e=>{let{value:t}=e.target;m(0===t.trim().length?t.trim():t),p({type:"Expand"})},ref:h}),ev.createElement(FP,null,ev.createElement(F$,null))),u.expanded&&ev.createElement(FA,{modal:!0,dispatch:p,...C.props,role:"listbox",id:"select-listbox",$width:v,$height:E},S.length>0?S.map(e=>ev.createElement(FO,{key:e.value.id||e.value.value,...e.props,id:e.props.active?"active-option":void 0,role:"option",onClick:()=>P(e.value),onMouseDown:e=>e.preventDefault(),"aria-selected":e.value===N||void 0,selected:e.value===N,ref:e.props.active?y:void 0},null!=d?ev.createElement(d,{option:e.value,active:e.props.active}):ev.createElement(FU,null,ev.createElement("span",null,e.value.label)))):ev.createElement(Fj,null,"No items matched your search.")))},FB=eL.default.div.withConfig({displayName:"styled__RecurrenceConfiguratorWrapper",componentId:"sc-ac34215e-0"})` + display: flex; + flex-direction: column; +`,Fz=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__StyledOverline",componentId:"sc-ac34215e-1"})` + ${e1.UiTypography.xxs}; + font-weight: 500; + margin-top: 12px; + margin-bottom: 8px; +`,FV=eL.default.div.withConfig({displayName:"styled__FieldGroup",componentId:"sc-ac34215e-2"})` + display: flex; + align-items: center; + justify-content: space-between; + grid-gap: var(--menu-item-gap); + + &:not(:last-child) { + margin-bottom: 6px; + } +`,Fq=eL.default.div.withConfig({displayName:"styled__FieldGroupWeek",componentId:"sc-ac34215e-3"})` + display: flex; + padding-top: 2px; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + grid-gap: var(--menu-item-gap); + + &:not(:last-child) { + margin-bottom: 6px; + } +`,FW=eL.default.div.withConfig({displayName:"styled__ConfigureOptions",componentId:"sc-ac34215e-4"})` + padding-left: 28px; +`,FH=(0,eL.default)(tn.Icon).attrs({icon:"date_repeat"}).withConfig({displayName:"styled__RepeatIcon",componentId:"sc-ac34215e-5"})` + transform: var(--menu-item-icon-scale); + flex-shrink: 0; + color: ${e=>e.theme.appColors.hex(10)}; +`,FG=(0,eL.default)(FL).withConfig({displayName:"styled__StyledSelect",componentId:"sc-ac34215e-6"})` + flex-grow: 1; +`,FK=eL.default.button.withConfig({displayName:"styled__WeekdayButton",componentId:"sc-ac34215e-7"})` + ${e1.UiTypography.xxs}; + + padding: 0px; + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + color: ${e=>e.theme.textColors.hex(10)}; + border-radius: 100%; + width: 24px; + height: 24px; + text-transform: uppercase; + background: none; + text-align: center; + + &:hover { + cursor: pointer; + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + border-color: ${e=>e.theme.primaryColorScheme?.base}; + color: #ffffff; + } + + &:focus { + outline: 0; + } + + ${e=>e.$selected&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha80}; + border-color: ${e.theme.primaryColorScheme?.base}; + color: #ffffff; + font-weight: bold; + `} +`,FY=eL.default.div.withConfig({displayName:"CountSelect__Wrapper",componentId:"sc-f89c3612-0"})` + flex: 2; +`,FQ=function(e){let{number:t,onNumberChange:a}=e,n=(0,ev.useMemo)(()=>{let e=new Map,t=new Intl.NumberFormat;for(let a=0;a<99;a++){let n=0===a?"Repeat":"Repeats",l={value:(a+1).toString(),label:`${t.format(a+1)} ${n}`};e.set(a+1,l)}return e},[]),l=(0,ev.useMemo)(()=>[...n.values()],[n]),r=(0,ev.useCallback)(e=>{null!=e&&a(parseInt(e.value,10))},[a]),o=(0,ev.useMemo)(()=>n.get(t),[n,t]);return ev.createElement(FY,null,ev.createElement(FG,{selected:o,options:l,onChange:r,search:!0}))};!function(e){e.Never="never",e.After="after",e.On="on"}(U||(U={}));let FJ=new Map([[U.Never,{value:U.Never,label:"Never"}],[U.After,{value:U.After,label:"After"}],[U.On,{value:U.On,label:"On"}]]),FX=eL.default.div.withConfig({displayName:"ModeSelect__Wrapper",componentId:"sc-ab249328-0"})` + flex: 1; + min-width: 70px; +`,F0=eL.default.span.withConfig({displayName:"ModeSelect__ItemSpan",componentId:"sc-ab249328-1"})` + flex-grow: 1; + padding: 0 12px; + display: flex; + justify-content: space-between; +`,F1=function(e){let{option:t}=e;return ev.createElement(F0,null,t.label)},F2=function(e){let{mode:t,onModeChange:a}=e,n=(0,ev.useCallback)(e=>{null!=e&&a(e.value)},[a]),l=(0,ev.useMemo)(()=>FJ.get(t),[t]),r=[...FJ.values()];return ev.createElement(FX,null,ev.createElement(FG,{selected:l,options:r,onChange:n,itemComponent:F1}))},F5=function(e){let{endOption:t,onModeChange:a,onCountChange:n}=e,l=(0,ev.useCallback)(e=>{null!=e&&n(e)},[n]),r=t.mode;return ev.createElement(ev.Fragment,null,ev.createElement(F2,{mode:r,onModeChange:a}),ev.createElement(FQ,{number:t.countOrdinal,onNumberChange:l}))},F3=eL.default.div.withConfig({displayName:"styled__RowGroup",componentId:"sc-adbe9e2-0"})` + display: flex; + align-items: center; + flex-grow: 1; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + padding-right: 8px; +`,F4=(0,eI.getColorScheme)(eI.ThemeColors.danger),F6=(0,eL.default)(nt).withConfig({displayName:"styled__StyledDateInput",componentId:"sc-adbe9e2-1"})` + ${e1.UiTypography.sm} + + width: 100%; + flex-grow: 1; + + color: ${e=>e.theme.textColors.hex(10)}; + background: none; + padding: 5.15px 8px; + margin: 0; + border: 0; + position: relative; + + &:focus { + outline: 0; + z-index: 1; + } + + &:invalid { + border-color: ${F4?.base}; + background-color: ${F4?.alpha20}; + } +`,F8=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-adbe9e2-2"})` + color: ${e=>e.theme.appColors.hex(10)}; + } +`,F7=eL.default.button.withConfig({displayName:"styled__StyledIconButton",componentId:"sc-adbe9e2-3"})` + background: none; + display: flex; + align-items: center; + border: none; + + &:hover { + cursor: pointer; + } +`;(function(e){e[e.OutsideMonth=0]="OutsideMonth",e[e.Singular=1]="Singular",e[e.Today=2]="Today"})(Z||(Z={})),eL.default.div.withConfig({displayName:"styled__CalendarWrapper",componentId:"sc-83c6b366-0"})` + display: flex; + flex-direction: column; + margin: 0; + max-width: 240px; +`;let F9=eL.default.div.withConfig({displayName:"styled__CalendarTable",componentId:"sc-83c6b366-1"})` + display: flex; + flex-direction: column; + align-items: center; + border-radius: 10px; + padding: 16px 16px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,Ae=eL.default.div.withConfig({displayName:"styled__WeekdayRow",componentId:"sc-83c6b366-2"})` + display: flex; + justify-content: space-between; + padding-bottom: 4px; +`,At=eL.default.div.withConfig({displayName:"styled__Weekday",componentId:"sc-83c6b366-3"})` + width: 30px; + ${e1.UiTypography.sm} + color: ${e=>e.theme.textColors.hex(60)}; + text-align: center; + font-size: 12px; +`,Aa=eL.default.div.withConfig({displayName:"styled__DaysGrid",componentId:"sc-83c6b366-4"})` + display: flex; + width: 100%; + flex-direction: column; + align-items: center; +`,An=eL.default.div.withConfig({displayName:"styled__DaysRow",componentId:"sc-83c6b366-5"})` + display: flex; + width: 100%; + justify-content: center; +`,Al=eL.default.div.withConfig({displayName:"styled__MonthName",componentId:"sc-83c6b366-6"})` + display: flex; + width: 100%; + align-items: center; + justify-content: space-between; + margin: 8px 0 16px; + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: 500; +`,Ar=eL.default.span.withConfig({displayName:"styled__DayText",componentId:"sc-83c6b366-7"})` + display: inline-block; + width: 100%; + height: 100%; + line-height: 30px; + border-radius: 100%; +`,Ao=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIconButton",componentId:"sc-83c6b366-8"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,Ai=eL.default.div.withConfig({displayName:"styled__DayWrapper",componentId:"sc-83c6b366-9"})` + ${e1.UiTypography.sm} + + position: relative; + width: 30px; + height: 30px; + padding: 0; + cursor: pointer; + line-height: 15px; + text-align: center; + user-select: none; + color: ${e=>e.theme.appColors.hex(10)}; + + border-radius: 100%; + + &:focus { + outline: 1px ${e=>e.theme.appColors.hex(60)} dashed; + background-color: ${e=>e.theme.primaryColorScheme?.alpha10}; + } + + ${e=>e.$types.has(Z.Today)&&(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + font-weight: 500; + `} + + ${e=>e.$types.has(Z.OutsideMonth)&&(0,eL.css)` + color: ${e.theme.appColors.hex(50)}; + `} + + ${e=>e.$types.has(Z.Singular)&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha10}; + color: ${e.theme.appColors.hex(10)}; + `} + + ${e=>e.$types.has(Z.Singular)&&(0,eL.css)` + ${Ar} { + background-color: ${e.theme.primaryColorScheme?.base}; + font-weight: 500; + } + border-radius: 100% 0% 0% 100%; + color: #ffffff; + `} +`,As=function(e){let{date:t,onDateClick:a,types:n,rowIndex:l,columnIndex:r}=e,o=(0,ev.useRef)(null),{props:i,dispatch:s}=(0,eI.useMenuItem)({stopRef:o,onClick:()=>{a(t)}});return(0,ev.useEffect)(()=>{n.has(Z.Today)&&s({type:aK.ActionTypes.Navigate,payload:o})},[s]),ev.createElement(Ai,{...i,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:{e.stopPropagation();let t=7;0===l&&(t=r+1,r<3.5&&(t+=1));for(let e=0;e{switch(e.stopPropagation(),e.key){case eI.KeyboardKeys.ArrowUp:break;case eI.KeyboardKeys.ArrowDown:for(let e=0;e<7;e++)r({type:aK.ActionTypes.Next});break;case eI.KeyboardKeys.ArrowLeft:r({type:aK.ActionTypes.Previous});break;case eI.KeyboardKeys.ArrowRight:break;default:l.onKeyDown(e)}}},ev.createElement(Ao,{icon:"date_next"}))},Am=eL.default.div.withConfig({displayName:"PrevButton__Wrapper",componentId:"sc-f2a6063-0"})` + display: flex; +`,Au=function(e){let{className:t,onClick:a}=e,n=(0,ev.useRef)(null),{props:l,dispatch:r}=(0,eI.useMenuItem)({stopRef:n,onClick:a});return ev.createElement(Am,{className:t,...l,onKeyDown:e=>{switch(e.stopPropagation(),e.key){case eI.KeyboardKeys.ArrowUp:break;case eI.KeyboardKeys.ArrowDown:for(let e=0;e<2;e++)r({type:aK.ActionTypes.Next});break;case eI.KeyboardKeys.ArrowLeft:break;case eI.KeyboardKeys.ArrowRight:r({type:aK.ActionTypes.Next});break;default:l.onKeyDown(e)}}},ev.createElement(Ao,{icon:"date_prev"}))},Ap=function(e){let{selectedDate:t,onDateClick:a}=e,[n,l]=(0,ev.useState)(t.clone().startOf("month")),r=(0,ev.useMemo)(()=>n.clone().startOf("week"),[n]),o=(0,ev.useMemo)(()=>{let e=[];for(let a=0;a<6;a++){let l=[];for(let e=0;e<7;e++){let o=r.clone().add(a,"weeks").add(e,"days"),i=new Set;o.month()!==n.month()&&i.add(Z.OutsideMonth),o.isSame(eG()(),"day")&&i.add(Z.Today),t.isSame(o,"day")&&i.add(Z.Singular);let s={date:o,types:i};l.push(s)}e[a]=l}return e},[r,n,t]),i=(0,ev.useMemo)(()=>{let e=[];for(let t=0;t<7;t++)e.push(eG()().weekday(t).format("ddd"));return e},[]),s=e=>{a(e)};return ev.createElement(eI.Menu,null,ev.createElement(F9,{role:"grid","aria-labelledby":"calendarheader"},ev.createElement(Al,null,ev.createElement(Au,{onClick:()=>{l(e=>{let t=e.clone();return t.subtract(1,"month"),t})}}),ev.createElement("span",null,n.format("MMMM YYYY")),ev.createElement(Ac,{onClick:()=>{l(e=>{let t=e.clone();return t.add(1,"month"),t})}})),ev.createElement(Ae,{role:"rowgroup"},i.map(e=>ev.createElement(At,{role:"columnheader",key:e},e))),ev.createElement(Aa,null,o.map((e,t)=>ev.createElement(An,{key:t},e.map((e,a)=>ev.createElement(As,{key:a,date:e.date,types:e.types,onDateClick:s,rowIndex:t,columnIndex:a})))))))},Ag=function(e){let{endOption:t,onModeChange:a,onDateChange:n}=e,l=t.mode,[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1}),i=ev.useRef(null),s=ev.useRef(null),d=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:r,placement:"top-start"}),c=(0,eI.useMenuButton)({dispatch:o,ref:i,state:r}),m=(0,ev.useMemo)(()=>t.mode!==U.On?null:t.endDate.format(a7),[t]),u=(0,ev.useCallback)(e=>{n(e),o({type:"Collapse"})},[n]),p=(0,ev.useCallback)(e=>{null!=e&&n(eG()(e,a7,!0))},[n]),g=eG().localeData().longDateFormat("L");return ev.createElement(ev.Fragment,null,ev.createElement(F2,{mode:l,onModeChange:a}),ev.createElement(F3,null,ev.createElement(F6,{date:m,onDateChange:p,displayFormat:g}),ev.createElement(F7,{...c.props,type:"button"},ev.createElement(F8,{icon:"addon_date"}))),r.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:o,modal:!0},ev.createElement(Ap,{selectedDate:t.endDate,onDateClick:u})))},Af=function(e){let{endOption:t,onModeChange:a,onDateChange:n,onCountChange:l}=e,r=t.mode;return t.mode===U.Never?ev.createElement(F2,{mode:r,onModeChange:a}):t.mode===U.After?ev.createElement(F5,{endOption:t,onModeChange:a,onCountChange:l}):t.mode===U.On?ev.createElement(Ag,{endOption:t,onModeChange:a,onDateChange:n}):null};(function(e){e[e.None=0]="None",e[e.Daily=1]="Daily",e[e.Weekly=2]="Weekly",e[e.Monthly=3]="Monthly",e[e.Yearly=4]="Yearly",e[e.Custom=5]="Custom"})(L||(L={})),function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.Year=3]="Year"}(B||(B={})),function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(z||(z={}));let Ah=new Map([[L.None,{value:L.None.toString(),label:"No Repeat"}],[L.Daily,{value:L.Daily.toString(),label:"Daily"}],[L.Weekly,{value:L.Weekly.toString(),label:"Weekly"}],[L.Monthly,{value:L.Monthly.toString(),label:"Monthly"}],[L.Yearly,{value:L.Yearly.toString(),label:"Yearly"}],[L.Custom,{value:L.Custom.toString(),label:"Custom"}]]),Ay=eL.default.span.withConfig({displayName:"ModeSelect__ItemSpan",componentId:"sc-74063fc2-0"})` + flex-grow: 1; + display: flex; + justify-content: space-between; +`,Ab=eL.default.div.withConfig({displayName:"ModeSelect__ItemPopup",componentId:"sc-74063fc2-1"})` + display: flex; + flex-direction: column; + background-color: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + border-radius: 10px; + color: ${e=>e.theme.textColors.hex(10)}; + padding: 10px; +`,Av=eL.default.span.withConfig({displayName:"ModeSelect__StyledPricingLink",componentId:"sc-74063fc2-2"})` + cursor: pointer; +`,Ak=eL.default.span.withConfig({displayName:"ModeSelect__StyledCTAText",componentId:"sc-74063fc2-3"})` + color: ${eI.ThemeColors.upgrade}; + &:hover { + text-decoration: underline; + } +`,AE=function(e){let{option:t,active:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=(0,e$.useDispatch)(),s=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:n,placement:"right"});return(0,ev.useEffect)(()=>{t.value===L.Custom.toString()&&l({type:a?"Expand":"Collapse"})},[t.value,a]),ev.createElement(ev.Fragment,null,ev.createElement(Ay,{ref:r},t.label,t.value===L.Custom.toString()&&ev.createElement(e1.UpgradeBadge,null)),n.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:l},ev.createElement(Ab,null,ev.createElement(Av,{onClick:()=>{i(d4())}},ev.createElement(e1.Notice,{className:"text-sm",$type:"upgrade"},"⚡️"," ",ev.createElement(eY.Z,{id:"general.recurrence_due_date_assign_paywall",defaultMessage:"Upgrade to set custom intervals.",values:{link:e=>ev.createElement(Ak,null,e)}}))))))},Ax=function(e){let{mode:t,onModeChange:a,recurrenceCustomEnabled:n}=e,l=(0,ev.useCallback)(e=>{null!=e&&a(parseInt(e.value,10))},[a]),r=(0,ev.useMemo)(()=>[...Ah.values()],[]),o=(0,ev.useMemo)(()=>Ah.get(t),[t]);return ev.createElement(FG,{options:r,selected:o,onChange:l,itemComponent:n?void 0:AE})},A_=function(e){let{month:t,onMonthChange:a}=e,n=(0,ev.useMemo)(()=>{let e=new Map;for(let[t,a]of eG().months().entries()){let n={value:t.toString(),label:a};e.set(t,n)}return e},[]),l=(0,ev.useCallback)(e=>{null!=e&&a(parseInt(e.value,10))},[a]),r=(0,ev.useMemo)(()=>n.get(t),[t,n]),o=(0,ev.useMemo)(()=>[...n.values()],[n]);return ev.createElement(FG,{selected:r,options:o,onChange:l,search:!0})},Aw=function(e){let{number:t,onNumberChange:a}=e,n=(0,ev.useMemo)(()=>{let e=new Map,t=new Intl.NumberFormat;for(let a=0;a<99;a++){let n={value:(a+1).toString(),label:t.format(a+1)};e.set(a+1,n)}return e},[]),l=(0,ev.useMemo)(()=>[...n.values()],[n]),r=(0,ev.useCallback)(e=>{null!=e&&a(parseInt(e.value,10))},[a]),o=(0,ev.useMemo)(()=>n.get(t),[n,t]);return ev.createElement(FG,{selected:o,options:l,onChange:r,search:!0})},AN=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]),AC=function(e){let{ordinal:t,onOrdinalChange:a,max:n}=e,l=(0,ev.useMemo)(()=>{let e=new Map;for(let t=0;t[...l.values()],[l]),o=(0,ev.useCallback)(e=>{null!=e&&a(parseInt(e.value,10))},[a]),i=(0,ev.useMemo)(()=>l.get(t),[t,l]);return ev.createElement(FG,{selected:i,options:r,onChange:o,search:!0})},AM=new Map([[B.Day,{value:B.Day.toString(),label:"Day"}],[B.Week,{value:B.Week.toString(),label:"Week"}],[B.Month,{value:B.Month.toString(),label:"Month"}],[B.Year,{value:B.Year.toString(),label:"Year"}]]),AS=function(e){let{timeUnit:t,onTimeUnitChange:a}=e,n=(0,ev.useMemo)(()=>[...AM.values()],[]),l=(0,ev.useCallback)(e=>{null!=e&&a(parseInt(e.value,10))},[a]),r=(0,ev.useMemo)(()=>AM.get(t),[t]);return ev.createElement(FG,{selected:r,options:n,onChange:l})},AI=function(e){let{weekday:t,onWeekdayChange:a}=e,n=(0,ev.useMemo)(()=>{let e=new Map;e.set("day",{value:"day",label:"Day"});for(let t=0;t<7;t++){let a=eG()().weekday(t),n=a.isoWeekday();7===n&&(n=0),e.set(n,{value:n.toString(),label:a.format("dddd")})}return e},[]),l=(0,ev.useMemo)(()=>[...n.values()],[]),r=(0,ev.useCallback)(e=>{null!=e&&("day"===e.value?a("day"):a(parseInt(e.value,10)))},[a]),o=(0,ev.useMemo)(()=>n.get(t),[t,n]);return ev.createElement(FG,{selected:o,options:l,onChange:r,search:!0})},AD={mode:L.None},AT=(e,t)=>{switch(t.type){case"set_mode":if(t.mode===e.mode)return e;switch(t.mode){case L.Custom:return{mode:L.Custom,endOption:{mode:U.Never},interval:1,intervalUnit:B.Day};case L.Daily:return{mode:L.Daily,interval:1,intervalUnit:B.Day};case L.Weekly:return{mode:L.Weekly,interval:1,intervalUnit:B.Week};case L.Monthly:return{mode:L.Monthly,interval:1,intervalUnit:B.Month};case L.Yearly:return{mode:L.Yearly,interval:1,intervalUnit:B.Year};case L.None:return{mode:L.None}}case"set_interval":{if(e.mode!==L.Custom)return e;let a={...e};return a.interval=t.interval,a}case"set_interval_unit":{if(e.mode!==L.Custom)return e;let a={...e};switch(a.intervalUnit=t.intervalUnit,a.intervalUnit){case B.Day:break;case B.Week:a.weekdays=new Set;break;case B.Month:a.ordinal=1,a.ordinalUnit="day";break;case B.Year:a.month=0,a.ordinal=1,a.ordinalUnit="day"}return a}case"condition_toggle_weekday":{if(e.mode!==L.Custom||e.intervalUnit!==B.Week)return e;let a=e.weekdays??new Set;return a.has(t.weekday)?a.delete(t.weekday):a.add(t.weekday),{...e,weekdays:a}}case"condition_set_month":if(e.mode!==L.Custom||e.intervalUnit!==B.Year)return e;return{...e,month:t.month};case"condition_set_ordinal":{if(e.mode!==L.Custom||e.intervalUnit!==B.Month&&e.intervalUnit!==B.Year)return e;let a={...e};return a.ordinal=t.ordinal,t.ordinal>=5&&"day"!==e.ordinalUnit&&(a.ordinalUnit="day"),a}case"condition_set_ordinal_unit":{if(e.mode!==L.Custom||e.intervalUnit!==B.Month&&e.intervalUnit!==B.Year)return e;let a={...e};return a.ordinalUnit=t.ordinalUnit,"day"!==t.ordinalUnit&&e.ordinal>=5&&(a.ordinal=1),a}case"set_custom_end_mode":{if(e.mode!==L.Custom)return e;let a={...e};switch(t.mode){case U.Never:a.endOption={mode:U.Never};break;case U.After:a.endOption={mode:U.After,countOrdinal:1};break;case U.On:a.endOption={mode:U.On,endDate:eG()()}}return a}case"set_custom_end_date":if(e.mode!==L.Custom||e.endOption.mode!==U.On)return e;return{...e,endOption:{mode:U.On,endDate:t.date}};case"set_custom_count":if(e.mode!==L.Custom||e.endOption.mode!==U.After)return e;return{...e,endOption:{mode:U.After,countOrdinal:t.count}};case"update_state":return t.state}},A$={SU:z.Sunday,MO:z.Monday,TU:z.Tuesday,WE:z.Wednesday,TH:z.Thursday,FR:z.Friday,SA:z.Saturday},AP={6:z.Sunday,0:z.Monday,1:z.Tuesday,2:z.Wednesday,3:z.Thursday,4:z.Friday,5:z.Saturday};function AF(e){return"string"==typeof e?A$[e]:"number"==typeof e?AP[e]:AP[e.weekday]}function AA(e){return Array.isArray(e)?e:[e]}function AR(e){let t=new Set;for(let a of AA(e))t.add(AF(a));return t}let Aj=new Map([[z.Sunday,mX.RRule.SU],[z.Monday,mX.RRule.MO],[z.Tuesday,mX.RRule.TU],[z.Wednesday,mX.RRule.WE],[z.Thursday,mX.RRule.TH],[z.Friday,mX.RRule.FR],[z.Saturday,mX.RRule.SA]]),AO=[31,29,31,30,31,30,31,31,30,31,30,31],AU=function(e){var t,a;let{className:n,recurrence:l,onRecurrenceChange:r,recurrenceCustomEnabled:o,textOverlineCustom:i,textOverlineCustomWeek:s,textOverlineCustomMonthYear:d}=e,c=(0,ev.useMemo)(()=>null==l?{mode:L.None}:function(e){let{interval:t,bymonthday:a,bymonth:n,byweekday:l}=e.origOptions;if(!(null!=t))switch(e.origOptions.freq){case mX.RRule.WEEKLY:return{mode:L.Weekly,interval:1,intervalUnit:B.Week};case mX.RRule.MONTHLY:return{mode:L.Monthly,interval:1,intervalUnit:B.Month};case mX.RRule.YEARLY:return{mode:L.Yearly,interval:1,intervalUnit:B.Year};default:return{mode:L.Daily,interval:1,intervalUnit:B.Day}}let r=t??1,o=function(e){let{until:t,count:a}=e.origOptions;return null!=t?{mode:U.On,endDate:eG()(t)}:null!=a?{mode:U.After,countOrdinal:a}:{mode:U.Never}}(e);switch(e.origOptions.freq){case mX.RRule.WEEKLY:{let e=AR(l??[]);return{mode:L.Custom,endOption:o,interval:r,intervalUnit:B.Week,weekdays:e}}case mX.RRule.MONTHLY:{let e=1,t="day";if(null!=a)Array.isArray(a)?(console.warn("multiple days per month are not supported"),e=1,t="day"):e=a,t="day";else if(null!=l){let a;t=AF(a=Array.isArray(l)?l[0]:l),"object"==typeof a&&null!=a.n&&(e=a.n)}return{mode:L.Custom,endOption:o,interval:r,intervalUnit:B.Month,ordinal:e,ordinalUnit:t}}case mX.RRule.YEARLY:{let e=1,t="day",i=1;if(null==n||Array.isArray(n)?console.error("unsupported rrule"):i=n-1,null==a||Array.isArray(a)){let a=AA(l??[])[0];null!=a&&"object"==typeof a&&"n"in a&&(e=a.n??1);let n=[...AR(l??[])][0];null==n?console.error("unsupported rrule"):t=n}else e=a,t="day";return{mode:L.Custom,endOption:o,interval:r,intervalUnit:B.Year,month:i,ordinal:e,ordinalUnit:t}}default:return{mode:L.Custom,endOption:o,interval:r,intervalUnit:B.Day}}}((0,mX.rrulestr)(l)),[l]),[m,u]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:AD;return(0,ev.useReducer)(AT,e)}(c),p=(0,e$.useDispatch)(),g=(0,ev.useCallback)(e=>{if(!0!==o&&e===L.Custom){p(d4());return}u({type:"set_mode",mode:e})},[u,o,p]),f=(0,ev.useCallback)(e=>{u({type:"set_interval",interval:e})},[u]),h=(0,ev.useCallback)(e=>{u({type:"set_interval_unit",intervalUnit:e})},[u]),y=(0,ev.useCallback)(e=>{u({type:"condition_set_ordinal_unit",ordinalUnit:e})},[u]),b=(0,ev.useCallback)(e=>{u({type:"condition_set_ordinal",ordinal:e})},[u]),v=(0,ev.useCallback)(e=>{u({type:"condition_set_month",month:e})},[u]),k=(0,ev.useCallback)(e=>{u({type:"condition_toggle_weekday",weekday:e})},[u]),E=(0,ev.useCallback)(e=>{u({type:"set_custom_end_mode",mode:e})},[u]),x=(0,ev.useCallback)(e=>{u({type:"set_custom_end_date",date:e})},[u]),_=(0,ev.useCallback)(e=>{u({type:"set_custom_count",count:e})},[u]);(0,ev.useEffect)(()=>{u({type:"update_state",state:c})},[c,u]),(0,ev.useEffect)(()=>{let e=function(e){switch(e.mode){case L.None:return null;case L.Daily:return new mX.RRule({freq:mX.RRule.DAILY,interval:void 0});case L.Weekly:return new mX.RRule({freq:mX.RRule.WEEKLY,byweekday:[],bymonthday:[],interval:void 0});case L.Monthly:return new mX.RRule({freq:mX.RRule.MONTHLY,bymonthday:[],interval:void 0});case L.Yearly:return new mX.RRule({freq:mX.RRule.YEARLY,bymonthday:[],interval:void 0})}let t={interval:e.interval};switch(e.intervalUnit){case B.Day:t.freq=mX.RRule.DAILY;break;case B.Week:if(t.freq=mX.RRule.WEEKLY,e.weekdays.size>0)for(let a of(t.byweekday=[],e.weekdays.values())){let e=Aj.get(a);null!=e&&t.byweekday.push(e)}break;case B.Month:(t.freq=mX.RRule.MONTHLY,"day"===e.ordinalUnit)?t.bymonthday=e.ordinal:t.byweekday=Aj.get(e.ordinalUnit)?.nth(e.ordinal);break;case B.Year:(t.freq=mX.RRule.YEARLY,t.bymonth=e.month+1,"day"===e.ordinalUnit)?t.bymonthday=e.ordinal:t.byweekday=Aj.get(e.ordinalUnit)?.nth(e.ordinal)}switch(e.endOption.mode){case U.Never:break;case U.After:t.count=e.endOption.countOrdinal;break;case U.On:t.until=e.endOption.endDate.toDate()}return new mX.RRule(t)}(m);r(e?.toString?.()??null)},[m,r]);let w=(0,ev.useMemo)(()=>{let e=[];for(let t=0;t<7;t++)e.push(eG()().weekday(t));return e},[]);return ev.createElement(FB,{className:n},ev.createElement(FV,null,ev.createElement(FH,null),ev.createElement(Ax,{mode:m.mode,onModeChange:g,recurrenceCustomEnabled:o})),m.mode===L.Custom&&ev.createElement(FW,null,ev.createElement(Fz,null,i??"Repeat Every"),ev.createElement(FV,null,ev.createElement(Aw,{number:m.interval,onNumberChange:f}),ev.createElement(AS,{timeUnit:m.intervalUnit,onTimeUnitChange:h})),m.intervalUnit===B.Week&&ev.createElement(ev.Fragment,null,ev.createElement(Fz,null,s??"On"),ev.createElement(Fq,null,w.map((e,t)=>{let a=e.isoWeekday();return 7===a&&(a=0),ev.createElement(FK,{key:t,onClick:()=>k(a),$selected:m.weekdays.has(a)},e.format("dd"))}))),m.intervalUnit===B.Year&&ev.createElement(FV,null,ev.createElement(A_,{month:m.month,onMonthChange:v})),(m.intervalUnit===B.Month||m.intervalUnit===B.Year)&&ev.createElement(ev.Fragment,null,ev.createElement(Fz,null,d??"On The"),ev.createElement(FV,null,ev.createElement(AC,{ordinal:m.ordinal,onOrdinalChange:b,max:(t=m.ordinalUnit,a=m.intervalUnit===B.Year?m.month:void 0,"day"===t?null!=a?AO[a]:31:4)}),ev.createElement(AI,{weekday:m.ordinalUnit,onWeekdayChange:y}))),ev.createElement(Fz,null,i??"Ends"),ev.createElement(FV,null,ev.createElement(Af,{endOption:m.endOption,onModeChange:E,onDateChange:x,onCountChange:_}))))},AZ={"Europe/Kiev":{ianaCode:"Europe/Kyiv"}},AL=(0,la.ZP)` + query MeTimezoneQuery { + me { + id + timezone + } + } +`;function AB(){let e=(0,eK.Z)(),{data:t}=(0,eB.a)(AL),a=t?.me?.timezone??null;return ev.useMemo(()=>{let t={};for(let n of eG().tz.names())t[n]={ianaCode:n,humanReadableLabel:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=eG().tz(e).format("Z"),l=e;if(e in AZ){let n=AZ[e],r=new Set(n.disabledLocales??[]),o=new Set(n.disabledTimezones??[]),i=r.has(t),s=null!=a&&o.has(a);i||s||(l=n.ianaCode)}return l=l.replace(/_/g," "),`${l} (GMT${n})`}(n,e.locale,a)};return{timezonesMap:t}},[e.locale,a])}let Az=eL.default.div.withConfig({displayName:"TimezoneSelect__Wrapper",componentId:"sc-40ce2ea0-0"})` + display: flex; + align-items: center; + + padding: 5px 20px; +`,AV=(0,eL.default)(tn.Icon).withConfig({displayName:"TimezoneSelect__StyledIcon",componentId:"sc-40ce2ea0-1"})` + margin-right: 10px; + + path { + fill: ${e=>e.theme.appColors.hex(20)}; + } +`,Aq=(0,eL.default)(FL).withConfig({displayName:"TimezoneSelect__StyledSelect",componentId:"sc-40ce2ea0-2"})` + margin-bottom: 0; + flex-grow: 1; +`,AW=function(e){let{className:t,timezone:a,onTimezoneChange:n}=e,{timezonesMap:l}=AB(),r=(0,ev.useMemo)(()=>{let e=new Map;for(let[t,a]of Object.entries(l))e.set(t,{value:a.ianaCode,label:a.humanReadableLabel});return e},[l]),o=(0,ev.useMemo)(()=>[...r.values()],[r]),i=(0,ev.useMemo)(()=>r.get(a),[r,a]),s=(0,ev.useCallback)(e=>{null!=e&&n(e.value)},[n]);return ev.createElement(Az,{className:t},ev.createElement(AV,{icon:"dd_language"}),ev.createElement(Aq,{selected:i,search:!0,options:o,onChange:s}))},AH=(0,eL.css)` + caption { + padding: 0; + } + + label { + margin: 0; + } +`,AG=eL.default.div.withConfig({displayName:"styled__ConfiguratorWrapper",componentId:"sc-5cbc35b3-0"})` + display: flex; + flex-direction: column; + overflow: hidden; + + ${AH} +`,AK=eL.default.div.withConfig({displayName:"styled__PickerContent",componentId:"sc-5cbc35b3-1"})` + display: flex; + flex-direction: column; + max-height: 80vh; + overflow-y: auto; + ${tM} + + & > :last-child { + margin-bottom: 56px; + } +`,AY=(0,eL.default)(Cg).withConfig({displayName:"styled__StyledMenuButton",componentId:"sc-5cbc35b3-2"})` + display: flex; + width: 100%; + align-items: center; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,AQ=(0,eL.default)(tn.Icon).attrs({icon:"date_remove"}).withConfig({displayName:"styled__RemoveIcon",componentId:"sc-5cbc35b3-3"})` + transform: var(--menu-item-icon-scale); + color: ${eI.ThemeColors.danger}; + margin-right: var(--menu-item-gap); +`,AJ=(0,eL.default)(e1.MenuItem).withConfig({displayName:"styled__RemoveMenuItemText",componentId:"sc-5cbc35b3-4"})` + ${e1.UiTypography.sm}; + color: ${eI.ThemeColors.danger}; +`,AX=eL.default.div.withConfig({displayName:"styled__ButtonWrapper",componentId:"sc-5cbc35b3-5"})` + display: grid; + width: calc(100% - 2px); + grid-template-columns: 1fr 1fr; + column-gap: ${eI.UiSpacing.getPx(2)}; + padding: 20px; + background: ${e=>e.theme.isNightMode?"rgba(23,25,28,0.8)":"rgba(255,255,255,0.8)"}; + position: absolute; + bottom: 1px; + border-radius: 0 0 10px 10px; +`,A0=(0,eL.default)(Cg).withConfig({displayName:"styled__ButtonBase",componentId:"sc-5cbc35b3-6"})` + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(3)}; + + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + font-weight: 500; +`,A1=(0,eL.default)(A0).withConfig({displayName:"styled__CTAButton",componentId:"sc-5cbc35b3-7"})` + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + + opacity: ${e=>e.$disabled?.5:1}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,A2=(0,eL.default)(A0).withConfig({displayName:"styled__ExitButton",componentId:"sc-5cbc35b3-8"})` + background-color: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(40)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(70)}; + } +`,A5=eL.default.div.withConfig({displayName:"styled__CalendarPickerWrapper",componentId:"sc-5cbc35b3-9"})` + margin: 0 ${eI.UiSpacing.getPx(3.5)} ${eI.UiSpacing.getPx(3)}; +`,A3=eL.default.div.withConfig({displayName:"styled__RecurrenceConfiguratorWrapper",componentId:"sc-5cbc35b3-10"})` + margin: 0 ${eI.UiSpacing.getPx(3.5)} ${eI.UiSpacing.getPx(1.5)}; +`,A4=eL.default.p.withConfig({displayName:"styled__ErrorMessage",componentId:"sc-5cbc35b3-11"})` + ${e1.UiTypography.sm} + color: ${eI.ThemeColors.danger}; + border: 1px solid ${eI.ThemeColors.danger}; + border-radius: 10px; + margin: 0 20px; + padding: 5px 0; + display: flex; + justify-content: center; +`,A6=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-dc1a1f3c-0"})` + background-color: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiBorderRadius.lg}; + padding: var(--menu-padding); + min-width: ${eI.UiSpacing.getPx(80)}; + + display: flex; + flex-direction: column; +`,A8=(0,eL.css)` + transform: var(--menu-item-icon-scale); + color: ${e=>e.theme.appColors.hex(10)}; +`,A7=(0,eL.default)(tn.Icon).attrs({icon:"date_timezone"}).withConfig({displayName:"styled__GlobeIcon",componentId:"sc-dc1a1f3c-1"})` + ${A8}; + margin-right: var(--menu-item-gap); +`,A9=(0,eL.default)(tn.Icon).attrs({icon:"date_caret"}).withConfig({displayName:"styled__CaretIcon",componentId:"sc-dc1a1f3c-2"})` + ${A8}; + margin-left: auto; +`,Re=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__StyledOverline",componentId:"sc-dc1a1f3c-3"})` + margin: 0 20px; +`,Rt=(0,eL.default)(AY).withConfig({displayName:"styled__TimezoneMenuButton",componentId:"sc-dc1a1f3c-4"})` + width: 100%; + padding: 4px 21px 4px 14px; + margin-top: 8px; + + ${e=>e.$active&&(0,eL.css)` + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + `} +`,Ra=function(e){let{initialFocus:t,startTimezone:a,endTimezone:n,onStartTimezoneChange:l,onEndTimezoneChange:r}=e,o=ev.useContext(eI.MenuGroupContext),i=ev.useCallback(e=>{o?.(e)},[o]),s=(0,ev.useCallback)(e=>{l?.(e)},[l]),d=(0,ev.useCallback)(e=>{r?.(e)},[r]);return ev.createElement(eI.MenuGroupContext.Provider,{value:i},ev.createElement(A6,{initialFocus:t,isSubmenu:!0,onMouseDown:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()}},null!=a&&ev.createElement(ev.Fragment,null,ev.createElement(Re,null,ev.createElement(eY.Z,{id:"general.start_date",defaultMessage:"Start Date"})),ev.createElement(AW,{timezone:a,onTimezoneChange:s})),null!=n&&ev.createElement(ev.Fragment,null,ev.createElement(Re,null,ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})),ev.createElement(AW,{timezone:n,onTimezoneChange:d}))))};function Rn(){return[{name:"offset",options:{offset:[0,-2]}},{name:"flip",options:{fallbackPlacements:["right-start"]}}]}let Rl=ev.forwardRef(function(e,t){let{startTimezone:a,endTimezone:n,onStartTimezoneChange:l,onEndTimezoneChange:r}=e,[o,i]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),s=ev.useRef(null),d=(0,ev.useRef)(null),c=ev.useRef(null);(0,ev.useImperativeHandle)(t,()=>({focus:()=>{d.current?.focus?.()}}));let{props:m}=(0,eI.useMenuButton)({dispatch:i,ref:d,state:o}),u=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:o,placement:"left-start",computeModifiersCallback:Rn}),p=ev.useCallback(()=>{o.expanded&&s.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[o.expanded]),g=ev.useCallback(()=>{d.current?.focus()},[]);return(0,eI.usePopupEvents)({state:o,onCollapse:g}),ev.createElement(ev.Fragment,null,ev.createElement(Rt,{onFocus:p,...m,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:case eI.KeyboardKeys.ArrowDown:break;default:m.onKeyDown(e)}},$active:o.expanded},ev.createElement(A7,null),ev.createElement(eY.Z,{id:"general.timezone",defaultMessage:"Time zone"}),ev.createElement(A9,null)),o.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:i},ev.createElement(Ra,{initialFocus:u.initialFocus,startTimezone:a,endTimezone:n,onStartTimezoneChange:l,onEndTimezoneChange:r})))}),Rr=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-4a25fa1e-0"})` + display: flex; + padding: 0 14px; +`,Ro=eL.default.div.withConfig({displayName:"styled__RemindersList",componentId:"sc-4a25fa1e-1"})` + display: flex; + flex-direction: column; + margin-left: var(--menu-item-gap); + row-gap: 4px; +`,Ri=(0,eL.default)(FL).withConfig({displayName:"styled__StyledSelect",componentId:"sc-4a25fa1e-2"})` + width: 100%; +`,Rs=(0,eL.default)(tn.Icon).attrs({icon:"dd_notifications"}).withConfig({displayName:"styled__BellIcon",componentId:"sc-4a25fa1e-3"})` + transform: var(--menu-item-icon-scale); + color: ${e=>e.theme.textColors.hex(10)}; +`,Rd=(0,eL.default)(tn.Icon).attrs({icon:"dd_new",width:16,height:16}).withConfig({displayName:"styled__AddIcon",componentId:"sc-4a25fa1e-4"})` + margin-right: 4px; +`,Rc=eL.default.button.withConfig({displayName:"styled__AddButton",componentId:"sc-4a25fa1e-5"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + padding: 2px 0; + + &:hover { + text-decoration: underline; + } +`;function Rm(e,t,a){switch(a){case"minute":{let a={action:"notification",trigger:{related:"start",at:{period:`-PT${t}M`}}};return{label:e.formatMessage({id:"general.remind_before_minutes",defaultMessage:`{duration, plural, + =0 {0 minutes} + one {1 minute} + other {# minutes}} + before`},{duration:t}),value:JSON.stringify(a)}}case"hour":{let a={action:"notification",trigger:{related:"start",at:{period:`-PT${t}H`}}};return{label:e.formatMessage({id:"general.remind_before_hours",defaultMessage:`{duration, plural, + =0 {0 hours} + one {1 hour} + other {# hours}} + before`},{duration:t}),value:JSON.stringify(a)}}case"day":{let a={action:"notification",trigger:{related:"start",at:{period:`-P${t}D`}}};return{label:e.formatMessage({id:"general.remind_before_days",defaultMessage:`{duration, plural, + =0 {0 days} + one {1 day} + other {# days}} + before`},{duration:t}),value:JSON.stringify(a)}}}}let Ru=function(e){let{value:t,onSelect:a,onSelectNone:n,virtual:l}=e,r=(0,eK.Z)(),o=(0,ev.useMemo)(()=>[{label:l?r.formatMessage({id:"general.no_notification",defaultMessage:"No notification"}):r.formatMessage({id:"general.none",defaultMessage:"None"}),value:""},{label:r.formatMessage({id:"general.remind_at_time_of_event",defaultMessage:"At time of event"}),value:JSON.stringify(hR.SE)},Rm(r,5,"minute"),Rm(r,10,"minute"),Rm(r,15,"minute"),Rm(r,30,"minute"),Rm(r,1,"hour"),Rm(r,1,"day")],[r,l]),i=(0,ev.useMemo)(()=>null==t?o[0]:o.find(e=>{if(""===e.value)return!1;let a=JSON.parse(e.value);return bW()(a,t)})??null,[t,o]),s=(0,ev.useCallback)(e=>{if(null!=e){if(""===e.value){n();return}a(JSON.parse(e.value))}},[a,n]);return ev.createElement(Ri,{selected:i,options:o,onChange:s})},Rp=function(e){let{alarm:t,index:a,onSelect:n,onDelete:l,virtual:r}=e,o=(0,ev.useCallback)(e=>{n(a,e)},[n,a]),i=(0,ev.useCallback)(()=>{l(a)},[a,l]);return ev.createElement(Ru,{value:t,onSelect:o,onSelectNone:i,virtual:r})},Rg=function(e){let{alarms:t,taskadePlanType:a,onAlarmsChange:n}=e,l=fR.Vl.getFeature("node.reminder.limit").plans[a],r=(0,ev.useCallback)((e,a)=>{let l=[...t];l.splice(e,1,a),n(l)},[t,n]),o=(0,ev.useCallback)(e=>{let a=[...t];a.splice(e,1),n(a)},[t,n]),i=(0,ev.useCallback)(e=>{e.stopPropagation()},[]);return ev.createElement(Rr,{onKeyDown:i},ev.createElement("div",null,ev.createElement(Rs,null)),ev.createElement(Ro,null,0===t.length&&ev.createElement(Rp,{index:0,onSelect:r,onDelete:o,virtual:!0}),t.map((e,t)=>ev.createElement(Rp,{key:t,alarm:e,index:t,onSelect:r,onDelete:o})),t.length{n([...t,{action:"notification",trigger:{related:"start",at:{period:"-PT5M"}}}])}},ev.createElement(Rd,null),ev.createElement(eY.Z,{id:"general.add_notification",defaultMessage:"Add notification"}))))},Rf=ev.forwardRef(function(e,t){let{onClick:a}=e;return ev.createElement(AY,{tabIndex:0,onClick:a,ref:t},ev.createElement(AQ,null),ev.createElement(AJ,null,ev.createElement(eY.Z,{id:"general.remove",defaultMessage:"Remove"})))}),Rh=(0,la.ZP)` + query MeTimezoneQuery { + me { + id + timezone + } + } +`,Ry=(e,t)=>{switch(t.type){case"set_calendar_picker_data":{let{startDate:a,startTime:n,endDate:l,endTime:r}=t;return{...e,startDate:a,startTime:n,endDate:l,endTime:r}}case"set_recurrence":return{...e,recurrence:t.recurrence};case"set_start_timezone":return{...e,startTimezone:t.timezone};case"set_end_timezone":return{...e,endTimezone:t.timezone};case"swap_timezones":return{...e,startTimezone:e.endTimezone,endTimezone:e.startTimezone};case"set_alarms":return{...e,alarms:t.alarms}}},Rb=(0,tB.P1)([iF,function(e,t){return t.nodeIds}],(e,t)=>{let a=new Map;for(let n of t)for(let t of e?.[n]?.dates?.attachments??[]){let e=a.get(n)??[];e.push(t),a.set(n,e)}return a}),Rv=function(e,t){let a=(0,mX.rrulestr)(e);if(null==a.origOptions.until)return!0;let n=cc()(a.origOptions.until);return!ez.DateTimeDescHelpers.toMoment(t).isSameOrAfter(n)},Rk=(0,e$.connect)(function(e,t){return{dueDatesByNodeId:Rb(e,t)}})(function(e){let{nodeIds:t,onExit:a,projectId:n,dueDatesByNodeId:l}=e,[o,d]=(0,ev.useState)(!1),c=(0,eK.Z)(),m=(0,ev.useMemo)(()=>(function(e){let t=0;for(let[a,n]of e.entries())t+=n.length;if(0===t)return{startDate:null,startTime:null,endDate:null,endTime:null,recurrence:null,startTimezone:null,endTimezone:null,alarms:[hR.SE]};let a={};for(let[t,n]of e.entries())for(let e of n){let t=JSON.stringify(e.addonDate),n=a[t]??0;n+=1,a[t]=n}let n=null,l=0;for(let[e,t]of Object.entries(a))t>l&&(n=JSON.parse(e),l=t);if(null==n)return{startDate:null,startTime:null,endDate:null,endTime:null,recurrence:null,startTimezone:null,endTimezone:null,alarms:[hR.SE]};let{start:r,end:o}=n,i=ez.DateDuration.fromDateRangeDesc({start:r,end:o}).toDisplayState(),s="recurrence"in n?n.recurrence?.rruleSet?.join?.("\n")??null:null,d=n.reminders?.alarms??[hR.SE];return{...i,recurrence:s,alarms:d}})(l),[l]),{data:u}=(0,eB.a)(Rh,{skip:null!=m.startTimezone&&null!=m.endTimezone}),[p,g]=(0,ev.useReducer)(Ry,m);(0,ev.useEffect)(()=>{let e=eG().tz.guess(),t=u?.me?.timezone??e;null==p.startTimezone&&g({type:"set_start_timezone",timezone:t}),null==p.endTimezone&&g({type:"set_end_timezone",timezone:t})},[u,p]);let{pickerProps:f,dispatch:h,output:y}=nx({pickerMode:r.End,startDate:null!=p.startDate?eG()(p.startDate):null,startTime:p.startTime,endDate:null!=p.endDate?eG()(p.endDate):null,endTime:p.endTime,quirks:{disableTime:!1,dateDependencyMode:i.MustHaveEnd,sameDateNoTimeResolutionStrategy:s.EndDate,autoSwitchMode:!1}});(0,ev.useEffect)(()=>{let{startDate:e,startTime:t,endDate:a,endTime:n}=p;d(!1),h({type:"update_state",startDate:e,startTime:t,endDate:a,endTime:n})},[p,h]);let b=(0,ev.useRef)(null!=p.endDate&&null!=p.startDate);(0,ev.useEffect)(()=>{let{startDate:e,startTime:t,endDate:a,endTime:n}=y;if(null==ez.DateDuration.fromDisplayState({startDate:e,startTime:t,endDate:a,endTime:n,startTimezone:p.startTimezone,endTimezone:p.endTimezone}))return;let l=b.current;g({type:"set_calendar_picker_data",startDate:e,startTime:t,endDate:a,endTime:n});let r=null!=e&&null!=a;b.current=r,r&&!l?g({type:"swap_timezones"}):l&&!r&&g({type:"swap_timezones"})},[p.startTimezone,p.endTimezone,y]);let{setDueDate:v,removeDueDate:k}=FS(n),E=async()=>{k(t),a?.()},x=(0,ev.useCallback)(e=>{d(!1),g({type:"set_recurrence",recurrence:e})},[g]),_=l.size>0,w=(0,ev.useCallback)(e=>{g({type:"set_start_timezone",timezone:e})},[g]),N=(0,ev.useCallback)(e=>{g({type:"set_end_timezone",timezone:e})},[g]),C=e=>{e.key!==eI.KeyboardKeys.Escape&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())},M=eG().localeData().longDateFormat("L"),S=`e.g. ${eG()("2:30 AM","hh:mm A").format("LT")}`,I=(0,ev.useRef)(null),D=(0,ev.useRef)(null),T=(0,ev.useRef)(null),$=(0,ev.useCallback)(e=>{g({type:"set_alarms",alarms:e})},[]),P=gV(),F=d6()&&!hA(P.type);return ev.createElement(eI.Menu,{isSubmenu:!0,initialFocus:"first"},ev.createElement(AG,null,ev.createElement(AK,null,ev.createElement(A5,{ref:I,onKeyDown:C},ev.createElement(ny,{pickerProps:f,focusPlaceholderDateStart:M,focusPlaceholderDateEnd:M,focusPlaceholderTimeStart:S,focusPlaceholderTimeEnd:S,formatDate:M,formatTime:"LT"})),ev.createElement(A3,{onKeyDown:C},ev.createElement(AU,{recurrence:p.recurrence,onRecurrenceChange:x,recurrenceCustomEnabled:!F,textOverlineCustomWeek:c.formatMessage({id:"general.on_these_days",defaultMessage:"On these days"})})),o&&ev.createElement(A4,null,ev.createElement(eY.Z,{id:"general_dac_recurrence_error",defaultMessage:"Invalid recurrence input."})),ev.createElement(ev.Fragment,null,ev.createElement(Rg,{alarms:p.alarms,taskadePlanType:P.taskadePlanType??"free",onAlarmsChange:$}),(null!=p.startDate||null!=p.endDate)&&ev.createElement(Rl,{ref:D,startTimezone:null!=p.startDate?p.startTimezone:null,endTimezone:p.endTimezone,onStartTimezoneChange:w,onEndTimezoneChange:N}),_&&ev.createElement(Rf,{onClick:E,ref:T}))),ev.createElement(AX,null,ev.createElement(A2,{onClick:a},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})),ev.createElement(A1,{$disabled:null==p.startDate&&null==p.endDate,onClick:e=>{let{startDate:n,startTime:l,endDate:r,endTime:o,startTimezone:i,endTimezone:s,recurrence:c}=p,m=ez.DateDuration.fromDisplayState({startDate:n,startTime:l,endDate:r,endTime:o,startTimezone:i,endTimezone:s});if(null==m)return;let u=m.toDateRangeDesc();if(null!=c&&!Rv(c,u.start)){d(!0);return}v(t,{start:u.start,end:u.end,reminders:{alarms:p.alarms},recurrence:null!=c?{rruleSet:[c]}:void 0}),a?.(e)}},ev.createElement(eY.Z,{id:"general.save",defaultMessage:"Save"})))))});!function(e){e[e.HasStarted=0]="HasStarted",e[e.HasEnded=1]="HasEnded",e[e.Upcoming=2]="Upcoming",e[e.Completed=3]="Completed"}(V||(V={}));let RE=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__AddonButtonIcon",componentId:"sc-999dca1-0"})` + flex-shrink: 0; + margin-right: ${e=>e.$noDate?"0px":"4px"}; + path { + stroke: ${e=>e.theme.appColors.hex(60)}; + } +`,Rx=eL.default.button.withConfig({displayName:"styled__AddonButton",componentId:"sc-999dca1-1"})` + display: flex; + align-items: center; + align-self: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + position: relative; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + ${e=>{let t;switch(e.$state){case V.HasEnded:t=(0,eI.getColorScheme)(eI.ThemeColors.danger);break;case V.Completed:return(0,eL.css)` + color: ${e.theme.textColors.hex(60)}; + background: none; + + &:hover { + color: ${e.theme.textColors.hex(10)}; + } + `}return null!=t?(0,eL.css)` + border-color: ${t?.alpha50}; + background-color: ${e.$active?t?.alpha20:t?.alpha10}; + color: ${t?.base}; + + &:hover { + border-color: ${t?.alpha80}; + } + `:null}} +`,R_=eL.default.span.withConfig({displayName:"styled__AddonButtonText",componentId:"sc-999dca1-2"})` + ${e1.UiTypography.xs}; +`,Rw=eL.default.div.withConfig({displayName:"styled__TooltipReference",componentId:"sc-999dca1-3"})` + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; +`,RN=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-999dca1-4"})` + width: ${eI.UiSpacing.getPx(64)}; + background: none; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + padding: ${eI.UiSpacing.getPx(3.5)} 0; + & .arrow { + display: none; + } +`,RC=ev.forwardRef(function(e,t){let{icon:a,text:n,state:l,active:r,disabled:o}=e,[i,s]=(0,ev.useState)(!1),d=(0,ev.useRef)(null),c=(0,ev.useRef)(null),m=(0,ev.useRef)(null),{arrowProps:u,popperProps:p,referenceProps:g}=(0,eI.useControlledTooltip)({referenceElementRef:d,arrowElementRef:c,popperElementRef:m,placement:"top",visible:i});return ev.createElement("div",null,ev.createElement(Rx,{...e,ref:t,$state:l,$active:r,disabled:o},ev.createElement(Rw,{...g,onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)}}),ev.createElement(RE,{icon:a,$noDate:0===n.length}),ev.createElement(R_,null,n)),i&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})))}),RM=(0,e$.connect)(function(e){return{isLoggedIn:t9(e)}})(function(e){let{projectId:t,nodeId:a,popupState:n,popupDispatch:l,dateAttachment:r,isLoggedIn:o,readOnly:i,nodeCompleted:s}=e,d=(0,e$.useDispatch)(),c=ev.useRef(null),m=ev.useRef(null),u=(0,eI.usePopup)({referenceElementRef:c,popupElementRef:m,state:n,placement:"bottom",computeModifiersCallback:tr}),p=(0,eI.useMenuButton)({dispatch:l,ref:c,state:n,onClick:e=>{null==t&&(e.preventDefault(),d(Fd()))}}),g=ev.useCallback(e=>{switch(e.type){case"Activate":break;case"Dismiss":l({type:"Collapse"})}},[l]),f=(0,ev.useMemo)(()=>{if(null==r)return{text:"",state:V.Upcoming};let{start:e,end:t}=r.addonDate,a=ez.DateDuration.fromDateRangeDesc({start:e,end:t}),n=V.Upcoming;switch(a.toRelativeStatus()){case"has_ended":n=V.HasEnded;break;case"has_started":n=V.HasStarted}return s&&(n=V.Completed),{text:a.toReadableFormat(),state:n}},[r,s]),h=r?.addonDate!=null&&"recurrence"in r.addonDate,y=(0,ev.useMemo)(()=>[a],[a]),b=(0,ev.useCallback)(()=>{l({type:"Collapse"})},[l]);return ev.createElement(ev.Fragment,null,ev.createElement(RC,{...p.props,icon:h?"addon_date_repeat":"addon_date",text:f.text,state:f.state,active:n.expanded,disabled:i,onClick:e=>{if(!i){if(!o){d(rh({isOpen:!0,activeView:rI}));return}p.props.onClick(e)}}}),n.expanded&&null!=t&&ev.createElement(eI.Popup,{...u.props,dispatch:l,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:g},ev.createElement(RN,{initialFocus:u.initialFocus,loop:!0,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseUp:e=>{requestAnimationFrame(()=>{u.popper.instanceRef.current?.update()})}},ev.createElement(Rk,{nodeIds:y,projectId:t,onExit:b})))))});function RS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;for(let t of e.value.marks.filter(e=>"link"===e.type))e.removeMark(t);if(eu()(t))e.collapseToEnd(),e.focus();else{let a=eg.vc.create({data:t,type:"link"});e.toggleMark(a),e.collapseToEnd(),e.toggleMark(a),e.insertText(" "),e.focus()}}function RI(e,t,a,n){e.deleteAtRange(eg.e6.create(n)),e.insertText(t),e.extend(-t.length),e.call(RS,a)}function RD(e,t){for(let t of e.value.marks.filter(e=>e?.type==="mention").toArray())e.removeMark(t);let a=eg.vc.create({type:"mention",data:t});return e.toggleMark(a),e.collapseToEnd(),e.toggleMark(a),e.insertText(" "),e.focus(),e}function RT(e,t,a){e.deleteAtRange(eg.e6.create(a)),e.insertText(`@${t}`),e.extend(-t.length-1),e.call(RD,{mention:!0})}function R$(e,t,a){e.deleteAtRange(eg.e6.create(a)),e.insertText(`#${t} `)}function RP(e,t,a){e.deleteAtRange(eg.e6.create(a)),e.insertText(t)}let RF=PB.map(e=>(0,eI.getHslColorScale)(e).hex("80"));function RA(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{document:n,selection:l}=e.value,r=null,o=null;l.isCollapsed?(o=l.moveToRangeOf(n),r=n.getMarksAtRange(o)):r=e.value.marks;let i={type:t};eu()(a)||(i.data=a);let s=eg.vc.create(i),d=r.some(e=>e.equals(s)),c=r.filter(e=>e.type===s.type);if("highlight"===s.type&&eu()(s.data.get("colorName"))&&1===c.count()){let t=c.first(),a=function(e){let t=RF.indexOf(e);return -1===t?null:RF[t+1]||null}(t.data.get("colorName")||RF[0]),n=eg.vc.create({data:{colorName:a},type:"highlight"});a?eu()(o)?(e.removeMark(t),e.addMark(n)):(e.removeMarkAtRange(o,t),e.addMarkAtRange(o,n)):eu()(o)?e.toggleMark(t):e.toggleMarkAtRange(o,t)}else if("link"===s.type&&null==a&&1===c.count()){let t=c.first();eu()(o)?e.removeMark(t):e.removeMarkAtRange(o,t)}else if(d&&1===c.count())eu()(o)?e.toggleMark(s):e.toggleMarkAtRange(o,s);else if(c.count()>0)eu()(o)?(c.forEach(t=>e.removeMark(t)),e.addMark(s)):(c.forEach(t=>e.removeMarkAtRange(o,t)),e.addMarkAtRange(o,s));else if("highlight"===s.type&&eu()(s.data.get("colorName"))&&0===c.count()){let t=eg.vc.create({data:{colorName:RF[0]},type:"highlight"});eu()(o)?(e.removeMark(s),e.addMark(t)):(e.removeMarkAtRange(o,s),e.addMarkAtRange(o,t))}else eu()(o)?e.toggleMark(s):e.toggleMarkAtRange(o,s)}var RR=a(84729),Rj=a.n(RR);let RO=(0,eV.TB)("down"),RU=(0,eV.TB)("right"),RZ=(0,eV.TB)("up"),RL=(0,eV.TB)("left"),RB=(0,eV.ZP)("mod+/"),Rz=(0,eV.ZP)("mod+'");var RV=a(57150);function Rq(e){u$?.track("Node Pasted Contents",{type:e,version:2},{context:{}})}function RW(e,t){if(null!=t.onPaste){let a=e.text??"",{plainTextAst:n,markdownText:l}=(0,lo.plainTextToMarkdownText)(a);if(n.data?.singleLineParagraph){let e=n.children[0];if(null==e)return!1;let a=(0,ld.Z)(),l=(0,ld.Z)(),r=li.Contents.create({rootID:a,nodes:{[a]:{id:a,collapsed:!1,completed:!1,children:[l],text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]}},[l]:{id:a,collapsed:!1,completed:!1,children:[],text:{ops:[{insert:e.value},{insert:"\n",attributes:{paragraph:!0}}]}}}});return t.onPaste(r),!0}let r=(0,lo.markdownTextToTaskastFragment)(l);return!(0,lr.isFragmentEmpty)(r)&&(t.onPaste({type:"application/vnd.taskade.taskast",fragment:r}),!0)}return!1}let RH={OnBackspace:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,eV.ZP)("backspace"),a=(0,eV.ZP)("mod+shift+backspace");return{onKeyDown(n,l){switch(!0){case t(n):if(l.value.selection.isAtStartOf(l.value.document))return n.preventDefault(),e.onBackspace&&e.onBackspace(),l;return;case a(n):return n.preventDefault(),e.onForceBackspace&&e.onForceBackspace(),l;default:return}}}},OnEnter:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,eV.ZP)("mod+enter"),a=(0,eV.ZP)("enter"),n=(0,eV.ZP)("mod+shift+enter"),l=(0,eV.ZP)("shift+enter");return{onKeyDown(r,o){switch(!0){case a(r):if(r.preventDefault(),e.onEnter&&e.onEnter())return o;break;case n(r):if(r.preventDefault(),e.onModShiftEnter&&e.onModShiftEnter())return o;break;case t(r):if(r.preventDefault(),e.onComplete&&e.onComplete())return o;break;case l(r):if(r.preventDefault(),e.onShiftEnter&&e.onShiftEnter())return o;break;default:return"Enter"===r.key?o:void 0}return console.warn("Event sent to `OnEnter` plugin is unhandled. Automatically consume the event to prevent unexpected outcome."),o}}},OnEscape:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,eV.ZP)("esc");return{onKeyDown(a,n){if(t(a)){if(n.value.isCollapsed)return n.blur();{let t=Rj()(e.toEdge||n.value.isForward?"start":"end");return n[`collapseTo${t}`]()}}}}},OnNextNode:function(e){return{onKeyDown(t,a){if(!a.value.isExpanded)switch(!0){case r9(t.nativeEvent):if(e.move&&e.move(t))return t.preventDefault(),a;return;case RO(t.nativeEvent):if(e.down&&e.down(a.value.selection.anchorOffset))return t.preventDefault(),a;return;case RU(t.nativeEvent):if(a.value.selection.isAtEndOf(a.value.document)&&e.right&&e.right(0))return t.preventDefault(),a;return;default:return}}}},OnPreviousNode:function(e){return{onKeyDown(t,a){if(!a.value.isExpanded)switch(!0){case oe(t.nativeEvent):if(e.move&&e.move(t))return t.preventDefault(),a;return;case RZ(t.nativeEvent):if(e.up&&e.up(a.value.selection.anchorOffset))return t.preventDefault(),a;return;case RL(t.nativeEvent):if(a.value.selection.isAtStartOf(a.value.document)&&e.left&&e.left(-1))return t.preventDefault(),a;return;default:return}}}},OnTab:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,eV.ZP)("tab"),a=(0,eV.ZP)("shift+tab");return{onKeyDown(n,l){switch(!0){case t(n):return n.preventDefault(),e.indent&&e.indent(),l;case a(n):return n.preventDefault(),e.outdent&&e.outdent(),l;default:return}}}},OnDelete:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,eV.ZP)("delete"),a=(0,eV.ZP)("mod+shift+delete");return{onKeyDown(n,l){switch(!0){case t(n):if(l.value.selection.isAtEndOf(l.value.document))return n.preventDefault(),e.onDelete&&e.onDelete(),l;return;case a(n):return n.preventDefault(),e.onForceDelete&&e.onForceDelete(),l;default:return}}}},MarkHotKey:function(e){let{type:t,key:a}=e,n=(0,eV.ZP)(`mod+${a}`);return{onKeyDown(e,a){if(n(e))return e.preventDefault(),a.call(RA,t)}}},OnCollapseExpandNode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,eV.ZP)("mod+down"),a=(0,eV.ZP)("mod+up");return{onKeyDown:(n,l)=>t(n)?(n.preventDefault(),e.onExpand&&e.onExpand(),l):a(n)?(n.preventDefault(),e.onCollapse&&e.onCollapse(),l):void 0}},OnPaste:function(e){return{onPaste(t,a){let n=t.clipboardData.getData("application/vnd.taskade.taskast");if(n.length>0)return function(e,t){try{if(null==t.onPaste)return!1;let a=JSON.parse(e),n=(0,lr.replaceIDs)(a);t.onPaste({type:"application/vnd.taskade.taskast",fragment:n})}catch(t){console.warn({fragment:e,error:t}),er.$e(a=>{a.setExtra("paste tastkast fragment",e),er.Tb(t)})}}(n,e),a;let l=(0,RV.MF)(t.nativeEvent);if(!a.value.isCollapsed&&null!=l.text&&$R.test(l.text))return Rq("link"),RS(a,{url:l.text??""}),a;switch(l.type){case"html":return Rq("html"),function(e,t){if(null==e.html)return!1;try{if(null!=t.onPaste){let a=(0,DP.htmlTextToTaskastFragment)(e.html);if((0,lr.isFragmentEmpty)(a))return!1;return t.onPaste({type:"application/vnd.taskade.taskast",fragment:a}),!0}}catch(t){console.warn({html:e.html,error:t}),er.$e(a=>{a.setExtra("html",e.html),er.Tb(t)})}return!1}(l,e)||RW(l,e),a;case"text":return Rq("text"),RW(l,e),a;case"fragment":Rq("fragment");return;case"files":return null!=l.text?(Rq("text"),RW(l,e)):(Rq("files"),null!=e.onPaste&&e.onPaste(l)),a;default:return Rq("unknown"),a}}}},OnDuplicate:function(e){let t=(0,eV.ZP)("mod+d");return{onKeyDown:(a,n)=>t(a.nativeEvent)?(a.stopPropagation(),a.preventDefault(),e?.onDuplicate?.(),n):void 0}},OnHistory:function(e){let t=(0,eV.ZP)("mod+z"),a=(0,eV.ZP)("mod+shift+z");return{onKeyDown:(n,l)=>t(n.nativeEvent)?(e?.onUndo?.(n),l):a(n.nativeEvent)?(e?.onRedo?.(n),l):void 0}},OnAddOnMenu:function(e){return{onKeyDown:(t,a)=>RB(t.nativeEvent)?(t.preventDefault(),e?.onAddOnMenu?.(t),a):void 0}},OnMoreMenu:function(e){return{onKeyDown:(t,a)=>Rz(t.nativeEvent)?(t.preventDefault(),e?.onMoreMenu?.(t),a):void 0}}},RG=eL.default.div.withConfig({displayName:"styled__ProjectCanvas",componentId:"sc-fd9abff9-0"})` + flex: 1 1 auto; + display: flex; + flex-direction: column; + + position: relative; + ${tM} + overflow: auto; + + ${e=>"board"===e.$documentView&&(0,eL.css)` + background: ${()=>e.theme.isNightMode?e.theme.appColors.hex(100):e.theme.primaryColorScheme?.alpha5}; + `}; + + @media print { + overflow: visible; + } + + cursor: grab; + &.dragging { + cursor: grabbing; + user-select: none; + } + + margin-right: -10px; + + ${e=>"background"===e.$coverImage&&(0,eL.css)` + .project-title-wrapper { + flex-direction: column; + margin-top: -35px; + } + .project-icon-container { + margin-bottom: 20px; + } + @media (min-width: 768px) { + .project-wrapper { + margin-top: 30px; + margin-bottom: 60px; + padding-bottom: 60px; + } + .nodes-wrapper { + padding-top: 40px; + } + .project-title-wrapper { + flex-direction: row; + margin-top: 0; + } + .cover-image { + position: fixed; + height: 100%; + top: 0; + left: 0; + z-index: 0; + } + } + `}; + ${e=>"background"===e.$coverImage&&"board"===e.$documentView&&(0,eL.css)` + .project-title-wrapper { + width: 100%; + padding: 10px 20px 0; + margin-bottom: 0; + } + `}; + + ${e=>"banner"===e.$coverImage&&(0,eL.css)` + .project-title-wrapper { + flex-direction: column; + align-items: flex-start; + padding: 10px 0 0; + margin-bottom: 0; + margin-top: -35px; + } + .project-icon-container { + margin-bottom: 10px; + } + .cover-image { + position: sticky; + left: 0; + } + .project-wrapper { + margin-bottom: 80px; + } + `}; + + ${e=>"banner"===e.$coverImage&&"board"===e.$documentView&&(0,eL.css)` + .project-title-wrapper { + padding: 10px 20px 0; + } + `}; + + ${e=>"none"===e.$coverImage&&"board"===e.$documentView&&(0,eL.css)` + .project-title-wrapper { + width: 100%; + padding: 10px 20px 0; + margin-bottom: 0; + } + .cover-image { + margin-bottom: 0; + } + `}; + + ${e=>("mindmap"===e.$documentView||"orgchart"===e.$documentView)&&(0,eL.css)` + @media (min-width: 768px) { + .project-title-wrapper { + flex-direction: row; + margin-top: 0; + } + .project-icon-container { + margin-bottom: 0; + } + } + `}; +`,RK=(0,eL.css)` + color: ${e=>e.theme.appColors.hex(10)}; + .bold { + font-weight: bold; + } + + .italic { + font-style: italic; + } + + .underline { + text-decoration: underline; + } + + .hashtag:hover, + .mention:hover, + .anchor:hover { + cursor: pointer; + text-decoration: underline; + } + + .hashtag, + .mention, + .anchor, + .hashtag .highlight, + .mention .highlight, + .anchor .highlight { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + + .highlight { + &.yellow { + border-bottom: 5px solid #ffef62; + } + + &.red { + border-bottom: 5px solid #fa88a1; + } + + &.green { + border-bottom: 5px solid #e7f4a1; + } + + &.blue { + border-bottom: 5px solid #b0dffa; + } + + &.purple { + border-bottom: 5px solid #cdc5f4; + } + } + + &.node-format-h1 { + font-weight: bold; + font-size: 1.25rem; + line-height: 1.625rem; + padding-top: 0.0625rem; + } + + &.node-format-h2 { + font-weight: bold; + font-size: 1.125rem; + line-height: 1.75rem; + } +`,RY=(0,eL.css)` + &.node-format-h1 { + left: 0; + padding-left: 0; + margin-left: -28px; + padding-bottom: 4px; + } + + &.node-format-h2 { + left: 0; + padding-left: 0; + padding-bottom: 4px; + margin-left: -28px; + } +`,RQ=(0,eL.css)` + ${RK}; + + ${RY}; +`,RJ=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-7eefa350-0"})` + padding: 20px 0; + + display: flex; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(90)}; + border-radius: 10px; + + max-width: 500px; +`,RX=eL.default.div.withConfig({displayName:"styled__NodeWrapper",componentId:"sc-7eefa350-1"})` + display: flex; + align-items: center; + + padding: 0 20px; +`,R0=(0,eL.default)(RV.ML).withConfig({displayName:"styled__StyledEditor",componentId:"sc-7eefa350-2"})` + ${RQ}; + word-break: break-word; + flex-grow: 1; + + ${e=>e.$completed&&(0,eL.css)` + text-decoration: line-through; + color: ${e.theme.textColors.hex(50)}; + & span { + color: ${e.theme.textColors.hex(50)} !important; + border-color: ${e.theme.appColors.hex(60)} !important; + } + `} +`;eL.default.div.withConfig({displayName:"styled__Content",componentId:"sc-7eefa350-3"})` + display: flex; + flex-direction: column; +`;let R1=eL.default.div.withConfig({displayName:"styled__Addons",componentId:"sc-7eefa350-4"})` + display: flex; + align-items: center; + + padding: 0 20px; + + margin-top: 10px; + margin-left: 25px; +`,R2=eL.default.div.withConfig({displayName:"styled__ActionBar",componentId:"sc-7eefa350-5"})` + display: flex; + align-items: center; + justify-content: flex-end; + + column-gap: 10px; + + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + + margin-top: 20px; + padding: 20px 20px 0; +`,R5=eL.default.button.withConfig({displayName:"styled__CTAButton",componentId:"sc-7eefa350-6"})` + ${e1.UiTypography.sm}; + + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + font-weight: 500; + + padding: 8px 20px; + border-radius: 10px; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &:disabled { + background: ${e=>e.theme.primaryColorScheme?.alpha30}; + } +`;eL.default.button.withConfig({displayName:"styled__CancelButton",componentId:"sc-7eefa350-7"})` + ${e1.UiTypography.sm}; + + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + color: ${e=>e.theme.textColors.hex(40)}; + + padding: 8px 20px; + border-radius: 10px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`;var R3=a(20640),R4=a.n(R3);let R6=(0,eL.default)(cF).withConfig({displayName:"MoreMenuItem__StyledMenuButton",componentId:"sc-aaeca42a-0"})` + position: relative; + justify-content: space-between; + padding-right: 15px; + text-align: left; + word-break: break-word; +`,R8=function(e){let{children:t,onClick:a,name:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({onClick:a,stopRef:l,name:n});return ev.createElement(R6,r.props,t)},R7=(0,eL.default)(eI.Menu).withConfig({displayName:"MoreMenu__StyledMenu",componentId:"sc-d39c330c-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,R9=eL.default.div.withConfig({displayName:"MoreMenu__IconName",componentId:"sc-d39c330c-1"})` + display: flex; + align-items: center; + & svg { + transform: var(--menu-item-icon-scale); + margin-right: var(--menu-item-gap); + } +`,je=eL.default.div.withConfig({displayName:"MoreMenu__DeleteIconName",componentId:"sc-d39c330c-2"})` + display: flex; + align-items: center; + color: ${eI.ThemeColors.danger}; +`,jt=function(e){let{readOnly:t,initialFocus:a}=e;return ev.createElement(R7,{initialFocus:a,loop:!0},ev.createElement(R8,{name:"copy_link"},ev.createElement(R9,null,ev.createElement(tn.Icon,{icon:"dd_copylink"}),ev.createElement(eY.Z,{id:"general.copylink",defaultMessage:"Copy link"}))),!t&&ev.createElement(R8,{name:"delete"},ev.createElement(je,null,ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.remove_date",defaultMessage:"Remove date"}))))},ja=eL.default.button.attrs({type:"button"}).withConfig({displayName:"MoreMenuButton__DropdownButton",componentId:"sc-81764fb7-0"})` + background: none; + border: none; + color: ${e=>e.theme.textColors.hex(50)}; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + outline: none; + padding: 0 0.25rem; + position: relative; + transition: color 0.2s ease-in-out; + + &:hover { + color: ${e=>e.theme.textColors.hex(20)}; + } + + &:focus { + outline: none; + } +`,jn=function(e){let{exit:t,readOnly:a,projectId:n,nodeID:l}=e,[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1}),i=ev.useRef(null),s=ev.useRef(null),d=ev.useCallback(()=>{i.current?.focus()},[]);(0,eI.usePopupEvents)({state:r,onCollapse:d});let c=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:r,placement:"bottom-end"}),m=(0,eI.useMenuButton)({dispatch:o,ref:i,state:r}),{removeDueDate:u}=FS(n),p=ev.useCallback(e=>{if("Activate"===e.type){let{name:a}=e.payload;switch(a){case"delete":u([l]),o?.({type:"Collapse",payload:"none"}),t();break;case"copy_link":{let e=new URL("https://www.taskade.com");e.pathname=`/d/${n}`,e.hash=`#node-${l}`,R4()(e.href),o?.({type:"Collapse",payload:"none"})}break;default:o?.({type:"Collapse"})}}},[u,l,t,n]);return ev.createElement(ev.Fragment,null,ev.createElement(ja,m.props,ev.createElement(tn.Icon,{icon:"header_more"})),r.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:p},ev.createElement(jt,{readOnly:a,initialFocus:c.initialFocus}))))},jl=(0,e$.connect)(function(e,t){let a=e.contents?.findNodeByID?.(t.nodeId),n=a?.completed??!1;return{value:iV(e,{nodeID:t.nodeId}),readOnly:dq(e),nodeCompleted:n,attachments:iA(e,{nodeID:t.nodeId})}})(function(e){let{projectId:t,nodeId:a,value:n,readOnly:l,exit:r,nodeCompleted:o,attachments:i}=e,s=(0,e$.useDispatch)(),d=(0,eF.k6)(),[c,m]=(0,ev.useState)(null),u=ev.useMemo(()=>[RH.MarkHotKey({key:"b",type:"bold"}),RH.MarkHotKey({key:"u",type:"underline"}),RH.MarkHotKey({key:"i",type:"italic"}),RH.MarkHotKey({key:"e",type:"highlight"}),RH.OnEnter(),{onPaste(e,t){let a=e.clipboardData.getData("text").replaceAll("\n"," ");if(ts()(a))return t;let{anchorOffset:n,focusOffset:l}=t.value.selection,r=Math.min(n,l),o=Math.max(n,l),i=[];r>0&&i.push({retain:r}),o>r&&i.push({delete:o-r}),i.push({insert:a});let s=new(CI())(i),d=(0,Df.Rx)(t.value,s);return t.applyOperations(d,{save:!1}),t}}],[]),p=(0,ev.useCallback)(e=>{s(mN(a,e))},[s,a]);(0,ev.useEffect)(()=>{d.replace({...d.location,hash:`#node-${a}`})},[d,a]);let g=(0,ev.useCallback)(e=>{e.key===eI.KeyboardKeys.Enter&&(e.preventDefault(),r())},[r]),[f,h]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),[y,b]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1});return((0,ev.useEffect)(()=>{c?.focus?.()},[c]),null==n)?null:ev.createElement(RJ,null,ev.createElement(RX,null,ev.createElement(Fa,{nodeID:a,nodeFormat:li.FORMAT_CHECKBOX,completed:o}),ev.createElement(R0,{ref:m,className:"mousetrap notranslate",value:n,autoCorrect:!0,spellCheck:!0,decorateNode:PC,renderMark:PX,readOnly:l,onChange:p,onKeyDown:g,plugins:u,$completed:o}),ev.createElement(jn,{readOnly:l,projectId:t,nodeID:a,exit:r})),ev.createElement(R1,null,ev.createElement(RM,{nodeId:a,projectId:t,dateAttachment:i?.dates?.attachments?.[0],popupState:y,popupDispatch:b,nodeCompleted:o}),ev.createElement(FM,{assignees:i?.assignees,documentID:t,nodeID:a,popupState:f,popupDispatch:h,nodeCompleted:o})),ev.createElement(R2,null,ev.createElement(R5,{onClick:r},ev.createElement(eY.Z,{id:"general.done",defaultMessage:"Done"}))))}),jr=(0,d9.oM)({name:"dialogs.node",initialState:{isOpen:!1},reducers:{toggleNodeDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0}}}),jo=(0,e$.connect)(function(e){return e.dialogs.node})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=ev.useCallback(()=>{a(jr.actions.toggleNodeDialog())},[a]);return t?ev.createElement(eI.ModalDialog,{close:n,isOpen:t,backdropOpacity:eI.ModalDialogOpacity.Translucent,autofocus:!1},t=>{let{exit:a}=t;return ev.createElement(jl,{exit:a,...e})}):null}),ji=eL.default.div.withConfig({displayName:"OutOfSyncModalDialog__FlexContainer",componentId:"sc-14775b4-0"})` + display: flex; + flex-direction: column; +`,js=eL.default.div.withConfig({displayName:"OutOfSyncModalDialog__Actions",componentId:"sc-14775b4-1"})` + display: flex; + flex-direction: row; + justify-content: flex-end; +`,jd=eL.default.div.withConfig({displayName:"OutOfSyncModalDialog__OutOfSyncMenu",componentId:"sc-14775b4-2"})` + position: fixed; + z-index: 11; + top: 50%; + transform: translateY(-50%) translateX(-50%); + left: 50%; + padding: 24px 30px; + width: 400px; + height: auto; + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.1); + border-radius: 10px; +`,jc=eL.default.h1.withConfig({displayName:"OutOfSyncModalDialog__OutOfSyncTitle",componentId:"sc-14775b4-3"})` + ${e1.ArticleTypography.heading3} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; + margin-bottom: 20px; +`,jm=eL.default.div.withConfig({displayName:"OutOfSyncModalDialog__OutOfSyncTint",componentId:"sc-14775b4-4"})` + display: block; + background: rgba(0, 0, 0, 0.3); + z-index: 10; + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; +`,ju=eL.default.a.withConfig({displayName:"OutOfSyncModalDialog__Refresh",componentId:"sc-14775b4-5"})` + display: flex; + padding: 8px 16px; + background: ${eI.ThemeColors.danger}; + color: #fff; + border-radius: 10px; + cursor: pointer; + margin-right: 5px; + font-weight: 500; + + &:focus { + outline: 0; + } + + &:focus, + &:hover { + background: rgba(255, 100, 107, 0.8); + color: #fff; + } +`,jp=(0,e$.connect)(function(e){return{outOfSync:e.session.outOfSync}})(function(e){let{outOfSync:t}=e;return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:()=>{},backdropOpacity:eI.ModalDialogOpacity.Translucent},()=>ev.createElement(ji,null,ev.createElement(jd,null,ev.createElement(jc,null,ev.createElement(eY.Z,{id:"general.project_out_of_sync_description",defaultMessage:"Looks like the project is outdated, please refresh to sync."})),ev.createElement(js,null,ev.createElement(ju,{href:"javascript:window.location.reload(true);"},ev.createElement(eY.Z,{id:"general.refresh",defaultMessage:"Refresh"})))),ev.createElement(jm,null))):null});(q||(q={})).PRINT="print";let jg=function(e){let{projectId:t,onCloseClick:a}=e,[n,l]=ev.useState(!0),[r,o]=ev.useState(null);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex flex-col items-center gap-y-2 rounded-lg bg-appcolor-100 px-2 py-4"},ev.createElement("span",{className:"font-medium"},ev.createElement(eY.Z,{id:"general.print_wait",defaultMessage:"Please wait, printing..."})),n?ev.createElement(eI.Spinner,null):ev.createElement("div",{className:"flex items-center gap-x-2.5"},ev.createElement("button",{className:"text-md rounded-lg bg-primary px-4 py-0.5 font-medium text-white hover:brightness-105",onClick:()=>{r?.contentWindow?.postMessage(q.PRINT)}},ev.createElement(eY.Z,{id:"general.print_again",defaultMessage:"Print again"})),ev.createElement("button",{className:"text-md rounded-lg bg-appcolor-400 px-4 py-0.5 font-medium text-white hover:bg-appcolor-500",onClick:a},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})))),ev.createElement("iframe",{ref:o,className:"h-0 w-0",src:`/print/${t}`,onLoad:()=>{l(!1)},frameBorder:"0"}))},jf=(0,e$.connect)(function(e){return e.dialogs.print})(function(e){let{isOpen:t,dispatch:a}=e,n=ev.useCallback(()=>{a(Mk.actions.togglePrintDialog())},[a]),l=(0,eL.useTheme)(),r=ev.useMemo(()=>gW()(l.primaryColor??eI.Colors.BRAND).rgb().join(" "),[l.primaryColor]);return t?ev.createElement(eI.ModalDialog,{close:n,isOpen:t,backdropOpacity:eI.ModalDialogOpacity.Translucent},()=>ev.createElement("div",{className:"flex w-20 flex-col",style:{"--color-primary":r}},ev.createElement(jg,{projectId:e.projectId,onCloseClick:n}))):null}),jh=eL.default.div.withConfig({displayName:"styled__Heading",componentId:"sc-dec2c35-0"})` + display: flex; + color: ${e=>e.theme.appColors.hex(10)}; + align-items: center; + & svg { + margin-right: 12px; + } + margin-bottom: 8px; + ${e1.UiTypography.md} + font-weight: 500; +`,jy=eL.default.div.withConfig({displayName:"styled__Description",componentId:"sc-dec2c35-1"})` + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + margin-bottom: 20px; +`,jb=eL.default.div.withConfig({displayName:"styled__SettingBlock",componentId:"sc-dec2c35-2"})` + margin-bottom: 20px; +`,jv=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__Subtitle",componentId:"sc-dec2c35-3"})` + color: ${e=>e.theme.textColors.hex("50")}; + margin-bottom: 5px; +`,jk=eL.default.div.withConfig({displayName:"styled__Note",componentId:"sc-dec2c35-4"})` + margin-bottom: 8px; +`,jE=eL.default.span.withConfig({displayName:"styled__Body",componentId:"sc-dec2c35-5"})` + color: ${e=>e.theme.appColors.hex(10)}; + + ${e1.UiTypography.sm}; +`,jx=function(e){let{documentView:t}=e;switch(t){case dl:return ev.createElement(tn.Icon,{className:"view_icon",icon:"view_board"});case dr:return ev.createElement(tn.Icon,{className:"view_icon",icon:"view_calendar"});case di:return ev.createElement(tn.Icon,{className:"view_icon",icon:"view_actionsheet"});case ds:return ev.createElement(tn.Icon,{className:"view_icon",icon:"view_mindmap"});case dd:return ev.createElement(tn.Icon,{className:"view_icon",icon:"view_orgchart"});case dc:return ev.createElement(tn.Icon,{className:"view_icon",icon:"app_store"});default:return ev.createElement(tn.Icon,{className:"view_icon",icon:"view_list"})}},j_=function(e){let{documentView:t}=e;switch(t){case dl:return ev.createElement(eY.Z,{id:"general.board",defaultMessage:"Board"});case dr:return ev.createElement(eY.Z,{id:"general.calendar",defaultMessage:"Calendar"});case di:return ev.createElement(eY.Z,{id:"general.action",defaultMessage:"Action"});case ds:return ev.createElement(eY.Z,{id:"general.mindmap",defaultMessage:"Mind Map"});case dd:return ev.createElement(eY.Z,{id:"general.org_chart",defaultMessage:"Org Chart"});case dc:return ev.createElement(eY.Z,{id:"general.gantt",defaultMessage:"Gantt Chart"});default:return ev.createElement(eY.Z,{id:"general.list",defaultMessage:"List"})}},jw=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-7277b462-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + & .view_icon { + margin-right: var(--menu-item-gap); + transform: var(--menu-item-icon-scale); + } + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,jN=function(e){let{value:t,name:a}=e,n=(0,ev.useRef)(null),l=(0,eI.useMenuItem)({stopRef:n,value:t,name:a});return ev.createElement(jw,l.props,ev.createElement(jx,{documentView:t}),ev.createElement(j_,{documentView:t}))},jC=(0,eL.default)(eI.Menu).withConfig({displayName:"DefaultViewMenu__StyledMenu",componentId:"sc-b03348bc-0"})` + display: flex; + overflow: auto; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + max-width: 240px !important; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + ${tM}; + + max-height: auto; + @media (max-height: 800px) { + max-height: 260px; + } +`,jM=function(e){let{initialFocus:t}=e;return ev.createElement(jC,{initialFocus:t,loop:!0},ev.createElement(jN,{name:"change",value:dn}),ev.createElement(jN,{name:"change",value:dl}),ev.createElement(jN,{name:"change",value:dr}),ev.createElement(jN,{name:"change",value:di}),ev.createElement(jN,{name:"change",value:ds}),ev.createElement(jN,{name:"change",value:dd}),!1)},jS=eL.default.button.withConfig({displayName:"DefaultViewPicker__Button",componentId:"sc-24b0e451-0"})` + display: flex; + align-items: center; + min-width: 240px; + padding: 6px 10px 6px 16px; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + transition: border-color ease-in-out 200ms; + + & .view_icon { + margin-right: 10px; + } + + & svg:last-of-type { + margin-left: auto; + color: ${e=>e.theme.appColors.hex(50)}; + } + + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + & svg:last-of-type { + color: ${e=>e.theme.appColors.hex(10)}; + } + } +`,jI=function(e){let{defaultView:t,handleDefaultViewSelect:a}=e,n=(0,ev.useRef)(null),l=(0,ev.useRef)(null),[r,o]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=(0,ev.useCallback)(e=>{if("Activate"===e.type){if("change"===e.payload.name){let t=hR.u5.safeParse(e.payload.value);t.success&&a(t.data)}o({type:"Collapse"})}},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(jS,{type:"button",...s.props},ev.createElement(jx,{documentView:t}),ev.createElement(j_,{documentView:t}),ev.createElement(tn.Icon,{icon:"caret_down"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(jM,{initialFocus:i.initialFocus}))))},jD=(0,la.ZP)` + mutation ProjectChatModeUpdateMutation($input: ProjectChatModeUpdateInput!) { + projectChatModeUpdate(input: $input) { + clientMutationId + document { + id + shared_preferences + } + } + } +`,jT=(0,la.ZP)` + mutation ProjectCommentsModeUpdateMutation($input: ProjectCommentsModeUpdateInput!) { + projectCommentsModeUpdate(input: $input) { + clientMutationId + document { + id + shared_preferences + } + } + } +`,j$=(0,la.ZP)` + mutation ProjectDefaultViewUpdateMutation($input: ProjectDefaultViewUpdateInput!) { + projectDefaultViewUpdate(input: $input) { + clientMutationId + document { + id + preferences { + view + } + shared_preferences + } + } + } +`,jP=eL.default.label.withConfig({displayName:"Admin__Label",componentId:"sc-c5709993-0"})` + color: ${e=>e.theme.appColors.hex(10)}; + display: flex; + flex-direction: row; + align-items: center; + ${e1.UiTypography.sm}; + padding: 0; + margin: 0; + cursor: pointer; +`,jF=(0,eL.default)(e1.Switch).withConfig({displayName:"Admin__StyledSwitch",componentId:"sc-c5709993-1"})` + cursor: pointer; + margin-right: 10px; + transition: all ease-in-out 300ms; +`,jA=function(e){let{document:t}=e,a=(0,ev.useMemo)(()=>t?.shared_preferences?.chatMode,[t]),n=(0,ev.useMemo)(()=>t?.shared_preferences?.commentsMode,[t]),l=t?.shared_preferences?.view??"list",[r]=(0,cs.D)(jD),[o]=(0,cs.D)(jT),[i]=(0,cs.D)(j$);return ev.createElement(ev.Fragment,null,ev.createElement(jh,null,ev.createElement(tn.Icon,{icon:"dd_settings"}),ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"})),ev.createElement(jy,null,ev.createElement(eY.Z,{id:"general.project_settings.admin_description",defaultMessage:"You may modify project settings here including enabling or disabling various features."})),ev.createElement(jb,null,ev.createElement(jv,null,ev.createElement(eY.Z,{id:"general.project_settings.default_view",defaultMessage:"Default View"})),ev.createElement(jE,null,ev.createElement(jk,null,ev.createElement(eY.Z,{id:"general.project_settings.choose_default_view_for_this_project",defaultMessage:"Choose the default view for this project."})),ev.createElement(jI,{defaultView:l,handleDefaultViewSelect:e=>{null!=t&&M0(t.role,"manage_settings")&&i({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:t.id,view:e}}})}}))),ev.createElement(jb,null,ev.createElement(jv,null,ev.createElement(eY.Z,{id:"general.project_settings.project_chat",defaultMessage:"Project Chat"})),ev.createElement(jE,null,ev.createElement(jk,null,ev.createElement(eY.Z,{id:"general.project_settings.project_chat_description",defaultMessage:"Enable or disable project chat. If disabled, the chat will not be visible to anyone."}))),ev.createElement(jP,null,ev.createElement(jF,{checked:a!==R.DISABLED,onChange:function(e){null!=t&&r({variables:{input:{clientMutationId:(0,ld.Z)(),documentId:t.id,chatMode:e?R.ENABLED:R.DISABLED}}})}}),a!==R.DISABLED?ev.createElement(eY.Z,{id:"general.enabled",defaultMessage:"Enabled"}):ev.createElement(eY.Z,{id:"general.disabled",defaultMessage:"Disabled"}))),ev.createElement(jb,null,ev.createElement(jv,null,ev.createElement(eY.Z,{id:"general.project_settings.comments",defaultMessage:"Comments"})),ev.createElement(jE,null,ev.createElement(jk,null,ev.createElement(eY.Z,{id:"general.project_settings.project_comments_description",defaultMessage:"Enable or disable comments. If disabled, comments will not be visible to anyone."}))),ev.createElement(jP,null,ev.createElement(jF,{checked:n!==j.DISABLED,onChange:function(e){null!=t&&o({variables:{input:{clientMutationId:(0,ld.Z)(),documentId:t.id,commentsMode:e?j.ENABLED:j.DISABLED}}})}}),n!==j.DISABLED?ev.createElement(eY.Z,{id:"general.enabled",defaultMessage:"Enabled"}):ev.createElement(eY.Z,{id:"general.disabled",defaultMessage:"Disabled"}))))};function jR(e,t,a,n,l){let r=function(e){if(ts()(e))throw Error("namespace must not be empty!");return"production"!==e?`${e}/`:""}(e);return a?`${r}${t}/${a}/${n}.${l}`:`${r}${t}/${n}.${l}`}function jj(e){return`https://files.taskade.com/${e}`}function jO(e,t,a){let{id:n,mimetype:l,namespace:r}=e,o=(0,cx.getThumbnailMimeTypeDesc)(l);if(null!=o){let l=o.extensions[0];(0,ei.assert)("string"==typeof l);let i=jj(jR(r,n,t,a,l)),s=jj(e.s3KeyOriginal);return{preview:i,view:s,download:s}}return{preview:"/images/file-placeholder2.png",view:"/images/file-placeholder-large.png",download:jj(e.s3KeyOriginal)}}function jU(e){if(null==e)return{background:{type:"default",data:{value:"bg-random"}},type:"image",value:"/images/wallpaper"};switch(e.type){case"custom":{let{file:t}=e.data;if(!["image/jpeg","image/png"].includes(t.mimetype))return{background:{type:"default",data:{value:"bg-none"}},type:"none"};let a=jO(e.data.file,"h_200,w_200","xhdpi");return{background:e,type:"image",value:a.view}}case"default":{let t=e.data.value;if("bg-random"===t)return{background:e,type:"image",value:"/images/wallpaper"};if("bg-none"===t)return{background:e,type:"none"};if(t.startsWith("bg-color"))return{background:e,type:"color",value:t};if(t.startsWith("gradient")){if(/^gradient-\d{4}$/.test(t))return{background:e,type:"image",value:`/images/gradients/gradient-${t.slice(-4)}.png`};return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}else if(t.startsWith("art")){if(/^art-\d{4}$/.test(t))return{background:e,type:"image",value:`/images/artwork/art-${t.slice(-4)}.jpg`};return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}else{if(/^bg-\d{4}$/.test(t))return{background:e,type:"image",value:`/images/wallpapers/${t.slice(-4)}.jpg`};return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}}default:return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}}let jZ="background",jL={start:null,end:null,view:"list",avatar:null,background:{type:"default",data:{value:"bg-none"}},coverImageType:jZ,chatMode:R.DISABLED,commentsMode:j.DISABLED},jB={start:null,end:null,view:"list",avatar:null,background:{type:"default",data:{value:"bg-random"}},coverImageType:jZ,chatMode:R.DISABLED,commentsMode:j.DISABLED},jz=ev.createContext(jL),jV=new Set(["bg-color-1","bg-color-2","bg-color-3","bg-color-4","bg-color-5","bg-color-6","bg-color-7","bg-color-8","bg-color-9","bg-color-10","bg-color-11","bg-color-12","bg-color-13","bg-color-14","bg-color-15","bg-color-16","bg-color-17","bg-color-18","bg-color-19","bg-color-20","bg-random","bg-0000","bg-0001","bg-0002","bg-0003","bg-0004","bg-0005","bg-0006","bg-0007","bg-0008","bg-0009","bg-0010","bg-0011","bg-0012","bg-0013","bg-0014","bg-0015","bg-0016","bg-0017","bg-0018","bg-0019","bg-0020","bg-0021","bg-0022","bg-0023","bg-0024","bg-0025","bg-0026","bg-0027","bg-0028","bg-0029","bg-0030","bg-0031","bg-0032","bg-0033","bg-0034","bg-0035","bg-0036","bg-0037","bg-0038","bg-0039","bg-0040","bg-0041","bg-0042","bg-0043","bg-0044","bg-0045","bg-0046","bg-0047","bg-0048","bg-0049","bg-0050","bg-0051","bg-0052","bg-0053","bg-0054","bg-0055","bg-0056","bg-0057","bg-0058","bg-0059","bg-0060","bg-0061","bg-0062","bg-0063","bg-0064","bg-0065","bg-0066","bg-0067","bg-0068","bg-0069","bg-0070","bg-0071","bg-0072","bg-0073","bg-0074","bg-0075","bg-0076","bg-0077","bg-0078","bg-0079","bg-0080","bg-0081","bg-0082","bg-0083","bg-0084","bg-0085","bg-0086","bg-0087","bg-0088","bg-0089","bg-0090","bg-0091","bg-0092","bg-0093","bg-0094","bg-0095","bg-0096","bg-0097","bg-0098","bg-0099","bg-0100","bg-0101","bg-0102","bg-0103","bg-0104","bg-0105","bg-0106","bg-0107","bg-0108","bg-0109","bg-0110","bg-0111","bg-0112","bg-0113","bg-0114","bg-0115","bg-0116","bg-0117","bg-0118","bg-0119"]),jq=["bg-color-1","bg-color-2","bg-color-3","bg-color-4","bg-color-5","bg-color-6","bg-color-7","bg-color-8","bg-color-9","bg-color-10","bg-color-11","bg-color-12","bg-color-13","bg-color-14","bg-color-15","bg-color-16","bg-color-17","bg-color-18","bg-color-19","bg-color-20","bg-color-21","bg-color-22","bg-color-23","bg-color-24","bg-color-25","bg-color-26","bg-color-27","bg-color-28","bg-color-29","bg-color-30","bg-color-31","bg-color-32","bg-color-33","bg-color-34","bg-color-35","bg-color-36","bg-color-37","bg-color-38","bg-color-39","bg-color-40","bg-color-41","bg-color-42","bg-color-43","bg-color-44","bg-color-45","bg-color-46","bg-color-47","bg-color-48","bg-color-49","bg-color-50","bg-color-51","bg-color-52","bg-color-53","bg-color-54","bg-color-55","bg-color-56","bg-color-57","bg-color-58","bg-color-59","bg-color-60","bg-color-61","bg-color-62","bg-color-63","bg-color-64","bg-color-65","bg-color-66","bg-color-67","bg-color-68","bg-color-69","bg-color-70","bg-color-71","bg-color-72","bg-color-73","bg-color-74","bg-color-75","bg-color-76","bg-color-77","bg-color-78","bg-color-79","bg-color-80","bg-color-81","bg-color-82","bg-color-83","bg-color-84","bg-color-85","bg-color-86","bg-color-87","bg-color-88","bg-color-89","bg-color-90","bg-color-91","bg-color-92","bg-color-93","bg-color-94","bg-color-95","bg-color-96","bg-color-97","bg-color-98","bg-color-99","bg-color-100","bg-color-101","bg-color-102","bg-color-103","bg-color-104","bg-color-105","bg-color-106","bg-color-107","bg-color-108","bg-color-109","bg-color-110","bg-color-111","bg-color-112","bg-color-113","bg-color-114","bg-color-115"],jW=["bg-random","bg-0000","bg-0001","bg-0002","bg-0003","bg-0004","bg-0005","bg-0006","bg-0007","bg-0008","bg-0009","bg-0010","bg-0011","bg-0012","bg-0013","bg-0014","bg-0015","bg-0016","bg-0017","bg-0018","bg-0019","bg-0020","bg-0021","bg-0022","bg-0023","bg-0024","bg-0025","bg-0026","bg-0027","bg-0028","bg-0029","bg-0030","bg-0031","bg-0032","bg-0033","bg-0034","bg-0035","bg-0036","bg-0037","bg-0038","bg-0039","bg-0040","bg-0041","bg-0042","bg-0043","bg-0044","bg-0045","bg-0046","bg-0047","bg-0048","bg-0049","bg-0050","bg-0051","bg-0052","bg-0053","bg-0054","bg-0055","bg-0056","bg-0057","bg-0058","bg-0059","bg-0060","bg-0061","bg-0062","bg-0063","bg-0064","bg-0065","bg-0066","bg-0067","bg-0068","bg-0069","bg-0070","bg-0071","bg-0072","bg-0073","bg-0074","bg-0075","bg-0076","bg-0077","bg-0078","bg-0079","bg-0080","bg-0081","bg-0082","bg-0083","bg-0084","bg-0085","bg-0086","bg-0087","bg-0088","bg-0089","bg-0090","bg-0091","bg-0092","bg-0093","bg-0094","bg-0095","bg-0096","bg-0097","bg-0098","bg-0099","bg-0100","bg-0101","bg-0102","bg-0103","bg-0104","bg-0105","bg-0106","bg-0107","bg-0108","bg-0109","bg-0110","bg-0111","bg-0112","bg-0113","bg-0114","bg-0115","bg-0116","bg-0117","bg-0118","bg-0119","bg-0120","bg-0121","bg-0122","bg-0123","bg-0124","bg-0125","bg-0126","bg-0127","bg-0128","bg-0129","bg-0130","bg-0131"],jH=["gradient-0000","gradient-0001","gradient-0002","gradient-0003","gradient-0004","gradient-0005","gradient-0006","gradient-0007","gradient-0008","gradient-0009","gradient-0010","gradient-0011","gradient-0012","gradient-0013","gradient-0014","gradient-0015","gradient-0016","gradient-0017","gradient-0018","gradient-0019","gradient-0020","gradient-0021","gradient-0022","gradient-0023","gradient-0024","gradient-0025","gradient-0026","gradient-0027","gradient-0028","gradient-0029","gradient-0030","gradient-0031","gradient-0032","gradient-0033","gradient-0034","gradient-0035","gradient-0036","gradient-0037","gradient-0038","gradient-0039","gradient-0040","gradient-0041","gradient-0042","gradient-0043","gradient-0044","gradient-0045","gradient-0046","gradient-0047","gradient-0048","gradient-0049","gradient-0050","gradient-0051","gradient-0052","gradient-0053","gradient-0054","gradient-0055","gradient-0056","gradient-0057"],jG=["art-0000","art-0001","art-0002","art-0003","art-0004","art-0005","art-0006","art-0007","art-0008","art-0009","art-0010","art-0011","art-0012","art-0013","art-0014","art-0015","art-0016","art-0017","art-0018","art-0019","art-0020","art-0021","art-0022","art-0023","art-0024","art-0025","art-0026","art-0027","art-0028","art-0029","art-0030","art-0031","art-0032","art-0033","art-0034"];function jK(e,t,a){return!jV.has(e)&&!!t&&!fR.Vl.getFeature("project.wallpaper").plans[a]}let jY={"bg-none":"","bg-random":"#333333"},jQ={"art-0000":"0 0","art-0001":"-122px 0","art-0002":"-244px 0","art-0003":"-366px 0","art-0004":"-488px 0","art-0005":"0 -80px","art-0006":"-122px -80px","art-0007":"-244px -80px","art-0008":"-366px -80px","art-0009":"-488px -80px","art-0010":"0 -160px","art-0011":"-122px -160px","art-0012":"-244px -160px","art-0013":"-366px -160px","art-0014":"-488px -160px","art-0015":"0 -240px","art-0016":"-122px -240px","art-0017":"-244px -240px","art-0018":"-366px -240px","art-0019":"-488px -240px","art-0020":"0 -320px","art-0021":"-122px -320px","art-0022":"-244px -320px","art-0023":"-366px -320px","art-0024":"-488px -320px","art-0025":"0 -400px","art-0026":"-122px -400px","art-0027":"-244px -400px","art-0028":"-366px -400px","art-0029":"-488px -400px","art-0030":"0 -480px","art-0031":"-122px -480px","art-0032":"-244px -480px","art-0033":"-366px -480px","art-0034":"-488px -480px"},jJ=eL.default.button.attrs(function(e){let{background:t}=e,a=jY[t],n=null;null!=a&&(n={backgroundColor:"bg-none"===t?e.theme.isNightMode?"#111":"#f8f8f8":a,backgroundImage:"none"});let l=jQ[t];return null!=l&&(n={backgroundPosition:l}),{style:n}}).withConfig({displayName:"ArtworkTile__Tile",componentId:"sc-9adcb58f-0"})` + display: flex; + width: 122px; + height: 72px; + align-items: center; + justify-content: center; + border: 2px solid transparent; + border-radius: 8px; + cursor: pointer; + background-image: url(${"/../images/art-sprite.jpg"}); + background-size: 610px 640px; + box-sizing: content-box; + padding: 0; + box-shadow: 0 0 0 0 ${e=>e.theme.appColors.hex(70)}; + transform: scale(0.95); + transition: box-shadow ease-in-out 100ms, transform ease-in-out 100ms; + + background-clip: content-box; + ${e=>e.active&&(0,eL.css)` + box-shadow: 0 0 0 2px ${e.theme.primaryColorScheme?.base}; + transform: scale(1); + `} + :hover { + transform: scale(1); + } + + :focus { + outline: 0; + } +`,jX=eL.default.span.withConfig({displayName:"ArtworkTile__Text",componentId:"sc-9adcb58f-1"})` + font-weight: 500; + color: ${e=>e.white?"#fcfcfc":e.theme.appColors.hex(10)}; + text-transform: uppercase; + ${e1.UiTypography.sm} +`,j0=eL.default.div.withConfig({displayName:"ArtworkTile__LockIconWrapper",componentId:"sc-9adcb58f-2"})` + display: flex; + border-radius: 5px; + background: rgba(0, 0, 0, 0.3); + padding: 5px; +`,j1=(0,eL.default)(lT.r_).withConfig({displayName:"ArtworkTile__LockIcon",componentId:"sc-9adcb58f-3"})` + transform: scale(1.2); + & path { + fill: #fff; + } +`,j2=function(e){let{background:t,locked:a,onBlock:n,onBackgroundChosen:l,active:r}=e;return ev.createElement(jJ,{background:t,onClick:a?n:()=>{l({type:"default",data:{value:t}},a)},active:r},"bg-none"===t&&ev.createElement(jX,null,ev.createElement(eY.Z,{id:"general.none",defaultMessage:"None"})),"bg-random"===t&&ev.createElement(jX,{white:!0},ev.createElement(eY.Z,{id:"general.random",defaultMessage:"Random"})),a&&ev.createElement(j0,null,ev.createElement(j1,null)))},j5=eL.default.div.withConfig({displayName:"Artwork__Container",componentId:"sc-9c055f79-0"})` + display: flex; + flex-wrap: wrap; + grid-gap: 10px; + padding: 10px 5px; + overflow-y: scroll; + ${tM}; +`,j3=(0,e$.connect)(function(e){return{isLoggedIn:t9(e)}})(function(e){let{isLoggedIn:t,taskadePlanType:a,onBackgroundChosen:n,backgroundState:l,dispatch:r}=e,o=ev.useMemo(()=>{let{background:e}=l;return"default"===e.type?e.data.value:null},[l]),i=()=>{t?r(d4()):r(rh({isOpen:!0,activeView:rI}))};return ev.createElement(j5,{className:"bg-tiles"},jG.map(e=>ev.createElement(j2,{key:e,background:e,onBackgroundChosen:n,locked:jK(e,t,a),onBlock:i,active:e===o})))}),j4={"bg-none":"","bg-random":"#333333","bg-color-1":"#FFB2B9","bg-color-2":"#FFDFB8","bg-color-3":"#B8FFC7","bg-color-4":"#B9E1FF","bg-color-5":"#FC5C65","bg-color-6":"#FD9644","bg-color-7":"#FED330","bg-color-8":"#26DE81","bg-color-9":"#2BCBBA","bg-color-10":"#45AAF2","bg-color-11":"#4B7BEC","bg-color-12":"#A55EEA","bg-color-13":"#D1D8E0","bg-color-14":"#778CA3","bg-color-15":"#333333","bg-color-16":"#F6C647","bg-color-17":"#CBE45A","bg-color-18":"#5EC8C3","bg-color-19":"#F1ABDC","bg-color-20":"#DB586A","bg-color-21":"#EBA342","bg-color-22":"#ABCA53","bg-color-23":"#3F87A4","bg-color-24":"#CD84F3","bg-color-25":"#A73E70","bg-color-26":"#DD6437","bg-color-27":"#419240","bg-color-28":"#2151D5","bg-color-29":"#9581F3","bg-color-30":"#7A396E","bg-color-31":"#D73934","bg-color-32":"#296165","bg-color-33":"#1A1460","bg-color-34":"#5758B5","bg-color-35":"#66244F","bg-color-36":"#F1A886","bg-color-37":"#61C9F3","bg-color-38":"#E2B759","bg-color-39":"#80E3C3","bg-color-40":"#CCD3C9","bg-color-41":"#E9865C","bg-color-42":"#499AF5","bg-color-43":"#F7F0C0","bg-color-44":"#6FAFA0","bg-color-45":"#2F3A46","bg-color-46":"#A54170","bg-color-47":"#3B3B93","bg-color-48":"#EC7A77","bg-color-49":"#ADEADC","bg-color-50":"#CEA4E4","bg-color-51":"#65274E","bg-color-52":"#1D2C5E","bg-color-53":"#E9537C","bg-color-54":"#BFC589","bg-color-55":"#7C5A9B","bg-color-56":"#84ECC7","bg-color-57":"#9CEAEB","bg-color-58":"#84B7F9","bg-color-59":"#A19BF7","bg-color-60":"#E0E6E9","bg-color-61":"#53B596","bg-color-62":"#5DCBC8","bg-color-63":"#3A82DC","bg-color-64":"#6A5DDF","bg-color-65":"#B4BEC3","bg-color-66":"#FCEBAF","bg-color-67":"#EFB4A4","bg-color-68":"#EE7E79","bg-color-69":"#ED81A7","bg-color-70":"#656E72","bg-color-71":"#F5CD7C","bg-color-72":"#D3765C","bg-color-73":"#C5403A","bg-color-74":"#D65191","bg-color-75":"#2E3436","bg-color-76":"#F2A4EF","bg-color-77":"#F6CC6B","bg-color-78":"#ED7470","bg-color-79":"#76D8F7","bg-color-80":"#63CEA4","bg-color-81":"#E271DB","bg-color-82":"#F2A456","bg-color-83":"#DD5D59","bg-color-84":"#55BADF","bg-color-85":"#4FAA87","bg-color-86":"#5FCFD2","bg-color-87":"#669EF8","bg-color-88":"#582BC5","bg-color-89":"#CBD6E4","bg-color-90":"#5A6573","bg-color-91":"#49A1A3","bg-color-92":"#4784D8","bg-color-93":"#312091","bg-color-94":"#8795A5","bg-color-95":"#252F3D","bg-color-96":"#DE6279","bg-color-97":"#595FC8","bg-color-98":"#72CCF6","bg-color-99":"#73E4E3","bg-color-100":"#6BE58B","bg-color-101":"#E24C5C","bg-color-102":"#3C40BF","bg-color-103":"#55B9F4","bg-color-104":"#62D5D5","bg-color-105":"#59C174","bg-color-106":"#F6C35F","bg-color-107":"#FADE70","bg-color-108":"#ED695E","bg-color-109":"#D4DAE1","bg-color-110":"#4B545F","bg-color-111":"#F3AC3D","bg-color-112":"#F8D553","bg-color-113":"#EB5141","bg-color-114":"#838E9A","bg-color-115":"#20272D"},j6=eL.default.button.attrs(function(e){let{background:t}=e,a=j4[t],n=null;return null!=a&&(n={backgroundColor:"bg-none"===t?e.theme.isNightMode?"#111":"#f8f8f8":a,backgroundImage:"none"}),{style:n}}).withConfig({displayName:"ColorTile__Tile",componentId:"sc-f54e4b3d-0"})` + display: flex; + width: 122px; + height: 72px; + align-items: center; + justify-content: center; + border: 2px solid transparent; + border-radius: 8px; + cursor: pointer; + background-image: url(${"/../images/bg-sprite.jpg"}); + background-size: 610px 1920px; + box-sizing: content-box; + padding: 0; + box-shadow: 0 0 0 0 ${e=>e.theme.appColors.hex(70)}; + transform: scale(0.95); + transition: box-shadow ease-in-out 100ms, transform ease-in-out 100ms; + + background-clip: content-box; + ${e=>e.active&&(0,eL.css)` + box-shadow: 0 0 0 2px ${e.theme.primaryColorScheme?.base}; + transform: scale(1); + `} + :hover { + transform: scale(1); + } + + :focus { + outline: 0; + } +`,j8=eL.default.span.withConfig({displayName:"ColorTile__Text",componentId:"sc-f54e4b3d-1"})` + font-weight: 500; + color: ${e=>e.white?"#fcfcfc":e.theme.appColors.hex(10)}; + text-transform: uppercase; + ${e1.UiTypography.sm} +`,j7=eL.default.div.withConfig({displayName:"ColorTile__LockIconWrapper",componentId:"sc-f54e4b3d-2"})` + display: flex; + border-radius: 5px; + background: rgba(0, 0, 0, 0.3); + padding: 5px; +`,j9=(0,eL.default)(lT.r_).withConfig({displayName:"ColorTile__LockIcon",componentId:"sc-f54e4b3d-3"})` + transform: scale(1.2); + & path { + fill: #fff; + } +`,Oe=function(e){let{background:t,locked:a,onBlock:n,onBackgroundChosen:l,active:r}=e;return ev.createElement(j6,{background:t,onClick:a?n:()=>{l({type:"default",data:{value:t}},a)},active:r},"bg-none"===t&&ev.createElement(j8,null,ev.createElement(eY.Z,{id:"general.none",defaultMessage:"None"})),"bg-random"===t&&ev.createElement(j8,{white:!0},ev.createElement(eY.Z,{id:"general.random",defaultMessage:"Random"})),a&&ev.createElement(j7,null,ev.createElement(j9,null)))},Ot=eL.default.div.withConfig({displayName:"Colors__Container",componentId:"sc-5c4aa1b4-0"})` + display: flex; + flex-wrap: wrap; + grid-gap: 10px; + padding: 10px 5px; + overflow-y: scroll; + ${tM}; +`,Oa=(0,e$.connect)(function(e){return{isLoggedIn:t9(e)}})(function(e){let{isLoggedIn:t,taskadePlanType:a,onBackgroundChosen:n,backgroundState:l,dispatch:r}=e,o=ev.useMemo(()=>{let{background:e}=l;return"default"===e.type?e.data.value:null},[l]),i=()=>{t?r(d4()):r(rh({isOpen:!0,activeView:rI}))};return ev.createElement(Ot,{className:"bg-tiles"},jq.map(e=>ev.createElement(Oe,{key:e,background:e,onBackgroundChosen:n,locked:jK(e,t,a),onBlock:i,active:e===o})))}),On=eL.default.div.withConfig({displayName:"CoverImageOption__Wrapper",componentId:"sc-13d7d223-0"})` + display: flex; + flex-direction: column; + margin-right: 12px; +`,Ol=eL.default.div.withConfig({displayName:"CoverImageOption__Display",componentId:"sc-13d7d223-1"})` + position: relative; + display: flex; + width: 130px; + height: 90px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + overflow: hidden; + + ${e=>e.$active&&(0,eL.css)` + border-width: 2px; + border-color: ${e.theme.primaryColorScheme?.base}; + `} + + &:hover { + cursor: pointer; + border-width: 2px; + border-color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,Or=eL.default.div.withConfig({displayName:"CoverImageOption__InnerContent",componentId:"sc-13d7d223-2"})` + background-color: ${e=>e.theme.appColors.hex(70)}; + width: 100%; + height: ${e=>{switch(e.$type){case"banner":return 40;case"background":return 100;case"none":return 0}}}%; +`,Oo=eL.default.span.withConfig({displayName:"CoverImageOption__Label",componentId:"sc-13d7d223-3"})` + margin-top: 4px; + text-align: center; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm}; + + ${e=>e.$active&&(0,eL.css)` + color: ${e.theme.appColors.hex(10)}; + `} +`,Oi=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"CoverImageOption__TickIcon",componentId:"sc-13d7d223-4"})` + position: absolute; + bottom: 10px; + right: 10px; + + width: 24px; + height: 24px; + + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: white; + border-radius: 100%; + padding: 4px; +`,Os={none:(0,te.Em)({id:"general.none",defaultMessage:"None"}),banner:(0,te.Em)({id:"general.banner",defaultMessage:"Banner"}),background:(0,te.Em)({id:"general.background",defaultMessage:"Background"})},Od=function(e){let{type:t,active:a,onSelect:n}=e;return ev.createElement(On,null,ev.createElement(Ol,{onClick:()=>{n?.(t)},$active:a},ev.createElement(Or,{$type:t}),a&&ev.createElement(Oi,null)),ev.createElement(Oo,{$active:a},ev.createElement(eY.Z,Os[t])))},Oc={"gradient-0000":"0 0","gradient-0001":"-122px 0","gradient-0002":"-244px 0","gradient-0003":"-366px 0","gradient-0004":"-488px 0","gradient-0005":"0 -80px","gradient-0006":"-122px -80px","gradient-0007":"-244px -80px","gradient-0008":"-366px -80px","gradient-0009":"-488px -80px","gradient-0010":"0 -160px","gradient-0011":"-122px -160px","gradient-0012":"-244px -160px","gradient-0013":"-366px -160px","gradient-0014":"-488px -160px","gradient-0015":"0 -240px","gradient-0016":"-122px -240px","gradient-0017":"-244px -240px","gradient-0018":"-366px -240px","gradient-0019":"-488px -240px","gradient-0020":"0 -320px","gradient-0021":"-122px -320px","gradient-0022":"-244px -320px","gradient-0023":"-366px -320px","gradient-0024":"-488px -320px","gradient-0025":"0 -400px","gradient-0026":"-122px -400px","gradient-0027":"-244px -400px","gradient-0028":"-366px -400px","gradient-0029":"-488px -400px","gradient-0030":"0 -480px","gradient-0031":"-122px -480px","gradient-0032":"-244px -480px","gradient-0033":"-366px -480px","gradient-0034":"-488px -480px","gradient-0035":"0 -560px","gradient-0036":"-122px -560px","gradient-0037":"-244px -560px","gradient-0038":"-366px -560px","gradient-0039":"-488px -560px","gradient-0040":"0 -640px","gradient-0041":"-122px -640px","gradient-0042":"-244px -640px","gradient-0043":"-366px -640px","gradient-0044":"-488px -640px","gradient-0045":"0 -720px","gradient-0046":"-122px -720px","gradient-0047":"-244px -720px","gradient-0048":"-366px -720px","gradient-0049":"-488px -720px","gradient-0050":"0 -800px","gradient-0051":"-122px -800px","gradient-0052":"-244px -800px","gradient-0053":"-366px -800px","gradient-0054":"-488px -800px","gradient-0055":"0 -880px","gradient-0056":"-122px -880px","gradient-0057":"-244px -880px"},Om=eL.default.button.attrs(function(e){let{background:t}=e,a=null,n=Oc[t];return null!=n&&(a={backgroundPosition:n}),{style:a}}).withConfig({displayName:"GradientTile__Tile",componentId:"sc-11a77e2e-0"})` + display: flex; + width: 122px; + height: 72px; + align-items: center; + justify-content: center; + border: 2px solid transparent; + border-radius: 8px; + cursor: pointer; + background-image: url(${"/../images/gradient-sprite.jpg"}); + background-size: 610px 960px; + box-sizing: content-box; + padding: 0; + box-shadow: 0 0 0 0 ${e=>e.theme.appColors.hex(70)}; + transform: scale(0.95); + transition: box-shadow ease-in-out 100ms, transform ease-in-out 100ms; + + background-clip: content-box; + ${e=>e.active&&(0,eL.css)` + box-shadow: 0 0 0 2px ${e.theme.primaryColorScheme?.base}; + transform: scale(1); + `} + :hover { + transform: scale(1); + } + + :focus { + outline: 0; + } +`,Ou=eL.default.span.withConfig({displayName:"GradientTile__Text",componentId:"sc-11a77e2e-1"})` + font-weight: 500; + color: ${e=>e.white?"#fcfcfc":e.theme.appColors.hex(10)}; + text-transform: uppercase; + ${e1.UiTypography.sm} +`,Op=eL.default.div.withConfig({displayName:"GradientTile__LockIconWrapper",componentId:"sc-11a77e2e-2"})` + display: flex; + border-radius: 5px; + background: rgba(0, 0, 0, 0.3); + padding: 5px; +`,Og=(0,eL.default)(lT.r_).withConfig({displayName:"GradientTile__LockIcon",componentId:"sc-11a77e2e-3"})` + transform: scale(1.2); + & path { + fill: #fff; + } +`,Of=function(e){let{background:t,locked:a,onBlock:n,onBackgroundChosen:l,active:r}=e;return ev.createElement(Om,{background:t,onClick:a?n:()=>{l({type:"default",data:{value:t}},a)},active:r},"gradient-none"===t&&ev.createElement(Ou,null,ev.createElement(eY.Z,{id:"general.none",defaultMessage:"None"})),"gradient-random"===t&&ev.createElement(Ou,{white:!0},ev.createElement(eY.Z,{id:"general.random",defaultMessage:"Random"})),a&&ev.createElement(Op,null,ev.createElement(Og,null)))},Oh=eL.default.div.withConfig({displayName:"Gradients__Container",componentId:"sc-aeef37d9-0"})` + display: flex; + flex-wrap: wrap; + grid-gap: 10px; + padding: 10px 5px; + overflow-y: scroll; + ${tM}; +`,Oy=(0,e$.connect)(function(e){return{isLoggedIn:t9(e)}})(function(e){let{isLoggedIn:t,taskadePlanType:a,onBackgroundChosen:n,backgroundState:l,dispatch:r}=e,o=ev.useMemo(()=>{let{background:e}=l;return"default"===e.type?e.data.value:null},[l]),i=()=>{t?r(d4()):r(rh({isOpen:!0,activeView:rI}))};return ev.createElement(Oh,{className:"bg-tiles"},jH.map(e=>ev.createElement(Of,{key:e,background:e,onBackgroundChosen:n,locked:jK(e,t,a),onBlock:i,active:e===o})))}),Ob={"bg-none":"","bg-random":"#333333"},Ov={"bg-0000":"0 0","bg-0001":"-122px 0","bg-0002":"-244px 0","bg-0003":"-366px 0","bg-0004":"-488px 0","bg-0005":"0 -80px","bg-0006":"-122px -80px","bg-0007":"-244px -80px","bg-0008":"-366px -80px","bg-0009":"-488px -80px","bg-0010":"0 -160px","bg-0011":"-122px -160px","bg-0012":"-244px -160px","bg-0013":"-366px -160px","bg-0014":"-488px -160px","bg-0015":"0 -240px","bg-0016":"-122px -240px","bg-0017":"-244px -240px","bg-0018":"-366px -240px","bg-0019":"-488px -240px","bg-0020":"0 -320px","bg-0021":"-122px -320px","bg-0022":"-244px -320px","bg-0023":"-366px -320px","bg-0024":"-488px -320px","bg-0025":"0 -400px","bg-0026":"-122px -400px","bg-0027":"-244px -400px","bg-0028":"-366px -400px","bg-0029":"-488px -400px","bg-0030":"0 -480px","bg-0031":"-122px -480px","bg-0032":"-244px -480px","bg-0033":"-366px -480px","bg-0034":"-488px -480px","bg-0035":"0 -560px","bg-0036":"-122px -560px","bg-0037":"-244px -560px","bg-0038":"-366px -560px","bg-0039":"-488px -560px","bg-0040":"0 -640px","bg-0041":"-122px -640px","bg-0042":"-244px -640px","bg-0043":"-366px -640px","bg-0044":"-488px -640px","bg-0045":"0 -720px","bg-0046":"-122px -720px","bg-0047":"-244px -720px","bg-0048":"-366px -720px","bg-0049":"-488px -720px","bg-0050":"0 -800px","bg-0051":"-122px -800px","bg-0052":"-244px -800px","bg-0053":"-366px -800px","bg-0054":"-488px -800px","bg-0055":"0 -880px","bg-0056":"-122px -880px","bg-0057":"-244px -880px","bg-0058":"-366px -880px","bg-0059":"-488px -880px","bg-0060":"0 -960px","bg-0061":"-122px -960px","bg-0062":"-244px -960px","bg-0063":"-366px -960px","bg-0064":"-488px -960px","bg-0065":"0 -1040px","bg-0066":"-122px -1040px","bg-0067":"-244px -1040px","bg-0068":"-366px -1040px","bg-0069":"-488px -1040px","bg-0070":"0 -1120px","bg-0071":"-122px -1120px","bg-0072":"-244px -1120px","bg-0073":"-366px -1120px","bg-0074":"-488px -1120px","bg-0075":"0 -1200px","bg-0076":"-122px -1200px","bg-0077":"-244px -1200px","bg-0078":"-366px -1200px","bg-0079":"-488px -1200px","bg-0080":"0 -1280px","bg-0081":"-122px -1280px","bg-0082":"-244px -1280px","bg-0083":"-366px -1280px","bg-0084":"-488px -1280px","bg-0085":"0 -1360px","bg-0086":"-122px -1360px","bg-0087":"-244px -1360px","bg-0088":"-366px -1360px","bg-0089":"-488px -1360px","bg-0090":"0 -1440px","bg-0091":"-122px -1440px","bg-0092":"-244px -1440px","bg-0093":"-366px -1440px","bg-0094":"-488px -1440px","bg-0095":"0 -1520px","bg-0096":"-122px -1520px","bg-0097":"-244px -1520px","bg-0098":"-366px -1520px","bg-0099":"-488px -1520px","bg-0100":"0 -1600px","bg-0101":"-122px -1600px","bg-0102":"-244px -1600px","bg-0103":"-366px -1600px","bg-0104":"-488px -1600px","bg-0105":"0 -1680px","bg-0106":"-122px -1680px","bg-0107":"-244px -1680px","bg-0108":"-366px -1680px","bg-0109":"-488px -1680px","bg-0110":"0 -1760px","bg-0111":"-122px -1760px","bg-0112":"-244px -1760px","bg-0113":"-366px -1760px","bg-0114":"-488px -1760px","bg-0115":"0 -1840px","bg-0116":"-122px -1840px","bg-0117":"-244px -1840px","bg-0118":"-366px -1840px","bg-0119":"-488px -1840px","bg-0120":"0 -1920px","bg-0121":"-122px -1920px","bg-0122":"-244px -1920px","bg-0123":"-366px -1920px","bg-0124":"-488px -1920px","bg-0125":"0 -2000px","bg-0126":"-122px -2000px","bg-0127":"-244px -2000px","bg-0128":"-366px -2000px","bg-0129":"-488px -2000px","bg-0130":"0 -2080px","bg-0131":"-122px -2080px"},Ok=eL.default.button.attrs(function(e){let{background:t}=e,a=Ob[t],n=null;null!=a&&(n={backgroundColor:"bg-none"===t?e.theme.isNightMode?"#111":"#f8f8f8":a,backgroundImage:"none"});let l=Ov[t];return null!=l&&(n={backgroundPosition:l}),{style:n}}).withConfig({displayName:"ImageTile__Tile",componentId:"sc-66d43024-0"})` + display: flex; + width: 122px; + height: 72px; + align-items: center; + justify-content: center; + border: 2px solid transparent; + border-radius: 8px; + cursor: pointer; + background-image: url(${"/../images/bg-sprite.jpg"}); + background-size: 610px 2160px; + box-sizing: content-box; + padding: 0; + box-shadow: 0 0 0 0 ${e=>e.theme.appColors.hex(70)}; + transform: scale(0.95); + transition: box-shadow ease-in-out 100ms, transform ease-in-out 100ms; + + background-clip: content-box; + ${e=>e.active&&(0,eL.css)` + box-shadow: 0 0 0 2px ${e.theme.primaryColorScheme?.base}; + transform: scale(1); + `} + :hover { + transform: scale(1); + } + + :focus { + outline: 0; + } +`,OE=eL.default.span.withConfig({displayName:"ImageTile__Text",componentId:"sc-66d43024-1"})` + font-weight: 500; + color: ${e=>e.white?"#fcfcfc":e.theme.appColors.hex(10)}; + text-transform: uppercase; + ${e1.UiTypography.sm} +`,Ox=eL.default.div.withConfig({displayName:"ImageTile__LockIconWrapper",componentId:"sc-66d43024-2"})` + display: flex; + border-radius: 5px; + background: rgba(0, 0, 0, 0.3); + padding: 5px; +`,O_=(0,eL.default)(lT.r_).withConfig({displayName:"ImageTile__LockIcon",componentId:"sc-66d43024-3"})` + transform: scale(1.2); + & path { + fill: #fff; + } +`,Ow=function(e){let{background:t,locked:a,onBlock:n,onBackgroundChosen:l,active:r}=e;return ev.createElement(Ok,{background:t,onClick:a?n:()=>{l({type:"default",data:{value:t}},a)},active:r},"bg-none"===t&&ev.createElement(OE,null,ev.createElement(eY.Z,{id:"general.none",defaultMessage:"None"})),"bg-random"===t&&ev.createElement(OE,{white:!0},ev.createElement(eY.Z,{id:"general.random",defaultMessage:"Random"})),a&&ev.createElement(Ox,null,ev.createElement(O_,null)))},ON=eL.default.div.withConfig({displayName:"Images__Container",componentId:"sc-8355995e-0"})` + display: flex; + flex-wrap: wrap; + grid-gap: 10px; + padding: 10px 5px; + overflow-y: scroll; + ${tM}; +`,OC=(0,e$.connect)(function(e){return{isLoggedIn:t9(e)}})(function(e){let{isLoggedIn:t,taskadePlanType:a,onBackgroundChosen:n,backgroundState:l,dispatch:r}=e,o=ev.useMemo(()=>{let{background:e}=l;return"default"===e.type?e.data.value:null},[l]),i=()=>{t?r(d4()):r(rh({isOpen:!0,activeView:rI}))};return ev.createElement(ON,{className:"bg-tiles"},jW.map(e=>ev.createElement(Ow,{key:e,background:e,onBackgroundChosen:n,locked:jK(e,t,a),onBlock:i,active:e===o})))});var OM=a(41389);async function OS(e,t){let{token:a,awsUploadAPIBaseURL:n}=t,l=await fetch(`${n}/uploads`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest","uploads-authorization-jwt":a,"Content-Type":"application/json"},body:JSON.stringify({body:{s3ObjectKey:e}})});if(!l.ok)throw Error("Something went wrong. Please try again.");return l.json()}async function OI(e,t,a,n,l){let r={type:e,includeS3Policy:"true",filename:t,filesize:a};null!=n&&(r.documentID=n),null!=l&&(r.spaceId=l);let o=await fetch("/web-api/uploads/request-data",{credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(r)});if(!o.ok){let e=new ei.FetchError(o),t=await e.toTaskadeError();if(null!=t)throw t;throw e}return o.json()}async function OD(e,t,a){let{s3Policy:n,s3URL:l}=t,{formData:r,s3ObjectKey:o}=uo(e,n,a);if(null==o||!(await fetch(l,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:r})).ok)throw Error("Something went wrong. Please try again.");return{s3ObjectKey:o}}async function OT(e,t){let a=function(e){switch(e.type){case"image/gif":return"gif";case"image/jpeg":return"jpg";case"image/png":return"png";default:return}}(e);if(null==a)throw new ei.HttpError({code:"BAD_REQUEST",message:"Invalid file"});let n=`background.${a}`,l=e.size,r=await OI("user_background",n,l,t);if(!r.ok)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Something went wrong. Please try again."});let o=r.payload,{s3ObjectKey:i}=await OD(e,o,n);return{ok:!0,object:await OS(i,o)}}let O$=(0,eL.css)` + background-image: linear-gradient( + 90deg, + ${e=>e.theme.appColors.hex(50)} 50%, + transparent 50% + ), + linear-gradient(90deg, ${e=>e.theme.appColors.hex(50)} 50%, transparent 50%), + linear-gradient(0deg, ${e=>e.theme.appColors.hex(50)} 50%, transparent 50%), + linear-gradient(0deg, ${e=>e.theme.appColors.hex(50)} 50%, transparent 50%); + + background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; + background-size: 15px 2px, 15px 2px, 2px 15px, 2px 15px; + background-position: left top, right bottom, left bottom, right top; +`,OP=eL.default.label.withConfig({displayName:"BackgroundUploadTile__Tile",componentId:"sc-a7fd3396-0"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,OF=eL.default.span.withConfig({displayName:"BackgroundUploadTile__Subtitle",componentId:"sc-a7fd3396-1"})` + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm}; +`,OA=eL.default.label.withConfig({displayName:"BackgroundUploadTile__DropzoneWrapper",componentId:"sc-a7fd3396-2"})` + ${O$} + display: flex; + align-items: center; + justify-content: center; + margin-top: 12px; + padding: 20px 0; + border-radius: 10px; + color: ${e=>e.error?eI.ThemeColors.warning:e.theme.appColors.hex(50)}; +`,OR=eL.default.div.withConfig({displayName:"BackgroundUploadTile__DropzoneTitle",componentId:"sc-a7fd3396-3"})` + display: inline; + font-size: 16px; + font-weight: 500; +`,Oj=eL.default.span.withConfig({displayName:"BackgroundUploadTile__UnderlineText",componentId:"sc-a7fd3396-4"})` + border-bottom: 1px solid ${e=>e.theme.appColors.hex(50)}; + cursor: pointer; + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,OO=eL.default.input.withConfig({displayName:"BackgroundUploadTile__StyledInput",componentId:"sc-a7fd3396-5"})` + display: none; +`,OU=eL.default.div.withConfig({displayName:"BackgroundUploadTile__ErrorWrapper",componentId:"sc-a7fd3396-6"})` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +`,OZ=eL.default.span.withConfig({displayName:"BackgroundUploadTile__ErrorMessage",componentId:"sc-a7fd3396-7"})` + color: ${eI.ThemeColors.warning}; +`,OL=(0,eL.default)(e1.Notice).withConfig({displayName:"BackgroundUploadTile__StyledNotice",componentId:"sc-a7fd3396-8"})` + color: ${eI.ThemeColors.success}; + ${e1.UiTypography.sm}; + margin-bottom: 12px; + margin-top: 6px; +`,OB=function(e){let t,a,n;let{documentId:l,onBackgroundChosen:r}=e,o=(0,wu.D)(async e=>{r({type:"custom",data:{file:(await OT(e,l)).object.data}},!1)}),i=o.mutate,s=(0,ev.useCallback)(e=>{let t=e[0];null!=t&&i(t)},[i]),{getRootProps:d,getInputProps:c,isDragActive:m}=(0,OM.u)({onDropAccepted:s,multiple:!1,accept:".jpg,.jpeg,.png,.gif",noDragEventsBubbling:!0});o.isSuccess&&(t=ev.createElement(OL,{$type:"success"},ev.createElement(eY.Z,{id:"general.image_upload_success",defaultMessage:"Image uploaded successfully!"})));let u=ev.createElement(OF,null,ev.createElement(eY.Z,{id:"general.image_upload_requirements",defaultMessage:"The image must be at least 800 x 600 and at most 6000 x 4000 pixels in width & height. Files cannot exceed 11MB."}));return o.isLoading?a=ev.createElement(OA,null,ev.createElement(eI.Spinner,{marginBottom:0})):(n=m?ev.createElement(eY.Z,{id:"general.drop_image_to_upload",defaultMessage:"Drop image to upload"}):o.isError?ev.createElement(OU,null,ev.createElement(OZ,null,o.error?.message),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.drag_image_here_or_select_image_to_upload",defaultMessage:"Drag image here or select image to upload",values:{span:e=>ev.createElement(Oj,null,e)}}))):ev.createElement(eY.Z,{id:"general.drag_image_here_or_select_image_to_upload",defaultMessage:"Drag image here or select image to upload",values:{span:e=>ev.createElement(Oj,null,e)}}),a=ev.createElement(OA,{...d(),onClick:e=>e.stopPropagation()},ev.createElement(OO,c()),ev.createElement(OR,null,n))),ev.createElement(OP,{htmlFor:"background"},t,u,a)},Oz=function(e){let{documentId:t,onBackgroundChosen:a}=e;return ev.createElement(OB,{documentId:t,onBackgroundChosen:a})},OV=(0,la.ZP)` + mutation ProjectBackgroundUpdateMutation($input: ProjectBackgroundUpdateInput!) { + projectBackgroundUpdate(input: $input) { + clientMutationId + document { + id + shared_preferences + } + } + } +`,Oq=(0,la.ZP)` + mutation ProjectCoverImageTypeUpdateMutation($input: ProjectCoverImageTypeUpdateInput!) { + projectCoverImageTypeUpdate(input: $input) { + clientMutationId + document { + id + shared_preferences + } + } + } +`;function OW(e){return!fR.Vl.getFeature("project.wallpaper").plans[e]}let OH=eL.default.div.withConfig({displayName:"styled__CoverImageOptionContainer",componentId:"sc-3735ac5d-0"})` + display: flex; + align-items: center; + margin-top: 8px; +`,OG=(0,eL.default)(eI.TabList).withConfig({displayName:"styled__StyledTabList",componentId:"sc-3735ac5d-1"})` + margin-top: 20px; + + display: flex; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + + & > div { + ${e1.UiTypography.sm}; + margin-right: 20px !important; + & > div { + margin-left: 2px; + } + } +`,OK=eL.default.div.withConfig({displayName:"styled__StyledTabPanel",componentId:"sc-3735ac5d-2"})` + margin-top: 10px; + ${e1.UiTypography.sm}; + display: flex; + flex-direction: column; + color: ${e=>e.theme.textColors.hex(50)}; + overflow: hidden; +`,OY=function(e){let{document:t}=e,a=t.space?.taskadePlanType??"free",n=d6(),l="free"!==a||n,[r,o]=(0,ev.useState)("images"),i=(0,ev.useContext)(jz),s=(0,eF.k6)(),d=ev.useMemo(()=>jU(i.background),[i.background]),[c]=(0,cs.D)(OV),[m]=(0,cs.D)(Oq),u=e=>{null!=t&&lm({role:t.role,action:{project:"edit",workspace:"project_edit"}})&&c({variables:{input:{clientMutationId:(0,ld.Z)(),documentId:t.id,background:e}}})},p=ev.useCallback(e=>{(async function(){if(null==t||!lm({role:t?.role,action:{project:"edit",workspace:"project_edit"}}))return;let a=(0,ld.Z)();await m({variables:{input:{clientMutationId:a,documentId:t?.id,coverImageType:e}}});let n=new URLSearchParams(s.location.search);if(!n.has("coverImageType"))return;n.delete("coverImageType");let l=n.toString();s.replace({...s.location,search:l})})()},[t,s,m]);return ev.createElement(ev.Fragment,null,ev.createElement(jh,null,ev.createElement(tn.Icon,{icon:"settings_appearance"}),"Appearance"),ev.createElement(jy,null,"Customize the project cover image, it can be hidden, displayed as a banner or a background."),ev.createElement(jv,null,"Cover Image"),ev.createElement(OH,null,ev.createElement(Od,{type:"none",active:"none"===i.coverImageType,onSelect:p}),ev.createElement(Od,{type:"banner",active:"banner"===i.coverImageType,onSelect:p}),ev.createElement(Od,{type:"background",active:"background"===i.coverImageType,onSelect:p})),"none"!==i.coverImageType&&ev.createElement(ev.Fragment,null,ev.createElement(OG,{type:e1.TabTypes.Underline,value:r,onChange:e=>o(e)},ev.createElement(e1.Tab,{value:"images"},ev.createElement(eY.Z,{id:"general.images",defaultMessage:"Images"})),ev.createElement(e1.Tab,{value:"colors"},ev.createElement(eY.Z,{id:"general.colors",defaultMessage:"Colors"})),l&&ev.createElement(e1.Tab,{value:"gradients"},ev.createElement(eY.Z,{id:"general.gradients",defaultMessage:"Gradients"}),OW(a)&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),l&&ev.createElement(e1.Tab,{value:"artwork"},ev.createElement(eY.Z,{id:"general.artwork",defaultMessage:"Artwork"}),OW(a)&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),l&&ev.createElement(e1.Tab,{value:"upload"},ev.createElement(eY.Z,{id:"general.upload",defaultMessage:"Upload"}),OW(a)&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"}))),ev.createElement(eI.TabPanelSwitch,{value:r},ev.createElement(OK,{value:"images"},ev.createElement(OC,{taskadePlanType:a,backgroundState:d,onBackgroundChosen:u})),ev.createElement(OK,{value:"colors"},ev.createElement(Oa,{taskadePlanType:a,backgroundState:d,onBackgroundChosen:u})),ev.createElement(OK,{value:"gradients"},ev.createElement(Oy,{taskadePlanType:a,backgroundState:d,onBackgroundChosen:u})),ev.createElement(OK,{value:"artwork"},ev.createElement(j3,{taskadePlanType:a,backgroundState:d,onBackgroundChosen:u})),ev.createElement(OK,{value:"upload"},ev.createElement(Oz,{documentId:t.id,onBackgroundChosen:u})))))},OQ=eL.default.div.withConfig({displayName:"ProjectSettingsDialogBody__Container",componentId:"sc-59e7ba0e-0"})` + display: flex; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 12px; + overflow: hidden; + + width: 90vw; + height: 90vh; + + @media screen and (min-width: 992px) { + width: 1012px; + height: 70vh; + } +`,OJ=eL.default.div.withConfig({displayName:"ProjectSettingsDialogBody__Sidebar",componentId:"sc-59e7ba0e-1"})` + display: flex; + flex-direction: column; + width: 180px; + flex-shrink: 0; + background: ${e=>e.theme.appColors.hex(90)}; + border-right: 1px solid ${e=>e.theme.appColors.hex(80)}; + padding: 20px 0; + + @media screen and (min-width: 992px) { + width: 260px; + } +`,OX=eL.default.button.withConfig({displayName:"ProjectSettingsDialogBody__SidebarItem",componentId:"sc-59e7ba0e-2"})` + display: flex; + align-items: center; + min-height: 40px; + padding: 0 20px; + color: ${e=>e.theme.appColors.hex(10)}; + & svg { + margin-right: 12px; + } + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background: ${e.theme.appColors.hex(80)}; + `} +`,O0=(0,eL.default)(e1.Overline).withConfig({displayName:"ProjectSettingsDialogBody__StyledOverline",componentId:"sc-59e7ba0e-3"})` + padding: 0 20px; +`,O1=eL.default.div.withConfig({displayName:"ProjectSettingsDialogBody__Content",componentId:"sc-59e7ba0e-4"})` + display: flex; + flex-direction: column; + padding: 30px; + overflow: hidden; +`,O2=function(e){let{dialogState:t}=e,{projectId:a,page:n}=t,[l,r]=(0,ev.useState)(n??"appearance"),{search:o}=(0,eF.TH)(),i=s4(o),{loading:s,data:d}=(0,eB.a)(s3,null!=a?{variables:{documentId:a,shareToken:i}}:{skip:!0});if(s)return ev.createElement(OQ,null,ev.createElement(eI.Spinner,{size:36}));let c=d?.document??null;return null==c?ev.createElement(OQ,null,"Project not found"):ev.createElement(OQ,null,ev.createElement(OJ,null,ev.createElement(O0,null,ev.createElement(eY.Z,{id:"general.project",defaultMessage:"Project"})),ev.createElement(OX,{$active:"appearance"===l,onClick:()=>r("appearance")},ev.createElement(tn.Icon,{icon:"settings_appearance"}),"Appearance"),ev.createElement(OX,{$active:"admin"===l,onClick:()=>r("admin")},ev.createElement(tn.Icon,{icon:"dd_settings"}),ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"}))),ev.createElement(O1,null,"appearance"===l&&ev.createElement(OY,{document:c}),"admin"===l&&ev.createElement(jA,{document:c})))},O5=(0,e$.connect)(function(e){return{doc:dV(e),dialogState:e.dialogs.projectSettings}})(function(e){let{dialogState:t,doc:a}=e,{isOpen:n}=t,l=(0,e$.useDispatch)(),r=(0,ev.useCallback)(()=>{l(M1.actions.toggleProjectSettingsDialog())},[l]);return n?M0(a?.role,"manage_settings")?ev.createElement(eI.ModalDialog,{isOpen:n,close:r,backdropOpacity:eI.ModalDialogOpacity.Translucent},e=>{let{exit:a}=e;return ev.createElement(O2,{dialogState:t,exit:a})}):(console.warn("User not allowed to view project settings."),l(M1.actions.toggleProjectSettingsDialog()),null):null});var O3=a(57043);let O4=dw.z.object({agentId:dw.z.string(),text:dw.z.string()});dw.z.object({data:O4,messages:dw.z.array(hR.gh)}),dw.z.object({text:dw.z.string()});let O6=dw.z.object({type:dw.z.literal("agent"),id:dw.z.string()}),O8=dw.z.object({messages:dw.z.array(hR.gh),input:hR.jS,context:O6.nullish().optional()}),O7={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ConversationMessagesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"last"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"5"}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"before"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationMessagesFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"conversationMessages"},arguments:[{kind:"Argument",name:{kind:"Name",value:"last"},value:{kind:"Variable",name:{kind:"Name",value:"last"}}},{kind:"Argument",name:{kind:"Name",value:"before"},value:{kind:"Variable",name:{kind:"Name",value:"before"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"conversationId"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"role"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}}]}}]}}]},O9={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUserConversationsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"conversations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]},Ue={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectConversationDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"conversationDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},Ut=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-df018548-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,Ua=ev.forwardRef(function(e,t){let{loading:a,onStopAiGeneration:n,sendChat:l}=e,[r,o]=ev.useState(""),i=ev.useRef(null),s=(0,eK.Z)(),d=(0,e$.useDispatch)();return ev.useImperativeHandle(t,()=>({focusInput:()=>{i.current?.focus()},resetInput:()=>{o("")}}),[]),ev.useEffect(()=>{i.current?.focus()},[]),ev.createElement("div",{onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.Enter:if(e.shiftKey)break;e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l(r)}},className:"mx-5 mt-auto rounded-xl border border-solid border-appcolor-400 bg-appcolor-100"},ev.createElement("div",{className:"flex flex-col gap-1 text-sm text-appcolor-700"},ev.createElement("div",{className:"flex"},ev.createElement(Dx.Z,{ref:i,className:"w-full bg-transparent p-4",placeholder:s.formatMessage({id:"agent.ask_me_anything",defaultMessage:"Ask me anything..."}),value:r,onChange:e=>{o(e.target.value)},minRows:2,maxRows:5})),ev.createElement("div",{className:"flex px-4 pb-3"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>{d(co.actions.toggleAiPromptTemplatesDialog())}},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"})),a?ev.createElement("button",{onClick:n,type:"button",className:"ml-auto flex h-7 items-center text-appcolor-500 hover:text-primary"},ev.createElement(tn.Icon,{icon:"ai_stop"})):ev.createElement("button",{className:"ml-auto flex items-center text-appcolor-500 hover:text-primary",onClick:()=>{l(r)}},ev.createElement(tn.Icon,{icon:"message_send"})))))}),Un=eL.default.div.withConfig({displayName:"styled__MarkdownFormatting",componentId:"sc-a21c7422-0"})` + display: flex; + flex-direction: column; + + & p { + margin-top: 0; + margin-bottom: 12px; + line-height: 19px; + + &:only-child { + margin-bottom: 0; + } + } + + & .paragraph { + word-break: break-word; + margin-bottom: 12px; + line-height: 19px; + &:only-child { + margin-bottom: 0; + } + } +`,Ul=function(e){let{onCopy:t}=e,[a,n]=ev.useState(!1);return ev.createElement("div",{className:"mt-2 flex gap-x-2"},ev.createElement("div",{onClick:()=>{t(),n(!0),setTimeout(()=>{n(!1)},1e3)},className:"mt-1 flex cursor-pointer justify-center rounded-xl border border-appcolor-400 px-3 py-1 text-xs text-appcolor-500 transition duration-150 ease-in-out hover:bg-appcolor-300 hover:text-appcolor-800"},a?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"})))},Ur=function(e){let{agent:t,content:a,loading:n}=e;return ev.createElement("div",{className:"rounded-xl border border-solid border-appcolor-300 bg-appcolor-200 py-5"},ev.createElement("div",{className:"flex px-4"},ev.createElement(Tc,{agent:t,size:"sm"}),ev.createElement("div",{className:"ml-3 flex-1"},ev.createElement("div",{className:"flex text-sm"},ev.createElement("span",{className:"flex-1 font-bold text-textcolor-900"},t.name)),ev.createElement(Un,{className:"mt-1 text-sm text-textcolor-900"},ev.createElement(DA,{value:a,shouldRemoveCodeFence:!0})),!n&&ev.createElement(Ul,{onCopy:()=>{navigator.clipboard.writeText(a)}}))))},Uo=function(e){let{message:t}=e,a=t.contents[0].content,n=(0,eB.a)(sW),l=n.data?.me,r=l?.default_name??"",o=l?.avatars_v2.small?.mdpi.url??"";return ev.createElement("div",{className:"flex px-4"},ev.createElement("img",{className:"h-6 w-6 rounded-full",src:o,alt:r}),ev.createElement("div",{className:"ml-3 flex-1"},ev.createElement("div",{className:"flex text-sm"},ev.createElement("span",{className:"flex-1 font-bold text-textcolor-900"},r)),ev.createElement(Un,{className:"mt-1 text-sm text-textcolor-900"},ev.createElement(Pa,{value:a}))))},Ui=eL.default.div.withConfig({displayName:"Conversation__MessageContainer",componentId:"sc-c93a0f8d-0"})` + ${tS} +`,Us=function(e){let{agent:t,sendChat:a,handleEditAgent:n}=e;return ev.createElement("div",{className:"mt-auto grid w-full grid-cols-2 gap-2 px-5 pb-5"},t.data.commands.map(e=>ev.createElement("button",{className:"flex items-start gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-3 text-sm text-appcolor-600 transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800",type:"button",key:e.id,onClick:()=>a(e.prompt)},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_commands"}),ev.createElement("div",{className:"flex flex-col gap-1 overflow-hidden text-left"},ev.createElement("span",{className:"truncate"},e.name),ev.createElement("p",{className:"line-clamp-1 flex-wrap truncate whitespace-normal break-all text-left text-appcolor-500"},e.prompt)))),ev.createElement("button",{className:"flex items-start gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-3 text-sm text-appcolor-600 transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800",type:"button",onClick:n},ev.createElement(tn.Icon,{className:"shrink-0",icon:"ai_add"}),ev.createElement("div",{className:"flex flex-col gap-1 text-left"},ev.createElement(eY.Z,{id:"general.edit_agent_add_command",defaultMessage:"Add command"}),ev.createElement("p",{className:"line-clamp-1 flex-wrap whitespace-normal break-all text-left text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.create_command",defaultMessage:"Create a new command"})))))},Ud=ev.forwardRef(function(e,t){let{className:a,agent:n,messages:l,sendChat:r,handleEditAgent:o,loading:i,onScroll:s}=e;return 0===l.length?ev.createElement("div",{className:"flex flex-1 flex-col items-center overflow-auto"},ev.createElement("div",{className:"mt-auto flex max-w-sm flex-col items-center py-16 text-center"},ev.createElement(lT.fJ,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.start_conversation",defaultMessage:"Start a conversation"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agents.ask_question_to_get_insights_based_on_your_agents_description_persona_tone_and_access_to_knowledge",defaultMessage:"Ask questions to get insights based on your agent's description, persona, tone, and access to knowledge."}))),ts()(n.data.commands)?ev.createElement("button",{className:"my-8 flex items-center gap-3 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-1 pl-2 pr-3 text-sm transition duration-150 ease-in-out hover:bg-appcolor-200",onClick:o},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"ai_add"})),ev.createElement(eY.Z,{id:"agent.add_command",defaultMessage:"Add command"})):ev.createElement(Us,{agent:n,sendChat:r,handleEditAgent:o})):ev.createElement("div",{ref:t,className:"flex w-full flex-1 flex-col items-center justify-end overflow-auto"},ev.createElement(Ui,{className:og()(a,"flex w-full flex-col-reverse gap-3 overflow-auto px-5 py-4"),onScroll:s},Array.from((0,eo.makeReverseIterable)(l),e=>"human"===e.role||"user"===e.role?ev.createElement(Uo,{key:e.id,message:e}):ev.createElement(Ur,{key:e.id,agent:n,content:e.contents[0].content,loading:null==e.id})),i&&ev.createElement(eI.Spinner,null)))}),Uc=function(e){let t=ev.useRef(null),a=ev.useRef(null),n=ev.useRef(null),[l,r]=ev.useState(!1),{arrowProps:o,popperProps:i,referenceProps:s}=(0,eI.useControlledTooltip)({referenceElementRef:t,arrowElementRef:a,popperElementRef:n,placement:"top",visible:l});return ev.createElement(ev.Fragment,null,ev.createElement(e1.Overline,{...s,onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},className:"w-fit cursor-pointer rounded-xl"},e.children),l&&ev.createElement(eI.Tooltip,{arrowProps:o,popperProps:i},e.tooltipContent))},Um={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentMediasQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"medias"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMediaParts"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]},Uu=function(e){let{data:t,loading:a,error:n,refetch:l}=(0,eB.a)(Um,{variables:{id:e.spaceAgentId}}),r=t?.spaceAgent.medias.edges,o=ev.useMemo(()=>a||null!=n?null:null==r||r.some(e=>{switch(e.node.transcriptEmbeddingStatus){case ei.StatusCode.OK:case ei.StatusCode.BAD_REQUEST:return!1;default:return!0}}),[r,n,a]);return a?ev.createElement(eI.Spinner,{width:20,height:20}):null!=n?ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs text-center"},n.message)},ev.createElement(tn.Icon,{onClick:()=>l(),className:"text-warning",icon:"automate_warning"})):o?ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"media.tooltip.theres_a_problem_with_one_or_more_knowledge_sources",defaultMessage:"There's a problem with one or more knowledge sources."}))},ev.createElement(tn.Icon,{className:"text-danger",icon:"automate_warning"})):null},Up=function(e){let{value:t,name:a,children:n,...l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a,disabled:l.disabled});return ev.createElement("button",{...o.props,...l},n)},Ug=function(e){let{initialFocus:t,menuGroupDispatch:a}=e,n=og()("flex select-none items-center px-3 py-1 text-sm hover:cursor-pointer hover:bg-appcolor-300");return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{className:"flex w-48 flex-col overflow-hidden rounded-xl border border-appcolor-300 bg-appcolor-0 py-2",initialFocus:t,loop:!0},ev.createElement(Up,{name:"clear_history",className:og()(n,"text-danger")},ev.createElement(tn.Icon,{className:"mr-2 shrink-0 scale-80",icon:"dd_delete"}),ev.createElement(eY.Z,{id:"agent.clear_history",defaultMessage:"Clear history"}))))},Uf=function(e){let{onClearHistory:t}=e,[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1}),l=ev.useRef(null),r=ev.useRef(null),o=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:a,placement:"bottom-end"}),i=(0,eI.useMenuButton)({dispatch:n,ref:l,state:a}),s=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:a}=e.payload;"clear_history"===a&&t(),n({type:"Collapse",payload:"none"});break}case"Dismiss":n({type:"Collapse"})}},[t]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...i.props,className:"group flex h-8 w-8 items-center justify-center text-appcolor-500 hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"header_more"})),a.expanded&&ev.createElement(eI.Popup,{...o.props,dispatch:n,modal:!0},ev.createElement(Ug,{initialFocus:o.initialFocus,menuGroupDispatch:s})))},Uh=function(e){let{agent:t,onExit:a,send:n}=e,l=(0,ll.x)(),r=(0,eK.Z)(),o=ev.useRef(null),i=ev.useRef(null),[s,d]=ev.useState(null),[c,m]=ev.useState(null),[u,{loading:p}]=(0,cs.D)(Ue),g=ev.useMemo(()=>({first:1,filterby:{spaceAgentId:t.id}}),[t]),{data:f,loading:h,error:y}=(0,eB.a)(O9,{variables:g}),b=f?.conversations?.edges[0]?.node.id??null,v=ev.useMemo(()=>({last:20,filterby:{conversationId:b}}),[b]),{data:k,error:E,loading:x,fetchMore:_}=(0,eB.a)(O7,{variables:v,notifyOnNetworkStatusChange:!0,skip:null==b}),w=k?.conversationMessages.pageInfo.startCursor,N=k?.conversationMessages.pageInfo.hasPreviousPage,C=k?.conversationMessages.edges,M=ev.useMemo(()=>{let e=(C??[]).map(e=>{let{node:t}=e;return{id:t.id,conversationId:t.conversationId,role:t.role,contents:[{content:t.message}]}});return null!=c&&e.push({id:c.id,conversationId:c.conversationId,role:c.role,contents:[{content:c.message}]}),e},[C,c]);ev.useEffect(()=>{null!=o.current&&(o.current.scrollTop=o.current.scrollHeight)},[M]);let[S,{loading:I,error:D}]=$N(ev.useCallback(e=>{m(null);let{cache:t}=l,a=hR.gh.safeParse(e);if(!a.success)return;let n=a.data,r={...v,filterby:{conversationId:n.conversationId}},o=t.readQuery({query:O9,variables:g});null==b&&ts()(o?.conversations.edges)&&t.updateQuery({query:O9,variables:g},e=>Ml()(e,{conversations:{$set:{edges:[{node:{id:n.conversationId}}]}}})),null==t.readQuery({query:O7,variables:r})&&t.writeQuery({query:O7,variables:r,data:{conversationMessages:{edges:[],pageInfo:{hasNextPage:!1,hasPreviousPage:!1,startCursor:null,endCursor:null}}}}),t.updateQuery({query:O7,variables:r},e=>{if(null==e)return e;let t=e.conversationMessages.edges.findLastIndex(e=>e.node.id===n.id);return -1!==t?Ml()(e,{conversationMessages:{edges:{[t]:{$set:{__typename:"ConversationMessageEdge",cursor:n.id,node:{__typename:"ConversationMessage",id:n.id,conversationId:n.conversationId,message:n.contents[0].content,role:n.role}}}}}}):0===n.contents[0].content.length?e:Ml()(e,{conversationMessages:{edges:{$push:[{__typename:"ConversationMessageEdge",cursor:n.id,node:{__typename:"ConversationMessage",id:n.id,conversationId:n.conversationId,message:n.contents[0].content,role:n.role}}]}}})})},[l,b,O7,v,g]),ev.useCallback(()=>{d(null)},[])),T=(h||x)&&0===M.length,$=CP()(M)?.id,P=ev.useCallback(e=>{if(0===e.trim().length||I)return;i.current?.resetInput(),i.current?.focusInput(),m({__typename:"ConversationMessage",id:(0,O3.SK)(),role:"human",message:e.trim(),conversationId:""});let a=O8.parse({input:{role:"human",content:e.trim(),parentMessageId:$??void 0},messages:M.slice(-8),context:{type:"agent",id:t.id}}),n=new AbortController;d(n),S("/web-api/ai/v2/conversation/agent",{method:"POST",credentials:"same-origin",body:JSON.stringify(a),headers:{"Content-Type":"application/json"},signal:n.signal})},[t,i,I,S,M,$]),F=ev.useCallback(async()=>{if(i.current?.focusInput(),p||T||null==b||""===b)return;let e=r.formatMessage({id:"general.confirm_clear_conversation",defaultMessage:"Are you sure you want to clear the conversation?"});confirm(e)&&await u({variables:{input:{clientMutationId:(0,ld.Z)(),id:b}},update(e,a){let{data:n,errors:l}=a;if(null!=l||null==n||!0!==n.conversationDelete.ok)return;let r=f?.conversations?.edges[0].node??null;null!=r&&(e.evict({id:"ROOT_QUERY",fieldName:"conversationMessages",args:{filterby:{conversationId:r.id}}}),e.evict({id:"ROOT_QUERY",fieldName:"conversations",args:{filterby:{spaceAgentId:t.id}}}),e.gc())}})},[t.id,f?.conversations?.edges,b,T,u,p,r]),A=ev.useCallback(()=>{n({type:"EXIT",payload:{source:"edit-agent",agentId:t.id}})},[t.id,n]),R=ev.useCallback(e=>{if(!N||null==w||x)return;let t=e.currentTarget;t.scrollTop+t.scrollHeight-t.clientHeight<5&&_({variables:{before:w}})},[x,_,N,w]),j=ev.useCallback(()=>{I&&null!=s&&(s.abort(),d(null))},[s,I]);D$({error:D,onError:a});let O=T_((0,eI.useTheme)()),U=(null==D||$_(D)?null:D)||y||E;return ev.createElement(Ut,{className:"flex h-full flex-col items-stretch bg-appcolor-0",style:O},ev.createElement("div",{className:"flex items-center border-b border-solid border-appcolor-300 pb-3 pl-8 pr-5 pt-4"},ev.createElement("div",{className:"flex items-center gap-3"},ev.createElement("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(Tc,{agent:t,size:"sm"})),ev.createElement("p",{className:"overflow flex w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-textcolor-900"},0===t.name.length?"Untitled":t.name)),ev.createElement("div",{className:"ml-auto flex items-center gap-2"},ev.createElement(Uu,{spaceAgentId:t.id}),ev.createElement("button",{type:"button",className:"flex h-8 items-center gap-1 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-2 py-2 text-sm text-appcolor-600 transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800",onClick:A},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_edit"}),ev.createElement(eY.Z,{id:"agent.edit_agent",defaultMessage:"Edit agent"})),ev.createElement(Uf,{onClearHistory:F}))),ev.createElement("div",{className:"flex flex-1 flex-col overflow-auto pb-5"},null!=U?ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},U.message):ev.createElement(ev.Fragment,null,T?ev.createElement("div",{className:"flex flex-1"},ev.createElement(eI.Spinner,null)):ev.createElement(ev.Fragment,null,ev.createElement(Ud,{ref:o,agent:t,messages:M,sendChat:P,handleEditAgent:A,loading:x,onScroll:R}),ev.createElement(Ua,{ref:i,loading:I,onStopAiGeneration:j,sendChat:P})))))},Uy=(0,d9.oM)({name:"dialogs.spaceAgentChat",initialState:{isOpen:!1,agent:null},reducers:{toggleSpaceAgentChatDialog(e,t){if(e.isOpen||null==t.payload)return{isOpen:!1,agent:null};let{agent:a}=t.payload;return{isOpen:!0,agent:a}}}}),Ub=function(){let e=(0,e$.useDispatch)(),t=(0,e$.useSelector)(e=>e.dialogs.spaceAgentChat),a=ev.useCallback((t,a)=>{e(Uy.actions.toggleSpaceAgentChatDialog()),"EXITED"===a.type&&null!=a.payload&&"edit-agent"===a.payload.source&&"string"==typeof a.payload.agentId&&e(TS.actions.toggleEditSpaceAgentDialog({agentId:a.payload.agentId}))},[e]);if(!t.isOpen||null==t.agent)return null;let{agent:n}=t;return ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-5xl rounded-xl",isOpen:t.isOpen,close:a,autofocus:!1,disableBackground:!0},e=>{let{exit:t,send:a}=e;return ev.createElement(Uh,{agent:n,onExit:t,send:a})})},Uv=function(){let e=(0,eF.$B)().params.documentID,{search:t}=(0,eF.TH)(),a=ev.useMemo(()=>s4(t),[t]),n=null!=e?{id:e,shareToken:a}:null,l=(0,e$.useDispatch)(),{data:r}=(0,eB.a)(Fm,null!=n?{variables:n,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}:{skip:!0}),o=r?.document?.addons.assignees;ev.useEffect(()=>{null!=o&&l({type:xg,payload:o})},[o,l]);let i=r?.document?.addons.dates;ev.useEffect(()=>{null!=i&&l(x_(i))},[i,l]);let s=r?.document?.addons.countdowns;ev.useEffect(()=>{null!=s&&l(xw(s))},[s,l]);let d=r?.document?.addons.reactionCollections;return ev.useEffect(()=>{null!=d&&l(xN(d))},[d,l]),null},Uk=(0,la.ZP)` + query TemplateChoicesQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + role + space { + id + templates { + edges { + node { + id + info + edit_path + shared_preferences + preferences { + view + } + role { + project + workspace + } + } + } + } + } + } + } +`,UE=(0,eL.css)` + display: flex; + background: none; + border: 0; + padding: 0; + margin: 0; + outline: 0; + cursor: pointer; + + &:focus { + outline: 0; + } +`,Ux=eL.default.div.withConfig({displayName:"Styles__TemplatesWrapper",componentId:"sc-89ea8830-0"})` + display: flex; + width: 100%; + padding: 0 20px; + flex-direction: column; + z-index: 1; +`,U_=eL.default.div.withConfig({displayName:"Styles__TemplateSection",componentId:"sc-89ea8830-1"})` + flex: 0 0 auto; + display: flex; + flex-direction: column; + width: 100%; + margin-bottom: 10px; + + & > div > button:last-child { + margin-bottom: 10px; + } +`;(0,eL.default)(e1.Overline).withConfig({displayName:"Styles__Heading",componentId:"sc-89ea8830-2"})` + padding: 0 10px; + margin-bottom: 4px; + color: ${e=>e.theme.textColors.hex("50")}; +`;let Uw=eL.default.div.withConfig({displayName:"Styles__TemplateButton",componentId:"sc-89ea8830-3"})` + ${UE}; + position: absolute; + top: 8px; + right: 12px; + opacity: 0; + color: ${e=>e.theme.appColors.hex(60)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,UN=eL.default.div.withConfig({displayName:"Styles__CreateButton",componentId:"sc-89ea8830-4"})` + align-items: center; + justify-content: flex-end; + width: 50%; + position: absolute; + top: 0; + bottom: 0; + right: 0; + border-radius: 0 12px 12px 0; + + background: ${e=>e.theme.isNightMode?"rgb(37, 40, 45)":"rgb(247, 247, 247)"}; + background: ${e=>e.theme.isNightMode?"linear-gradient(90deg, rgba(37, 40, 45, 0) 0%, rgba(37, 40, 45, 1) 50%)":"linear-gradient(90deg, rgba(247, 247, 247, 0) 0%, rgba(247, 247, 247, 1) 50%)"}; + + & > span { + display: flex; + align-items: center; + justify-content: center; + height: 30px; + padding: 0 10px; + font-weight: 500; + border-radius: 12px; + white-space: nowrap; + color: #fff; + ${e1.UiTypography.sm}; + background: ${e=>e.theme.primaryColorScheme?.base}; + margin-right: 4px; + transition: background-color ease-in-out 0.2s; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,UC=eL.default.button.withConfig({displayName:"Styles__TemplateMenuItem",componentId:"sc-89ea8830-5"})` + width: 100%; + ${e1.UiTypography.sm}; + padding: 4px 40px 4px 10px; + align-items: center; + border-radius: 10px; + justify-content: space-between; + color: ${e=>e.theme.textColors.hex(10)}; + background: ${e=>e.$selected?e.theme.appColors.hex(80):"inherit"}; + margin-bottom: 0.125rem; + position: relative; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + ${Uw} { + opacity: 1; + } + } + + ${Uw} { + opacity: ${e=>e.$selected?"1":"0"}; + } + + ${UN} { + display: ${e=>e.$selected?"flex":"none"}; + opacity: ${e=>e.$selected?"1":"0"}; + } +`,UM=eL.default.a.withConfig({displayName:"Styles__ViewMore",componentId:"sc-89ea8830-6"})` + display: flex; + width: 100%; + ${e1.UiTypography.sm}; + padding: 4px 40px 4px 10px; + align-items: center; + border-radius: 10px; + justify-content: flex-start; + color: ${e=>e.theme.textColors.hex(10)}; + margin-bottom: 0.125rem; + position: relative; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(10)}; + } +`;eL.default.a.withConfig({displayName:"Styles__BrowseTemplatesMenuItem",componentId:"sc-89ea8830-7"})` + ${e1.UiTypography.md}; + padding: 6px 10px; + align-items: center; + border-radius: 10px; + justify-content: space-between; + color: ${e=>e.theme.textColors.hex(10)}; + margin-bottom: 0.125rem; + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + ${Uw} { + opacity: 1; + } + } +`;let US=eL.default.div.withConfig({displayName:"Styles__TemplateIcon",componentId:"sc-89ea8830-8"})` + display: flex; + flex-shrink: 0; + width: 26px; + height: 26px; + align-items: center; + justify-content: center; + font-size: 17px; // special case + align-self: flex-start; + + /* Special case */ + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(70):e.theme.appColors.hex(100)}; + border-radius: 10px; + margin-right: 0.75rem; + color: ${e=>e.theme.appColors.hex(50)}; + box-shadow: rgb(0 0 0 / 10%) 0px 1px 1px; +`,UI=eL.default.div.withConfig({displayName:"Styles__EmojiWrapper",componentId:"sc-89ea8830-9"})` + font-size: 20px; + transform: scale(0.8); +`,UD=eL.default.p.withConfig({displayName:"Styles__ErrorMessage",componentId:"sc-89ea8830-10"})` + display: flex; + height: 100%; + align-self: center; + ${e1.UiTypography.sm}; +`,UT=eL.default.div.withConfig({displayName:"Styles__EditTemplateWrapper",componentId:"sc-89ea8830-11"})` + display: flex; + flex-direction: row; + align-items: center; + width: 100%; + position: sticky; + z-index: 1; + left: 0; + min-height: 42px; + height: 42px; + color: ${e=>e.theme.textColors.hex(50)}; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.92)":"rgba(255,255,255,0.92)"}; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.sm}; + + & > div { + margin: 0 auto; + } +`,U$=eL.default.button.withConfig({displayName:"Styles__UseTemplate",componentId:"sc-89ea8830-12"})` + position: absolute; + right: 24px; + ${UE} + color: #fff; + padding: 5px 16px; + border-radius: 20px; + background: ${e=>e.theme.primaryColorScheme?.base}; + z-index: 1; + transition: background-color 150ms ease-in-out; + white-space: nowrap; + pointer-events: fill; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,UP=eL.default.div.withConfig({displayName:"Styles__IconName",componentId:"sc-89ea8830-13"})` + display: flex; + align-items: center; + text-align: left; + white-space: normal; + ${e1.UiTypography.sm}; + word-break: break-word; +`,UF=eL.default.button.withConfig({displayName:"Styles__FoldableHeading",componentId:"sc-89ea8830-14"})` + padding: 0 10px; + margin-bottom: 4px; + color: ${e=>e.theme.appColors.hex(50)}; + text-align: left; + ${e1.UiTypography.sm}; + + & svg { + margin: 0 14px 0 3px; + transform: scale(1.2) translateY(-0.09375rem); + } + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,UA=eL.default.div.withConfig({displayName:"Styles__SearchWrapper",componentId:"sc-89ea8830-15"})` + display: flex; + align-items: center; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + margin-top: 4px; + border-radius: 30px; + padding: 4px 10px; + margin-bottom: 20px; + color: ${e=>e.theme.appColors.hex(60)}; + transition: border-color ease-in-out 150ms; + + &:focus-within { + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,UR=eL.default.input.withConfig({displayName:"Styles__SearchInput",componentId:"sc-89ea8830-16"})` + display: flex; + flex: 1; + background: none; + border: none; + padding-left: 10px; + ${e1.UiTypography.sm}; + + color: ${e=>e.theme.appColors.hex(10)}; +`,Uj=e=>{let{to:t,children:a}=e,n=(0,e$.useDispatch)(),l=(0,eF.k6)(),{pathname:r}=(0,eF.TH)(),o=new URL(t,window.location.href).pathname===`${r}`;return ev.createElement(UC,{$selected:o,onClick:e=>{e.preventDefault(),o?n(Fd()):l.push(t)}},a,ev.createElement(UN,null,ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.create",defaultMessage:"Create"}))))};function UO(e){let{children:t}=e;return Ck(e)?t:null}function UU(e){let{children:t}=e;return Eu(e)?t:null}function UZ(e){let t=(0,ev.useRef)();return(0,ev.useEffect)(()=>{t.current=e}),t.current}UO.propTypes={children:l7().node.isRequired,role:l7().shape({project:l7().string,workspace:l7().string}),action:l7().shape({project:l7().string,workspace:l7().string}).isRequired},UU.propTypes={children:l7().node.isRequired,role:l7().string,action:l7().string.isRequired};let UL=e=>{let{isNewTemplate:t=!1,space:a,templates:n,user:l,membership:r,query:o}=e,i=(0,eF.k6)(),[s,d]=(0,ev.useState)(!1),c=UZ(o),m=ev.useMemo(()=>{let e=o.toLowerCase();return n.filter(t=>{let a=t.node?.info?.title?.toLowerCase();if(null!=a)return a.includes(e)})},[n,o]);(0,ev.useEffect)(()=>{c!==o&&0!==m.length&&d(!1)},[m.length,o,c]);let u=t?"new/template":"new";if(eu()(a))return null;let p=(e,t)=>{e.stopPropagation(),t?.node?.edit_path!=null&&i.push(t.node.edit_path)},g=m.length>0||t;return ev.createElement(U_,null,g&&ev.createElement(UF,{onClick:()=>{d(!s)}},ev.createElement(tn.Icon,{icon:s?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.custom_templates",defaultMessage:"Custom Templates"})),t&&null!=r&&null!=l?ev.createElement(UU,{role:r.role,action:"create_template"},ev.createElement(Uj,{to:`/spaces/${a.id}/new/template`},ev.createElement(UP,null,ev.createElement(US,null,ev.createElement(tn.Icon,{icon:"dd_newtemplate"})),ev.createElement(eY.Z,{id:"general.blank_template",defaultMessage:"Blank Template"})))):null,s?null:ev.createElement("div",null,m.map(e=>{if(e?.node==null)return;let n=e.node.preferences?.view??e.node.shared_preferences?.view??null,l=null!=n?`?as=${n}`:"",r=nQ(e.node);return ev.createElement(Uj,{key:`custom-template-choice-${e.node.id}`,to:`/spaces/${a.id}/${u}/from/${e.node.id}${l}`},ev.createElement(UP,null,null!=r?ev.createElement(US,null,ev.createElement(UI,null,r)):ev.createElement(US,null,ev.createElement(tn.Icon,{icon:"dd_project"})),e.node.info.title||"Untitled"),t&&ev.createElement(UO,{role:e.node.role,action:{project:"edit"}},ev.createElement(Uw,{onClick:t=>p(t,e)},ev.createElement(tn.Icon,{icon:"dd_edit"}))))})))},UB=e=>{let{query:t}=e,a=(0,eF.TH)(),n=CT()(a.pathname.split("/new")),[l,r]=(0,ev.useState)(new Map),[o,i]=(0,ev.useState)([]),s=(0,eF.$B)(),d=s.params.documentID,c="template"===s.params.isTemplate,m=("gallery"===new URLSearchParams(a.search).get("from"))??null,u=(0,wo.a)(["template-gallery"],async()=>{let e=await fetch("https://www.taskade.com/api/templates",{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("Network response was not ok");return await e.json()},{retry:!1,cacheTime:864e5,staleTime:864e5}),p=(0,ev.useMemo)(()=>{if(!u.isLoading&&null!=u.data)return new to.Z(u.data,{keys:["templates.title"],threshold:.2,includeMatches:!0})},[u.data,u.isLoading]);if((0,ev.useEffect)(()=>{r(new Map(l.set("Featured",!1)))},[]),(0,ev.useEffect)(()=>{if(u.isLoading||null==u.data||null==p)return;let e=u.data;""!==t&&(e=p.search(t).map(e=>{let{item:t,matches:a}=e;return{name:t.name,templates:a?.map(e=>{let{refIndex:a}=e;if(null!=a)return t.templates[a]}).filter(e=>null!=e)}})),i(e),r(a=>{let n=new Map;e.forEach(e=>{""===t&&n.set(e.name,a.get(e.name)??!0)});let l=!1;for(let a of e){if(l)break;for(let e of a.templates.slice(0,5))if(d===e.projectId&&m&&""===t){n.set(a.name,!1),l=!0;break}}return n})},[u.data,u.isLoading,p,t,n,a.pathname,a.search,d,m]),u.isLoading)return ev.createElement(Ux,null,ev.createElement(eI.Spinner,{height:170}));if(u.isError)return ev.createElement(Ux,null,ev.createElement(UD,null,ev.createElement(eY.Z,{id:"general.errors.load_template_gallery",defaultMessage:"There was a problem loading templates, please try again."})));let g=e=>{let t=l.get(e);if(null==t){r(new Map(l.set(e,!0)));return}r(new Map(l.set(e,!t)))};return ev.createElement(ev.Fragment,null,o.map(e=>ev.createElement(U_,{key:e.name},ev.createElement(UF,{onClick:()=>g(e.name)},ev.createElement(tn.Icon,{icon:!0===l.get(e.name)?"default_caret_right":"default_caret_down"}),e.name),!0===l.get(e.name)?null:ev.createElement("div",null,e.templates.slice(0,5).map(e=>{let t=e.as;"org-chart"===e.as&&(t="orgchart");let a=`${n}/new/from/${e.projectId}?share=view&view=${e.viewToken}&as=${t}&from=gallery`;return c&&(a=`${n}/new/template/from/${e.projectId}?share=view&view=${e.viewToken}&as=${t}&from=gallery`),ev.createElement(Uj,{key:e.title,to:a},ev.createElement(UP,null,ev.createElement(US,null,ev.createElement(UI,null,e.emoji)),e.title))}),ev.createElement(UM,{target:"_blank",href:`https://www.taskade.com/templates/${e.slug}`,rel:"noopener noreferrer"},ev.createElement(UP,null,ev.createElement(US,null,ev.createElement(tn.Icon,{icon:"dd_browsetemplates"}))),ev.createElement(eY.Z,{id:"general.view_more",defaultMessage:"View more"}))))))};function Uz(e){return function(t){return ec()(t,["settings",e])}}let UV=Uz("onboard-addspace-0001"),Uq=Uz("onboard-invite-0001"),UW=Uz("seen-tour-001-step2"),UH=Uz("seen-tour-001-step3"),UG=Uz("seen-tour-001-step4"),UK=Uz("seen-tour-001-step5"),UY=Uz("hide-get-started-template");function UQ(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,tB.P1)([t9,e,t],(e,t,n)=>!e||eu()(t)&&a?"true"===n||"false"!==n&&n:t)}UQ(t1,UV,!0);let UJ=UQ(t2,Uq,!0);UQ(t5,UW,!0),UQ(t3,UH,!0),UQ(t4,UG,!0),UQ(t6,UK);let UX=UQ(t8,UY),U0=(0,e$.connect)(function(e,t){return{backendError:_F(e,t),user:t7(e,t),syncState:dR(e),hideGetStartedTemplate:UX(e,t)}},function(e){return(0,ek.DE)({setLoginSignupModalState:rh,createDocument:Fd,updateUserPreferences:cE},e)})(e=>{let{space:t,syncState:a,user:n,document:l}=e,r=(0,eF.TH)(),o=(0,eF.$B)(),i=(0,eK.Z)(),[s,d]=(0,ev.useState)(""),c=o.params?.isNewDocument!=null,m=l?.isTemplate||o.params?.isTemplate!=null,u=c&&m,p=u?"new/template":"new",{data:g,loading:f,error:h}=(0,eB.a)(Uk,{variables:{spaceId:t?.id},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:null==t});if(null!=_T(e.backendError))return null;let y=e=>{d(e.target.value)},b=e=>{if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}},v=()=>ev.createElement(ev.Fragment,null,"Unable to load additional templates");if(a!==Ng)return ev.createElement(Ux,null,ev.createElement(eI.Spinner,{height:170}));let k=CT()(r.pathname.split("/new"));if(null==t)return ev.createElement(Ux,null,ev.createElement(UA,null,ev.createElement(tn.Icon,{icon:"sidebar_search"}),ev.createElement(UR,{placeholder:i.formatMessage({id:"general.search_templates",defaultMessage:"Search templates…"}),onChange:y,onKeyDown:b,value:s})),ev.createElement(U_,null,ev.createElement("div",null,ev.createElement(Uj,{to:`${k}/${p}`},ev.createElement(UP,null,ev.createElement(US,null,ev.createElement(tn.Icon,{icon:"dd_project_small"})),ev.createElement(eY.Z,{id:"general.blank_project",defaultMessage:"Blank project"}))))),ev.createElement(ef.SV,{fallback:v},ev.createElement(UB,{query:s})));if(f)return ev.createElement(Ux,null,ev.createElement(eI.Spinner,{height:170}));if(h)return ev.createElement(Ux,null,ev.createElement(UD,null,ev.createElement(eY.Z,{id:"general.errors.load_template_gallery",defaultMessage:"There was a problem loading templates, please try again."})));let E=g?.membership?.space?.templates?.edges??[];return ev.createElement(Ux,null,ev.createElement(UA,null,ev.createElement(tn.Icon,{icon:"sidebar_search"}),ev.createElement(UR,{placeholder:i.formatMessage({id:"general.search_templates",defaultMessage:"Search templates…"}),onChange:y,onKeyDown:b,value:s})),!u&&ev.createElement(U_,null,ev.createElement("div",null,ev.createElement(Uj,{to:`${k}/new`},ev.createElement(UP,null,ev.createElement(US,null,ev.createElement(tn.Icon,{icon:"dd_project_small"})),ev.createElement(eY.Z,{id:"general.blank_project",defaultMessage:"Blank project"}))))),ev.createElement(UL,{isNewTemplate:u,space:t,user:n,membership:g?.membership,templates:E,query:s}),ev.createElement(ef.SV,{fallback:v},ev.createElement(UB,{query:s})))}),U1={project:"outsider",workspace:"outsider"},U2=ev.createContext(U1);var U5=a(46848);let U3=lw().object({url:lw().string().uri({domain:{minDomainSegments:2,tlds:{allow:!1}},scheme:["https","http"]}).required()}),U4=eL.default.div.withConfig({displayName:"styled__FormGroup",componentId:"sc-3edc9c2a-0"})``,U6=eL.default.label.withConfig({displayName:"styled__Label",componentId:"sc-3edc9c2a-1"})` + ont-size: 13px; + color: #999; + text-transform: uppercase; + margin-bottom: 5px; +`,U8=eL.default.input.withConfig({displayName:"styled__Input",componentId:"sc-3edc9c2a-2"})` + display: flex; + width: 100%; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + border-radius: 10px; + padding: 0 10px; + margin-bottom: 5px; + height: calc(2.25rem + 2px); + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + + &:focus-within { + border: 1px solid ${e=>e.theme.isNightMode?"#384147":"#ccc"}; + } +`,U7=eL.default.input.withConfig({displayName:"styled__SubmitButton",componentId:"sc-3edc9c2a-3"})` + width: 100%; + font-size: 18px; + line-height: 24px; + margin-top: 20px; + font-weight: 500; + padding: 14px 16px; + color: #fff; + cursor: pointer; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + border: none; + border-radius: 12px; + transition: background-color 120ms ease-in-out; + + &:hover { + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &:focus { + outline: 0; + } +`,U9=(0,e$.connect)(function(e,t){return{attachments:iA(e,t)}})(function(e){let{attachments:t,documentID:a,nodeID:n,exit:l}=e,r=(0,eK.Z)(),o=(0,e$.useDispatch)(),{control:i,formState:s,handleSubmit:d,register:c,setError:m}=(0,sz.cI)({defaultValues:{url:""},resolver:(0,U5.L)(U3)}),u=ev.useCallback(e=>{if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}},[]),p=ev.useCallback(async e=>{if((t?.media?.total??0)+(t?.media?.uploadingAttachments?.length??0)>=12){o(DE(n,!1)),l(),o((0,l3.error)({uid:"attachment-embed-error",message:m4,position:"tc",autoDismiss:8,dismissible:!1}));return}try{await new Promise((t,l)=>{o(mL(a,{nodeID:n,data:{type:T.Embed,embed:{data:{url:e.url}}}},e=>{let a=e?.["FINAL_FORM/form-error"];null!=a&&l(Error(a)),t(void 0)}))})}catch(e){m("FINAL_FORM/form-error",{message:e.message});return}o(DE(n,!1)),l()},[t,o,a,l,m,n]),g=s.errors["FINAL_FORM/form-error"],f=s.errors.url;return ev.createElement("form",{onSubmit:d(p)},null!=g&&ev.createElement(rO,{padding:"10px",margin:"0 0 10px",role:"alert"},g.message),ev.createElement(U4,{$hasError:null!=f},ev.createElement(U6,null,ev.createElement(eY.Z,{id:"general.url",defaultMessage:"URL"})),ev.createElement(U8,{...c("url",{setValueAs:e=>{if(""===e.trim())return e;try{return function(e){let t=e.trim();if(""===t)throw Error("Invalid url.");let a=t.match(/^((?:.*:)?\/\/)?(.*)/i);if(null==a)throw Error("Invalid url.");let n=null!=a[1]?a[1].toLowerCase():null,l=a[2];return"https://"!==n?`https://${l}`:e}(e)}catch(e){return""}}}),type:"text",onKeyDown:u,autoFocus:!0}),null!=f&&ev.createElement(rO,{margin:"12px 0 10px",role:"alert"},f.message)),s.isSubmitting?ev.createElement(eI.Spinner,null):ev.createElement(U7,{type:"submit",value:r.formatMessage({id:"general.embed",defaultMessage:"Embed"})}))}),Ze=eL.default.div.withConfig({displayName:"EmbedDialogBody__FlexContainer",componentId:"sc-c92f94fc-0"})` + display: flex; + flex-direction: column; + align-items: stretch; + padding: 40px 60px; + width: 550px; + position: relative; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; +`,Zt=eL.default.h2.withConfig({displayName:"EmbedDialogBody__Title",componentId:"sc-c92f94fc-1"})` + font-size: 24px; + line-height: 32px; + color: ${e=>e.theme.textColors.hex(10)}; + text-align: center; + margin-bottom: 2px; +`,Za=eL.default.p.withConfig({displayName:"EmbedDialogBody__Description",componentId:"sc-c92f94fc-2"})` + font-size: 16px; + line-height: 22px; + margin-bottom: 30px; + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + text-align: center; +`,Zn=function(e){let{documentID:t,nodeID:a,exit:n}=e;return ev.createElement(Ze,null,ev.createElement(Zt,null,ev.createElement(eY.Z,{id:"general.embed_link",defaultMessage:"Embed Link"})),ev.createElement(Za,null,"For best results, embed public links only."),ev.createElement(U9,{documentID:t,nodeID:a,exit:n}))},Zl=(0,d9.oM)({name:"dialogs.embed",initialState:{isOpen:!1},reducers:{toggleEmbedModalDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0}}}),Zr=(0,e$.connect)(function(e){return e.dialogs.embed})(function(e){let t=(0,e$.useDispatch)(),a=ev.useCallback(()=>{(0,e$.batch)(()=>{null!=e.nodeID&&t(mI(e.nodeID,null)),t(Zl.actions.toggleEmbedModalDialog())})},[t,e.nodeID]);if(!(e.isOpen&&null!=e.documentID&&null!=e.nodeID))return null;let{isOpen:n,documentID:l,nodeID:r}=e;return ev.createElement(eI.ModalDialog,{autofocus:!1,isOpen:n,close:a},e=>{let{exit:t}=e;return ev.createElement(Zn,{exit:t,documentID:l,nodeID:r})})});var Zo=a(22004);let Zi=new Set(["gif","jpg","jpeg","mov","mp3","mp4","mkv","ogg","ogv","pdf","png","wav","webm"]),Zs=new Map([["mp3","audio/mp3"],["wav","audio/wav"]]),Zd=new Map([["mov",null],["mkv","video/mp4"],["mp4","video/mp4"],["ogg","video/ogg"],["ogv","video/ogg"],["webm","video/webm"]]),Zc=new Map([["pdf","application/pdf"],["csv","text/csv"]]),Zm=function(e){let{url:t}=e,a=ev.useRef(null),[n,l]=ev.useState(!1),r=ev.useCallback(()=>{l(!1)},[]);return ev.useEffect(()=>{let e=new(hF())(a.current);return e.on("success",()=>{l(!0)}),()=>{e.destroy()}},[]),ev.createElement("button",{type:"button",className:"ril__toolbarItemChild ril__builtinButton ril__copylinkButton text-sm","data-clipboard-text":t,onBlur:r,onMouseOut:r,ref:a},ev.createElement("span",null,n?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"})))},Zu=eL.default.iframe.withConfig({displayName:"FigmaEmbed__StyledIframe",componentId:"sc-5b1010d2-0"})` + border: 1px solid rgba(0, 0, 0, 0.1); +`,Zp=function(e){let{url:t}=e,a=encodeURIComponent(t),n=`https://www.figma.com/embed?embed_host=share&url=${a}`;return ev.createElement(Zu,{width:"80%",height:"80%",src:n,allowfullscreen:!0})},Zg=eL.default.iframe.withConfig({displayName:"InVisionEmbed__StyledIframe",componentId:"sc-aef39f31-0"})` + background: ${e=>e.theme.isNightMode?"rgba(0,0,0,0.8)":"#fff"}; +`,Zf=function(e){let{url:t}=e;return ev.createElement(Zg,{src:t,frameBorder:"0",allowFullScreen:!0,width:"80%",height:"80%"})},Zh=function(e){let{url:t}=e,a=t.replace(/\/share/,"/embed");return ev.createElement("iframe",{src:a,frameBorder:"0",webkitallowfullscreen:!0,mozallowfullscreen:!0,allowFullScreen:!0,width:"80%",height:"80%"})},Zy=eL.default.a.withConfig({displayName:"OtherEmbed__Link",componentId:"sc-1c2c0dec-0"})` + display: flex; + flex-direction: column; + align-items: center; + + & img { + max-height: 50vw; + border-radius: 10px; + } +`,Zb=function(e){let{url:t}=e,a=e.title??"",n=e.imageUrl??"/images/no-embed.png";return ev.createElement("div",{className:"other-embed"},ev.createElement(Zy,{href:t,target:"_blank",rel:"noopener noreferrer"},ev.createElement("img",{alt:a,title:a,src:n})))},Zv=a(17563),Zk=function(e){let{url:t}=e;try{let e=new URL(t),a={...Object.fromEntries(e.searchParams),"typeform-embed":"oembed","typeform-medium":"embed-oembed",format:"json"};e.search=Zv.stringify(a);let n=e.toString();return ev.createElement("iframe",{src:n,frameBorder:"0",allowFullScreen:!0,width:"80%",height:"80%"})}catch(e){return null}},ZE=eL.default.iframe.withConfig({displayName:"WhimsicalEmbed__StyledIframe",componentId:"sc-26ad02ef-0"})` + border: none; +`,Zx=function(e){let{url:t}=e,a=t;try{let e=new URL(t);return e.pathname.startsWith("/embed")||(e.pathname=`/embed${e.pathname}`,a=e.toString()),ev.createElement(ZE,{width:"80%",height:"80%",src:a})}catch(e){return null}};function Z_(e){return"data"in e&&"type"in e.data&&"embed"===e.data.type}function Zw(e){return"data"in e&&"type"in e.data&&"file"===e.data.type}function ZN(e){return"data"in e&&"type"in e.data&&"comment"===e.data.type&&"file"===e.data.body.type}function ZC(e){return"__typename"in e&&"ChatMessageFileBody"===e.__typename}var ZM=a(99888);let ZS=function(e){let{url:t}=e;return ZM.PDFObject.supportsPDFs()?ev.createElement("div",{className:"pdf-preview"},ev.createElement(ZM.PDFObject,{width:"100%",height:"100vh",url:t,pdfOpenParams:{view:"Fit"}})):ev.createElement("div",{className:"pdf-preview"},ev.createElement("div",{className:"pdf-preview-unavailable"},ev.createElement(eY.Z,{id:"general.pdf_preview_is_not_available",defaultMessage:"PDF Preview is not available"}),ev.createElement("a",{href:t,rel:"noopener noreferrer",target:"_blank"},ev.createElement(eY.Z,{id:"general.view_pdf",defaultMessage:"View PDF"}))))};function ZI(e,t,a,n){return{title:e,toolbarButtons:function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==t)return;let n=[];return a&&n.push(ev.createElement("button",{key:"askai",className:"whitespace-nowrap text-sm font-medium transition duration-150 ease-in-out",onClick:e},ev.createElement("div",{className:"px-2"},ev.createElement(tn.Icon,{className:"-mt-1 mr-2 scale-90 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ask_ai",defaultMessage:"Ask AI"}))))),n.push(ev.createElement(Zm,{key:"copy",url:t}),ev.createElement("a",{className:"ril__toolbarItemChild ril__builtinButton ril__downloadButton text-sm",key:"download",href:t,rel:"noopener noreferrer",target:"_blank",style:{color:"#FFF"}},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.download",defaultMessage:"Download"})))),n}(a,t,n),mainCustomContent:ev.createElement(ZS,{url:t}),enableZoom:!1}}function ZD(e,t,a){let n=(0,sX.extractFileExtension)(e);if(Zd.has(n)){let e=Zd.get(n)??void 0;return ev.createElement("video",{controls:!0,autoPlay:!0},ev.createElement("source",{src:t,type:e}),ev.createElement("img",{src:a}))}if(Zs.has(n)){let e=Zs.get(n)??void 0;return ev.createElement("audio",{controls:!0,autoPlay:!0},ev.createElement("source",{src:t,type:e}),ev.createElement("img",{src:a}))}}function ZT(e,t){return null==e?null:Z_(e)?function(e){let t;let a=e.other?.ogTags?.ogTitle??void 0,n=e.other?.ogTags?.ogImage?.url??void 0,l=e.data.embed.data.url,r=null;switch(e.data.embed.type){case"figma":r=ev.createElement(Zp,{url:l});break;case"invision":r=ev.createElement(Zf,{url:l});break;case"loom":r=ev.createElement(Zh,{url:l});break;case"typeform":r=ev.createElement(Zk,{url:l});break;case"whimsical":r=ev.createElement(Zx,{url:l});break;case"other":t=[ev.createElement("a",{className:"ril__toolbarItemChild ril__builtinButton ril__openLinkButton text-sm",key:"1",href:l,rel:"noopener noreferrer",target:"_blank",style:{color:"#FFF"}},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.open_link",defaultMessage:"Open link"})))],r=ev.createElement(Zb,{imageUrl:n,title:a,url:l});break;default:r=Zo.Z.canPlay(l)?ev.createElement(Zo.Z,{width:"80%",height:"80%",url:l,config:{vimeo:{playerOptions:{allowfullscreen:!1}}},controls:!0}):ev.createElement(Zb,{imageUrl:n,title:a,url:l})}return{title:a,mainCustomContent:r,toolbarButtons:t,enableZoom:!1}}(e):Zw(e)&&"file"in e.data&&"mimetype"in e.data.file&&"application/pdf"===e.data.file.mimetype&&null!=e.data.url.download?ZI($k(e.data.file)??`Unknown.${e.data.file.extension}`,e.data.url.download,t,!0):Zw(e)?function(e){let t;let a=e.data.file.filename,n=e.data.url.download??void 0,l=e.data.url.view,r=n??l;null!=r&&(t=[ev.createElement(Zm,{key:"0",url:r}),ev.createElement("a",{className:"ril__toolbarItemChild ril__builtinButton ril__downloadButton text-sm",key:"1",href:r,rel:"noopener noreferrer",target:"_blank",style:{color:"#FFF"}},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.download",defaultMessage:"Download"})))]);let o=ZD(a,n,l),i=null==o?l:void 0;return{title:a,toolbarButtons:t,mainCustomContent:o,mainSrc:i,enableZoom:null!=l&&null!=n}}(e):ZN(e)&&"pdf"===(0,sX.extractFileExtension)(e.data.body.data.file.filename).toLowerCase()&&null!=e.data.body.data.url.download?ZI(e.data.body.data.file.filename,e.data.body.data.url.download,t,!1):ZN(e)?function(e){let t;let a=e.data.body.data.file.filename,n=e.data.body.data.url.download??void 0,l=e.data.body.data.url.view,r=n??l;null!=r&&(t=[ev.createElement(Zm,{key:"0",url:r}),ev.createElement("a",{className:"ril__toolbarItemChild ril__builtinButton ril__downloadButton text-sm",key:"1",href:r,rel:"noopener noreferrer",target:"_blank",style:{color:"#FFF"}},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.download",defaultMessage:"Download"})))]);let o=ZD(a,n,l),i=null==o?l:void 0;return{title:a,toolbarButtons:t,mainCustomContent:o,mainSrc:i,enableZoom:null!=l&&null!=n}}(e):ZC(e)&&"pdf"===(0,sX.extractFileExtension)(e.filename).toLowerCase()&&null!=e.fileUrls.download?ZI(e.filename,e.fileUrls.download,t,!1):ZC(e)?function(e){let t;let a=e.filename,n=e.fileUrls.download??void 0,l=e.fileUrls.view,r=n??l;null!=r&&(t=[ev.createElement(Zm,{key:"0",url:r}),ev.createElement("a",{className:"ril__toolbarItemChild ril__builtinButton ril__downloadButton text-sm",key:"1",href:r,rel:"noopener noreferrer",target:"_blank",style:{color:"#FFF"}},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.download",defaultMessage:"Download"})))]);let o=ZD(a,n,l),i=null==o?l:void 0;return{title:a,toolbarButtons:t,mainCustomContent:o,mainSrc:i,enableZoom:null!=l&&null!=n}}(e):null}let Z$=(0,d9.oM)({name:"dialogs.media",initialState:{isOpen:!1},reducers:{toggleMediaDialog(e,t){var a;if(null==t.payload||null==t.payload.media||e.isOpen)return{isOpen:!1};let n=t.payload.index??0;return null==t.payload.media[n]?{isOpen:!1}:Z_(a=t.payload.media[n])||Zw(a)||ZN(a)||ZC(a)?{isOpen:!0,media:t.payload.media,index:t.payload.index}:{isOpen:!1}},setMediaIndex:(e,t)=>null==t.payload?e:{...e,index:t.payload.index}}}),ZP=null;"undefined"!=typeof window&&(ZP=a(92879).Z);let ZF=(0,eL.default)(function(e){return ev.cloneElement(e.children,{wrapperClassName:e.className})}).withConfig({displayName:"MediaBody__WrappedLightbox",componentId:"sc-486f70ce-0"})` + .ril__inner { + top: 60px; + + border-top-left-radius: 0px; + border-top-right-radius: 0px; + } + + .pdf-preview { + display: flex; + & > .pdfobject-container { + width: 100%; + } + } + + .pdf-preview-unavailable { + display: flex; + flex: 1 1 auto; + flex-direction: column; + align-items: center; + align-self: center; + color: ${e=>e.theme.appColors.hex(10)}; + & > a { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + } +`,ZA=function(e){let t;let{media:a,documentId:n}=e,l=e.index??0,r=a?.length??0,o=(0,e$.useDispatch)(),i=ev.useContext(eI.LayersContext),s=r>l?a?.[l]:void 0;null==s||ZC(s)||(t=s?.data?.type==="embed"?s.data.embed.data.url:void 0);let d=(0,wo.a)(["embed",t],async()=>{if(null==t)return null;let e=encodeURIComponent(t),a=await fetch(`/web-api/embed?url=${e}`,{credentials:"same-origin",method:"GET",headers:{"X-Anonymous-ID":u$?.getAnonymousId()??void 0,"X-Requested-With":"XMLHttpRequest"}});if(!a.ok)throw Error("Network response was not ok");return await a.json()},{retry:!1,cacheTime:864e5});null!=s&&d?.data!=null&&(s={...s,other:d?.data});let c=ev.useCallback(e=>{var t;null!=n&&null!=s&&"data"in(t=s)&&"file"===t.data.type&&(o(Z$.actions.toggleMediaDialog()),o(Pw.actions.toggleEditorMediaAiDialog({documentId:n,attachment:s})),e.stopPropagation())},[o,n,s]),m=ev.useMemo(()=>ZT(s,c),[c,s]),u=ev.useMemo(()=>{if(1===r)return null;let e=(l+1)%r;return ZT(a?.[e],c)},[c,l,a,r]),p=ev.useMemo(()=>{if(1===r)return null;let e=(l+r-1)%r;return ZT(a?.[e],c)},[c,l,a,r]),g=ev.useCallback(()=>{o(Z$.actions.toggleMediaDialog())},[o]),f=ev.useCallback(()=>{o(Z$.actions.setMediaIndex({index:(l+1)%r}))},[o,l,r]),h=ev.useCallback(()=>{o(Z$.actions.setMediaIndex({index:(l+r-1)%r}))},[o,l,r]);if(null==ZP||null==m)return null;let y=i?.overlay??("undefined"!=typeof document?document.body:null);if(null==y)return null;let{title:b,toolbarButtons:v,mainCustomContent:k,mainSrc:E,enableZoom:x}=m;return ep.createPortal(ev.createElement("div",null,ev.createElement(ZF,null,ev.createElement(ZP,{imagePadding:60,imageTitle:b,mainCustomContent:k,nextCustomContent:u?.mainCustomContent,prevCustomContent:p?.mainCustomContent,mainSrc:E,nextSrc:u?.mainSrc,prevSrc:p?.mainSrc,onCloseRequest:g,onMovePrevRequest:h,onMoveNextRequest:f,toolbarButtons:v,enableZoom:x}))),y)},ZR=(0,e$.connect)(function(e){return{documentId:dP(e),dialogState:e.dialogs.media}})(function(e){let{documentId:t,dialogState:a}=e;if(!(a.isOpen&&null!=a.media))return null;let{index:n,media:l}=a;return ev.createElement(ZA,{index:n,media:l,documentId:t})}),Zj="@@taskade/Chatroom/CHATROOM_SET_LATEST_MESSAGE_AT",ZO="@@taskade/Chatroom/CHATROOM_UNSET_LATEST_MESSAGE_AT";var ZU=a(91033);function ZZ(e){let t=0,a=null,n=()=>{t>0&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{t=0,e()})},l=()=>(null==a&&(a=new ZU.Z(n)),a);return{observe:e=>{l().observe(e)},unobserve:e=>{a?.unobserve(e)},disconnect:()=>{t>0&&(window.cancelAnimationFrame(t),t=0),null!=a&&(a.disconnect(),a=null)}}}function ZL(e,t){let a=t.length>3,n=(a?uz()(t,3):t).map(e=>e.name).join(", ");return{uid:e,message:`Sorry, but the following files are not supported and can’t be uploaded: ${n}${a?"...":""}`,position:"tc",autoDismiss:8,dismissible:!1}}let ZB=eL.default.div.withConfig({displayName:"ChatDropZone__DropzoneContainer",componentId:"sc-46efb1ba-0"})` + display: block; + width: 100%; + height: 100%; + background: ${e=>e.theme.isNightMode?"rgba(29, 31, 34, 0.9)":"rgba(247, 247, 247, 0.9)"}; + color: ${e=>e.theme.appColors.hex(10)}; + position: absolute; + top: 0; + z-index: 10; + opacity: 0; + padding: 10px; + pointer-events: none; + + ${e=>e.isVisible?(0,eL.css)` + opacity: 1; + left: 0; + pointer-events: fill; + `:""} +`,Zz=eL.default.div.withConfig({displayName:"ChatDropZone__InnerWrapper",componentId:"sc-46efb1ba-1"})` + text-align: center; + display: inline-block; + width: auto; + position: absolute; + top: 50%; + margin-top: -57px; + left: 50%; + margin-left: -75px; +`,ZV=eL.default.p.withConfig({displayName:"ChatDropZone__DisplayText",componentId:"sc-46efb1ba-2"})` + font-size: 20px; + width: 150px; + color: ${e=>e.theme.appColors.hex(10)}; + line-height: 24px; + text-align: center; + margin: 0 auto; + + &.note { + font-size: 16px; + color: ${e=>e.theme.textColors.hex(50)}; + line-height: 18px; + margin-top: 2px; + } +`,Zq=eL.default.div.withConfig({displayName:"ChatDropZone__StyledDropzone",componentId:"sc-46efb1ba-3"})` + ${O$} + width: 100%; + height: 100%; + border-radius: 10px; + padding: 20px; + font-size: 17px; + + ${e=>e.isHovered?(0,eL.css)` + border-color: ${e.theme.isNightMode?"#666":"#ccc"}; + `:(0,eL.css)` + border-color: #999; + `} + + transition: border-color 120ms ease-in-out; +`,ZW=(0,eL.default)(lT.Bu).withConfig({displayName:"ChatDropZone__UploadImage",componentId:"sc-46efb1ba-4"})` + display: inline-block; + width: 60px; + height: 60px; + margin: 0 auto; + + & path { + stroke: ${e=>(e.theme.isNightMode,"#ccc")}; + } +`,ZH=ev.forwardRef(function(e,t){let{documentID:a,onFilesUploaded:n}=e,l=(0,e$.useDispatch)(),[r,o]=(0,ev.useState)(!1),i=(0,ev.useRef)(0),s=(0,ev.useCallback)(e=>{e.preventDefault(),i.current+=1,1===i.current&&o(!0)},[]),d=(0,ev.useCallback)(e=>{e.preventDefault(),i.current-=1,0===i.current&&o(!1)},[]),c=(0,ev.useCallback)(e=>{e.preventDefault()},[]),m=(0,ev.useCallback)(e=>{e.preventDefault(),i.current=0,o(!1)},[]);(0,ev.useEffect)(()=>(document.addEventListener("dragenter",s),document.addEventListener("dragleave",d),document.addEventListener("dragover",c),document.addEventListener("drop",m),()=>{i.current=0,o(!1),document.removeEventListener("dragenter",s),document.removeEventListener("dragleave",d),document.removeEventListener("dragover",c),document.removeEventListener("drop",m)}),[s,d,c,m]);let u=uy(a),p=(0,ev.useCallback)(e=>{i.current=0,o(!1);let t=new CustomEvent("UserUploadFileEvent",{detail:e,cancelable:!0});if(n(t),!t.defaultPrevented)for(let t of e)u({__typename:"ChatMessageFileBody",filename:t.name,fileUrls:{__typename:"FileUrls",view:"",preview:"",download:""},file:t,lambdaResponse:null})},[n,u]),g=(0,ev.useCallback)(e=>{l((0,l3.error)(ZL("chat-dnd-rejected-files",e)))},[l]),{getRootProps:f,getInputProps:h,isDragActive:y,open:b}=(0,OM.u)({onDrop:p,onDropRejected:g,multiple:!0,accept:cN,noDragEventsBubbling:!0});return(0,ev.useImperativeHandle)(t,()=>({open:()=>{b()}}),[b]),ev.createElement(ZB,{isVisible:r},ev.createElement(Zq,{isHovered:y,...f()},ev.createElement("input",h()),ev.createElement(Zz,null,ev.createElement(ZW,null),ev.createElement(ZV,null,ev.createElement(eY.Z,{id:"general.drop_your_file_here_to_upload",defaultMessage:"Drop your file here to upload"})))))}),ZG=function(e){let{name:t,value:a}=e,n=(0,ev.useRef)(null),l=(0,eI.useMenuItem)({stopRef:n,name:t,value:a});return ev.createElement("button",{className:"flex px-3 py-1",...l.props},ev.createElement(tn.Icon,{className:"ml-auto shrink-0 scale-80 text-appcolor-500 hover:text-appcolor-800",icon:"dd_edit"}))},ZK=function(e){let{children:t}=e;return ev.createElement("div",{className:"mt-2 flex w-full items-center border-t border-solid border-appcolor-300 px-3 pb-1 pt-3 text-xs font-medium uppercase text-appcolor-500"},t)},ZY=function(e){let{name:t,value:a,selectedItem:n,children:l,style:r}=e,o=(0,ev.useRef)(null),i=(0,eI.useMenuItem)({stopRef:o,name:t,value:a}),s=n?.value===a;return ev.createElement("button",{...i.props,className:og()("up flex w-full cursor-pointer items-center justify-start border-none py-1 pl-3 text-sm text-appcolor-900 outline-0 ",{"font-bold":s&&"agent"===r})},l)},ZQ=function(e){let{agent:t,className:a,emoji:n,icon:l,size:r}=e,o=og()("w-5 scale-90",a);if(null!=l)return ev.createElement(tn.Icon,{icon:l,className:o});if(null!=n)return ev.createElement(e1.AgentAvatar,{name:n,size:r,className:a});if(null==t||null==t.data.avatar)return ev.createElement(tn.Icon,{icon:"dd_ai",className:o});if("emoji"===t.data.avatar.type)return ev.createElement(e1.AgentAvatar,{name:t.data.avatar.data.value,size:r,className:a});if("custom"!==t.data.avatar.type)return ev.createElement(tn.Icon,{icon:"dd_ai",className:o});let i=Td(t.data.avatar.data.file,"h_100,w_100","hdpi");return null==i?ev.createElement(tn.Icon,{icon:"dd_ai",className:o}):ev.createElement(e1.AgentAvatar,{src:i,size:r,className:a})},ZJ=function(e){let{menuGroupDispatch:t,initialFocus:a,menuSections:n,selectedItem:l}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eI.Menu,{className:"max-h-[50vh] w-72 overflow-y-auto rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 text-sm",initialFocus:a,loop:!0},ev.createElement("div",{className:"my-2"},n.map((e,t)=>ev.createElement("div",{key:`section-${t}`},!0!==e.hideLabel&&ev.createElement(ZK,null,e.label),e.items.map(e=>ev.createElement("div",{className:"group flex hover:bg-appcolor-300 focus:bg-appcolor-300 group-hover:text-appcolor-900",key:e.value},ev.createElement(ZY,{value:e.value,selectedItem:l,style:e.style},ev.createElement("div",{className:og()("mr-3",{"rounded-full bg-appcolor-300 p-px":"agent"===e.style,"text-appcolor-500":"create"===e.style})},ev.createElement(ZQ,{agent:e.agent,icon:e.icon,emoji:e.emoji,size:"xs",className:"mr-1 shrink-0"})),ev.createElement("div",{className:"flex flex-col items-start"},ev.createElement("span",{className:og()("whitespace-normal text-left group-hover:text-appcolor-900",{"text-appcolor-500":"create"===e.style})},e.label),e.description&&ev.createElement("span",{className:"mt-px whitespace-normal pb-1 text-appcolor-500"},e.description))),null!=e.agent&&e.isEditable&&ev.createElement(ZG,{name:"edit_agent",value:e.value}))))))))},ZX={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MembershipQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MembershipParts"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Space"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MembershipParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceParts"}}]}}]}}]},Z0={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]},Z1=function(e){let{className:t,onSelectChatMode:a,projectId:n,spaceId:l}=e,r=e.selectedValue??"ask_project",[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=ev.useRef(null),d=ev.useRef(null),c=(0,e$.useDispatch)(),m=ev.useCallback(()=>{s.current?.focus()},[]);(0,eI.usePopupEvents)({state:o,onCollapse:m});let u=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:o,placement:"bottom"}),p=(0,eI.useMenuButton)({dispatch:i,ref:s,state:o}),{menuSections:g,menuItemsMap:f}=function(e){let{spaceId:t,projectId:a}=e,n=(0,eK.Z)(),{data:l,loading:r}=(0,eB.a)(Z0,null!=t?{variables:{filterby:{spaceId:t}}}:{skip:!0}),{data:o}=(0,eB.a)(ZX,null!=t?{variables:{spaceID:t}}:{skip:!0}),i=eB.a(s3,{variables:{documentId:a}})?.data?.document??null,s=o?.membership?.role,d=pW({role:s,action:"create_space_agent"}),c=pW({role:s,action:"edit_space_agent"}),m=ev.useMemo(()=>{let e={value:"ask_project",label:n.formatMessage({id:"general.ask_project",defaultMessage:"Ask Project"}),style:"tab",description:n.formatMessage({id:"general.ask_project_description",defaultMessage:"Get answers with AI."})};if(null!=i){let t=nQ(i);null!=t&&(e.emoji=t)}return null==e.emoji&&(e.icon="dd_chat"),[e,{value:"team_chat",label:n.formatMessage({id:"general.team_chat",defaultMessage:"Team Chat"}),icon:"dd_comment",style:"tab",description:n.formatMessage({id:"general.team_chat_description",defaultMessage:"Collaborate with your team."})}]},[i,n]),{items:u,map:p}=ev.useMemo(()=>{let e=new Map,a=[];if(r)return{items:a,map:e};for(let t of l?.spaceAgents?.edges??[]){let n=hR.Sx.safeParse(t.node.data);if(!n.success)continue;let l={...t.node,data:n.data};a.push({value:t.node.id,label:t.node.name,agent:l,style:"agent",isEditable:c}),e.set(t.node.id,l)}if(null!=t&&d){let e=n.formatMessage({id:"general.create_agent",defaultMessage:"Create agent"});a.push({label:e,value:"create_agent",icon:"dd_new",style:"create"})}return{items:a,map:e}},[r,l,t,d,c,n]),g=ev.useMemo(()=>{let e=n.formatMessage({id:"general.agents",defaultMessage:"Agents"}),t=[{label:"default",hideLabel:!0,items:m}];return 0!==u.length&&t.push({label:e,items:u}),t},[u,m,n]),f=ev.useMemo(()=>{let e=new Map;for(let t of g)for(let a of t.items)e.set(a.value,a);return e},[g]);return{menuSections:g,menuItemsMap:f,agentsMap:p}}({spaceId:l,projectId:n}),h=f.get(r),y=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t,value:n}=e.payload;if(null==n)break;let r=f.get(n);if(null==r)break;"edit_agent"===t&&null!=n?c(TS.actions.toggleEditSpaceAgentDialog({agentId:n})):"create_agent"===n&&null!=l?c(TN.actions.toggleCreateSpaceAgentDialog({spaceId:l})):a(r),i({type:"Collapse",payload:"none"});break}case"Dismiss":i({type:"Collapse"})}},[c,f,a,l]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex max-w-48 cursor-pointer items-center rounded-xl border border-solid border-appcolor-400 bg-appcolor-200 px-3 py-1.5 text-left hover:bg-appcolor-300",t),...p.props},ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col"},null==h?ev.createElement("div",{className:"flex items-center overflow-hidden text-ellipsis text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.ask_project",defaultMessage:"Ask Project"})):ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-center overflow-hidden text-sm text-appcolor-600"},ev.createElement(ZQ,{agent:h.agent,icon:h.icon,emoji:h.emoji,size:"xs",className:"mr-1.5 shrink-0"}),ev.createElement("span",{className:"flex w-full truncate"},h.label)))),ev.createElement(tn.Icon,{icon:"date_caret",className:"ml-1 flex-none scale-90 text-appcolor-500"})),o.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:i,modal:!0},ev.createElement(ZJ,{initialFocus:u.initialFocus,menuGroupDispatch:y,menuSections:g,selectedItem:h})))},Z2=function(e){let{onClick:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"bottom",visible:a}),c=ev.useCallback(()=>{n(!0)},[]),m=ev.useCallback(()=>{n(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...d,onClick:t,onMouseEnter:c,onMouseLeave:m,className:"group flex items-center justify-center rounded-xl p-2 text-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"chat_end_call",className:"scale-110 text-danger"})),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.end_call",defaultMessage:"End Call"})))},Z5=function(e){let{onClick:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"bottom",visible:a}),c=ev.useCallback(()=>{n(!0)},[]),m=ev.useCallback(()=>{n(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...d,onClick:t,onMouseEnter:c,onMouseLeave:m,className:"group flex items-center justify-center rounded-xl p-2 text-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"chat_call",className:"scale-110 text-primary"})),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.start_call",defaultMessage:"Start Call"})))},Z3=function(e){let{onClick:t}=e,a=(0,eK.Z)(),[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"bottom",visible:n}),m=ev.useCallback(()=>{l(!0)},[]),u=ev.useCallback(()=>{l(!1)},[]),p=(0,te.Em)({id:"general.hide_chat",defaultMessage:"Hide Chat"});return ev.createElement(ev.Fragment,null,ev.createElement("button",{...c,"aria-label":a.formatMessage(p),className:"group flex items-center justify-center rounded-xl p-2 hover:bg-appcolor-300",onClick:t,onMouseEnter:m,onMouseLeave:u},ev.createElement(tn.Icon,{icon:"chat_toggle",className:"text-appcolor-500 group-hover:text-appcolor-1000"})),n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(IN,null,ev.createElement(eY.Z,p),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"\\")))))},Z4=eL.default.div.withConfig({displayName:"ChatHeader__JitsiPalette",componentId:"sc-a1e116ed-0"})` + height: 0; + background-color: ${e=>e.theme.primaryColorScheme?.base}; +`,Z6=eL.default.div.withConfig({displayName:"ChatHeader__JitsiWrapper",componentId:"sc-a1e116ed-1"})` + display: flex; + background: ${e=>e.theme.appColors.hex(100)}; + flex: 0 0 auto; +`,Z8=function(e){let{documentID:t,chatMode:a,onSelectChatMode:n,setInCall:l,spaceId:r}=e,o=(0,e$.useSelector)(dZ),i=(0,e$.useDispatch)(),s=(0,ev.useCallback)(e=>{i({type:xP,payload:{conference:e}})},[i]),d=(0,eL.useTheme)(),c=(0,eB.a)(uf),m=c.data?.me,u=function(e){let t=uh(e);return(0,ev.useCallback)(e=>{t({data:{...e,__typename:"ChatMessageEventBodyData"},__typename:"ChatMessageEventBody"})},[t])}(t),p=(0,ev.useCallback)(e=>{null!=m&&(e.executeCommand("displayName",m.handle),e.executeCommand("avatarUrl",m.avatars_v2?.default?.hdpi?.url)),e.on("videoConferenceJoined",function(){var e;u({scope:"jitsi",eventType:"conference_joined"}),e=t,u$?.track("Project Joined Call",{version:2},{context:{projectId:e}})}),e.on("videoConferenceLeft",function(){var e;e=t,u$?.track("Project Left Call",{version:2},{context:{projectId:e}})})},[u,m,t]),{ref:g,active:f,start:h,end:y}=function(e){let{active:t,backgroundColor:a,documentID:n,domain:l="call.taskade.com",onCreated:r,setActive:o}=e,i=(0,ev.useRef)(null),s=(0,ev.useRef)(null),d=(0,ev.useCallback)(()=>{i.current&&(i.current.executeCommand("hangup"),i.current.dispose(),i.current=null,o(!1))},[o]),c=(0,ev.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];i.current&&(i.current.executeCommand("hangup"),i.current.dispose(),i.current=null,o(!1));let t=function(e){let{backgroundColor:t,documentID:a,parentNode:n,voiceOnly:l}=e;return{width:"100%",height:340,gatherStats:!1,enableStatsID:!1,enableWelcomePage:!1,enableClosePage:!0,disableReactions:!1,configOverwrite:{enableClosePage:!0,startAudioOnly:l,enableNoisyMicDetection:!1,prejoinPageEnabled:!0,desktopSharingFrameRate:{min:5,max:30}},interfaceConfigOverwrite:{DEFAULT_BACKGROUND:t,VIDEO_QUALITY_LABEL_DISABLED:!0,AUDIO_LEVEL_PRIMARY_COLOR:"rgba(255,255,255,0.3)",AUDIO_LEVEL_SECONDARY_COLOR:"rgba(255,255,255,0.3)",MOBILE_DOWNLOAD_LINK_IOS:"https://apps.apple.com/us/app/taskade-team-productivity/id1264713923",MOBILE_DOWNLOAD_LINK_ANDROID:"https://play.google.com/store/apps/details?id=com.taskade.mobile",APP_NAME:"Taskade",NATIVE_APP_NAME:"Taskade",filmStripOnly:!1,DEFAULT_REMOTE_DISPLAY_NAME:"Tasker",SHOW_WATERMARK_FOR_GUESTS:!1,SHOW_BRAND_WATERMARK:!1,BRAND_WATERMARK_LINK:"https://taskade.com",SHOW_JITSI_WATERMARK:!1,DISPLAY_WELCOME_PAGE_CONTENT:!1,INVITATION_POWERED_BY:!1,AUTHENTICATION_ENABLE:!1,SUPPORT_URL:"https://taskade.com/contact",SETTINGS_SECTIONS:["language"],SHOW_CHROME_EXTENSION_BANNER:!1,TOOLBAR_BUTTONS:l?["microphone","camera","fullscreen","fodeviceselection","hangup","settings","filmstrip","shortcuts","tileview","select-background","raisehand"]:["microphone","camera","fullscreen","hangup","desktop","fodeviceselection","settings","videoquality","shortcuts","tileview","filmstrip","select-background","raisehand"]},parentNode:n,roomName:`taskade-${a}`}}({backgroundColor:a||function(){let e=document.getElementById("palette");if(null!=e)return window.getComputedStyle(e,null).getPropertyValue("background-color").toString()}(),documentID:n,parentNode:s.current,voiceOnly:e}),d=new JitsiMeetExternalAPI(l,t);d.on("readyToClose",function(){i.current.executeCommand("hangup"),i.current.dispose(),i.current=null,o(!1)}),i.current=d,o(!0),r&&r(i.current)},[a,n,l,r,o]);return(0,ev.useEffect)(()=>()=>{i.current&&(i.current.executeCommand("hangup"),i.current.dispose(),i.current=null,o(!1))},[o]),{ref:s,active:t,start:c,end:d}}({active:o,documentID:t,setActive:s,onCreated:p,backgroundColor:d?.primaryColorScheme?.base});return ev.createElement(ev.Fragment,null,ev.createElement(Z4,null),ev.createElement("div",{className:"flex items-center justify-between border-b border-appcolor-300 px-3 py-2"},ev.createElement(Z3,{onClick:()=>{i(xk(t))}}),null!=m&&ev.createElement(Z1,{projectId:t,spaceId:r,selectedValue:a,onSelectChatMode:n}),f?ev.createElement(Z2,{onClick:()=>{l(!1),y()}}):ev.createElement(Z5,{onClick:()=>{l(!0),h()}})),ev.createElement(Z6,{ref:g,id:"jitsi"}))},Z7=eL.default.div.withConfig({displayName:"DateSeparator__DayDividerWrapper",componentId:"sc-6968d5fe-0"})` + display: flex; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(80)}; + justify-content: center; + height: 16px; + margin-bottom: 16px; + margin-top: 5px; +`,Z9=eL.default.div.withConfig({displayName:"DateSeparator__DayDivider",componentId:"sc-6968d5fe-1"})` + display: flex; + height: 32px; + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: 500; + padding: 2px 12px; + border-radius: 30px; + font-size: 13px; + position: relative; + border: 4px solid transparent; +`,Le=ev.memo(function(e){let{unixTimestampMs:t,timezone:a}=e,n=(0,ev.useMemo)(()=>CR(t,a),[t,a]);return ev.createElement(Z7,null,ev.createElement(Z9,null,n))}),Lt=eL.default.a.withConfig({displayName:"EnableNotifications__Wrapper",componentId:"sc-1f9abc63-0"})` + width: 100%; + display: flex; + padding: 6px 0; + font-weight: bold; + ${e1.UiTypography.sm}; + align-content: center; + justify-content: center; + color: ${e=>e.theme.primaryColorScheme?.base}; + background: ${e=>e.theme.appColors.hex(90)}; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(80)}; + transition: color ease-in-out 0.2s; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,La=function(){let e=(0,e$.useSelector)(t7),t=(0,e$.useSelector)(_R),{arrowProps:a,popperProps:n,referenceProps:l,setVisible:r,visible:o}=(0,eI.useTooltip)({placement:"top"});return null==e||"messaging/permission-granted"===t||"messaging/unsupported-browser"===t?null:ev.createElement(Lt,{id:"enable-notifications",href:"/settings/notifications",target:"_blank",rel:"noopener noreferrer",onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},...l},ev.createElement(eY.Z,{id:"general.enable_notifications",defaultMessage:"Enable Notifications"}),o&&ev.createElement(eI.Tooltip,{arrowProps:a,popperProps:n},ev.createElement(eY.Z,{id:"general.enable_notifications_description",defaultMessage:"Get notified for chats, comments, reminders, and more."})))},Ln=(0,la.ZP)` + mutation chatMessageDelete($input: ChatMessageDeleteInput!) { + chatMessageDelete(input: $input) { + clientMutationId + to + messageAt + messageID + } + } +`;function Ll(e,t){let a={clientMutationId:(0,ld.Z)(),to:{type:"document",id:e},messageAt:t.at,messageID:t.id},[n]=(0,cs.D)(Ln,{variables:{input:a},update:(t,a)=>{let{data:n}=a,l=t.readQuery({query:ug,variables:{id:e,last:10,before:null}}),r=n?.chatMessageDelete?.messageID;if(null==l)return;let{chatMessages:o}=l.document,i={document:{...l?.document,chatMessages:{...o,totalCount:o.totalCount-1,edges:o.edges.filter(e=>e.node.id!==r)}}};t.writeQuery({query:ug,variables:{id:e,last:10,before:null},data:i})}});return(0,ev.useCallback)(()=>{n()},[n])}let Lr=(0,la.ZP)` + mutation chatMessageEventSend($input: ChatMessageEventSendInput!) { + chatMessageEventSend(input: $input) { + clientMutationId + to + message { + id + at + user { + ...BasicUserFields + } + body { + ... on ChatMessageEventBody { + data { + eventType + scope + } + } + } + } + } + } + ${up} +`,Lo=(0,la.ZP)` + mutation chatMessageFileSend($input: ChatMessageFileSendInput!) { + chatMessageFileSend(input: $input) { + clientMutationId + to + message { + id + at + user { + ...BasicUserFields + } + body { + ... on ChatMessageFileBody { + filename + fileUrls { + view + preview + download + } + } + } + } + } + } + ${up} +`,Li=(0,la.ZP)` + mutation chatMessageTextSend($input: ChatMessageTextSendInput!) { + chatMessageTextSend(input: $input) { + clientMutationId + to + message { + id + at + user { + ...BasicUserFields + } + body { + ... on ChatMessageTextBody { + value + editedAt + } + } + } + } + } + ${up} +`,Ls=(0,la.ZP)` + mutation chatMessageTextUpdate($input: ChatMessageTextUpdateInput!) { + chatMessageTextUpdate(input: $input) { + clientMutationId + to + message { + id + at + user { + ...BasicUserFields + } + body { + ... on ChatMessageTextBody { + value + editedAt + } + } + } + } + } + ${up} +`;var Ld=a(59043);let Lc=(0,lb.C)({tsTypes:{},schema:{context:{},events:{},services:{}},id:"upload",initial:"idle",states:{idle:{on:{UPLOAD:{target:"#upload.uploading"}}},uploading:{initial:"backendData",states:{backendData:{invoke:{id:"uploadBackendData",src:"uploadBackendData",onDone:[{actions:"uploadBackendDataOnDone",target:"#upload.uploading.s3"}],onError:[{actions:"uploadBackendDataOnError",target:"#upload.failed"}]}},s3:{invoke:{id:"uploadS3",src:"uploadS3",onDone:[{actions:"uploadS3OnDone",target:"#upload.uploading.lambda"}],onError:[{actions:"uploadS3OnError",target:"#upload.failed"}]}},lambda:{invoke:{id:"uploadLambda",src:"uploadLambda",onDone:[{actions:"uploadLambdaOnDone",target:"#upload.uploaded"}],onError:[{actions:"uploadLambdaOnError",target:"#upload.failed"}]}}}},uploaded:{type:"final",data:e=>{if(null==e.lambdaResponse)throw Error("Invalid state transition");return{lambdaResponse:e.lambdaResponse}}},failed:{entry:"failedEntry",on:{RETRY:{target:"#upload.uploading"}}}}},{actions:{failedEntry:(0,lv.sendParent)(e=>({type:Ld.M.ErrorCustom,data:{scope:"upload",backendDataResponse:e.backendDataResponse}})),uploadBackendDataOnDone:(0,lv.assign)({backendDataResponse:(e,t)=>t.data}),uploadBackendDataOnError:(0,lv.assign)({error:(e,t)=>t.data}),uploadLambdaOnDone:(0,lv.assign)({lambdaResponse:(e,t)=>t.data}),uploadLambdaOnError:(0,lv.assign)({error:(e,t)=>t.data}),uploadS3OnDone:(0,lv.assign)({s3ObjectKey:(e,t)=>t.data}),uploadS3OnError:(0,lv.assign)({error:(e,t)=>t.data})},services:{uploadBackendData:async e=>{let{documentID:t,file:a}=e;if(null==t)throw Error("Bad Request: Document ID not provided");if(null==a)throw Error("Bad Request: File not provided");let n=JSON.stringify({type:"message",documentID:t,includeS3Policy:"true",filename:a.name,filesize:a.size}),l=await fetch("/web-api/uploads/request-data",{method:"POST",body:n,headers:{"Content-Type":"application/json"},credentials:"same-origin"});return await l.json()},uploadLambda:async e=>{let{backendDataResponse:t,s3ObjectKey:a}=e;if(null==t)throw Error("Invalid Backend Data Response");let{token:n,awsUploadAPIBaseURL:l}=t.payload,r=JSON.stringify({body:{s3ObjectKey:a}}),o=await fetch(`${l}/uploads`,{method:"POST",headers:{"uploads-authorization-jwt":n,"Content-Type":"application/json"},body:r,credentials:"same-origin"}),{data:i}=await o.json();return i},uploadS3:async e=>{let{file:t,backendDataResponse:a}=e;if(null==a||!a.ok)throw Error("Invalid Backend Data Response");if(null==t)throw Error("Bad Request: File not provided");let{s3Policy:n,s3URL:l}=a.payload,{formData:r,s3ObjectKey:o}=uo(t,n);if(null==o)throw Error("Invalid S3 Object Key");return await fetch(l,{method:"POST",body:r,credentials:"same-origin"}),o}}}),Lm=(0,lb.C)({context:{message:null,isEditedBefore:!1,isSubmitted:!1,documentID:""},tsTypes:{},schema:{context:{},events:{},services:{}},id:"chatMessageState",initial:"pending",states:{pending:{always:[{cond:"isEdited",target:"#chatMessageState.edited.success"},{cond:"isSubmitted",target:"#chatMessageState.submitted"},{cond:"isUploadedViaUppy",target:"#chatMessageState.submitting"},{cond:"isSubmittingFile",target:"#chatMessageState.submittingFile"},{cond:"isSubmitting",target:"#chatMessageState.submitting"}]},submittingFile:{entry:"submittingFileEntry",invoke:{id:"uploadFile",src:"uploadFile",data:e=>({documentID:e.documentID,file:e.file}),onDone:[{actions:"uploadFileOnDone",target:"#chatMessageState.submitting"}],onError:[{actions:["uploadFileOnError","onUploadFailure"],target:"#chatMessageState.failure"}]}},submitting:{invoke:{src:"submit",id:"submitMessage",onDone:[{target:"#chatMessageState.submitted"}],onError:[{actions:"submitMessageOnError",target:"#chatMessageState.failure"}]}},submitted:{on:{TYPING:{target:"#chatMessageState.editing"}}},failure:{on:{RETRY:{target:"#chatMessageState.submitting"}}},editing:{on:{SUBMIT:{actions:"editingOnSubmit",target:"#chatMessageState.edited"},CANCEL:[{cond:"isEditedBefore",target:"#chatMessageState.edited.success"},{cond:"isNotEditedBefore",target:"#chatMessageState.submitted"}]}},edited:{initial:"submitting",states:{submitting:{invoke:{src:"submitEdit",id:"submitMessageEdit",onDone:[{target:"#chatMessageState.edited.success"}],onError:[{actions:"submitMessageEditOnError",target:"#chatMessageState.edited.failure"}]}},success:{},failure:{on:{RETRY:{target:"#chatMessageState.edited.submitting"}}}},on:{TYPING:{target:"#chatMessageState.editing"}}}}},{actions:{editingOnSubmit:(0,lv.assign)(e=>({...e,isEditedBefore:!0})),submittingFileEntry:(0,lv.send)("UPLOAD",{to:"uploadFile"}),submitMessageEditOnError:(0,lv.assign)({error:(e,t)=>t.data}),submitMessageOnError:(0,lv.assign)({error:(e,t)=>t.data}),uploadFileOnDone:(0,lv.assign)({lambdaResponse:(e,t)=>t.data.lambdaResponse}),uploadFileOnError:(0,lv.assign)({error:(e,t)=>t.data})},guards:{isEdited:e=>null!=e.message&&"ChatMessageTextBody"===e.message.body.__typename&&null!=e.message.body.editedAt,isEditedBefore:e=>e.isEditedBefore,isNotEditedBefore:e=>!e.isEditedBefore,isSubmitting:e=>null!=e.message&&""===e.message.at,isSubmitted:e=>null!=e.message&&""!==e.message.at,isSubmittingFile:e=>null!=e.message&&""===e.message.at&&"ChatMessageFileBody"===e.message.body.__typename,isUploadedViaUppy:e=>null!=e.message&&""===e.message.at&&"ChatMessageFileBody"===e.message.body.__typename&&null!=e.lambdaResponse}});function Lu(e){if(null==e)return;let t=eG()().tz(e);if(null==t)return;let a=t.hour();return a<7||a>=19}let Lp=eL.default.div.withConfig({displayName:"LocalTime__LocalTimeContainer",componentId:"sc-3a8a7c41-0"})` + display: flex; + flex-direction: row; + align-items: center; + + svg { + height: 12px; + margin: 0 5px 1px 0; + + * { + fill: ${e=>e.color}; + } + } +`,Lg=eL.default.span.withConfig({displayName:"LocalTime__TimeWrapper",componentId:"sc-3a8a7c41-1"})` + display: inline-block; + color: ${e=>e.color}; + font-size: 14px; + vertical-align: middle; +`,Lf=function(e){let{night:t,timezone:a}=e,n=e.color??"#999",l=function(e){let t=eG()();if(!e)return t;let a=t.clone().tz(e);return null!=a&&a.isValid()?a:t}(a);return ev.createElement(Lp,{color:n},t&&ev.createElement(lT.Qw,null),ev.createElement(Lg,{color:n},l.format("LT")))},Lh=eL.default.div.withConfig({displayName:"MessageAvatar__Container",componentId:"sc-70c19a8c-0"})` + height: fit-content; +`,Ly=function(e){let{user:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a}),c=t?.avatars_v2??null,m=t?.handle??"",u=t?.timezone??null,p=(0,ev.useCallback)(()=>{n(null!=u)},[u]),g=(0,ev.useCallback)(()=>{n(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement(Lh,{...d,onMouseEnter:p,onMouseLeave:g},ev.createElement(ao,{avatars_v2:c,handle:m,size:30,userID:parseInt(t?.id??"",10)})),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},null!=u&&ev.createElement(Lf,{night:Lu(u)??!1,timezone:u,color:"#fff"})))},Lb=(0,sX.regexSupplant)("^#{emojiSequence}+$",{emojiSequence:sX.regexen.emojiSequence},"u"),Lv=eL.default.p.withConfig({displayName:"EditedIndicator__TextEdited",componentId:"sc-4fd1258e-0"})` + display: inline; + white-space: pre-wrap; + color: ${e=>e.theme.textColors.hex("50")}; +`,Lk=function(e){let{editedAt:t,timezone:a}=e,n=new Date(t),l=eG()(n);null!=a&&l.tz(a);let r=l.format("M/D/YY hh:mm A");return ev.createElement(Lv,{alt:r,title:r},ev.createElement("em",null,"(edited)"))},LE=eL.default.img.withConfig({displayName:"FileImage__FilePreviewImg",componentId:"sc-ff08abc9-0"})` + width: 120px; + min-height: 120px; + background: ${e=>e.theme.isNightMode?"#333":"#e5e5e5"}; + border-radius: 5px; + cursor: zoom-in; +`,Lx=function(e){let{alt:t,downloadUrl:a,previewUrl:n,title:l}=e,r=(0,sX.extractFileExtension)(a),o=Zd.has(r);if(null!=a&&o){let e=Zd.get(r)??void 0;return ev.createElement("video",{preload:"metadata",width:120,height:120},ev.createElement("source",{src:a,type:e}),ev.createElement("img",{src:n}))}return ev.createElement(LE,{src:n,alt:t,title:l})};class L_ extends ev.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){uT(e,uI)}render(){return null!=this.state.error?ev.createElement(eY.Z,{id:"general.markdown_rendering_error",defaultMessage:"An error has occurred. Please try again later."}):this.props.children}}var Lw=a(54042);let LN=(0,eL.default)(Lw.Z).withConfig({displayName:"Textarea",componentId:"sc-c3c984f7-0"})` + display: flex; + width: 100%; + border: 0; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 15px; + resize: vertical; + height: auto; + padding: 0 18px; + background: none; + overflow-y: auto; + ${tM}; + + &::-webkit-input-placeholder { + color: ${e=>e.theme.appColors.hex(60)}; + } + &::-moz-placeholder { + color: ${e=>e.theme.appColors.hex(60)}; + } + &:-ms-input-placeholder { + color: ${e=>e.theme.appColors.hex(60)}; + } + &:-moz-placeholder { + color: ${e=>e.theme.appColors.hex(60)}; + } +`,LC=eL.default.div.withConfig({displayName:"MessageBody__TextBody",componentId:"sc-9f6d6b46-0"})` + display: grid; + white-space: pre-wrap; + color: ${e=>e.theme.textColors.hex("10")}; + + & > strong { + font-weight: 500; + } + & > .paragraph { + display: block; + word-break: break-word; + margin-bottom: 18px; + &:last-of-type { + margin-bottom: 0; + } + font-size: ${e=>e.$emojiOnly?"48px":"inherit"}; + letter-spacing: ${e=>e.$emojiOnly?"12px":"inherit"}; + } +`,LM=(0,eL.default)(LN).withConfig({displayName:"MessageBody__EditTextarea",componentId:"sc-9f6d6b46-1"})` + margin: 10px 0; + padding: 10px; + border-radius: 5px; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; +`,LS=eL.default.div.withConfig({displayName:"MessageBody__EditMessageActionsContainer",componentId:"sc-9f6d6b46-2"})` + display: flex; + justify-content: flex-end; + padding-bottom: 4px; +`,LI=(0,eL.default)(Cg).withConfig({displayName:"MessageBody__EditMessageButton",componentId:"sc-9f6d6b46-3"})` + display: flex; + align-content: center; + padding: 6px 18px; + border-radius: 5px; + line-height: inherit; + font-weight: 500; +`,LD=(0,eL.default)(LI).withConfig({displayName:"MessageBody__EditMessageSaveButton",componentId:"sc-9f6d6b46-4"})` + background: ${e=>e.theme?.primaryColorScheme?.base}; + color: #fff; + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } +`,LT=(0,eL.default)(LI).withConfig({displayName:"MessageBody__EditMessageCancelButton",componentId:"sc-9f6d6b46-5"})` + color: #999; + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,L$=eL.default.div.withConfig({displayName:"MessageBody__FilePreview",componentId:"sc-9f6d6b46-6"})` + position: relative; + max-width: 100%; + width: 120px; + margin: 5px 0 0; +`,LP=eL.default.span.withConfig({displayName:"MessageBody__FileExtension",componentId:"sc-9f6d6b46-7"})` + display: block; + position: absolute; + top: 5px; + right: 5px; + padding: 2px 5px; + background: rgba(0, 0, 0, 0.2); + border-radius: 5px; + color: #fff; + font-weight: 500; + font-size: 15px; + text-transform: uppercase; + pointer-events: none; + z-index: 1; +`,LF=eL.default.span.withConfig({displayName:"MessageBody__FileName",componentId:"sc-9f6d6b46-8"})` + display: block; + width: 120px; + padding: 4px 0 0; + color: ${e=>(e.theme?.isNightMode,"#999")}; + font-size: 15px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +`,LA=eL.default.div.withConfig({displayName:"MessageBody__FilePreviewImgContainer",componentId:"sc-9f6d6b46-9"})` + position: relative; +`,LR=eL.default.div.withConfig({displayName:"MessageBody__SpinnerWrapper",componentId:"sc-9f6d6b46-10"})` + position: absolute; +`,Lj=eL.default.div.withConfig({displayName:"MessageBody__ActivityWrapper",componentId:"sc-9f6d6b46-11"})` + display: flex; + flex-direction: column; + margin-top: 4px; +`,LO=eL.default.div.withConfig({displayName:"MessageBody__Activity",componentId:"sc-9f6d6b46-12"})` + display: flex; + margin-bottom: 5px; + word-break: break-all; +`,LU=eL.default.div.withConfig({displayName:"MessageBody__ActivitySideline",componentId:"sc-9f6d6b46-13"})` + display: flex; + flex: 1 0 auto; + width: 3px; + max-width: 3px; + background: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + border-radius: 10px; +`,LZ=eL.default.div.withConfig({displayName:"MessageBody__ActivityBody",componentId:"sc-9f6d6b46-14"})` + padding-left: 8px; + text-decoration: line-through; + color: ${e=>e.theme?.isNightMode?"#999":"#666"}; +`,LL=function(e){let{message:t,editValue:a,editedSubmitting:n,editedFailure:l,setEditValue:r,onClickFile:o,onClickEditSave:i,onClickEditCancel:s,editing:d,timezone:c,disableEditSave:m}=e,u=(0,ev.useRef)(null);(0,ev.useEffect)(()=>{d&&u.current&&ow(u.current?.textarea)},[d]);let p=(0,ev.useCallback)(e=>{r?.(e.target.value)},[r]),g=(0,ev.useMemo)(()=>"ChatMessageTextBody"===t.body.__typename&&Lb.test(t.body.value),[t.body]);switch(t.body.__typename){case"ChatMessageFileBody":{let e=t.body;return ev.createElement(L$,{onClick:o},ev.createElement(LP,null,(0,sX.extractFileExtension)(e.filename)),ev.createElement(LA,null,""===t.at&&ev.createElement(LR,null,ev.createElement(eI.Spinner,{width:120,height:120,color:"#fff"})),ev.createElement(Lx,{alt:"",downloadUrl:e.fileUrls.download,previewUrl:e.fileUrls.preview,title:e.filename})),ev.createElement(LF,null,e.filename))}case"ChatMessageEventBody":{let e=t.body,a=e.data.eventType;if("jitsi"===e.data.scope)return"conference_joined"===e.data.eventType&&(a=`${t.user?.handle} has joined the call.`),ev.createElement(LC,null,a);break}case"ChatMessageActivityBody":{let e=t.body;if("document"===e.data.scope){if("ChatMessageActivityNodeCompletedData"===e.data.__typename){let a=e?.data?.nodes?.length??0;return ev.createElement(ev.Fragment,null,a>0&&ev.createElement(Lj,null,e.data.nodes.map(e=>{let a=new URL(e.url);return ev.createElement(LO,{key:`message-${t.id}-completed-node-${e.id}`},ev.createElement(LU,null),ev.createElement(sC.rU,{to:a.hash},ev.createElement(LZ,null,ev.createElement(L_,null,ev.createElement(Pa,{value:e.text||"Untitled"})))))})))}if("ChatMessageActivityDocumentCompletedData"===e.data.__typename)return null}}}let f=t.body;return d?ev.createElement(ev.Fragment,null,ev.createElement(LM,{autoFocus:!0,type:"text",value:a,onChange:p,onKeyDown:e=>{if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}13===e.keyCode?e.shiftKey||(e.preventDefault(),i?.()):27===e.keyCode&&s?.()},ref:u}),ev.createElement(LS,null,ev.createElement(LT,{type:"button",onClick:s},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(LD,{type:"submit",disabled:m,onClick:i},ev.createElement(eY.Z,{id:"general.save",defaultMessage:"Save"})))):ev.createElement(LC,{$emojiOnly:g},ev.createElement(L_,null,ev.createElement(Pa,{value:f.value})),(n||l||f.editedAt)&&ev.createElement(Lk,{editedAt:Number(f.editedAt),timezone:c??void 0}))},LB=(0,eL.default)(Cg).withConfig({displayName:"ActionsMenuButton__StyledActionsMenuButton",componentId:"sc-9d9fb055-0"})` + display: flex; + align-items: center; + justify-content: center; + border-radius: 10px; + margin: 2px; + + svg path { + stroke: ${e=>e.theme.appColors.hex(10)}; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + + svg path { + stroke: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333"}; + } + } +`,Lz=function(e){let{children:t,onClick:a,tooltip:n}=e,{arrowProps:l,popperProps:r,referenceProps:o,setVisible:i,visible:s}=(0,eI.useTooltip)({placement:"top"});return ev.createElement(ev.Fragment,null,ev.createElement(LB,{...o,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},onClick:a},t),s&&ev.createElement(eI.Tooltip,{arrowProps:l,popperProps:r},n))},LV=eL.default.div.withConfig({displayName:"Menu__Wrapper",componentId:"sc-ce045385-0"})` + display: flex; + visibility: ${e=>!0===e.isVisible?"visible":"hidden"}; + position: absolute; + top: -12px; + right: 0px; + padding: 1.5px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + overflow: hidden; +`,Lq=function(e){let{isVisible:t,message:a,onClickReply:n,onClickEdit:l,onClickRetry:r,onClickDelete:o,isRoleDeleteChatAllowed:i,isRetryEnabled:s}=e,d=(0,eK.Z)(),c=eB.a(uf).data?.me,m=null!=c&&c.id===a.user?.id,u=(0,ev.useCallback)(()=>{if("ChatMessageFileBody"!==a.body.__typename)return;let{download:e,view:t}=a.body.fileUrls;window.open(e??t,void 0,"noopener,noreferrer")},[a.body]),p=(0,ev.useCallback)(()=>{null!=a.user&&n?.(a)},[n,a]),g=!s&&"ChatMessageTextBody"===a.body.__typename&&m,f=i||m;return ev.createElement(LV,{isVisible:t},!s&&ev.createElement(Lz,{onClick:p,tooltip:d.formatMessage({id:"chat.reply",defaultMessage:"Reply"})},ev.createElement(lT._K,null)),"ChatMessageFileBody"===a.body.__typename&&ev.createElement(Lz,{onClick:u,tooltip:d.formatMessage({id:"chat.download_file",defaultMessage:"Download file"})},ev.createElement(lT.uc,null)),g&&ev.createElement(Lz,{onClick:l,tooltip:d.formatMessage({id:"chat.edit",defaultMessage:"Edit"})},ev.createElement(lT.K4,null)),m&&s&&ev.createElement(Lz,{onClick:r,tooltip:d.formatMessage({id:"chat.retry",defaultMessage:"Retry"})},ev.createElement(lT.Gp,null)),f&&ev.createElement(Lz,{onClick:o,tooltip:d.formatMessage({id:"chat.delete",defaultMessage:"Delete"})},ev.createElement(lT.tP,null)))},LW=eL.default.time.withConfig({displayName:"Timestamp__Time",componentId:"sc-40fbe873-0"})` + margin-left: 0.25rem; + color: ${e=>e.theme.textColors.hex("70")}; + ${e1.UiTypography.xs}; + &:hover { + text-decoration: underline; + } +`,LH=eL.default.div.withConfig({displayName:"Timestamp__TimeContainer",componentId:"sc-40fbe873-1"})` + display: flex; + flex-direction: row; + align-items: center; +`,LG=eL.default.span.withConfig({displayName:"Timestamp__TimeWrapper",componentId:"sc-40fbe873-2"})` + display: inline-block; + color: #fff; + ${e1.UiTypography.xs}; +`,LK=ev.memo(function(e){let{unixEpochMs:t,timezone:a}=e,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"top",visible:n}),m=ev.useCallback(()=>{l(!0)},[l]),u=ev.useCallback(()=>{l(!1)},[l]),{children:p,datetime:g,tooltip:f}=ev.useMemo(()=>{let e=eG()(t);return null!=a&&(e=e.tz(a)),{children:eG()().diff(e,"days")>0?e.format("L"):e.format("LT"),datetime:e.toISOString(),tooltip:e.calendar(null,{sameElse:"llll"})}},[t,a]);return ev.createElement(LW,{dateTime:g,...c,onMouseEnter:m,onMouseLeave:u},p,n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(LH,null,ev.createElement(LG,null,f))))}),LY=function(e){let{message:t}=e;if("ChatMessageActivityBody"===t.body.__typename)switch(t.body.data.__typename){case"ChatMessageActivityNodeCompletedData":if("node_completed"===t.body.data.type){let e=t.body.data.nodes?.length??0;return ev.createElement(eY.Z,{id:"chat.document_node_completed",defaultMessage:"{editor} completed {taskCount, plural, =0 {no tasks} one {a task} other {# tasks}}",values:{editor:t.user?.handle,taskCount:e,span:e=>ev.createElement("span",null,e),strong:e=>ev.createElement("strong",null,e)}})}break;case"ChatMessageActivityDocumentCompletedData":if("document_completed"===t.body.data.type)return ev.createElement(eY.Z,{id:"chat.document_completed",defaultMessage:"{editor} completed the project",values:{editor:t.user?.handle,strong:e=>ev.createElement("strong",null,e)}})}return ev.createElement("strong",null,t.user?.handle)},LQ=eL.default.div.withConfig({displayName:"MessageFrom__Container",componentId:"sc-1678c071-0"})` + width: 100%; + align-items: center; + position: relative; + word-break: break-word; +`,LJ=(0,eL.keyframes)` + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +`,LX=(0,eL.default)(lT.tb).withConfig({displayName:"MessageFrom__StyledChatSendingIcon",componentId:"sc-1678c071-1"})` + margin-left: 2px; + animation: ${LJ} infinite 0.75s linear; + + path { + stroke: ${e=>e.theme.appColors.hex(10)}; + } +`,L0=(0,eL.default)(lT.IQ).withConfig({displayName:"MessageFrom__StyledChatFailedIcon",componentId:"sc-1678c071-2"})` + margin-left: 4px; +`,L1=function(e){let{isMenuVisible:t,isRoleDeleteChatAllowed:a,message:n,onClickDelete:l,onClickEdit:r,onClickReply:o,onClickRetry:i,isRetryEnabled:s,isSubmitting:d}=e,c=(0,e$.useDispatch)(),[m,u]=ev.useState(!1),p=ev.useRef(null),g=ev.useRef(null),f=ev.useRef(null),{referenceProps:h,arrowProps:y,popperProps:b}=(0,eI.useControlledTooltip)({referenceElementRef:p,arrowElementRef:g,popperElementRef:f,visible:m,placement:"bottom"}),v=ev.useCallback(()=>{u(!0)},[]),k=ev.useCallback(()=>{u(!1)},[]),E=e.shouldShowUpgradeButton??!1,x=(0,ev.useMemo)(()=>""===n.at?Date.now():Number(n.at),[n.at]);return ev.createElement(LQ,null,ev.createElement(LY,{message:n}),t&&ev.createElement(Lq,{isVisible:t&&!d,message:n,isRoleDeleteChatAllowed:a,onClickDelete:l,onClickEdit:r,onClickRetry:i,onClickReply:o,isRetryEnabled:s}),E&&ev.createElement("span",{...h,onMouseEnter:v,onMouseLeave:k},ev.createElement(e1.UpgradeBadge,{onClick:()=>{c(d4())}})),m&&ev.createElement(eI.Tooltip,{arrowProps:y,popperProps:b},ev.createElement(eY.Z,{id:"general.upgrade_to_unlock_larger_file_upload",defaultMessage:"Upgrade to unlock larger file upload limit."})),s&&!E&&ev.createElement(L0,null),d&&ev.createElement(LX,null),!s&&!d&&ev.createElement(LK,{unixEpochMs:x}))},L2=e=>!0===e?(0,eL.css)` + background: ${e=>e.theme.appColors.hex(80)}; + `:(0,eL.css)` + background: transparent; + `,L5=eL.default.div.withConfig({displayName:"ComplexMessage__Wrapper",componentId:"sc-a622238d-0"})` + display: grid; + grid-template: 'avatar body' / max-content auto; + gap: 8px; + padding: 6px 16px; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 15px; + ${e=>L2(e.isEditOn)} + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,L3=eL.default.div.withConfig({displayName:"ComplexMessage__Content",componentId:"sc-a622238d-1"})` + max-width: 100%; + + p { + margin-bottom: 0; + white-space: pre-wrap; + word-break: break-word; + + a { + color: ${e=>e.theme?.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } + } + } +`,L4=ev.memo(e=>{let{message:t,documentID:a,isRoleDeleteChatAllowed:n,onClickReply:l}=e,r=(0,e$.useSelector)(dU),o=(0,e$.useDispatch)(),i=function(e,t){let a=(0,ll.x)();return(0,ev.useCallback)(()=>{let n=a.readQuery({query:ug,variables:{id:e,last:10,before:null}});if(null==n)return;let{chatMessages:l}=n.document,r=t.id,o={document:{...n?.document,chatMessages:{...l,totalCount:l.totalCount-1,edges:l.edges.filter(e=>e.node.id!==r)}}};a.writeQuery({query:ug,variables:{id:e,last:10,before:null},data:o})},[a,e,t])}(a,t),s=(0,ev.useCallback)(e=>{let{error:t}=e;null!=t&&"upload"===t.scope&&null!=t.backendDataResponse&&"TASKADE_UNLIMITED_REQUIRED_ERROR"===t.backendDataResponse.code&&(Ic()?o(E3()):o(d4(r)),i())},[i,o,r]),{editing:d,submitting:c,failure:m,editedFailure:u,editedSubmitting:p,edit:g,submit:f,cancel:h,retry:y,shouldShowUpgradeButton:b}=function(e,t,a){let n,l;let r=(0,ll.x)();if(e?.body?.__typename==="ChatMessageFileBody"){let t=e.body;n=t.file,l=t.lambdaResponse}let[o,i]=(0,ls.e)(Lm,{context:{message:e,documentID:t,file:n,lambdaResponse:l},actions:a.actions,services:{submit:async(e,a)=>{let{message:n}=e;switch(n?.body?.__typename){case"ChatMessageTextBody":{let e=n.body;return r.mutate({mutation:Li,variables:{input:{clientMutationId:(0,ld.Z)(),id:n.id,to:{type:"document",id:t},text:e.value}}})}case"ChatMessageFileBody":{let{lambdaResponse:a}=e;return r.mutate({mutation:Lo,variables:{input:{clientMutationId:(0,ld.Z)(),id:n.id,to:{type:"document",id:t},file:a}}})}case"ChatMessageEventBody":{let e=n.body;return r.mutate({mutation:Lr,variables:{input:{clientMutationId:(0,ld.Z)(),id:n.id,to:{type:"document",id:t},data:{eventType:e.data.eventType,scope:e.data.scope}}}})}}},submitEdit:async(e,t)=>r.mutate({mutation:Ls,variables:{input:t.payload.input}}),uploadFile:Lc}}),s=(0,ev.useCallback)(()=>{i({type:"TYPING"})},[i]),d=(0,ev.useCallback)(e=>{i({type:"SUBMIT",payload:{input:e}})},[i]),c=(0,ev.useCallback)(()=>{i({type:"CANCEL"})},[i]),m=(0,ev.useCallback)(e=>{i({type:"RETRY",payload:{input:e}})},[i]),u=o.matches("submitting"),p=o.matches("submitted"),g=o.matches("editing"),f=o.matches("edited"),h=o.matches("failure"),y=o.matches("edited.failure"),b=o.matches("edited.submitting"),v=o.context.error?.backendDataResponse?.code==="PAYMENT_REQUIRED";return{submitting:u,submitted:p,editing:g,edited:f,failure:h,editedFailure:y,editedSubmitting:b,messageState:o,edit:s,submit:d,cancel:c,retry:m,shouldShowUpgradeButton:v}}(t,a,(0,ev.useMemo)(()=>({actions:{onUploadFailure:s}}),[s])),[v,k]=(0,ev.useState)(!1),E=(0,ev.useMemo)(()=>"ChatMessageTextBody"!==t.body.__typename?"":t.body.value,[t.body]),[x,_]=(0,ev.useState)(E);(0,ev.useEffect)(()=>{_(E)},[E]);let w=(0,ev.useCallback)(()=>{k(!0)},[]),N=(0,ev.useCallback)(()=>{k(!1)},[]),C=(0,ev.useCallback)(()=>{ZC(t.body)&&o(Z$.actions.toggleMediaDialog({media:[t.body]}))},[o,t]),M=(0,ev.useCallback)(e=>{f({clientMutationId:(0,ld.Z)(),to:{type:"document",id:a},text:e,messageAt:t.at,messageID:t.id})},[f,a,t]),S=(0,ev.useCallback)(e=>{y({clientMutationId:(0,ld.Z)(),to:{type:"document",id:a},text:e,messageAt:t.at,messageID:t.id})},[y,a,t]),I=Ll(a,t),D=(0,ev.useCallback)(()=>{window.confirm("Are you sure you want to delete this message?")&&I()},[I]),T=(0,ev.useCallback)(()=>{0!==x.length&&M(x)},[M,x]),$=(0,ev.useCallback)(()=>{0!==x.length&&S(x)},[S,x]);return ev.createElement(L5,{onMouseEnter:w,onMouseLeave:N,isEditOn:d},ev.createElement(Ly,{user:t.user}),ev.createElement(L3,null,ev.createElement(L1,{isMenuVisible:v,isRoleDeleteChatAllowed:n,message:t,isRetryEnabled:m||u,isSubmitting:c,onClickDelete:D,onClickEdit:g,onClickReply:l,onClickRetry:$,shouldShowUpgradeButton:b}),ev.createElement(LL,{message:t,editing:d,editValue:x,editedSubmitting:p,editedFailure:u,setEditValue:_,onClickFile:C,onClickEditSave:T,onClickEditCancel:h,timezone:t.user?.timezone})))}),L6=e=>!0===e?(0,eL.css)` + background: ${e=>e.theme.appColors.hex(80)}; + `:(0,eL.css)` + background: transparent; + `,L8=eL.default.div.withConfig({displayName:"SimpleFileEventMessage__Wrapper",componentId:"sc-718e72f8-0"})` + display: grid; + grid-template: 'avatar body' / max-content auto; + gap: 8px; + padding: 6px 16px; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 15px; + ${e=>L6(e.isEditOn)} + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,L7=eL.default.div.withConfig({displayName:"SimpleFileEventMessage__Content",componentId:"sc-718e72f8-1"})` + max-width: 100%; + + p { + display: inline-block; + margin-bottom: 0; + white-space: pre-wrap; + word-break: break-word; + + a { + color: ${e=>e.theme?.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } + } + } +`,L9=ev.memo(e=>{let{message:t,documentID:a,isRoleDeleteChatAllowed:n,onClickReply:l}=e,[r,o]=(0,ev.useState)(!1),i=(0,e$.useDispatch)(),s=(0,ev.useCallback)(()=>{o(!0)},[]),d=(0,ev.useCallback)(()=>{o(!1)},[]),c=(0,ev.useCallback)(()=>{ZC(t.body)&&i(Z$.actions.toggleMediaDialog({media:[t.body]}))},[i,t]),m=Ll(a,t),u=(0,ev.useCallback)(()=>{window.confirm("Are you sure you want to delete this message?")&&m()},[m]);return ev.createElement(L8,{onMouseEnter:s,onMouseLeave:d,isEditOn:!1},ev.createElement(Ly,{user:t.user}),ev.createElement(L7,null,ev.createElement(L1,{isMenuVisible:r,isRoleDeleteChatAllowed:n,message:t,onClickDelete:u,onClickReply:l}),ev.createElement(LL,{message:t,onClickFile:c,timezone:t.user?.timezone})))}),Be=ev.memo(function(e){let{message:t,documentID:a,isRoleDeleteChatAllowed:n,onClickReply:l}=e;if(""!==t.at)switch(t.body.__typename){case"ChatMessageFileBody":case"ChatMessageEventBody":return ev.createElement(L9,{message:t,documentID:a,isRoleDeleteChatAllowed:n,onClickReply:l})}return ev.createElement(L4,{message:t,documentID:a,isRoleDeleteChatAllowed:n,onClickReply:l})});var Bt=a(57913);let Ba=cx.UPLOAD_VALID_EXTENSIONS.map(e=>`.${e}`),Bn=["pdf","docx","txt"],Bl=["csv"],Br=ev.memo(function(e){let{onClick:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:r}),c=(0,ev.useCallback)(e=>{o(!1),t?.(e)},[t]),m=(0,ev.useCallback)(()=>{o(!0)},[]),u=(0,ev.useCallback)(()=>{o(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...d,type:"button",onClick:c,onMouseEnter:m,onMouseLeave:u,className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_audio"})),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.audio",defaultMessage:"Audio"})))}),Bo=eL.default.div.withConfig({displayName:"AutocompleteItem__AvatarWrapper",componentId:"sc-1916ccc4-0"})` + margin-right: 8px; +`,Bi=eL.default.div.withConfig({displayName:"AutocompleteItem__TextWrapper",componentId:"sc-1916ccc4-1"})` + width: 100%; + display: grid; + grid-template-columns: 1fr auto; + gap: 5px; + align-items: start; + + & .rta__user { + & > .name { + color: ${e=>(e.theme.isNightMode,"#999")}; + } + & > .char { + color: ${e=>e.theme.textColors.hex(10)}; + } + } +`,Bs=function(e){let{entity:t}=e,{id:a,avatars_v2:n,handle:l,display_name:r,timezone:o}=t,i=Lu(o)??!1;return ev.createElement("div",null,ev.createElement(Bo,null,ev.createElement(ao,{avatars_v2:n,handle:l,size:20,userID:parseInt(a,10)})),ev.createElement(Bi,null,ev.createElement("div",{className:"rta__user"},ev.createElement("span",{className:"char"},l),r&&ev.createElement("span",{className:"name"},r)),ev.createElement(Lf,{night:i,timezone:o})))},Bd=ev.memo(function(e){let{onClick:t}=e,{arrowProps:a,popperProps:n,referenceProps:l,setVisible:r,visible:o}=(0,eI.useTooltip)({placement:"top"}),i=(0,ev.useCallback)(e=>{r(!1),t?.(e)},[t,r]),s=(0,ev.useCallback)(()=>{r(!0)},[r]),d=(0,ev.useCallback)(()=>{r(!1)},[r]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...l,type:"button",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",onClick:i,onMouseEnter:s,onMouseLeave:d},ev.createElement(tn.Icon,{icon:"message_mention"})),o&&ev.createElement(eI.Tooltip,{arrowProps:a,popperProps:n},ev.createElement(eY.Z,{id:"general.mention",defaultMessage:"Mention"})))}),Bc=ev.memo(function(e){let{onClick:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:r}),c=(0,ev.useCallback)(e=>{o(!1),t?.(e)},[t]),m=(0,ev.useCallback)(()=>{o(!0)},[]),u=(0,ev.useCallback)(()=>{o(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...d,type:"button",onClick:c,onMouseEnter:m,onMouseLeave:u,className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"dd_upload_screencast"})),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.screencast",defaultMessage:"Screencast"})))}),Bm=function(e){let{disabled:t,onClick:a}=e;return ev.createElement("button",{className:"ml-auto flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",type:"submit",disabled:t,onClick:a},ev.createElement(tn.Icon,{icon:"message_send"}))},Bu=eL.default.div.withConfig({displayName:"styled__IconName",componentId:"sc-3697b242-0"})` + display: flex; + align-items: center; + + & svg { + width: 20px; + margin-right: 12px; + } +`,Bp=eL.default.span.withConfig({displayName:"styled__Shortcut",componentId:"sc-3697b242-1"})` + display: flex; + margin-left: 2px; + font-size: 10px; + line-height: 18px; + color: #999; +`,Bg=eL.default.span.withConfig({displayName:"styled__ShortcutKey",componentId:"sc-3697b242-2"})` + display: flex; + margin-left: 3px; + text-transform: uppercase; +`,Bf=(0,eL.default)(cF).withConfig({displayName:"MenuItem__MenuButton",componentId:"sc-7269997c-0"})` + position: relative; + justify-content: space-between; + + ${e=>e.$navigated&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,Bh=eL.default.div.withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-7269997c-1"})` + & svg { + margin-right: 0; + transform: none; + align-self: center; + } +`,By=function(e){let{children:t,onClick:a,name:n,value:l,isPaywallEnabled:r}=e,o=ev.useRef(null),i=(0,eI.useMenuItem)({onClick:a,stopRef:o,name:n,value:l});return ev.createElement(Bf,{...i.props,$navigated:i.navigated},t,r&&ev.createElement(Bh,null,ev.createElement(e1.UpgradeBadge,null)))},Bb=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-c1ffbbf9-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + margin-top: -9px; +`,Bv=ev.forwardRef(function(e,t){let{onFileClick:a,...n}=e,{isPaywallEnabled:l}=gV();return ev.createElement(Bb,{...n,ref:t},ev.createElement(By,{name:$.Computer,onClick:a},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_file"}),ev.createElement(eY.Z,{id:"general.computer",defaultMessage:"Computer"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"F"))),ev.createElement(By,{name:$.Cloud,value:"google-drive",isPaywallEnabled:l},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload_google_drive"}),ev.createElement(eY.Z,{id:"general.cloud_upload_googledrive",defaultMessage:"Google Drive"}))),ev.createElement(By,{name:$.Cloud,value:"dropbox",isPaywallEnabled:l},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload_dropbox"}),ev.createElement(eY.Z,{id:"general.cloud_upload_dropbox",defaultMessage:"Dropbox"}))),ev.createElement(By,{name:$.Cloud,value:"instagram",isPaywallEnabled:l},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload_instagram"}),ev.createElement(eY.Z,{id:"general.cloud_upload_instagram",defaultMessage:"Instagram"}))),ev.createElement(By,{name:$.Cloud,value:"box",isPaywallEnabled:l},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload_box"}),ev.createElement(eY.Z,{id:"general.cloud_upload_box",defaultMessage:"Box"}))),ev.createElement(By,{name:$.Cloud,value:"camera",isPaywallEnabled:l},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload_camera"}),ev.createElement(eY.Z,{id:"general.cloud_upload_camera",defaultMessage:"Camera"}))),ev.createElement(By,{name:$.Cloud,value:"audio",isPaywallEnabled:l},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload_audio"}),ev.createElement(eY.Z,{id:"general.cloud_upload_audio",defaultMessage:"Audio"}))))}),Bk=ev.memo(function(e){let{disabled:t,onCloudUpload:a,onFileClick:n}=e,l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=(0,eI.useMenuButton)({dispatch:s,ref:o,state:i}),c=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:r,state:i,placement:"top"}),m=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t}=e.payload;switch(t){case $.Cloud:a();break;case $.Computer:n()}s({type:"Collapse",payload:"none"});break}case"Dismiss":s({type:"Collapse"})}},[s,a,n]),{arrowProps:u,popperProps:p,referenceProps:g,setVisible:f,visible:h}=(0,eI.useTooltip)({placement:"top"}),y=ev.useCallback(()=>{f(!1)},[f]),b=ev.useCallback(()=>{i.expanded||f(!0)},[i,f]),v=ev.useCallback(e=>{"f"===e.key&&(e.stopPropagation(),e.preventDefault(),m({type:"Activate",payload:{name:$.Computer}}))},[m]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",...d.props,type:"button",disabled:t},ev.createElement("span",{...g,onMouseEnter:b,onMouseLeave:y},ev.createElement(tn.Icon,{icon:"message_upload"}))),i.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:s,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:m},ev.createElement(Bv,{ref:l,initialFocus:c.initialFocus,isSubmenu:!1,onKeyDown:v}))),h&&!i.expanded&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},ev.createElement(eY.Z,{id:"general.upload_file",defaultMessage:"Upload File"})))}),BE=ev.memo(function(e){let{onClick:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:r}),c=(0,ev.useCallback)(e=>{o(!1),t?.(e)},[t]),m=(0,ev.useCallback)(()=>{o(!0)},[]),u=(0,ev.useCallback)(()=>{o(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...d,type:"button",onClick:c,onMouseEnter:m,onMouseLeave:u,className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_camera"})),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.camera",defaultMessage:"Camera"})))}),Bx=(0,la.ZP)` + query MentionChoices($documentID: ID!, $shareToken: ShareTokenInput) { + document(id: $documentID, shareToken: $shareToken) { + id + members { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + space { + id + memberships { + id + user { + ...BasicUserFields + } + } + } + } + } + ${up} +`,B_=e=>{let{entity:{id:t,native:a}}=e;return ev.createElement(Bw,null,ev.createElement(BN,null,`${a}`),`:${t}`)},Bw=eL.default.div.withConfig({displayName:"MessageBox__AutoCompleteEmoji",componentId:"sc-7a681717-0"})` + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; +`,BN=eL.default.div.withConfig({displayName:"MessageBox__EmojiSpan",componentId:"sc-7a681717-1"})` + display: flex; + width: 18px; + height: 18px; + margin-right: var(--menu-item-gap); +`,BC=eL.default.div.withConfig({displayName:"MessageBox__Wrapper",componentId:"sc-7a681717-2"})` + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding-bottom: 16px; + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.05)":"rgba(255,255,255,0.05)"}; + backdrop-filter: blur(10px); + position: relative; + z-index: 2; + + & .rta { + height: inherit; + max-height: 40vh; + } +`,BM=(0,eL.default)(function(e){return ev.createElement(Bt.Z,e)}).withConfig({displayName:"MessageBox__ReactTextareaAutocompleteStyled",componentId:"sc-7a681717-3"})` + & ~ .rta__autocomplete { + border-radius: 0; + background: ${e=>e.theme.appColors.hex(100)}; + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + height: auto; + overflow-y: auto; + ${tS} + + .rta__entity { + background: none; + } + .rta__entity--selected { + background: ${e=>e.theme.appColors.hex(80)}; + } + } +`,BS=ev.forwardRef(function(e,t){let a=e.onOpenUploadDropzone??null,{defaultPlaceholder:n,handleSignUp:l,documentID:r}=e,o=(0,e$.useDispatch)(),i=gV(),[s,d]=ev.useReducer(eI.popupReducer,{expanded:!1}),c=(0,ev.useMemo)(()=>null!=a,[a]),m=(0,ev.useRef)(null),[u,p]=(0,ev.useState)(""),[g,f]=(0,ev.useState)(n),h=uy(r),y=(0,e$.useSelector)(t9),{search:b}=(0,eF.TH)(),v=s4(b),k=(0,ev.useCallback)(e=>{p(t=>`${t}${e}`),m.current?.focus?.(),requestAnimationFrame(()=>{null!=m.current&&(m.current.scrollTop=m.current.scrollHeight)})},[]);(0,ev.useImperativeHandle)(t,()=>({insertText:e=>{k(e)}}),[k]);let E=(0,ev.useCallback)(()=>{k("@")},[k]),x=function(e){let t=uh(e);return(0,ev.useCallback)(e=>{t({value:e,editedAt:null,__typename:"ChatMessageTextBody"})},[t])}(r),_=(0,ev.useCallback)(()=>{0!==u.length&&(x(u),p(""),s.expanded&&d({type:"Collapse"}),m.current?.focus())},[u,x,s.expanded]),w=(0,ev.useCallback)(e=>{if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}switch(e.key){case eI.KeyboardKeys.Enter:e.shiftKey||(e.preventDefault(),_());break;case eI.KeyboardKeys.Escape:s.expanded&&d({type:"Collapse"})}},[_,s.expanded]),N=(0,ev.useCallback)(e=>{if(0===e.clipboardData.getData("text/plain").length&&e.clipboardData?.files?.length>0){let t=e.clipboardData.files[0];h({__typename:"ChatMessageFileBody",filename:t.name,fileUrls:{view:"",preview:"",download:"",__typename:"FileUrls"},file:t,lambdaResponse:null})}},[h]),C=(0,ev.useCallback)(()=>{f(n)},[n]),M=(0,ev.useCallback)(()=>{a?.()},[a]),S=(0,ev.useCallback)(()=>{let e=i.taskadePlanType??"free",t=fR.Vl.getFeature("upload.size");(0,ei.assert)("GB"===t.unit);let a=1e3*t.plans[e]*1048576;if(i.isPaywallEnabled){o(d4(i.id));return}o(uN.actions.toggleCloudUploadDialog({documentId:r,restrictions:{allowedFileTypes:Ba,maxFileSize:a},uploadType:D.Chat}))},[o,r,i]),I=(0,ev.useCallback)(e=>{"native"in e&&k(e.native)},[k]),T=(0,ev.useCallback)(()=>{m.current?.focus()},[]),{data:$}=(0,eB.a)(Bx,{variables:{documentID:r,shareToken:v}}),P=(0,ev.useCallback)(e=>{y||(e.preventDefault(),e.stopPropagation(),l())},[y,l]);return ev.createElement(BC,{onClickCapture:P},ev.createElement("div",{className:"flex items-center justify-center px-3 py-2"},ev.createElement(Bd,{onClick:E}),ev.createElement(gf,{onEmojiPick:I,onClose:T,state:s,dispatch:d}),c&&ev.createElement(Bk,{onCloudUpload:S,onFileClick:M}),ev.createElement(BE,{onClick:S}),ev.createElement(Br,{onClick:S}),ev.createElement(Bc,{onClick:S}),ev.createElement(Bm,{onClick:_})),ev.createElement(BM,{onKeyDown:w,onMouseOver:C,onPaste:N,onChange:e=>{y&&p(e.target.value)},loadingComponent:()=>ev.createElement("span",null,"Loading"),placeholder:g,minChar:0,rows:1,innerRef:e=>{m.current=e},maxLength:4096,value:u,trigger:{"@":{dataProvider:e=>{let t=$?.document?.space?.memberships??[],a=($?.document?.members?.edges??[]).map(e=>e.node?.user).filter(e=>null!=e),n=t.map(e=>e.user);return tu()([...a,...n],"id").filter(t=>{let a=e.toLowerCase();return t.handle.toLowerCase().includes(a)||t.display_name?.toLowerCase()?.includes(a)})},component:Bs,output:e=>`@${e.handle}`},":":{dataProvider:e=>0===e.length?[]:go.bj.search(e).map(e=>{let{id:t,native:a}=e;return{id:t,native:a}}),component:B_,output:(e,t)=>e.native}},textAreaComponent:{component:LN,ref:"innerRef"}}))}),BI=eL.default.div.withConfig({displayName:"ChatError",componentId:"sc-7834f46e-0"})` + display: inline-block; + width: 100%; + position: absolute; + top: 59px; + z-index: 5; + background: #ff8181; + color: #fff; + padding: 12px 16px; + line-height: 18px; + font-size: 15px; + text-align: center; +`,BD=eL.default.div.withConfig({displayName:"MessageEmptyState__Wrapper",componentId:"sc-92f0013-0"})` + display: flex; + height: 100%; + align-items: center; +`,BT=eL.default.div.withConfig({displayName:"MessageEmptyState__EmptyView",componentId:"sc-92f0013-1"})` + display: flex; + flex-direction: column; + width: 100%; + align-items: center; + padding: 0; + pointer-events: none; + + & span { + font-size: 20px; + width: 150px; + color: #333; + line-height: 24px; + color: #999; + text-align: center; + margin: 2px auto 0; + } +`,B$=(0,eL.default)(lT.CT).withConfig({displayName:"MessageEmptyState__ImageEmptyScreen",componentId:"sc-92f0013-2"})` + display: flex; + flex: 1 0 auto; + transform: ${e=>e.theme?.isNightMode?"translateX(-215px)":"translateX(0)"}; +`,BP=eL.default.div.withConfig({displayName:"MessageEmptyState__ImageEmptyScreenWrapper",componentId:"sc-92f0013-3"})` + display: flex; + width: 215px; + height: 217px; + overflow: hidden; +`,BF=function(){return ev.createElement(BD,null,ev.createElement(BT,null,ev.createElement(BP,null,ev.createElement(B$,null)),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.start_a_call_chat_or_share_files",defaultMessage:"Start a call, chat or share files"}))))},BA=(0,eL.default)(Cg).withConfig({displayName:"ScrollToBottomButton__Wrapper",componentId:"sc-6167fe22-0"})` + position: absolute; + bottom: 100px; + left: 50%; + transform: translateX(-50%); + + display: flex; + align-items: center; + background: ${e=>e.theme.primaryColorScheme?.base}; + padding: 6px 15px 6px 8px; + color: #fff; + border-radius: 15px; + font-size: 0.8em; + font-weight: 700; + line-height: 20px; + z-index: 2; + + svg { + margin-right: 3px; + + path { + stroke: #fff; + } + } + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.darker10}; + } +`,BR=function(e){let{onClick:t}=e;return ev.createElement(BA,{onClick:t},ev.createElement(lT.nz,null),ev.createElement(eY.Z,{id:"chat.scroll_to_bottom",defaultMessage:"Scroll to bottom"}))};function Bj(e){return e.scrollHeight-e.clientHeight}var BO=a(51961);function BU(e){for(var t=arguments.length,a=Array(t>1?t-1:0),n=1;nnew Promise((n,l)=>{t({type:r_,payload:{eventName:e,args:a},executor:{resolve:n,reject:l}})})}function BZ(){return e=>new Promise((t,a)=>{e({type:rw,payload:{},executor:{resolve:t,reject:a}})})}let BL=(0,la.ZP)` + query ChatGetMessage($filterby: ChatMessageFiltering!) { + chatMessage(filterby: $filterby) { + id + user { + ...BasicUserFields + } + } + } + ${up} +`;function BB(e,t){let a=function(e){switch(e.body){case"event":{if(null==e.event)return;let{eventType:t,scope:a}=e.event;if(null==t||null==a)return;return{__typename:"ChatMessageEventBody",data:{__typename:"ChatMessageEventBodyData",eventType:t,scope:a}}}case"activity":{if(null==e.activity)return;let t=e.activity;switch(t.data){case"nodeCompleted":{if(null==t.nodeCompleted)return;let{type:e,scope:a,nodes:n}=t.nodeCompleted;if(null==e||null==a||null==n)return;return{__typename:"ChatMessageActivityBody",data:{__typename:"ChatMessageActivityNodeCompletedData",type:e,scope:a,nodes:n.map(e=>({__typename:"ChatNodeInfo",...e}))}}}case"documentCompleted":{if(null==t.documentCompleted)return;let{type:e,scope:a}=t.documentCompleted;if(null==e||null==a)return;return{__typename:"ChatMessageActivityBody",data:{__typename:"ChatMessageActivityDocumentCompletedData",type:e,scope:a}}}}break}case"file":{if(null==e.file)return;let{filename:t,fileUrls:a}=e.file;if(null==t||null==a)return;let{preview:n,view:l,download:r}=a;if(null==n||null==l||null==r)return;return{__typename:"ChatMessageFileBody",filename:t,fileUrls:{__typename:"FileUrls",preview:n,view:l,download:r},file:null,lambdaResponse:null}}case"text":{if(null==e.text)return;let{value:t}=e.text;if(null==t)return;return{__typename:"ChatMessageTextBody",value:t,editedAt:null!=e.text.editedAt&&0!==e.text.editedAt?e.text.editedAt.toString():null}}default:return}}(e);if(null!=a)return{id:e.id,at:e.at.toString(),body:a,user:t??{__typename:"User",id:e.userId.toString(),default_name:"unknown",display_name:null,handle:"",initials:"U",timezone:"Etc/UTC",avatars_v2:{__typename:"UserAvatarV2",small:{__typename:"UserAvatar",hdpi:{size:{height:90,width:90,__typename:"Size"},__typename:"Image",url:"/images/no-avatar.png"},ldpi:{size:{height:45,width:45,__typename:"Size"},__typename:"Image",url:"/images/no-avatar.png"}}}},__typename:"ChatMessage"}}function Bz(e,t){return e.readFragment({id:`User:${t}`,fragment:up,fragmentName:"BasicUserFields"})}function BV(){return"undefined"!=typeof document&&document.hasFocus()}let Bq=eL.default.div.withConfig({displayName:"ChatScreen__Container",componentId:"sc-f396e197-0"})` + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.92)":"rgba(255,255,255,0.95)"}; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + + position: relative; + z-index: 1; + border-left: 1px solid ${e=>e.theme.appColors.hex(70)}; + display: block; + width: ${e=>e.$isInCall?"524px":"360px"}; + min-width: ${e=>e.$isInCall?"524px":"360px"} !important; + max-width: 50%; + flex-shrink: 0; + overflow: hidden; + + & .inner { + height: 100%; + display: flex; + flex-direction: column; + } + & .chatlog-wrapper { + flex: 1; + min-height: 0; + ${tM}; + } + + // Note:(shaowei@taskade.com) Do not display chat when screen size is too small + @media (max-width: 768px) { + display: none; + } +`,BW=eL.default.div.withConfig({displayName:"ChatScreen__MessageContainer",componentId:"sc-f396e197-1"})` + max-height: 100%; + overflow-y: auto; + + ${tS} + &:empty { + display: none; + } +`;function BH(e,t){let a;return a=""===e.at?eG()():eG()(Number(e.at)),null!=t&&(a=a.tz(t)),a}let BG=function(e){let{chatMode:t,className:a,documentID:n,onSelectChatMode:l,spaceId:r}=e,o=(0,ev.useRef)(null),i=(0,ev.useRef)(null),s=(0,ev.useRef)(null),d=(0,ev.useRef)(null),c=gV().taskadePlanType??"free",[m,u]=(0,ev.useState)(!1),[p,g]=(0,ev.useState)(!0),[f,h]=(0,ev.useState)(!1),y=(0,ev.useRef)(0),b=(0,ev.useRef)(0),v=(0,ev.useRef)(0),k=(0,e$.useSelector)(t9),E=(0,e$.useDispatch)();!function(e){let t=(0,e$.useDispatch)(),a=(0,ll.x)(),{search:n}=(0,eF.TH)(),l=s4(n),r=(0,ev.useCallback)(t=>{let n,r;let o=BO.ChatroomEvent.decode(new Uint8Array(t)),{message:i}=o;if(null==i)return;let s=new BO.ChatMessage(i),d={id:e,last:10,before:null,shareToken:l},c=a.readQuery({query:ug,variables:d}),m=c?.document?.chatMessages?.edges??[];switch(o.type){case BO.ChatroomEventType.NEW:{if(null!=m.find(e=>e.node.id===s.id))return;let t=Bz(a,s.userId);if(eu()(t)||""===t.handle){let n={filterby:{documentID:e,messageAt:s.at.toString(),messageID:s.id}};a.query({query:BL,variables:n}),t=Bz(a,s.userId)}let l=BB(s,t);if(null==l||null==c||null==c.document)return;r=c.document.chatMessages.totalCount+1,n=[...c.document.chatMessages.edges,{node:l,cursor:`${s.at}`,__typename:"ChatMessageEdge"}];break}case BO.ChatroomEventType.UPDATE:if(null==c||null==c.document)return;r=c.document.chatMessages.totalCount,n=m.map(e=>{if(e.node.id!==s.id&&e.node.at!==s.at?.toString())return e;let t=Bz(a,s.userId),n=BB(s,t);return null==n?e:{node:n,cursor:s.at?.toString(),__typename:"ChatMessageEdge"}});break;case BO.ChatroomEventType.DELETE:if(null==c||null==c.document)return;r=c.document.chatMessages.totalCount-1,n=m.filter(e=>e.node.id!==s.id&&e.node.at!==s.at?.toString())}a.writeQuery({query:ug,variables:d,data:{...c,document:{...c.document,chatMessages:{...c.document.chatMessages,totalCount:r,edges:n}}}})},[l,a,e]);(0,ev.useEffect)(()=>((async function(){(await BZ()(t)).on("CHAT_MESSAGE_EVENT",r)})(),()=>{(async function(){(await BZ()(t)).removeListener("CHAT_MESSAGE_EVENT",r)})()}),[t,r])}(n);let x=ev.useCallback(()=>{E(rh({isOpen:!0,activeView:rI,enableCopyList:void 0}))},[E]),_=ev.useCallback(e=>{if(!k){e.preventDefault(),x();return}!fR.Vl.getFeature("media.upload.non_image_types").plans[c]&&e.detail.some(e=>!cx.ImageMimeTypes.has(e.type))&&(e.preventDefault(),E(d4(r,_w.enum.uploadFileType)))},[E,x,k,r,c]),{data:w}=(0,eB.a)(uf),{search:N}=(0,eF.TH)(),C=s4(N),{data:M,loading:S,error:I,fetchMore:D,refetch:T}=(0,eB.a)(ug,{variables:{id:n,last:10,before:null,shareToken:C},notifyOnNetworkStatusChange:!0}),$=M?.document,P=Ck({role:$?.role,action:{project:"delete_chat"}});(0,ev.useEffect)(()=>{T()},[T]);let F=function(){let e=(0,eK.Z)();return(0,ev.useCallback)(t=>{let a=`@${t.user?.handle} `;switch(t.body.__typename){case"ChatMessageTextBody":{let e=t.body.value.split("\n").map(e=>`>${e}`).join("\n");a=`${e} + +@${t.user?.handle} `;break}case"ChatMessageEventBody":"conference_joined"===t.body.data.eventType&&(a=`> _**${t.user?.handle} has joined the call **_ + +`);break;case"ChatMessageFileBody":a=`> _**${t.body.filename}**_ + +@${t.user?.handle} `;break;case"ChatMessageActivityBody":switch(t.body.data.__typename){case"ChatMessageActivityDocumentCompletedData":a=`> _**${t.user?.handle} completed the project**_ + +@${t.user?.handle}`;break;case"ChatMessageActivityNodeCompletedData":{let n=t.body.data.nodes,l=e.formatMessage({id:"chat.document_node_completed",defaultMessage:"{editor} completed {taskCount, plural, =0 {no tasks} one {a task} other {# tasks}}"},{editor:t.user?.handle,taskCount:n.length,span:e=>e,strong:e=>`**${e}**`});for(let e of(a=`> _${l}_ +`,n))a+=`> _- ${e.text}_ +`;a+=` +@${t.user?.handle} `}}}return a},[e])}(),A=(0,ev.useCallback)(e=>{if(!k){x();return}let t=F(e);i.current?.insertText(t)},[k,x,F]),R=(0,ev.useCallback)(()=>{o.current?.open()},[]),j=(0,ev.useMemo)(()=>M?.document?.chatMessages?.edges??[],[M]);(0,ev.useEffect)(()=>{if(j.length>0){let e=parseInt(j[j.length-1].node.at,10);Number.isFinite(e)&&E({type:Zj,payload:{latestMessageAt:e}})}return()=>{E({type:ZO})}},[j,E]);let O=(0,ev.useMemo)(()=>CT()(j)?.node??null,[j]),U=(0,ev.useMemo)(()=>CP()(j)?.node??null,[j]),{isWindowFocused:Z,activateMarquee:L}=function(e,t){let[a,n]=(0,ev.useState)(!1),l=function(e){let{onBlur:t,onFocus:a}=e,[n,l]=(0,ev.useState)(BV),r=(0,ev.useRef)(),o=(0,ev.useRef)();return(0,ev.useEffect)(()=>{r.current=t,o.current=a},[t,a]),(0,ev.useEffect)(()=>{let e=e=>{l(!1),r.current?.(e)},t=e=>{l(!0),o.current?.(e)};return window.addEventListener("blur",e),window.addEventListener("focus",t),()=>{window.removeEventListener("blur",e),window.removeEventListener("focus",t)}},[]),n}({onFocus:()=>n(!1)});return function(e){let{active:t,interval:a,onShow:n,onHide:l}=e,r=(0,ev.useRef)(),o=(0,ev.useRef)();(0,ev.useEffect)(()=>{r.current=l,o.current=n},[l,n]),(0,ev.useEffect)(()=>{let e=0;if(t){let t=setInterval(function(){(e+=1)%2?o.current():r.current()},a);return()=>{clearInterval(t),r.current()}}},[t,a])}({active:a,interval:1e3,onShow:()=>{window.document.title=t},onHide:()=>{window.document.title=e}}),{isWindowFocused:l,activateMarquee:()=>n(!0)}}((0,e$.useSelector)(dz)||"Untitled","New Message"),B=UZ(Z);(0,ev.useEffect)(()=>{if(null==U)return;let e=U?.user?.id===w?.me?.id;Z||B||e||L()},[U,B,w,Z,L]);let z=(0,ev.useMemo)(()=>M?.document?.chatMessages?.pageInfo?.endCursor??"",[M]),V=(0,ev.useCallback)(e=>{let{current:t}=d;null!=t&&function(e,t){let a=e.scrollTop,n=Bj(e),l="top"===t?0:n;window.CSS&&window.CSS.supports("scroll-behavior","smooth")?e.scroll({top:l,behavior:"smooth"}):window.requestAnimationFrame(()=>(function t(a){e.scroll({top:a});let r=e.scrollTop;if(r!==l){let e=(r>l?-1:1)*(1-r/n);window.requestAnimationFrame(()=>t(a+500*e))}})(a??0))}(t,e)},[]);v.current=d.current?Bj(d.current):0,b.current=d.current?.scrollTop??0,(0,ev.useEffect)(()=>{let{current:e}=d;if(null==U||null==e)return;let t=v.current;U?.user?.id===w?.me?.id||t-e.scrollTop<=80?V("bottom"):h(t>0)},[U,w,V]);let q=(0,ev.useCallback)(()=>{D({variables:{before:z},updateQuery:(e,t)=>{let{fetchMoreResult:a}=t,n=a?.document.chatMessages.edges,l=a?.document.chatMessages.pageInfo,r=a?.document.chatMessages.totalCount;return n?.length?{document:{id:e.document.id,__typename:e.document.__typename,role:e.document.role,chatMessages:{__typename:e.document.chatMessages.__typename,edges:[...n,...e.document.chatMessages.edges],pageInfo:l,totalCount:r}}}:e}})},[D,z]),W=(0,ev.useMemo)(()=>M?.document?.chatMessages?.pageInfo?.hasNextPage,[M]);(0,ev.useEffect)(()=>{let{current:e}=d;if(null==e)return;let t=e?.scrollHeight-y.current-36;t>0&&e.scrollTo({top:t})},[O]),(0,ev.useEffect)(()=>{let{current:e}=d;null!=e&&p&&null!=W&&(e.scrollHeight<=e.clientHeight&&W?q():(g(!1),V("bottom")))},[p,q,W,V]);let H=(0,ev.useCallback)(()=>{let{current:e}=d;if(null!=e){if(0===e.scrollTop){if(""===z)return;y.current=e.scrollHeight,q()}else h(v.current-e.scrollTop>=80)}},[q,z]),G=(0,ev.useCallback)(()=>{V("bottom")},[V]);(0,ev.useEffect)(()=>{let{current:e}=s,{current:t}=d;if("undefined"==typeof window||null==e||null==t)return;let a=ZZ(()=>{let e=v.current,a=Bj(t);t.scroll({top:b.current??t?.scrollTop});let n=e-t.scrollTop<=80;n&&t.scroll({top:a}),h(!n)});return a.observe(t),()=>{a.disconnect()}},[]);let K=w?.me?.timezone,Y=(0,ev.useMemo)(()=>{let e;let t=[];for(let a of j){let l=a.node,r=SI(e,l,BH,K);null!=r&&t.push(ev.createElement(Le,{key:`date-separator-${l.id}`,unixTimestampMs:r,timezone:K})),t.push(ev.createElement(Be,{key:l.id,message:l,documentID:n,isRoleDeleteChatAllowed:P,onClickReply:A})),e=l}return t},[n,A,P,j,K]),Q=(0,ev.useCallback)(e=>{if(!s.current)return;e.preventDefault();let t=e.clientX,a=s.current.offsetWidth,n=!1,l=e=>{e.preventDefault(),n||(requestAnimationFrame(()=>{null!=s.current&&(s.current.style.width=a+(t-e.clientX)+"px"),n=!1}),n=!0)},r=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",r)},[]),J=(0,ev.useCallback)(()=>{null!=s.current&&(s.current.style.width="")},[]);return ev.createElement(Bq,{className:og()(a,"tc-chat"),ref:s,$isInCall:m},ev.createElement("div",{className:"group absolute left-0 z-10 flex h-full w-6 cursor-col-resize items-center justify-start bg-transparent opacity-100",onMouseDown:Q,onDoubleClick:J},ev.createElement("div",{className:"flex h-full w-1 bg-primary/50 opacity-0 transition duration-150 ease-in-out group-hover:opacity-100"})),ev.createElement(ZH,{ref:o,onFilesUploaded:_,documentID:n}),ev.createElement("div",{className:"inner"},ev.createElement(Z8,{chatMode:t,documentID:n,setInCall:u,onSelectChatMode:l,spaceId:r}),ev.createElement(La,null),ev.createElement("div",{className:"chatlog-wrapper notranslate"},null!=I&&ev.createElement(BI,{role:"alert"},"There was an error loading the messages. Please try again."),ev.createElement(BW,{onScroll:H,ref:d,$isInCall:m},S&&ev.createElement(eI.Spinner,{height:36}),Y),!S&&0===j.length&&ev.createElement(BF,null)),f&&ev.createElement(BR,{onClick:G}),ev.createElement(BS,{ref:i,defaultPlaceholder:"Type a message...",documentID:n,onOpenUploadDropzone:R,handleSignUp:x})))};var BK=a(63201);let BY=function(e){let{children:t,onClick:a,name:n,warning:l,value:r}=e,o=ev.useRef(null),i=(0,eI.useMenuItem)({onClick:a,stopRef:o,name:n,value:r});return ev.createElement("div",{className:og()("flex select-none items-center px-3 py-1 text-sm hover:cursor-pointer",{"bg-appcolor-300":i.navigated},{"text-danger":l}),...i.props},t)},BQ=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{className:"flex w-48 flex-col overflow-hidden rounded-xl border border-appcolor-300 bg-appcolor-0 py-2",initialFocus:t,loop:!0},ev.createElement(BY,{name:"open_ai_prompt_templates"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"mr-2 shrink-0 scale-80"}),ev.createElement(eY.Z,{id:"general.view_prompts",defaultMessage:"View prompts"})),ev.createElement(BY,{name:"delete_conversation",warning:!0},ev.createElement(tn.Icon,{icon:"dd_delete",className:"mr-2 shrink-0 scale-80"}),ev.createElement(eY.Z,{id:"general.ai.clear_history",defaultMessage:"Clear history"}))))},BJ=function(e){let{onDeleteConversation:t,onOpenAiPromptTemplates:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:n,placement:"bottom-end"}),s=(0,eI.useMenuButton)({dispatch:l,ref:r,state:n}),d=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:n}=e.payload;switch(n){case"delete_conversation":t();break;case"open_ai_prompt_templates":a()}l({type:"Collapse",payload:"none"});break}case"Dismiss":l({type:"Collapse"})}},[t,a]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...s.props,className:"group h-9 w-9 items-center justify-center rounded-xl border-0 p-1 text-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"header_more",className:"text-appcolor-500 group-hover:text-appcolor-1000"})),n.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:l,modal:!0},ev.createElement(BQ,{initialFocus:i.initialFocus,menuGroupDispatch:d})))},BX=function(e){let{onClickDeleteConversation:t,onOpenAiPromptTemplates:a,onSelectChatMode:n,projectId:l,selectedMode:r,spaceId:o,toggleChat:i}=e;return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-center justify-between border-b border-appcolor-300 px-3 py-2"},ev.createElement(Z3,{onClick:i}),ev.createElement(Z1,{projectId:l,spaceId:o,selectedValue:r,onSelectChatMode:n}),ev.createElement("div",{className:"flex gap-1 rounded-xl"},ev.createElement(BJ,{onDeleteConversation:t,onOpenAiPromptTemplates:a}))))},B0=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-cf167c14-0"})` + display: flex; + flex-direction: column; + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.92)":"rgba(255,255,255,0.95)"}; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + max-width: 50%; + min-width: ${360}px; + width: ${360}px; + + position: relative; + z-index: 1; + border-left: 1px solid ${e=>e.theme.appColors.hex(70)}; + overflow: hidden; + flex-shrink: 0; +`,B1=function(e){let{agent:t,size:a}=e;if(null==t.data.avatar)return ev.createElement(tn.Icon,{icon:"dd_ai"});if("emoji"===t.data.avatar.type)return ev.createElement(e1.AgentAvatar,{name:t.data.avatar.data.value,size:a});if("custom"!==t.data.avatar.type)return ev.createElement(tn.Icon,{icon:"dd_ai"});let n=Td(t.data.avatar.data.file,"h_100,w_100","hdpi");return null==n?ev.createElement(tn.Icon,{icon:"dd_ai"}):ev.createElement(e1.AgentAvatar,{src:n,size:a})};eL.default.div.withConfig({displayName:"styled__LoadingAnimation",componentId:"sc-e1a37c03-0"})` + @keyframes dot-flashing { + 0% { + background-color: ${e=>e.theme.primaryColorScheme?.base}; + } + 50%, + 100% { + background-color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } + } + position: relative; + width: 6px; + height: 6px; + border-radius: 5px; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: ${e=>e.theme.primaryColorScheme?.base}; + animation: dot-flashing 1s infinite linear alternate; + animation-delay: 0.5s; + + &::before, + &::after { + content: ''; + display: inline-block; + position: absolute; + top: 0; + } + + &::before { + left: -10px; + width: 6px; + height: 6px; + border-radius: 5px; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: ${e=>e.theme.primaryColorScheme?.base}; + animation: dot-flashing 1s infinite alternate; + animation-delay: 0s; + } + + &::after { + left: 10px; + width: 6px; + height: 6px; + border-radius: 5px; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: ${e=>e.theme.primaryColorScheme?.base}; + animation: dot-flashing 1s infinite alternate; + animation-delay: 1s; + } +`;let B2=eL.default.div.withConfig({displayName:"styled__MarkdownFormatting",componentId:"sc-e1a37c03-1"})` + & .paragraph { + margin-bottom: 12px; + line-height: 19px; + &:only-child { + margin-bottom: 0; + } + } +`,B5=eL.default.button.withConfig({displayName:"styled__TemplateButton",componentId:"sc-e1a37c03-2"})` + background: ${e=>e.theme.isNightMode?e.theme.appColors.rgba(100,.6):e.theme.appColors.hex(100)}; + + backdrop-filter: blur(7px); + position: relative; + + &:before { + content: ''; + position: absolute; + inset: -1px; + border-radius: 12px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(0deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotateonce 1s linear 1 forwards; + } + + &:hover::before { + animation: rotateforever 3s linear infinite; + } + + @keyframes rotateforever { + 100% { + filter: hue-rotate(360deg); + } + } + + @keyframes rotateonce { + 0% { + filter: hue-rotate(0deg); + } + 80% { + filter: hue-rotate(180deg); + } + 100% { + filter: hue-rotate(360deg); + opacity: 0; + } + } + + @keyframes rainbowIconOne { + 0% { + color: #4fcf70; + } + 25% { + color: #fad648; + } + 50% { + color: #a767e5; + } + 75% { + color: #12bcfe; + } + 99% { + color: #44ce7b; + } + 100% { + color: inherit; + } + } + + & svg { + animation: rainbowIconOne 3s linear infinite 1 forwards; + } + + &:hover { + & svg { + animation: rainbowIconOne 3s linear infinite; + } + & .rainbow { + background: linear-gradient(to right, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-background-clip: text; + background-clip: text; + background-size: 200% 100%; + animation: movingGradient 3s linear infinite; + -webkit-text-fill-color: transparent; + + @keyframes movingGradient { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } + } + } + } +`,B3=function(e){let{agent:t}=e;return ev.createElement("div",{className:"mt-4 flex w-full flex-col justify-center gap-1 p-2"},t.data.commands.slice(0,6).map((t,a)=>ev.createElement("div",{key:`command-${a}`,className:"flex"},ev.createElement(B5,{className:"flex w-full items-center justify-center whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm font-medium transition duration-150 ease-in-out",onClick:()=>{e.onPrompt(t.prompt)}},ev.createElement("span",{className:"rainbow"},t.name)))))},B4=function(e){let{agent:t,onPrompt:a}=e,n=(0,e$.useDispatch)(),l=ev.useCallback(()=>{n(TS.actions.toggleEditSpaceAgentDialog({agentId:t.id,tab:"commands"}))},[t,n]);return ev.createElement("div",{className:"flex h-full flex-col items-center justify-center overflow-y-auto px-4 py-2"},ev.createElement("div",{className:"mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-appcolor-300"},ev.createElement(B1,{agent:t,size:"lg"})),ev.createElement("div",{className:"text-md font-bold"},t.name),ev.createElement("div",{className:"pb-2 text-center text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"general.chat_with_your_agent_or_use_commands_below",defaultMessage:"Chat with your agent or use commands below."})),ev.createElement(B3,{agent:t,onPrompt:a}),ev.createElement("div",{className:"mt-3 flex justify-center"},ev.createElement("button",{className:"flex items-center rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-xs font-medium text-appcolor-800 transition duration-150 ease-out hover:border-appcolor-400 hover:text-appcolor-1000",onClick:l},ev.createElement(tn.Icon,{className:"mr-1 scale-90",icon:"ai_add"}),ev.createElement(eY.Z,{id:"agent.add_command",defaultMessage:"Add command"}))))},B6=eL.default.div.withConfig({displayName:"AgentConversation__MessageContainer",componentId:"sc-350392b3-0"})` + ${tS} +`,B8=ev.forwardRef(function(e,t){let{className:a,agent:n,loading:l,messages:r,onPrompt:o,onScroll:i}=e;return 0===r.length?ev.createElement(B4,{agent:n,onPrompt:o}):ev.createElement("div",{ref:t,className:"flex min-h-0 w-full flex-1 flex-col items-center justify-end overflow-auto"},ev.createElement(B6,{className:og()(a,"flex w-full flex-col-reverse gap-3 overflow-auto px-5 py-4"),onScroll:i},Array.from((0,eo.makeReverseIterable)(r),e=>"human"===e.role||"user"===e.role?ev.createElement(Uo,{key:e.id,message:e}):ev.createElement(Ur,{key:e.id,agent:n,content:e.contents[0].content,loading:null==e.id})),l&&ev.createElement(eI.Spinner,null)))}),B7={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]},B9=hR.jS,ze=(0,te.Em)({id:"general.ask_agent_with_name",defaultMessage:"Ask {agentName}..."}),zt=(0,te.Em)({id:"general.ask_agent_without_name",defaultMessage:"Ask the agent..."}),za=function(e){let{agentId:t,onSelectChatMode:a,projectId:n,selectedMode:l,spaceId:r}=e,o=(0,e$.useDispatch)(),i=(0,eK.Z)(),s=(0,ll.x)(),d=ev.useRef(null),c=ev.useRef(null),[m,u]=ev.useState(null),[p,g]=ev.useState(null),{data:f,loading:h,error:y}=(0,eB.a)(B7,{variables:{id:t}}),b=f?.spaceAgent,v=ev.useMemo(()=>({first:1,filterby:{spaceAgentId:t}}),[t]),{data:k,loading:E,error:x}=(0,eB.a)(O9,{variables:v}),_=k?.conversations?.edges[0]?.node.id??null,w=ev.useMemo(()=>({last:20,filterby:{conversationId:_}}),[_]),{data:N,error:C,loading:M,fetchMore:S}=(0,eB.a)(O7,{variables:w,notifyOnNetworkStatusChange:!0,skip:null==_}),I=N?.conversationMessages.pageInfo.startCursor,D=N?.conversationMessages.pageInfo.hasPreviousPage,T=N?.conversationMessages.edges,$=ev.useMemo(()=>{let e=(T??[]).map(e=>{let{node:t}=e;return{id:t.id,conversationId:t.conversationId,role:t.role,contents:[{content:t.message}]}});return null!=p&&e.push({id:p.id,conversationId:p.conversationId,role:p.role,contents:[{content:p.message}]}),e},[T,p]),[P,{loading:F}]=(0,cs.D)(Ue);ev.useEffect(()=>{null!=c.current&&(c.current.scrollTop=c.current.scrollHeight)},[$]);let A=(0,sz.cI)({resolver:(0,BK.F)(B9)}),R=CP()($)?.id;ev.useEffect(()=>{let{invalid:e}=A.getFieldState("parentMessageId");e||A.setValue("parentMessageId",R)},[A,R]);let j=ev.useCallback(e=>{if(!d.current)return;e.preventDefault();let t=e.clientX,a=d.current.offsetWidth,n=!1,l=e=>{e.preventDefault(),n||(requestAnimationFrame(()=>{null!=d.current&&(d.current.style.width=a+(t-e.clientX)+"px"),n=!1}),n=!0)},r=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",r)},[]),O=ev.useCallback(()=>{null!=d.current&&(d.current.style.width="")},[]),U=ev.useCallback(async()=>{if(F||M||null==_||""===_)return;let e=i.formatMessage({id:"general.confirm_clear_conversation",defaultMessage:"Are you sure you want to clear the conversation?"});confirm(e)&&await P({variables:{input:{clientMutationId:(0,ld.Z)(),id:_}},update(e,a){let{data:n,errors:l}=a;if(null!=l||null==n||!0!==n.conversationDelete.ok)return;let r=k?.conversations?.edges[0].node??null;null!=r&&(e.evict({id:"ROOT_QUERY",fieldName:"conversationMessages",args:{filterby:{conversationId:r.id}}}),e.evict({id:"ROOT_QUERY",fieldName:"conversations",args:{filterby:{spaceAgentId:t}}}),e.gc())}})},[t,k?.conversations?.edges,_,M,P,F,i]),Z=ev.useCallback(e=>{g(null);let{cache:t}=s,a=hR.gh.safeParse(e);if(!a.success)return;let n=a.data,l={...w,filterby:{conversationId:n.conversationId}},r=t.readQuery({query:O9,variables:v});null==_&&ts()(r?.conversations.edges)&&t.updateQuery({query:O9,variables:v},e=>Ml()(e,{conversations:{$set:{edges:[{node:{id:n.conversationId}}]}}})),null==t.readQuery({query:O7,variables:l})&&t.writeQuery({query:O7,variables:l,data:{conversationMessages:{edges:[],pageInfo:{hasNextPage:!1,hasPreviousPage:!1,startCursor:null,endCursor:null}}}}),t.updateQuery({query:O7,variables:l},e=>{if(null==e)return e;let t=e.conversationMessages.edges.findLastIndex(e=>e.node.id===n.id);return -1!==t?Ml()(e,{conversationMessages:{edges:{[t]:{$set:{__typename:"ConversationMessageEdge",cursor:n.id,node:{__typename:"ConversationMessage",id:n.id,conversationId:n.conversationId,message:n.contents[0].content,role:n.role}}}}}}):0===n.contents[0].content.length?e:Ml()(e,{conversationMessages:{edges:{$push:[{__typename:"ConversationMessageEdge",cursor:n.id,node:{__typename:"ConversationMessage",id:n.id,conversationId:n.conversationId,message:n.contents[0].content,role:n.role}}]}}})})},[s,_,O7,w,v]),L=ev.useCallback(()=>{u(null)},[]),B=ev.useCallback(e=>{if(!D||null==I||M)return;let t=e.currentTarget;t.scrollTop+t.scrollHeight-t.clientHeight<5&&S({variables:{before:I}})},[M,S,D,I]),[z,{loading:V,error:q}]=$N(Z,L),W=ev.useCallback(()=>{V&&null!=m&&(m.abort(),u(null))},[m,V]),H=ev.useCallback(()=>{A.reset(),V&&null!=m&&(m.abort(),u(null))},[m,A,V]);ev.useEffect(()=>{H()},[t]),D$({error:q});let G=A.handleSubmit(e=>{let a=e.content.trim();if(0===a.length||V)return;g({__typename:"ConversationMessage",id:(0,O3.SK)(),role:"human",message:a,conversationId:""}),A.reset();let n=O8.parse({input:{role:"human",content:a,parentMessageId:e.parentMessageId??void 0},messages:$.slice(-8),context:{type:"agent",id:t}}),l=new AbortController;u(l),z("/web-api/ai/v2/conversation/agent",{method:"POST",credentials:"same-origin",body:JSON.stringify(n),headers:{"Content-Type":"application/json"},signal:l.signal})}),K=()=>{o(co.actions.toggleAiPromptTemplatesDialog())},Y=()=>{o(xk(n))},Q=M&&0===$.length,J=h||E||Q,X=null!=y||null!=x||null!=C;if(J||X||null==b)return ev.createElement(B0,{ref:d,className:"step3"},ev.createElement("div",{className:"group absolute left-0 z-10 flex h-full w-4 cursor-col-resize items-center justify-start bg-transparent opacity-100",onMouseDown:j,onDoubleClick:O},ev.createElement("div",{className:"flex h-full w-1 bg-primary/50 opacity-0 transition duration-150 ease-in-out group-hover:opacity-100"})),ev.createElement(BX,{onClickDeleteConversation:U,onOpenAiPromptTemplates:K,onSelectChatMode:a,projectId:n,selectedMode:l,spaceId:r,toggleChat:Y}),ev.createElement("div",{className:"flex h-full flex-1"},J&&ev.createElement(eI.Spinner,null),X&&ev.createElement(eY.Z,{id:"general.generic_error_occurred",defaultMessage:"An error occurred."})));let ee=null!=b&&""!==b.name?i.formatMessage(ze,{agentName:b.name}):i.formatMessage(zt);return ev.createElement(B0,{ref:d,className:"step3"},ev.createElement("div",{className:"group absolute left-0 z-10 flex h-full w-4 cursor-col-resize items-center justify-start bg-transparent opacity-100",onMouseDown:j,onDoubleClick:O},ev.createElement("div",{className:"flex h-full w-1 bg-primary/50 opacity-0 transition duration-150 ease-in-out group-hover:opacity-100"})),ev.createElement(BX,{onClickDeleteConversation:U,onOpenAiPromptTemplates:K,onSelectChatMode:a,projectId:n,selectedMode:l,spaceId:r,toggleChat:Y}),ev.createElement(B8,{agent:b,messages:$,onPrompt:e=>{A.watch("content"),A.setValue("content",e),A.setFocus("content")},onScroll:B,loading:M}),ev.createElement("div",{className:"my-4 flex-initial px-4"},ev.createElement("form",{className:"flex w-full items-center justify-between rounded-xl border border-appcolor-300 px-4 py-2 text-sm shadow",onSubmit:G},null!=R&&ev.createElement("input",{type:"hidden",...A.register("parentMessageId",{value:R})}),ev.createElement(Dx.Z,{maxRows:10,className:"w-full resize-none bg-transparent",placeholder:ee,...A.register("content"),onKeyPress:e=>{e.key===eI.KeyboardKeys.Enter&&(e.shiftKey||(e.preventDefault(),G()))},onKeyDown:e=>{"a"===e.key&&e.metaKey&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())}}),V?ev.createElement("button",{onClick:W,type:"button",className:"flex h-7 items-center"},ev.createElement(tn.Icon,{icon:"ai_stop"})):ev.createElement("button",{type:"submit"},ev.createElement(tn.Icon,{icon:"message_send",className:"h-7"})))))},zn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectConversationsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"conversations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]},zl=ev.createContext(null),zr=function(e){let{name:t,value:a,selectedPersona:n,children:l}=e,r=(0,ev.useRef)(null),o=(0,eI.useMenuItem)({stopRef:r,name:t,value:a});return ev.createElement("button",{...o.props,className:"flex max-h-7 w-60 cursor-pointer items-center justify-between border-none bg-appcolor-100 px-3 py-1.5 text-appcolor-900 outline-0 hover:bg-appcolor-300 focus:bg-appcolor-300"},l,n?.value===a&&ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_check"}))},zo=function(e){let{menuGroupDispatch:t,initialFocus:a,personaOptions:n,selectedPersona:l}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eI.Menu,{className:"max-h-[50vh] overflow-y-scroll rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm",initialFocus:a,loop:!0},ev.createElement("div",{className:"my-2"},n.map(e=>ev.createElement(zr,{key:e.value,value:e.value,selectedPersona:l},e.label)))))};function zi(){let e=(0,eK.Z)();return[{value:"default",label:e.formatMessage({id:"default",defaultMessage:"Default"}),prompt:null},{value:"marketing-expert",label:e.formatMessage({id:"general.ai_chat_persona_marketing_expert",defaultMessage:"\uD83D\uDCCA Marketing Expert"}),prompt:"marketing-expert"},{value:"financial-advisor",label:e.formatMessage({id:"general.ai_chat_persona_financial_advisor",defaultMessage:"\uD83D\uDCB0 Financial Advisor"}),prompt:"financial-advisor"},{value:"product-manager",label:e.formatMessage({id:"general.ai_chat_persona_product_manager",defaultMessage:"\uD83D\uDCE6 Product Manager"}),prompt:"product-manager"},{value:"startup-tech-lawyer",label:e.formatMessage({id:"general.ai_chat_persona_legal_advisor",defaultMessage:"⚖️ Legal Advisor"}),prompt:"startup-tech-lawyer"},{value:"software-developer",label:e.formatMessage({id:"general.ai_chat_persona_software_developer",defaultMessage:"\uD83D\uDCBB Software Developer"}),prompt:"software-developer"},{value:"graphic-designer",label:e.formatMessage({id:"general.ai_chat_persona_graphic_designer",defaultMessage:"\uD83C\uDFA8 Graphic Designer"}),prompt:"graphic-designer"},{value:"hr-consultant",label:e.formatMessage({id:"general.ai_chat_persona_hr_consultant",defaultMessage:"\uD83D\uDC65 HR Consultant"}),prompt:"hr-consultant"},{value:"tech-writer",label:e.formatMessage({id:"general.ai_chat_persona_copywriter",defaultMessage:"✍️ Copywriter"}),prompt:"tech-writer"},{value:"startup-idea-generator",label:e.formatMessage({id:"general.ai_chat_persona_idea_architect",defaultMessage:"\uD83D\uDCA1 Idea Architect"}),prompt:"startup-idea-generator"},{value:"professional-salesperson",label:e.formatMessage({id:"general.ai_chat_persona_sales_expert",defaultMessage:"\uD83D\uDECD️ Sales Expert"}),prompt:"professional-salesperson"},{value:"career-counselor",label:e.formatMessage({id:"general.ai_chat_persona_career_counselor",defaultMessage:"\uD83D\uDCBC Career Counselor"}),prompt:"career-counselor"},{value:"life-coach",label:e.formatMessage({id:"general.ai_chat_persona_life_coach",defaultMessage:"\uD83C\uDF1F Life Coach"}),prompt:"life-coach"},{value:"customer-support-agent",label:e.formatMessage({id:"general.ai_chat_persona_customer_support_agent",defaultMessage:"\uD83D\uDCDE Customer Support Agent"}),prompt:"customer-support-agent"},{value:"mindfulness-coach",label:e.formatMessage({id:"general.ai_chat_persona_mindfulness_coach",defaultMessage:"\uD83E\uDDD8‍♀️ Mindfulness Coach"}),prompt:"mindfulness-coach"},{value:"life-hacker",label:e.formatMessage({id:"general.ai_chat_persona_life_hacker",defaultMessage:"⚡ Life Hacker"}),prompt:"life-hacker"},{value:"nutritionist",label:e.formatMessage({id:"general.ai_chat_persona_nutritionist",defaultMessage:"\uD83C\uDF4F Nutritionist"}),prompt:"nutritionist"},{value:"personal-trainer",label:e.formatMessage({id:"general.ai_chat_persona_personal_trainer",defaultMessage:"\uD83D\uDCAA Personal Trainer"}),prompt:"personal-trainer"},{value:"travel-guide",label:e.formatMessage({id:"general.ai_chat_persona_travel_guide",defaultMessage:"\uD83D\uDDFA️ Travel Guide"}),prompt:"travel-guide"},{value:"journalist",label:e.formatMessage({id:"general.ai_chat_persona_journalist",defaultMessage:"\uD83D\uDCF0 Journalist"}),prompt:"journalist"},{value:"diy-expert",label:e.formatMessage({id:"general.ai_chat_persona_diy_expert",defaultMessage:"\uD83D\uDD28 DIY Expert"}),prompt:"diy-expert"},{value:"professional-chef",label:e.formatMessage({id:"general.ai_chat_persona_professional_chef",defaultMessage:"\uD83D\uDC68‍\uD83C\uDF73 Professional Chef"}),prompt:"professional-chef"},{value:"academic-researcher",label:e.formatMessage({id:"general.ai_chat_persona_researcher",defaultMessage:"\uD83E\uDDE0 Researcher"}),prompt:"academic-researcher"},{value:"language-tutor",label:e.formatMessage({id:"general.ai_chat_persona_tutor",defaultMessage:"\uD83D\uDCDA Tutor"}),prompt:"language-tutor"},{value:"entrepreneur",label:e.formatMessage({id:"general.ai_chat_persona_entrepreneur",defaultMessage:"\uD83D\uDE80 Entrepreneur"}),prompt:"entrepreneur"},{value:"ecommerce-strategist",label:e.formatMessage({id:"general.ai_chat_persona_ecommerce_strategist",defaultMessage:"\uD83D\uDED2 E-Commerce Strategist"}),prompt:"ecommerce-strategist"},{value:"seo-expert",label:e.formatMessage({id:"general.ai_chat_persona_seo_expert",defaultMessage:"\uD83D\uDD0D SEO Expert"}),prompt:"seo-expert"},{value:"programming-genius",label:e.formatMessage({id:"general.ai_chat_persona_programming_genius",defaultMessage:"\uD83D\uDCBB Programmer"}),prompt:"programming-genius"},{value:"content-creator",label:e.formatMessage({id:"general.ai_chat_persona_content_creator",defaultMessage:"✍️ Content Creator"}),prompt:"content-creator"},{value:"socialmedia-influencer",label:e.formatMessage({id:"general.ai_chat_persona_social_media_influencer",defaultMessage:"\uD83D\uDCF1 Influencer"}),prompt:"socialmedia-influencer"},{value:"investor",label:e.formatMessage({id:"general.ai_chat_persona_investor",defaultMessage:"\uD83D\uDCC8 Investor"}),prompt:"investor"},{value:"pr-specialist",label:e.formatMessage({id:"general.ai_chat_persona_pr_specialist",defaultMessage:"\uD83D\uDDE3️ PR Specialist"}),prompt:"pr-specialist"},{value:"business-mentor",label:e.formatMessage({id:"general.ai_chat_persona_business_mentor",defaultMessage:"\uD83E\uDDE0 Business Coach"}),prompt:"business-mentor"},{value:"negotiator",label:e.formatMessage({id:"general.ai_chat_persona_negotiator",defaultMessage:"\uD83E\uDD1D Negotiation Expert"}),prompt:"negotiator"}]}let zs=function(e){let{className:t,selectPersona:a,selectedPersona:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{o.current?.focus()},[]);(0,eI.usePopupEvents)({state:l,onCollapse:s});let d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"top-start"}),c=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),m=zi(),u=ev.useMemo(()=>new Map(m.map(e=>[e.value,e])),[m]),p=ev.useCallback(e=>{switch(e.type){case"Activate":{let{value:t}=e.payload;if(null==t)break;let n=u.get(t);if(null==n)break;a(n),r({type:"Collapse",payload:"none"});break}case"Dismiss":r({type:"Collapse"})}},[u,a]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex cursor-pointer items-center rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 text-left hover:bg-appcolor-300",t),...c.props},ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col"},null==n||null==n.prompt?ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.output_persona",defaultMessage:"Persona"})):ev.createElement(ev.Fragment,null,ev.createElement("p",{className:"text-2xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.output_persona",defaultMessage:"Persona"})),ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},n?.label))),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(zo,{initialFocus:d.initialFocus,menuGroupDispatch:p,personaOptions:m,selectedPersona:n})))},zd=function(e){let{name:t,value:a,selectedTone:n,children:l}=e,r=(0,ev.useRef)(null),o=(0,eI.useMenuItem)({stopRef:r,name:t,value:a});return ev.createElement("button",{...o.props,className:"flex max-h-7 w-60 cursor-pointer items-center justify-between border-none bg-appcolor-100 px-3 py-1.5 text-appcolor-900 outline-0 hover:bg-appcolor-300 focus:bg-appcolor-300"},l,n?.value===a&&ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_check"}))},zc=function(e){let{menuGroupDispatch:t,initialFocus:a,toneOptions:n,selectedTone:l}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eI.Menu,{className:"max-h-[50vh] overflow-y-scroll rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm",initialFocus:a,loop:!0},ev.createElement("div",{className:"my-2"},n.map(e=>ev.createElement(zd,{key:e.value,value:e.value,selectedTone:l},e.label)))))};function zm(){let e=(0,eK.Z)();return[{value:"default",label:e.formatMessage({id:"default",defaultMessage:"Default"}),prompt:null},{value:"creative",label:e.formatMessage({id:"general.ai_chat_persona_creative",defaultMessage:"\uD83C\uDFA8 Creative"}),prompt:"creative"},{value:"inspiring",label:e.formatMessage({id:"general.ai_chat_persona_inspiring",defaultMessage:"\uD83D\uDCA1 Inspiring"}),prompt:"inspiring"},{value:"casual",label:e.formatMessage({id:"general.ai_chat_persona_casual",defaultMessage:"\uD83D\uDE0E Casual"}),prompt:"casual"},{value:"confident",label:e.formatMessage({id:"general.ai_chat_tone_confident",defaultMessage:"\uD83D\uDCBC Confident"}),prompt:"confident"},{value:"authoritative",label:e.formatMessage({id:"general.ai_chat_tone_authoritative",defaultMessage:"\uD83D\uDC51 Authoritative"}),prompt:"authoritative"},{value:"friendly",label:e.formatMessage({id:"general.ai_chat_tone_friendly",defaultMessage:"\uD83D\uDE0A Friendly"}),prompt:"friendly"},{value:"empathetic",label:e.formatMessage({id:"general.ai_chat_tone_empathetic",defaultMessage:"\uD83D\uDC95 Empathetic"}),prompt:"empathetic"},{value:"optimistic",label:e.formatMessage({id:"general.ai_chat_tone_optimistic",defaultMessage:"\uD83C\uDF08 Optimistic"}),prompt:"optimistic"},{value:"formal",label:e.formatMessage({id:"general.ai_chat_tone_formal",defaultMessage:"\uD83D\uDC54 Formal"}),prompt:"formal"},{value:"serious",label:e.formatMessage({id:"general.ai_chat_tone_serious",defaultMessage:"\uD83D\uDC69‍\uD83D\uDCBC Serious"}),prompt:"serious"},{value:"warm",label:e.formatMessage({id:"general.ai_chat_tone_warm",defaultMessage:"\uD83D\uDD25 Warm"}),prompt:"warm"},{value:"humourous",label:e.formatMessage({id:"general.ai_chat_tone_humourous",defaultMessage:"\uD83D\uDE02 Humourous"}),prompt:"humourous"},{value:"informal",label:e.formatMessage({id:"general.ai_chat_tone_informal",defaultMessage:"\uD83D\uDC5F Informal"}),prompt:"informal"},{value:"clinical",label:e.formatMessage({id:"general.ai_chat_tone_clinical",defaultMessage:"\uD83D\uDC89 Clinical"}),prompt:"clinical"},{value:"playful",label:e.formatMessage({id:"general.ai_chat_tone_playful",defaultMessage:"\uD83C\uDF88 Playful"}),prompt:"playful"},{value:"emotional",label:e.formatMessage({id:"general.ai_chat_tone_emotional",defaultMessage:"\uD83D\uDE2D Emotional"}),prompt:"emotional"},{value:"sympathetic",label:e.formatMessage({id:"general.ai_chat_tone_sympathetic",defaultMessage:"\uD83D\uDE22 Sympathetic"}),prompt:"sympathetic"},{value:"tentative",label:e.formatMessage({id:"general.ai_chat_tone_tentative",defaultMessage:"\uD83D\uDC63 Tentative"}),prompt:"tentative"},{value:"cold",label:e.formatMessage({id:"general.ai_chat_tone_cold",defaultMessage:"\uD83E\uDDCA Cold"}),prompt:"cold"},{value:"cynical",label:e.formatMessage({id:"general.ai_chat_tone_cynical",defaultMessage:"\uD83D\uDE12 Cynical"}),prompt:"cynical"},{value:"ironic",label:e.formatMessage({id:"general.ai_chat_tone_ironic",defaultMessage:"\uD83D\uDE43 Ironic"}),prompt:"ironic"},{value:"sarcastic",label:e.formatMessage({id:"general.ai_chat_tone_sarcastic",defaultMessage:"\uD83D\uDE0F Sarcastic"}),prompt:"sarcastic"},{value:"pessimistic",label:e.formatMessage({id:"general.ai_chat_tone_pessimistic",defaultMessage:"☔ Pessimistic"}),prompt:"pessimistic"}]}let zu=function(e){let{className:t,selectTone:a,selectedTone:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{o.current?.focus()},[]);(0,eI.usePopupEvents)({state:l,onCollapse:s});let d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"top-start"}),c=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),m=zm(),u=ev.useMemo(()=>new Map(m.map(e=>[e.value,e])),[m]),p=ev.useCallback(e=>{switch(e.type){case"Activate":{let{value:t}=e.payload;if(null==t)break;let n=u.get(t);if(null==n)break;a(n),r({type:"Collapse",payload:"none"});break}case"Dismiss":r({type:"Collapse"})}},[a,u]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex cursor-pointer items-center rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 text-left hover:bg-appcolor-300",t),...c.props},ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col"},null==n||null==n.prompt?ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.output_tone",defaultMessage:"Tone"})):ev.createElement(ev.Fragment,null,ev.createElement("p",{className:"text-2xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.output_tone",defaultMessage:"Tone"})),ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},n?.label))),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(zc,{initialFocus:d.initialFocus,menuGroupDispatch:p,toneOptions:m,selectedTone:n})))},zp=function(e){let{error:t}=e,a=(0,eF.k6)(),n=(0,e$.useDispatch)(),l=(0,ei.getMessageFromError)(t)??"Unknown Error",r=(0,ei.getStatusCodeFromError)(t)??520,o=(0,ei.getCodeFromError)(t)??"UNKNOWN_ERROR";return $_(t)?null:402===r?ev.createElement("div",{className:"mb-2 rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-4 text-sm text-textcolor-700"},ev.createElement("div",{className:"mb-4"},l),ev.createElement("div",{className:"flex cursor-pointer items-center justify-center rounded-full bg-upgrade px-4 py-1 font-semibold text-textlight-900 hover:bg-upgrade/80",onClick:()=>{"ACTIVATION_REQUIRED"===o?a.push("/settings/plans"):n(d4())}},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1 mt-0.5"}),"ACTIVATION_REQUIRED"===o?ev.createElement(eY.Z,{id:"general.activate",defaultMessage:"Activate"}):ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))):ev.createElement("div",{className:"mb-2 flex items-center rounded-md border border-appcolor-300 px-4 py-4 text-xs text-textcolor-700"},ev.createElement(tn.Icon,{icon:"ai_error",className:"text-danger"}),ev.createElement("span",{className:"ml-1"},l))},zg=function(e){let{content:t,projectId:a}=e,n=(0,e$.useDispatch)();return ev.createElement("div",{onClick:()=>{n((e,n)=>{let l=n();null!=l.meta.id&&l.meta.id===a&&"edit"===l.meta.share&&e(Da({id:null,position:"beforeend"},(0,lo.markdownTextToTaskastFragment)(t,{shouldRemoveCodeFence:!0})))})},className:"mt-3 flex cursor-pointer justify-center rounded-xl border border-appcolor-400 p-2 text-xs text-textcolor-900 hover:bg-appcolor-300"},ev.createElement(eY.Z,{id:"general.quickadd_add_to_project",defaultMessage:"Add to project"}))},zf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceDocumentsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderby"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"DocumentOrdering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentFiltering"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"documents_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"orderby"},value:{kind:"Variable",name:{kind:"Name",value:"orderby"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"archived_at"}},{kind:"Field",name:{kind:"Name",value:"assignments"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"edit_path"}},{kind:"Field",name:{kind:"Name",value:"has_move_permission"}},{kind:"Field",name:{kind:"Name",value:"has_leave_permission"}},{kind:"Field",name:{kind:"Name",value:"is_owner"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"pinned_at"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}}]}},{kind:"Field",name:{kind:"Name",value:"starred_at"}},{kind:"Field",name:{kind:"Name",value:"view_path"}},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"raw_key"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"color"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"templated_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},zh={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectsCreateWithTaskastMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectsCreateWithTaskastInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectsCreateWithTaskast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"trees"}},{kind:"Field",name:{kind:"Name",value:"spaceId"}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]}}]},zy=function(e){let{content:t,spaceId:a}=e,[n,{data:l,loading:r}]=(0,cs.D)(zh),o=(0,eF.k6)();return ev.createElement("div",{onClick:()=>{if(!r){if(null!=l){let e=l.projectsCreateWithTaskast.documents.edges?.[0]?.node?.id;if(null==e)return;o.push(`/d/${e}`);return}{let e=(0,lo.markdownTextToTaskastFragment)(t,{shouldRemoveCodeFence:!0}),l=JSON.stringify((0,lo.fragmentToRoot)(e));n({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:a,trees:[l]}},refetchQueries:[{query:zf,variables:pU(a,"active",o.location.search,null,null)}]})}}},className:"mt-3 flex w-fit cursor-pointer justify-center rounded-xl border border-appcolor-400 p-2 text-xs text-textcolor-900 hover:bg-appcolor-300"},r&&ev.createElement(eY.Z,{id:"general.ai_chat_project_creating",defaultMessage:"Creating..."}),!r&&l&&ev.createElement(eY.Z,{id:"general.ai_chat_go_to_project",defaultMessage:"Go to project"}),!r&&null==l&&ev.createElement(eY.Z,{id:"general.ai_chat_create_project",defaultMessage:"Create Project"}))},zb=function(e){let{content:t,onCopy:a}=e,n=ev.useContext(zl),[l,r]=ev.useState(!1);return ev.createElement("div",{className:"flex gap-x-2"},ev.createElement("div",{onClick:()=>{a(),r(!0),setTimeout(()=>{r(!1)},1e3)},className:"mt-3 flex w-14 cursor-pointer justify-center rounded-xl border border-appcolor-400 p-2 text-xs text-textcolor-900 hover:bg-appcolor-300"},l?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"})),null!=n&&("document"===n.type?ev.createElement(zg,{content:t,projectId:n.id}):"space"===n.type?ev.createElement(zy,{content:t,spaceId:n.id}):null))},zv=function(e){let{avatarUrl:t,content:a,displayName:n}=e;return ev.createElement("div",{className:"rounded-xl bg-appcolor-200 py-5"},ev.createElement("div",{className:"flex break-words px-4"},ev.createElement("img",{className:"h-6 w-6 rounded-full",src:t,alt:n}),ev.createElement("div",{className:"ml-3 flex-1 overflow-hidden"},ev.createElement("div",{className:"flex text-sm"},ev.createElement("span",{className:"flex-1 font-medium text-textcolor-900"},n)),ev.createElement(B2,{className:"mt-1 text-sm text-textcolor-900"},ev.createElement(DA,{value:a,shouldRemoveCodeFence:!0})),ev.createElement(zb,{content:a,onCopy:()=>{navigator.clipboard.writeText(a)}}))))},zk=function(e){let{message:t}=e,a=t.contents[0].content,n=(0,eB.a)(sW),l=n.data?.me,r=l?.default_name??"",o=l?.avatars_v2.small?.mdpi.url??"";return ev.createElement("div",{className:"flex px-4"},ev.createElement("img",{className:"h-6 w-6 rounded-full",src:o,alt:r}),ev.createElement("div",{className:"ml-3 flex-1"},ev.createElement("div",{className:"flex text-sm"},ev.createElement("span",{className:"flex-1 font-medium text-textcolor-900"},r)),ev.createElement(B2,{className:"mt-1 break-all text-sm text-textcolor-900"},ev.createElement(Pa,{value:a}))))},zE=eL.default.div.withConfig({displayName:"Conversation__MessageContainer",componentId:"sc-4df8185-0"})` + ${tS} +`,zx=function(e){let{className:t,isLoading:a,messages:n,onScroll:l}=e;return ev.createElement(zE,{className:og()(t,"flex flex-col-reverse gap-4 pl-4 pr-3 pt-8"),onScroll:l},Array.from((0,eo.makeReverseIterable)(n),e=>"human"===e.role||"user"===e.role?ev.createElement(zk,{key:e.id,message:e}):ev.createElement(zv,{key:e.id,avatarUrl:"/images/logo.svg",displayName:"Taskade AI",content:e.contents[0].content})),a&&ev.createElement(eI.Spinner,null))},z_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentSpacePlanQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlan"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"state"}},{kind:"Field",name:{kind:"Name",value:"usage"}}]}}]}}]}}]}}]},zw={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectEmbeddingUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectEmbeddingUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectEmbeddingUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},zN=(0,e$.connect)(function(e){return{spaceId:dU(e)}})(function(e){let{projectId:t,spaceId:a}=e,[n,{loading:l,error:r}]=(0,cs.D)(zw),{data:o,loading:i}=(0,eB.a)(z_,a?{variables:{spaceID:a}}:{skip:!0});ev.useEffect(()=>{if(i)return;let e=o?.membership;if(null==e)return;let a=e.space.taskadePlan.type;"owner"===e.role&&"free"!==a&&(async()=>{try{await n({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:t}}})}catch(t){let e="An error occurred";t instanceof ea.cA&&(e=t.message),console.warn(e)}})()},[n,t,o?.membership,i]);let s=ev.useCallback(()=>{n({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:t}}})},[n,t]);if(ev.useEffect(()=>{if(null==r)return;let e="An error occurred";r instanceof ea.cA&&(e=r.message),console.warn(e)},[r]),i)return null;if(null!=r){let e=bH(r,["projectEmbeddingUpdate"]);if(e?.extensions.statusCode===402)return null}return ev.createElement("div",{className:"pl-4 pr-3"},l?ev.createElement(eI.Spinner,null):ev.createElement("button",{className:"hidden",onClick:s},ev.createElement(tn.Icon,{icon:"dd_restore",className:"h-7"})),null!=r&&ev.createElement("div",{className:"mt-2 rounded-lg border border-danger bg-danger/20 px-2 py-1 text-xs leading-tight text-danger"},r.message))});var zC=a(42404),zM=a.n(zC);let zS=function(e){let{template:t,onClick:a}=e;return ev.createElement(B5,{className:"flex w-full items-center justify-center whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm font-medium transition duration-150 ease-in-out",onClick:a},ev.createElement("span",{className:"rainbow"},ev.createElement(eY.Z,t.title)))},zI=function(e){let t=(0,eK.Z)(),a=ev.useMemo(()=>zM()(cn,6),[]);return ev.createElement("div",{className:"mt-4 flex w-full flex-col justify-center gap-1 p-2"},a.map((a,n)=>ev.createElement("div",{key:`sample-${n}`,className:"flex"},ev.createElement(zS,{template:a,onClick:()=>{let n=t.formatMessage(a.value);e.onPrompt(n)}}))))},zD=function(e){let t=(0,e$.useDispatch)(),a=ev.useCallback(()=>{t(co.actions.toggleAiPromptTemplatesDialog())},[t]);return ev.createElement("div",{className:"flex h-full flex-col items-center justify-center overflow-y-auto px-4 py-2"},ev.createElement("div",{className:"text-md font-bold"},ev.createElement(eY.Z,{id:"general.ai.taskade_ai",defaultMessage:"Taskade AI"})),ev.createElement("div",{className:"pb-2 text-center text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"general.get_started_with_prompts_below_or_browse_all_prompts",defaultMessage:"Get started with prompts below or browse all prompts."})),ev.createElement(zI,{onPrompt:e.onPrompt}),ev.createElement("div",{className:"mt-3 flex justify-center"},ev.createElement("button",{className:"flex items-center rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-xs font-bold text-appcolor-800 transition duration-150 ease-out hover:border-appcolor-400 hover:text-appcolor-1000",onClick:a},ev.createElement(tn.Icon,{className:"mr-2 scale-90",icon:"dd_prompt_templates"}),ev.createElement(eY.Z,{id:"general.ai.view_more",defaultMessage:"View More"}))))},zT=function(e){let{errorMessage:t,onRetry:a}=e;return ev.createElement("div",{className:"flex h-full flex-col items-center justify-center overflow-y-auto"},ev.createElement(tn.Icon,{className:"mb-8 flex-shrink-0 scale-[2]",icon:"ai_error"}),ev.createElement("div",{className:"pb-2 text-lg font-bold"},"Taskade AI"),ev.createElement("div",{className:"text-md text-center text-textcolor-500"},t),ev.createElement("div",{className:"mt-3 flex justify-center"},ev.createElement("button",{className:"flex items-center rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-xs font-bold text-appcolor-800 transition duration-150 ease-out hover:border-appcolor-400 hover:text-appcolor-1000",onClick:a},ev.createElement(tn.Icon,{className:"mr-2 rotate-90 scale-90",icon:"dd_restore"}),ev.createElement(eY.Z,{id:"general.retry",defaultMessage:"Retry"}))))},z$=function(e){let{onClick:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:r});return ev.createElement(ev.Fragment,null,ev.createElement("button",{type:"button",...d,className:"mr-2 text-textcolor-400 hover:text-textcolor-600",onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},onClick:e=>{o(!1),t?.(e)}},ev.createElement(tn.Icon,{icon:"dd_assign"})),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.toggle_personas_and_tones",defaultMessage:"Toggle Personas & Tones"})))},zP=hR.jS,zF=function(e){let t=e.shouldAutoFocus??!0,a=function(){let e=(0,eF.TH)();return ev.useMemo(()=>{let t=II(e.pathname);if(null!=t)return{type:"space",id:t};let a=function(e){if(ts()(e))return null;let t=(0,eF.LX)(e,{path:"/d/:documentId",exact:!0});return null==t?null:t.params.documentId}(e.pathname);return null!=a?{type:"document",id:a}:null},[e.pathname])}(),n=(0,ll.x)(),[l]=ev.useState(null),[r,o]=ev.useState(null),i=ev.useRef(null),s=ev.useMemo(()=>null==a||"space"===a.type?{filterby:{conversationId:null}}:{last:20,filterby:{conversationId:null,projectId:a.id}},[a]),{data:d,loading:c,error:m,fetchMore:u,refetch:p}=(0,eB.a)(O7,{variables:s,notifyOnNetworkStatusChange:!0});(0,eB.a)(zn,{variables:{first:1,filterby:{projectId:a?.id}},skip:null==a||"space"===a.type});let g=d?.conversationMessages,f=g?.pageInfo.startCursor,h=g?.pageInfo.hasPreviousPage,y=g?.edges,[b,v]=ev.useState(!0),k=zi(),[E,x]=ev.useState(null),_=zm(),[w,N]=ev.useState(null),C=ev.useMemo(()=>{let e=(y??[]).map(e=>{let{node:t}=e;return{id:t.id,conversationId:t.conversationId,role:t.role,contents:[{content:t.message}]}});return null!=r&&e.push({id:r.id,conversationId:r.conversationId,role:r.role,contents:[{content:r.message}]}),e},[y,r]),M=ev.useCallback(e=>{if(!h||null==f||c)return;let t=e.currentTarget;t.scrollTop+t.scrollHeight-t.clientHeight<5&&u({variables:{before:f}})},[u,h,c,f]),S=ev.useCallback(e=>{if(e?.conversationId==null)return;let{cache:t}=n,{projectId:a}=s.filterby;if(null!=a){let n={first:1,filterby:{projectId:a}},l=t.readQuery({query:zn,variables:n});if(!eW().isEmpty(l?.conversations.edges))return;t.updateQuery({query:zn,variables:n},t=>Ml()(t,{conversations:{$set:{edges:[{node:{id:e.conversationId}}]}}}))}if(null==a){let a={first:1,filterby:{projectId:null}},n=t.readQuery({query:O9,variables:a});if(!eW().isEmpty(n?.conversations.edges))return;t.updateQuery({query:O9,variables:a},t=>Ml()(t,{conversations:{$set:{edges:[{node:{id:e.conversationId}}]}}}))}},[n,s.filterby]),[I,{loading:D,error:T}]=$N(ev.useCallback(e=>{o(null);let t=hR.gh.safeParse(e);if(!t.success)return;let a=t.data,{cache:l}=n;S(e),l.updateQuery({query:O7,variables:s},e=>{if(null==e)return e;let t=e.conversationMessages.edges.findLastIndex(e=>e.node.id===a.id);return -1===t?Ml()(e,{conversationMessages:{edges:{$push:[{__typename:"ConversationMessageEdge",cursor:a.id,node:{__typename:"ConversationMessage",id:a.id,conversationId:a.conversationId,message:a.contents[0].content,role:a.role}}]}}}):Ml()(e,{conversationMessages:{edges:{[t]:{$set:{__typename:"ConversationMessageEdge",cursor:a.id,node:{__typename:"ConversationMessage",id:a.id,conversationId:a.conversationId,message:a.contents[0].content,role:a.role}}}}}})})},[n,O7,s,S])),$=(0,ei.getStatusCodeFromError)(T);D$({error:T});let P=(0,sz.cI)({resolver:(0,BK.F)(zP)}),F=CP()(C)?.id;ev.useEffect(()=>{let{invalid:e}=P.getFieldState("parentMessageId");e||P.setValue("parentMessageId",F)},[P,F]);let A=P.handleSubmit(e=>{if(D)return;let t={...e,persona:E?.prompt,tone:w?.prompt},n=hR.N4.parse({context:a,input:t,messages:(y??[]).slice(-8).map(e=>{let{node:t}=e;return{id:t.id,conversationId:t.conversationId,role:t.role,contents:[{content:t.message}]}})});o({__typename:"ConversationMessage",conversationId:e.conversationId??"",id:(0,O3.SK)(),message:e.content,role:e.role??"human"}),P.reset();let l=new AbortController;i.current=l,I("/web-api/ai/conversation",{method:"POST",credentials:"same-origin",body:JSON.stringify(n),headers:{"Content-Type":"application/json"},signal:l.signal})});if(c&&null==g)return ev.createElement("div",{className:"flex h-full flex-1"},ev.createElement(eI.Spinner,null));if(null!=m){let e=bH(m,["conversationMessages"]),t=(0,ei.getMessageFromError)(e)??(0,ei.getMessageFromError)(m)??"Unknown Error";return ev.createElement(zT,{errorMessage:t,onRetry:()=>{p()}})}return ev.createElement(zl.Provider,{value:a},ev.createElement("div",{className:"min-h-0 flex-1"},C.length>0?ev.createElement(zx,{className:"h-full overflow-y-scroll",isLoading:c,messages:C,onScroll:M}):ev.createElement(zD,{onPrompt:e=>{P.watch("content"),P.setValue("content",e),P.setFocus("content")}})),a?.type==="document"&&ev.createElement(zN,{projectId:a.id}),ev.createElement("div",{className:"my-4 flex-initial px-4"},null!=T&&402!==$&&ev.createElement(zp,{error:T}),ev.createElement("div",{className:og()("mb-2 gap-2",b?"flex":"hidden")},ev.createElement(zs,{className:"min-w-0 flex-1",selectedPersona:E,selectPersona:e=>{x(e)}}),ev.createElement(zu,{className:"min-w-0 flex-1",selectedTone:w,selectTone:e=>{N(e)}})),ev.createElement("form",{className:"flex w-full items-center justify-between rounded-xl border border-appcolor-300 px-4 py-2 text-sm shadow",onSubmit:A},ev.createElement("input",{type:"hidden",...P.register("role",{value:"human"})}),ev.createElement("input",{type:"hidden",...P.register("conversationId",{value:l})}),null!=F&&ev.createElement("input",{type:"hidden",...P.register("parentMessageId",{value:F})}),ev.createElement(z$,{onClick:()=>{v(!b),!1===b?(x(k[0]),N(_[0])):(x(null),N(null))}}),ev.createElement(Dx.Z,{maxRows:10,className:"w-full resize-none bg-transparent",placeholder:"Ask Taskade AI...",...P.register("content"),onKeyPress:e=>{e.key===eI.KeyboardKeys.Enter&&(e.shiftKey||(e.preventDefault(),A()))},onKeyDown:e=>{"a"===e.key&&e.metaKey&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())},autoFocus:t}),D?ev.createElement("button",{type:"button",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-appcolor-200 text-textcolor-700 hover:bg-appcolor-300",onClick:e=>{e.preventDefault(),i.current?.abort()}},ev.createElement(tn.Icon,{icon:"dd_stop",className:"h-5 w-5"})):ev.createElement("button",{type:"submit",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-appcolor-200 text-textcolor-700 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"message_send",className:"h-5 w-5"})))))},zA=function(e){let{documentId:t,onSelectChatMode:a,selectedMode:n,spaceId:l}=e,r=(0,ev.useRef)(null),o=(0,e$.useDispatch)(),i=(0,eK.Z)(),s=(0,ll.x)(),{isLoading:d,mutate:c}=(0,wu.D)({mutationFn:async()=>{let e={first:1,filterby:{projectId:t}},a=(await s.query({query:zn,variables:e})).data.conversations.edges[0];if(null==a)return;let n=a.node.id;await s.mutate({mutation:Ue,variables:{input:{clientMutationId:(0,ld.Z)(),id:n}},update:(a,l)=>{let{data:r,errors:o}=l;if(null!=o||null==r)return;let i={last:20,filterby:{conversationId:null,projectId:t}},s=a.readQuery({query:O7,variables:i});if(null==s||0===s.conversationMessages.edges.length)return;a.writeQuery({query:O7,variables:i,data:{...s,conversationMessages:{...s.conversationMessages,edges:[],pageInfo:{hasNextPage:!1,hasPreviousPage:!1,startCursor:null,endCursor:null}}}});let d=a.readQuery({query:zn,variables:e});if(null==d)return;let c=d.conversations.edges.findIndex(e=>e.node.id===n);-1!==c&&(d=Ml()(d,{conversations:{edges:{$splice:[[c,1]]}}}),a.writeQuery({query:zn,variables:e,data:d}))}})},mutationKey:["ProjectConversation",t]}),m=(0,ev.useCallback)(e=>{if(!r.current)return;e.preventDefault();let t=e.clientX,a=r.current.offsetWidth,n=!1,l=e=>{e.preventDefault(),n||(requestAnimationFrame(()=>{null!=r.current&&(r.current.style.width=a+(t-e.clientX)+"px"),n=!1}),n=!0)},o=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",o)},[]),u=async()=>{if(d)return;let e=i.formatMessage({id:"general.confirm_clear_conversation",defaultMessage:"Are you sure you want to clear the conversation?"});confirm(e)&&c()},p=(0,ev.useCallback)(()=>{null!=r.current&&(r.current.style.width="")},[]);return ev.createElement(B0,{ref:r,className:"step3"},ev.createElement("div",{className:"group absolute left-0 z-10 flex h-full w-4 cursor-col-resize items-center justify-start bg-transparent opacity-100",onMouseDown:m,onDoubleClick:p},ev.createElement("div",{className:"flex h-full w-1 bg-primary/50 opacity-0 transition duration-150 ease-in-out group-hover:opacity-100"})),ev.createElement(BX,{onClickDeleteConversation:u,onOpenAiPromptTemplates:()=>{o(co.actions.toggleAiPromptTemplatesDialog())},onSelectChatMode:a,projectId:t,selectedMode:n,spaceId:l,toggleChat:()=>{o(xk(t))}}),ev.createElement(zF,{shouldAutoFocus:!1}))},zR={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectMembersQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"document_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"document_id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"members"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ProjectMemberParts"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ProjectMemberParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ProjectMember"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},zj=ev.memo(function(e){let{documentID:t,spaceId:a}=e,[n,l]=ev.useState("team_chat"),[r,o]=ev.useState(null),{data:i,loading:s}=(0,eB.a)(zR,{variables:{document_id:t}});ev.useEffect(()=>{if(null==i||i.document?.members?.edges==null)return;let e=i.me?.id;if(null==e)return;let t=i.document.members.edges;if(1!==t.length)return;let a=t[0]?.node;null!=a&&a.user.id===e&&l("ask_project")},[i]);let[d,c]=ev.useState(!1);ev.useEffect(()=>{let e=window.matchMedia("(min-width: 768px)");c(e.matches);let t=e=>{c(e.matches)};return"function"==typeof e.addEventListener&&e.addEventListener("change",t),()=>{"function"==typeof e.removeEventListener&&e.removeEventListener("change",t)}},[]);let m=ev.useCallback(e=>{l(e.value),o(e.agent?.id??null)},[]);return s||!d?null:null!=r?ev.createElement(za,{agentId:r,spaceId:a,onSelectChatMode:m,projectId:t,selectedMode:n}):"ask_project"===n?ev.createElement(zA,{documentId:t,spaceId:a,onSelectChatMode:m,selectedMode:n}):ev.createElement(BG,{chatMode:n,documentID:t,onSelectChatMode:m,spaceId:a})});var zO=a(4480);let zU=eL.default.div.withConfig({displayName:"embedded-footer__EmbedFooter",componentId:"sc-f330f7b-0"})` + display: none; + width: 100%; + height: 44px; + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(100)}; + padding: 0 12px 1px; + + position: fixed; + bottom: 0; + z-index: 5; + align-items: center; + justify-content: space-between; + + body.taskade-embed && { + display: flex; + } + + & > a:first-child > svg { + & > path:last-child { + fill: ${e=>e.theme.appColors.hex(10)}; + } + } +`,zZ=function(e){let{location:t,isLoggedIn:a}=e,{isFooterHidden:n,isCopyHidden:l}=ev.useMemo(()=>{if(!t.pathname.startsWith("/embed/"))return{isFooterHidden:!1,isCopyHidden:!1};let e=new URLSearchParams(t.search);return{isFooterHidden:"hidden"===e.get("footer"),isCopyHidden:"hidden"===e.get("copy")}},[t.pathname,t.search]);if(n)return null;let r=`${t.pathname.replace(/\/embed/,"/d")}${t.search}`;return ev.createElement(zU,null,ev.createElement("a",{href:"https://www.taskade.com",rel:"noopener noreferrer",target:"_blank"},ev.createElement(lT.fl,null)),ev.createElement("div",{className:"flex items-center gap-x-1"},!l&&ev.createElement("a",{className:"embed-copy flex items-center gap-x-1 rounded-xl p-2 text-sm text-appcolor-500 hover:bg-appcolor-300 hover:text-appcolor-800",href:a?r:"/signup",rel:"noopener noreferrer",target:"_blank"},ev.createElement(tn.Icon,{icon:"embed_copy"}),"Copy"),ev.createElement("a",{className:"flex items-center gap-x-1 rounded-xl p-2 text-sm text-appcolor-500 hover:bg-appcolor-300 hover:text-appcolor-800",href:a?r:"/signup",rel:"noopener noreferrer",target:"_blank"},ev.createElement(tn.Icon,{icon:"embed_open"}),"Open")))},zL=(0,la.ZP)` + mutation CreateDocumentMutation($params: DocumentInput!) { + createDocument(document: $params) { + id + view_path + } + } +`,zB=(0,la.ZP)` + query TemplatesQuery($spaceID: ID!) { + membership(space_id: $spaceID) { + id + role + space { + id + templates { + edges { + node { + id + info + edit_path + shared_preferences + preferences { + view + } + role { + project + workspace + } + } + } + } + } + } + } +`,zz=function(e){let{isNewTemplate:t,documentID:a,documentView:n,spaceID:l}=e,r=(0,eF.k6)(),[o,{data:i,loading:s}]=(0,cs.D)(zL);(0,ev.useEffect)(()=>{(0,eq.isNil)(i)||r.push(`/d/${i.createDocument.id}`)},[i,r]);let{data:d}=(0,eB.a)(IA,null!=l?{variables:{spaceID:l}}:{skip:!0}),c=d?.membership?.space,{data:m,loading:u,error:p}=(0,eB.a)(zB,{variables:{spaceID:l},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:(0,eq.isNil)(c)||t}),g=(0,eq.get)(m,["membership"],{});return u||s?ev.createElement(Ux,null,ev.createElement(eI.Spinner,{height:42})):g?.role==null?null:p?ev.createElement(Ux,null,ev.createElement(UD,null,"There's been a problem loading templates, please try again.")):ev.createElement(UT,null,ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.edit_template",defaultMessage:"Edit Template"})),ev.createElement(UU,{role:g.role,action:"create_project"},ev.createElement(U$,{onClick:()=>{if(t){Fd();return}null!=a&&null!=l&&o({variables:{params:{view:n,spaceID:l,template:{type:"document",id:a}}}})}},ev.createElement(eY.Z,{id:"general.use_template",defaultMessage:"Use Template"}))))},zV="SET_SELF_PRESENCE",zq="UPDATE_PRESENCES",zW="UNSET_PRESENCE";function zH(e){return{type:zV,payload:{selfPresenceID:e}}}function zG(e){return{type:zq,payload:{presenceEvent:e}}}function zK(){return{type:zW}}function zY(){return(e,t)=>i5(t())}let zQ=function(e){let{projectID:t}=e,a=(0,e$.useSelector)(i5),n=(0,e$.useDispatch)(),l=(0,ev.useRef)(!1),r=(0,ev.useCallback)(()=>{let e=n(zY()),a=BO.PresenceCommand.encode({type:BO.PresenceType.AVAILABLE,projectId:t,focusState:{nodeId:e}}).finish();n({type:r_,payload:{eventName:"PRESENCE_COMMAND",args:[new Blob([a])]}})},[n,t]);return(0,ev.useEffect)(()=>{let e=async function(){let e=await BZ()(n);e.connected&&(n(zH(e.id)),r(),l.current=!0);let t=()=>{n(zH(e.id)),r(),l.current=!0},a=e=>{n(zG(BO.PresenceEvent.decode(new Uint8Array(e))))},o=()=>{n(zK()),l.current=!1};return e.on("connect",t),e.on("PRESENCE_EVENT",a),e.on("disconnect",o),()=>{e.removeListener("connect",t),e.removeListener("PRESENCE_EVENT",a),e.removeListener("disconnect",o)}}();return()=>{e.then(e=>{e()})}},[n,r]),(0,ev.useEffect)(()=>()=>{let e=BO.PresenceCommand.encode({type:BO.PresenceType.UNAVAILABLE,projectId:t}).finish();n(zK()),n({type:r_,payload:{eventName:"PRESENCE_COMMAND",args:[new Blob([e])]}}),l.current=!1},[t,n]),(0,ev.useEffect)(()=>{if(!l.current)return;let e=BO.PresenceCommand.encode({type:BO.PresenceType.AVAILABLE,projectId:t,focusState:null!=a?{nodeId:a}:null}).finish();n({type:r_,payload:{eventName:"PRESENCE_COMMAND",args:[new Blob([e])]}})},[t,a,n]),(0,ev.useEffect)(()=>{let e=setInterval(()=>{l.current&&r()},36e4);return()=>{clearInterval(e)}},[r]),null};eL.default.div.withConfig({displayName:"Styled__ActionsContainer",componentId:"sc-747d71f5-0"})` + display: flex; +`,eL.default.button.attrs({type:"button"}).withConfig({displayName:"Styled__ActionButton",componentId:"sc-747d71f5-1"})` + color: ${e=>e.theme.textColors.hex(10)}; + display: flex; + align-items: center; + justify-content: center; + height: 34px; + padding: 0 0.25rem; + position: relative; + transition: color 0.2s ease-in-out; + transform: var(--global-icon-scale); + + &:hover { + color: ${e=>e.theme.textColors.hex(50)}; + } +`;let zJ=eL.default.button.withConfig({displayName:"Styled__ToggleCompleted",componentId:"sc-747d71f5-2"})` + display: flex; + margin: 0 auto; + padding: 12px 20px; + width: 100%; + max-width: 1000px; + cursor: pointer; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.textColors.hex(50)}; + border: 0; + ${e1.UiTypography.md}; + border-radius: 10px; + box-shadow: none; + outline: 0; + justify-content: center; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + outline: 0; + } + + @media print { + display: none !important; + } +`;function zX(e){let{completedCount:t,documentID:a,hideCompleted:n,toggleDocumentHideCompleted:l,user:r}=e;return ev.createElement(ev.Fragment,null,r&&t>0&&ev.createElement(zJ,{className:"toggle-completed",onClick:()=>{a&&l(a)}},n?ev.createElement(eY.Z,{id:"general.show_completed",defaultMessage:"Show completed"}):ev.createElement(eY.Z,{id:"general.hide_completed",defaultMessage:"Hide completed"})," ","(",t,")"))}zX.propTypes={completedCount:l7().number.isRequired,documentID:l7().string,hideCompleted:l7().bool.isRequired,toggleDocumentHideCompleted:l7().func.isRequired,user:l7().shape()},zX.defaultProps={documentID:null,user:null};let z0=(0,e$.connect)(function(e,t){return{completedCount:dK(e),hideCompleted:dT(e),user:t7(e,t)}},function(e){return(0,ek.DE)({toggleDocumentHideCompleted:xE},e)})(zX);var z1=a(5729);let z2=ev.createContext();var z5=a(41143),z3=a.n(z5);function z4(e,t){let a=Math.min(e.length,t.length);for(let n=0;nt.length?(z3()(t.length===a,"target length must be the same as compare length"),{common:t,source:e.slice(a),target:[]}):(z3()(e.length===a,"source length must be the same as compare length"),z3()(t.length===a,"target length must be the same as compare length"),{common:e,source:[],target:[]})}function z6(e,t){return t.left<=e.x&&t.top<=e.y&&t.right>=e.x&&t.bottom>=e.y}function z8(e){return{x:e.clientX,y:e.clientY}}let z7=(0,eV.ZP)("mod+enter"),z9=(0,eV.ZP)("backspace"),Ve=(0,eV.ZP)("del"),Vt=/( )/gm;class Va extends ev.Component{static propTypes={contents:l7().instanceOf(li.Contents).isRequired,canSelectAllNodes:l7().func.isRequired,fetchFocusNodeId:l7().func.isRequired,toggleSelectionComplete:l7().func.isRequired,toggleSelectionMark:l7().func.isRequired,onClearFocus:l7().func.isRequired,onDeleteNodes:l7().func.isRequired,indentNodes:l7().func.isRequired,outdentNodes:l7().func.isRequired,undo:l7().func.isRequired,redo:l7().func.isRequired,moveNodesToPreviousLocation:l7().func.isRequired,moveNodesToNextLocation:l7().func.isRequired,multiselectEnter:l7().func.isRequired,multiselectDown:l7().func,multiselectUp:l7().func,children:l7().any.isRequired};registry;selectionObservers;selectingItems;selectingItemsUnregistered;selectedItems;selectedItemsUnregistered;selection;hasDocumentMouseDownListener;isSelecting;constructor(e){super(e),this.registry=new Map,this.selectionObservers=new Set,this.selectingItems=(0,tz.OrderedSet)(),this.selectingItemsUnregistered=new Map,this.selectedItems=(0,tz.OrderedSet)(),this.selectedItemsUnregistered=new Map,this.selection=null,this.hasDocumentMouseDownListener=!1,this.isSelecting=!1}componentDidMount(){document.addEventListener("copy",this.handleCopy),document.addEventListener("keydown",this.handleDocumentKeydown)}componentWillUnmount(){document.removeEventListener("copy",this.handleCopy),document.removeEventListener("keydown",this.handleDocumentKeydown),this.removeDocumentMouseDownListener()}addDocumentMouseDownListener=()=>{this.hasDocumentMouseDownListener||(document.addEventListener("mousedown",this.handleDocumentMouseDown),this.hasDocumentMouseDownListener=!0)};removeDocumentMouseDownListener=()=>{this.hasDocumentMouseDownListener&&(document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.hasDocumentMouseDownListener=!1)};registerSelectable=(e,t)=>{let a=this.registry.get(e);null==a?(a={id:e,selectable:t,count:1},this.registry.set(e,a)):(a.selectable=t,a.count+=1),this.registerSelectingItemIfNeeded(e),this.registerSelectedItemIfNeeded(e);let n=this.selectingItems.has(e),l=this.selectedItems.has(e);(n!==t.selecting||l!==t.selected)&&t.onSelectingSelected(n,l)};registerSelectingItemIfNeeded=e=>{let t=this.selectingItemsUnregistered.get(e);return null==t?(t={id:e,count:-1},this.selectingItemsUnregistered.set(e,t)):t.count-=1,0===t.count&&(this.selectingItemsUnregistered.delete(e),this.selectingItems=this.selectingItems.add(e)),!0};registerSelectedItemIfNeeded=e=>{let t=this.selectedItemsUnregistered.get(e);return null==t?(t={id:e,count:-1},this.selectedItemsUnregistered.set(e,t)):t.count-=1,0===t.count&&(this.selectedItemsUnregistered.delete(e),this.selectedItems=this.selectedItems.add(e)),!0};unregisterSelectable=e=>{let t=this.registry.get(e);if(null!=t){t.count-=1,t.count<=0&&this.registry.delete(e),this.unregisterSelectingItemIfNeeded(e),this.unregisterSelectedItemIfNeeded(e);let a=t.selectable,n=this.selectingItems.has(e),l=this.selectedItems.has(e);(n!==a.selecting||l!==a.selected)&&a.onSelectingSelected(n,l)}else this.unregisterSelectingItemIfNeeded(e),this.unregisterSelectedItemIfNeeded(e);for(let e of this.selectionObservers.values())e.updateSelectingSelectedItems(this.selectingItems,this.selectedItems)};unregisterSelectingItemIfNeeded=e=>{if(!this.selectingItems.has(e))return!1;let t=this.selectingItemsUnregistered.get(e);return null==t?(t={id:e,count:1},this.selectingItemsUnregistered.set(e,t)):t.count+=1,0===t.count&&(this.selectingItemsUnregistered.delete(e),this.selectingItems=this.selectingItems.add(e)),!0};unregisterSelectedItemIfNeeded=e=>{if(!this.selectedItems.has(e))return!1;let t=this.selectedItemsUnregistered.get(e);return null==t?(t={id:e,count:1},this.selectedItemsUnregistered.set(e,t)):t.count+=1,0===t.count&&(this.selectedItemsUnregistered.delete(e),this.selectedItems=this.selectedItems.add(e)),!0};registerSelectionObserver=e=>{this.selectionObservers.add(e)};unregisterSelectionObserver=e=>{this.selectionObservers.delete(e)};updateSelectingItems=e=>{let{selectingItems:t}=this,a=t.subtract(e),n=e.subtract(t);for(let t of(this.selectingItems=e,a.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelecting(!1)}),n.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelecting(!0)}),this.selectionObservers.values()))t.updateSelectingItems(this.selectingItems)};resetSelectionItems=()=>{let{selectingItems:e,selectedItems:t}=this,a=e.intersect(t),n=e.subtract(a),l=t.subtract(a);for(let r of(this.selectingItems=e.clear(),this.selectingItemsUnregistered.clear(),this.selectedItems=t.clear(),this.selectedItemsUnregistered.clear(),a.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelectingSelected(!1,!1)}),n.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelecting(!1)}),l.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelected(!1)}),this.selectionObservers.values()))r.updateSelectingSelectedItems(this.selectingItems,this.selectedItems)};promoteToSelectedItems=()=>{let{selectingItems:e,selectedItems:t}=this,a=t.subtract(e),n=e.subtract(t);for(let t of(this.selectingItems=e.clear(),this.selectingItemsUnregistered.clear(),this.selectedItems=e,a.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelected(!1)}),n.forEach(e=>{let t=this.registry.get(e);t?.selectable.onSelectingSelected(!1,!0)}),this.selectionObservers.values()))t.updateSelectingSelectedItems(this.selectingItems,this.selectedItems);if(!this.selectedItems.isEmpty()){this.addDocumentMouseDownListener();let{onClearFocus:e}=this.props;e()}};clearSelection=()=>{this.resetSelectionItems(),this.selection=null,this.removeDocumentMouseDownListener()};handleSelect=()=>{if(eu()(this.selection))return;if(null==this.selection.start){let e=Error("Invalid selection: start is nullish");er.$e(t=>{t.setContext("selection",this.selection),er.Tb(e)}),this.updateSelectingItems((0,tz.OrderedSet)());return}if(eu()(this.selection.end)){this.updateSelectingItems((0,tz.OrderedSet)());return}let{contents:e}=this.props,{start:t,end:a}=this.selection,{common:n,source:l,target:r}=z4(t.ancestryPath,a.ancestryPath);if(ts()(l)||ts()(r))this.updateSelectingItems((0,tz.OrderedSet)([CP()(n)]));else{let t=CP()(n),a=e.findNodeByID(t),o=a.children.indexOf(CT()(l)),i=a.children.indexOf(CT()(r));othis.registry.has(e)))):o>i&&this.updateSelectingItems((0,tz.OrderedSet)(a.children.slice(i,o+1).filter(e=>this.registry.has(e))))}};handleDocumentKeydown=e=>{r7(e)?this.handleSelectAll(e):rV(e)?this.handleEsc(e):z7(e)?this.handleComplete(e):z9(e)||Ve(e)?this.handleDelete(e):r3(e)?this.handleIndent(e):r6(e)?this.handleOutdent(e):rJ(e)?this.handleUndo(e):r5(e)?this.handleRedo(e):r9(e)?this.handleMoveDown(e):oe(e)?this.handleMoveUp(e):on(e)?this.handleBold(e):ol(e)?this.handleUnderline(e):or(e)?this.handleItalic(e):oo(e)?this.handleHighlight(e):oi(e)?this.handleEnter(e):os(e)?this.handleDown(e):od(e)?this.handleUp(e):ot(e)?this.handleShiftDownSelect(e):oa(e)&&this.handleShiftUpSelect(e)};handleUndo=e=>{e.preventDefault(),e.stopPropagation(),this.props.undo()};handleRedo=e=>{e.preventDefault(),e.stopPropagation(),this.props.redo()};handleIndent=e=>{e.preventDefault(),e.stopPropagation();let{indentNodes:t}=this.props;t(this.selectedItems.toArray())};handleOutdent=e=>{e.preventDefault(),e.stopPropagation();let{outdentNodes:t}=this.props;t(this.selectedItems.toArray())};handleDocumentMouseDown=e=>{let t;if(0!==e.button)return;let a=z8(e);for(let{selectable:e}of this.registry.values()){let{dimension:n}=e;if(null!=n&&z6(a,n.marginBox)){t=e;break}}eu()(t)&&this.clearSelection()};handleMouseDown=e=>{let t;if(0!==e.button)return;let a=z8(e);for(let{selectable:e}of this.registry.values()){let{dimension:n}=e;if(null!=n&&z6(a,n.marginBox)){t=e;break}}if(this.hasDocumentMouseDownListener&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()),null==t){this.clearSelection();return}if(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),this.resetSelectionItems(),e.shiftKey&&null!=this.selection){let{start:a,end:n}=this.selection;if(a===t)return;if(n!==t){let e={start:a,end:t};this.selection=e}this.handleSelect(),this.promoteToSelectedItems(),e.preventDefault();return}this.selection={start:t,end:null},this.isSelecting=!0,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)};handleMouseMove=(0,z1.Z)(e=>{let t;let a=z8(e);for(let{selectable:e}of this.registry.values()){let{dimension:n}=e;if(null!=n&&z6(a,n.marginBox)){t=e;break}}if(null==t)return;let{selection:n}=this;null!=n&&(n.start===t&&(t=null),n.end!==t&&(n.end=t,this.handleSelect()))});handleMouseUp=e=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.isSelecting=!1,this.promoteToSelectedItems()};handleDown=e=>{if(this.selectedItems.isEmpty())return;let{multiselectDown:t}=this.props;null!=t&&(t(this.selectedItems),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.clearSelection())};handleUp=e=>{if(this.selectedItems.isEmpty())return;let{multiselectUp:t}=this.props;null!=t&&(t(this.selectedItems),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.clearSelection())};handleShiftDownSelect=e=>{let t;let{fetchFocusNodeId:a}=this.props;if(null==this.selection){let e=a();if(null==e)return;let n=this.registry.get(e);if(null==n)return;t={start:n.selectable,end:null}}else t={...this.selection};let n=this.props.findNextNodeIdForSelection?.(t);if(null==n)return;let l=this.registry.get(n);null!=l&&(this.selection={start:t.start,end:l.selectable},this.resetSelectionItems(),this.handleSelect(),this.promoteToSelectedItems())};handleShiftUpSelect=e=>{let t;let{fetchFocusNodeId:a}=this.props;if(null==this.selection){let e=a();if(null==e)return;let n=this.registry.get(e);if(null==n)return;t={start:n.selectable,end:null}}else t={...this.selection};let n=this.props.findPreviousNodeIdForSelection?.(t);if(null==n)return;let l=this.registry.get(n);null!=l&&(this.selection={start:t.start,end:l.selectable},this.resetSelectionItems(),this.handleSelect(),this.promoteToSelectedItems())};handleMoveDown=e=>{this.selectedItems.isEmpty()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.props.moveNodesToNextLocation(this.selectedItems.toArray()))};handleMoveUp=e=>{this.selectedItems.isEmpty()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.props.moveNodesToPreviousLocation(this.selectedItems.toArray()))};handleCopy=e=>{if(!this.selectedItems.isEmpty()){let{contents:t}=this.props,a=1===this.selectedItems.size&&t.rootID===this.selectedItems.toArray()[0]?t.toST():t.extractFragment(this.selectedItems.toArray()),n=(0,lo.taskastToMdast)(a);if(null!=e.clipboardData){let t=(0,lo.mdastToMarkdownText)(n),l=t.replace(Vt," "),r=(0,DP.mdastToHtmlText)(n);e.clipboardData.setData("application/vnd.taskade.taskast",JSON.stringify(a)),e.clipboardData.setData("text/html",r),e.clipboardData.setData("text/markdown",t),e.clipboardData.setData("text/plain",l)}e.preventDefault()}};handleEsc=e=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.clearSelection()};handleSelectAll=e=>{let{selectedItems:t}=this,{canSelectAllNodes:a,contents:n,fetchFocusNodeId:l}=this.props;if(!a())return;e.preventDefault();let r=function(e,t,a){let n=e.first();if(null==n){let e=a();return null!=e?tz.default.OrderedSet([e]):tz.default.OrderedSet([t.rootID])}let l=t.findParentNodeByID(n);return null==l?tz.default.OrderedSet([t.rootID]):l.children.some(t=>!e.has(t))?tz.default.OrderedSet(l.children):l.id===t.rootID?e:tz.default.OrderedSet([l.id])}(t,n,l);this.resetSelectionItems(),this.updateSelectingItems(r),this.promoteToSelectedItems()};handleComplete=e=>{if(!this.selectedItems.isEmpty()){e.preventDefault();let t=Array.from(this.selectedItems);this.clearSelection(),this.props.toggleSelectionComplete(t)}};handleDelete=e=>{if(!this.selectedItems.isEmpty()){e.preventDefault();let t=Array.from(this.selectedItems);document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.clearSelection(),this.props.onDeleteNodes(t)}};handleBold=e=>{this.selectedItems.isEmpty()||(e.preventDefault(),this.props.toggleSelectionMark([...this.selectedItems],"bold"))};handleUnderline=e=>{this.selectedItems.isEmpty()||(e.preventDefault(),this.props.toggleSelectionMark([...this.selectedItems],"underline"))};handleItalic=e=>{this.selectedItems.isEmpty()||(e.preventDefault(),this.props.toggleSelectionMark([...this.selectedItems],"italic"))};handleHighlight=e=>{this.selectedItems.isEmpty()||(e.preventDefault(),this.props.toggleSelectionMark([...this.selectedItems],"highlight"))};handleEnter=e=>{if(!this.selectedItems.isEmpty()){e.preventDefault();let t=Array.from(this.selectedItems);document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.clearSelection(),this.props.multiselectEnter(t)}};isNodeIdSelected(e,t){return!!this.selectedItems.has(e)||(0,tz.Seq)(t).reverse().some(e=>null!=e&&this.selectedItems.has(e))}getSelectedIdsAtNode(e,t){return this.selectedItems.isEmpty()?[e]:this.isNodeIdSelected(e,t)?this.selectedItems.toArray():[]}render(){let{props:e}=this;return ev.createElement(z2.Provider,{value:this},ev.createElement("div",{className:"nodes-wrapper",onMouseDown:this.handleMouseDown,role:"presentation"},e.children))}}var Vn=a(27642);class Vl extends ev.Component{static contextType=z2;selectableRef=ev.createRef();state={selected:!1,selecting:!1};componentDidMount(){this.context.registerSelectable(this.props.nodeID,this)}componentDidUpdate(e){if(e.nodeID!==this.props.nodeID){let t=this.context;t.unregisterSelectable(e.nodeID),t.registerSelectable(this.props.nodeID,this)}}componentWillUnmount(){this.context.unregisterSelectable(this.props.nodeID)}onSelecting=e=>{this.setState({selecting:e})};onSelected=e=>{this.setState({selected:e})};onSelectingSelected=(e,t)=>{this.setState({selecting:e,selected:t})};get ancestors(){return this.props.ancestors}get nodeID(){return this.props.nodeID}get ancestryPath(){return[...this.props.ancestors,this.props.nodeID]}get dimension(){return null==this.selectableRef.current?null:(0,Vn.iz)(this.selectableRef.current)}get selecting(){return this.state.selecting}get selected(){return this.state.selected}render(){let{state:e}=this,{WrappedComponent:t,...a}=this.props;return ev.createElement(t,{...a,selected:e.selected,selecting:e.selecting,selectableRef:this.selectableRef})}}function Vr(e){return function(t){return ev.createElement(Vl,{...t,WrappedComponent:e})}}var Vo=a(82492),Vi=a.n(Vo),Vs=a(57557),Vd=a.n(Vs);class Vc extends ev.Component{static propTypes={selectionProvider:l7().instanceOf(Va).isRequired,WrappedComponent:l7().any.isRequired,forwardedRef:l7().oneOfType([l7().func,l7().object])};static defaultProps={forwardedRef:void 0};static getDerivedStateFromProps(e,t){let a=null;return a=Vi()(a,{isSelecting:e.selectionProvider.isSelecting}),e.selectionProvider.selectingItems!==t.selectingItems&&(a=Vi()(a,{selectingItems:e.selectionProvider.selectingItems})),e.selectionProvider.selectedItems!==t.selectedItems&&(a=Vi()(a,{selectedItems:e.selectionProvider.selectedItems})),a}state={selectingItems:void 0,selectedItems:void 0,isSelecting:!1};componentDidMount(){this.props.selectionProvider.registerSelectionObserver(this)}componentWillUnmount(){this.props.selectionProvider.unregisterSelectionObserver(this)}clearSelection=()=>{let{selectionProvider:e}=this.props;e.clearSelection()};updateSelectingItems=e=>{this.setState({selectingItems:e})};updateSelectedItems=e=>{this.setState({selectedItems:e})};updateSelectingSelectedItems=(e,t)=>{this.setState({selectingItems:e,selectedItems:t})};render(){let{state:e}=this,t=Vd()(this.props,["forwardedRef","selectionProvider","WrappedComponent"]),{WrappedComponent:a,forwardedRef:n}=this.props;return ev.createElement(a,{...t,ref:n,selectingItems:e.selectingItems,selectedItems:e.selectedItems,clearSelection:this.clearSelection,isSelecting:e.isSelecting})}}function Vm(){let{forwardRef:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>e?ev.forwardRef(function(e,a){return ev.createElement(z2.Consumer,null,n=>ev.createElement(Vc,{...e,forwardedRef:a,selectionProvider:n,WrappedComponent:t}))}):function(e){return ev.createElement(z2.Consumer,null,a=>ev.createElement(Vc,{...e,selectionProvider:a,WrappedComponent:t}))}}let Vu=eL.default.div.withConfig({displayName:"HoverLinkInput__Menu",componentId:"sc-44262b7-0"})` + padding: 5px 0; + background-color: rgba(0, 0, 0, 0.9); + margin-left: -34px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + border-radius: 10px; + height: 44px; + position: relative; +`,Vp=eL.default.div.withConfig({displayName:"HoverLinkInput__Caret",componentId:"sc-44262b7-1"})` + position: relative; + bottom: 5px; + height: 10px; + width: 10px; + transform: rotate(45deg); + background-color: rgba(0, 0, 0, 0.9); +`,Vg=eL.default.div.withConfig({displayName:"HoverLinkInput__CaretMenuWrapper",componentId:"sc-44262b7-2"})` + position: absolute; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + pointer-events: auto; +`,Vf=eL.default.button.withConfig({displayName:"HoverLinkInput__LinkAction",componentId:"sc-44262b7-3"})` + display: flex; + background: none; + border: 0; + padding: 0; + margin: 0; + outline: 0; + cursor: pointer; + position: absolute; + right: ${e=>e.hasUrl?"40px":"10px"}; + + &:focus { + outline: 0; + } + + & svg path { + fill: #ccc; + } + + &:hover svg path { + fill: #e5e5e5; + } +`,Vh=eL.default.input.attrs({type:"text"}).withConfig({displayName:"HoverLinkInput__TextInput",componentId:"sc-44262b7-4"})` + flex: 1 1 auto; + width: 280px; + border: 0; + padding: 0 70px 0 10px; + font-size: 16px; + line-height: 16px; + background: none; + color: ${e=>e.theme.primaryColorScheme?.base}; + + &::placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } +`,Vy=function(e){let{nodeID:t,style:a,selection:n,url:l,onInput:r,onInputBlur:o,onInputError:i,error:s}=e,d=(0,eK.Z)(),{toggleLink:c,focusNode:m}=function(e){let t=(0,ev.useMemo)(()=>e,[]),a=(0,e$.useDispatch)();return(0,ev.useMemo)(()=>(0,ek.DE)(t,a),[t,a])}({toggleLink:mO,focusNode:mI}),u=!ts()(l),[p,g]=(0,ev.useState)(l),f=a?.inputMenuLeft??"0",h=a?.menuTop??"0",y=a?.caretLeft??"0",b=()=>{ts()(p)?c(t):$R.test(p)?c(t,{url:p}):i()},v=e=>{e.preventDefault(),b()};return ev.createElement(Vg,{id:`hover-menu-${t??null}`,style:{left:f,top:h}},ev.createElement(Vu,null,ev.createElement(Vh,{placeholder:d.formatMessage({id:"general.add_link",defaultMessage:"Add link"}),value:p,onChange:e=>{g(e.target.value),r()},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),b()):"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),m(t,n?.end)):"a"===e.key&&e.metaKey&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())},onBlur:o,autoFocus:!0}),u&&ev.createElement(Vf,null,ev.createElement(lT.QT,{onMouseDown:e=>{e.preventDefault(),c(t),o()}})),ev.createElement(Vf,{hasUrl:u},"validation"===s?ev.createElement(lT.gZ,{onMouseDown:v}):ev.createElement(lT.$y,{onMouseDown:v}))),ev.createElement(Vp,{style:{left:y}}))},Vb=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-976e8354-0"})` + padding: 0; + background-color: ${e=>e.selected?e.theme.isNightMode?"#333333":"#e5e5e5":"transparent"}; + border-radius: 5px; + border: 0; + opacity: ${e=>e.disabled?"0.2":"1"}; + cursor: pointer; + > svg > g { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; + } + > svg > path { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; + } + + &:disabled { + cursor: default; + :hover { + background-color: transparent; + } + } + + &:hover { + background: ${e=>e.theme.isNightMode?"#333":"#f8f8f8"}; + } +`,Vv=eL.default.button.withConfig({displayName:"styled__ToolbarButton",componentId:"sc-976e8354-1"})` + padding: 0; + border-radius: 5px; + border: 0; + cursor: pointer; + color: ${e=>e.theme.appColors.hex(10)}; + + &:disabled { + cursor: default; + :hover { + background-color: transparent; + } + } + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + :focus { + outline: none; + } +`,Vk=eL.default.span.withConfig({displayName:"styled__HighlightButtonVisual",componentId:"sc-976e8354-2"})` + background: ${e=>e.bgColor}; + ${e=>e.$selected&&(0,eL.css)` + box-shadow: 0 0 0 1px black, 0 0 0 3px white; + `} + border-radius: 50px; + width: 22px; + height: 22px; + align-self: center; + transition: all ease-in-out 0.2s; +`,VE=(0,eL.default)(Cg).withConfig({displayName:"styled__HighlightButton",componentId:"sc-976e8354-3"})` + display: flex; + justify-content: center; + width: 30px; + height: 34px; + margin-right: 1px; + cursor: pointer; + + &:disabled { + opacity: 0.2; + cursor: default; + &:hover { + background: none; + + & > ${Vk} { + transform: scale(1); + } + } + } + + &:hover, + &.active { + background: transparent; + & > ${Vk} { + transform: scale(1.15); + } + } +`,Vx=eL.default.div.withConfig({displayName:"styled__StyledMenuIconWrapper",componentId:"sc-976e8354-4"})` + display: flex; + align-items: center; + justify-content: center; + color: #fff; + + & svg { + flex-shrink: 0; + } +`,V_=(0,eL.default)(Vx).withConfig({displayName:"styled__StyledCaretIconWrapper",componentId:"sc-976e8354-5"})` + display: flex; + align-items: center; + margin-left: 6px; +`,Vw=eL.default.div.withConfig({displayName:"styled__StyledIconWrapper",componentId:"sc-976e8354-6"})` + display: flex; + align-items: center; + justify-content: center; + transform: var(--menu-item-icon-scale); + + margin-right: var(--menu-item-gap); + color: ${e=>e.theme.appColors.hex(10)}; +`,VN=function(e){let{color:t,selected:a,disabled:n,onHighlight:l}=e,r=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault()},[]),o=ev.useCallback(()=>{l(t)},[t,l]);return ev.createElement(VE,{disabled:n,onMouseDown:r,onClick:o},ev.createElement(Vk,{bgColor:t,$selected:a}))},VC=eL.default.div.withConfig({displayName:"MoreHighlightColorsMenu__Wrapper",componentId:"sc-29d0a60c-0"})` + display: grid; + grid-template-columns: repeat(6, 1fr); + padding: 0px 8px 0px 8px; +`,VM=function(e){let{selectedIds:t,selectedColor:a,onSelect:n}=e,l=null==t,r=(0,e$.useDispatch)(),o=ev.useMemo(()=>{let e=[];for(let t of[90,80,70,60])for(let a of Pz.slice(0,6)){let n=(0,eI.getHslColorScale)(a);e.push(n.hex(t))}for(let t of[60,70,80,90])for(let a of(0,eo.makeReverseIterable)(Pz.slice(6,12))){let n=(0,eI.getHslColorScale)(a);e.push(n.hex(t))}return e},[]),i=ev.useCallback(e=>{l||("string"==typeof t?r(mj(t,"highlight",{colorName:e})):Array.isArray(t)&&r(Ds(t,"highlight",{colorName:e})),n?.())},[r,l,t,n]);return ev.createElement(VC,null,o.map(e=>ev.createElement(VN,{key:`${e}`,color:e,disabled:l,onHighlight:i,selected:a===e})))},VS=eL.default.button.withConfig({displayName:"MoreHighlightColorsMenuButton__StyledButton",componentId:"sc-95599520-0"})` + padding: 2px 6px 6px 6px; + background: none; + border-radius: 10px; + border: 0; + opacity: ${e=>e.disabled?"0.2":"1"}; + cursor: pointer; + > svg > g { + fill: ${e=>e.theme.appColors.hex(10)}; + } + > svg > path { + fill: ${e=>e.theme.appColors.hex(10)}; + } + ${e=>e.selected&&(0,eL.css)` + background-color: ${e.$isHoverMenu?"#333":e.theme.appColors.hex(70)}; + `} + &:disabled { + cursor: default; + :hover { + background-color: transparent; + } + } + + &:hover { + background: ${e=>e.$isHoverMenu?"#333":e.theme.appColors.hex(70)}; + } + + :focus { + outline: none; + } +`,VI=eL.default.div.withConfig({displayName:"MoreHighlightColorsMenuButton__HighlightIconName",componentId:"sc-95599520-1"})` + display: flex; + + & svg { + flex-shrink: 0; + transform: scale(1.2) translateY(1px); + box-shadow: 0 2px 0 0 + ${e=>null!=e.$selectedColor?e.$selectedColor:"#fff599"}; + path { + stroke: none; + fill: ${e=>e.$isHoverMenu?"#e5e5e5":e.theme.appColors.hex(10)}; + } + } +`,VD=(0,eL.default)(eI.Menu).withConfig({displayName:"MoreHighlightColorsMenuButton__StyledMenu",componentId:"sc-95599520-2"})` + display: flex; + flex-direction: column; + width: inherit; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + max-width: 280px; + background: ${e=>e.$isHoverMenu?"rgba(0,0,0,0.9)":e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid + ${e=>e.$isHoverMenu?"rgba(0,0,0,0.9)":e.theme.isNightMode?"#262A2D":"#e5e5e5"}; +`,VT=function(e){let{selectedIds:t,isHoverMenu:a,selectedColor:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"top"}),d=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),[c,m]=ev.useState(!1),u=ev.useRef(null),p=ev.useRef(null),{arrowProps:g,popperProps:f,referenceProps:h}=(0,eI.useControlledTooltip)({referenceElementRef:o,arrowElementRef:u,popperElementRef:p,placement:"top",visible:c}),y=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault()},b=d.props.onClick,v=ev.useCallback(e=>{b(e)},[b]);return ev.createElement(ev.Fragment,null,ev.createElement(VS,{...d.props,selected:l.expanded,$isHoverMenu:a,onClick:v,onMouseDown:y,...h,onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)}},ev.createElement(VI,{$isHoverMenu:a,$selectedColor:n},ev.createElement(tn.Icon,{className:"highlight",icon:"dd_highlight"}))),l.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:r,modal:!0,onBackdropMouseDown:y},ev.createElement(VD,{isSubmenu:!0,$isHoverMenu:a},ev.createElement(VM,{selectedIds:t,selectedColor:n}))),c&&ev.createElement(eI.Tooltip,{arrowProps:g,popperProps:f},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.highlight_colors",defaultMessage:"Highlight Colors"}))))},V$={blue:(0,te.Em)({id:"general.highlight_blue",defaultMessage:"Highlight Blue"}),green:(0,te.Em)({id:"general.highlight_green",defaultMessage:"Highlight Green"}),purple:(0,te.Em)({id:"general.highlight_purple",defaultMessage:"Highlight Purple"}),red:(0,te.Em)({id:"general.highlight_red",defaultMessage:"Highlight Red"}),yellow:(0,te.Em)({id:"general.highlight_yellow",defaultMessage:"Highlight Yellow"})},VP=function(e){let{highlightColor:t,disabled:a,onHighlight:n}=e,l=(0,eI.getHslColorScale)(t).hex("80"),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),[s,d]=ev.useState(!1),{arrowProps:c,popperProps:m,referenceProps:u}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"top",visible:s});return ev.createElement(ev.Fragment,null,ev.createElement(VE,{...u,disabled:a,onClick:()=>{n(l)},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault()},onMouseEnter:()=>{a||d(!0)},onMouseLeave:()=>{d(!1)}},ev.createElement(Vk,{bgColor:l})),s&&ev.createElement(eI.Tooltip,{arrowProps:c,popperProps:m},ev.createElement(IN,null,ev.createElement(eY.Z,V$[t]),ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"E")))))},VF=eL.default.div.withConfig({displayName:"OriginalHighlightColorsMenu__Wrapper",componentId:"sc-bb7ac2b7-0"})` + display: inline-flex; + align-items: center; + margin-right: 5px; + flex-direction: inherit; +`,VA=function(e){let{selectedIds:t}=e,a=null==t,n=(0,e$.useDispatch)(),l=ev.useCallback(e=>{!a&&("string"==typeof t?n(mj(t,"highlight",{colorName:e})):Array.isArray(t)&&n(Ds(t,"highlight",{colorName:e})))},[a,n,t]);return ev.createElement(VF,null,PB.map(e=>ev.createElement(VP,{key:e,highlightColor:e,disabled:a,onHighlight:l})))};function VR(e,t){let a=e=>{if(null==e.id)return e;let n=t?.[e.id];return(0,es.ZP)(e,e=>{if(e.children=e.children.map(a),null==n)return e;null==e.attributes&&(e.attributes={});let t=n.assignees?.attachments;if(null!=t){let a={};for(let e of t)if(e.data?.assignee?.id!=null){let t=`${e.data.assignee.id}`;a[t]={type:"user",id:t}}e.attributes._assignees=a}let l=n.dates?.attachments;if(null!=l&&l.length>0){let t=l[0].addonDate;if(null!=t.start){let a={start:t.start};null!=t.end&&(a.end=t.end),null!=t.reminders&&(a.reminders=t.reminders),"recurrence"in t&&null!=t.recurrence.rruleSet&&(a.recurrence={...t.recurrence,rruleSet:[t.recurrence.rruleSet.join("\n")]}),e.attributes._dueDate=a}}let r=n.media?.attachments;if(null!=r){let t=[];for(let e of r)switch(e.data.type){case"embed":t.push({type:e.data.type,embed:{url:e.data.embed.data.url}});break;case"file":t.push({type:e.data.type,file:{type:"@taskade/attachment",id:e.id}})}e.attributes._media=t}return e})};return(0,es.ZP)(e,e=>(e.children=e.children.map(a),e))}function Vj(e){return(t,a)=>{let n=a(),l=iL(n),r=iF(n),o=l.extractFragment(e),i=dP(n),s=dO(n);return null!=i&&null!=s&&(o.project={id:i,revision:s}),o=VR(o,r)}}let VO=eL.default.button.withConfig({displayName:"HoverBaseButton__StyledButton",componentId:"sc-aa51ccb1-0"})` + z-index: 1; + padding: 0; + background-color: ${e=>e.$selected?"rgba(255, 255, 255, 0.2)":"transparent"}; + border-radius: 4px; + border: 0; + cursor: pointer; + > svg > g { + fill: #ffffff; + } + > svg > path { + fill: #ffffff; + } + > svg > rect { + fill: #ffffff; + stroke: #ffffff; + } + + :hover { + background-color: rgba(255, 255, 255, 0.2); + } + + :focus { + outline: none; + } +`,VU=function(e){let{selected:t,className:a,onMouseDown:n,children:l,tooltipMessage:r,suffix:o}=e,{arrowProps:i,popperProps:s,referenceProps:d,visible:c,setVisible:m}=(0,eI.useTooltip)({placement:"top"});return ev.createElement(ev.Fragment,null,ev.createElement(VO,{$selected:t,className:a,...d,onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onMouseDown:n},l),c&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(IN,null,r,o)))},VZ=eL.default.button.withConfig({displayName:"HoverLinkButton__StyledButton",componentId:"sc-9d40e686-0"})` + z-index: 1; + padding: 0; + background-color: ${e=>e.$selected?"rgba(255, 255, 255, 0.2)":"transparent"}; + border-radius: 4px; + border: 0; + cursor: pointer; + > svg path { + stroke: #ffffff; + } + + :hover { + background-color: rgba(255, 255, 255, 0.2); + } + + :focus { + outline: none; + } +`,VL=function(e){let{selected:t,className:a,onMouseDown:n,children:l,tooltipMessage:r,suffix:o}=e,{arrowProps:i,popperProps:s,referenceProps:d,visible:c,setVisible:m}=(0,eI.useTooltip)({placement:"top"});return ev.createElement(ev.Fragment,null,ev.createElement(VZ,{$selected:t,className:a,...d,onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onMouseDown:n},l),c&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(IN,null,r,o)))},VB=eL.default.div.withConfig({displayName:"HoverMenu__Menu",componentId:"sc-2c63472f-0"})` + padding: 5px 12px; + background-color: rgba(0, 0, 0, 0.9); + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + border-radius: 10px; +`,Vz=eL.default.div.withConfig({displayName:"HoverMenu__Caret",componentId:"sc-2c63472f-1"})` + position: relative; + bottom: 5px; + height: 10px; + width: 10px; + transform: rotate(45deg); + background-color: rgba(0, 0, 0, 0.9); +`,VV=eL.default.div.withConfig({displayName:"HoverMenu__CaretMenuWrapper",componentId:"sc-2c63472f-2"})` + position: absolute; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + pointer-events: auto; +`,Vq=eL.default.div.withConfig({displayName:"HoverMenu__IndentButtonWrapper",componentId:"sc-2c63472f-3"})` + display: flex; + flex-direction: row; + > button { + margin-right: 2px; + } + > :last-child { + margin-right: 0; + } +`,VW=(0,eL.default)(Vq).withConfig({displayName:"HoverMenu__StyleButtonWrapper",componentId:"sc-2c63472f-4"})` + margin: 0 12px; + + > :last-child { + margin-left: 12px; + } +`,VH=function(e){let{style:t}=e,a=(0,eK.Z)(),n=(0,e$.useDispatch)(),l=(0,eB.a)(sW),r=l.data?.me,o=t?.menuLeft??"0",i=t?.menuTop??"0",s=t?.caretLeft??"0",d=function(t,a){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.preventDefault();let{nodeID:l,toggleMark:r}=e;eu()(l)||eu()(r)||r(l,a,n)},c=ev.useCallback(()=>{if(null==e.documentId||null==e.nodeID)return;if(null==r){n(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!1}));return}let t=n(Vj([e.nodeID]));if(0===t.children.length)return;let a=t.children[0],l=(0,lD.textDeltaToString)(a.text);n(DT.actions.toggleAiAssistantDialog({nodeId:e.nodeID,nodeText:l,projectId:e.documentId}))},[r,n,e.documentId,e.nodeID]),m=ev.useCallback(()=>{if(null==e.documentId||null==e.nodeID)return;if(null==r){n(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!1}));return}let t=n(Vj([e.nodeID]));if(0===t.children.length)return;let a=t.children[0],l=(0,lD.textDeltaToString)(a.text);n(DT.actions.toggleAiAssistantDialog({nodeId:e.nodeID,nodeText:l,projectId:e.documentId,shouldShowCustomAgentOptions:!0}))},[r,n,e.documentId,e.nodeID]);return ev.createElement(VV,{id:`hover-menu-${e.nodeID}`,style:{left:o,top:i}},ev.createElement(VB,null,ev.createElement(Vq,null,ev.createElement(VU,{onMouseDown:t=>{t.preventDefault();let{nodeID:a,outdentNode:n}=e;eu()(a)||eu()(n)||n(a)},tooltipMessage:a.formatMessage({id:"general.unindent",defaultMessage:"Unindent"}),suffix:ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.Shift),ev.createElement(eI.Shortcut.Key,null,"Tab"))},ev.createElement(lT.sB,null)),ev.createElement(VU,{onMouseDown:t=>{t.preventDefault();let{nodeID:a,indentNode:n}=e;eu()(a)||eu()(n)||n(a)},tooltipMessage:a.formatMessage({id:"general.indent",defaultMessage:"Indent"}),suffix:ev.createElement(eI.Shortcut.Key,{alwaysDark:!0},"Tab")},ev.createElement(lT.KJ,null))),ev.createElement(VW,null,ev.createElement(VU,{selected:e.bold,onMouseDown:e=>{d(e,"bold")},tooltipMessage:a.formatMessage({id:"general.bold",defaultMessage:"Bold"}),suffix:ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"B"))},ev.createElement(lT.X4,null)),ev.createElement(VU,{selected:e.italic,onMouseDown:e=>{d(e,"italic")},tooltipMessage:a.formatMessage({id:"general.italic",defaultMessage:"Italic"}),suffix:ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"I"))},ev.createElement(lT.vE,null)),ev.createElement(VU,{selected:e.underline,onMouseDown:e=>{d(e,"underline")},tooltipMessage:a.formatMessage({id:"general.underline",defaultMessage:"Underline"}),suffix:ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"U"))},ev.createElement(lT.cd,null)),ev.createElement(VL,{onMouseDown:t=>{t.preventDefault();let{addLink:a}=e;a?.()},tooltipMessage:a.formatMessage({id:"general.hyperlink",defaultMessage:"Add hyperlink"}),suffix:ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.Shift),ev.createElement(eI.Shortcut.Key,null,"L"))},ev.createElement(lT.EN,null))),ev.createElement(VA,{selectedIds:e.nodeID}),ev.createElement(VT,{selectedIds:e.nodeID,isHoverMenu:!0,selectedColor:e.highlight}),ev.createElement("div",{className:"ml-2 flex gap-1"},ev.createElement("button",{className:"relative flex h-7.5 items-center justify-center rounded-lg px-2 hover:bg-appcolor-200",onMouseDown:m},ev.createElement("div",{className:"flex animate-color-rainbow items-center gap-2 text-sm"},ev.createElement(tn.Icon,{className:"flex items-start",icon:"dd_ai"}),ev.createElement(eY.Z,{id:"general.ai_agent",defaultMessage:"AI Agent"}))),ev.createElement("button",{className:"relative flex h-7.5 items-center justify-center rounded-lg px-2 hover:bg-appcolor-200",onMouseDown:c},ev.createElement("div",{className:"flex animate-color-rainbow items-center gap-2 text-sm"},ev.createElement(tn.Icon,{className:"flex items-start",icon:"dd_ai_spark"}))))),ev.createElement(Vz,{style:{left:s}}))},VG=(0,lb.C)({context:{nodeID:void 0,url:void 0,style:void 0,selection:void 0},tsTypes:{},schema:{context:{},events:{}},id:"hoverMenu",initial:"blur",states:{blur:{on:{TRANSIT:{target:"#hoverMenu.transition"}}},transition:{on:{FOCUS:{target:"#hoverMenu.active"}}},active:{on:{BLUR:{target:"#hoverMenu.blur"},PREVIEW:{actions:"addlink",target:"#hoverMenu.link"}}},link:{initial:"transition",states:{transition:{},editing:{},deleting:{},error:{on:{TYPING:{actions:"edit",target:"#hoverMenu.link.editing"}}}},on:{EDIT:{actions:"edit",target:"#hoverMenu.link.editing"},DELETE:{target:"#hoverMenu.link.deleting"},BLUR:{target:"#hoverMenu.blur"},ERROR:{actions:"error",target:"#hoverMenu.link.error"}}}}},{actions:{addlink:(0,lv.assign)((e,t)=>t.payload),edit:(0,lv.assign)(e=>(0,es.ZP)(e,e=>(e.error=void 0,e))),error:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.payload.error,e)))}}),VK=function(e){let{primaryColor:t,isOpened:a,isMultiselecting:n,positionMenu:l,style:r,menuState:o,documentId:i}=e,s=(0,ev.useContext)(eI.LayersContext),d=(0,e$.useSelector)(e=>iV(e,{nodeID:o?.nodeID})),c=a&&!n,m=(0,ev.useMemo)(()=>eu()(t)?void 0:{primaryColor:t},[t]),[u,p]=(0,ls.e)(VG),g=(0,ev.useCallback)(()=>{if(null==d)return;let e=d.marks,t="";for(let a of e)if("link"===a.type&&null!=a.data.get("url")){t=a.data.get("url");break}p({type:"PREVIEW",payload:{nodeID:o?.nodeID,url:t,style:r,selection:o?.selection}})},[o,d,p,r]),f=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),g()},[g]);switch((0,ev.useEffect)(()=>(c?p({type:"TRANSIT"}):u.matches("link")||p({type:"BLUR"}),uS().bind("mod+shift+l",f),()=>{uS().unbind("mod+shift+l")}),[p,c,u,f]),!0){case u.matches("transition"):return l(),p({type:"FOCUS"}),null;case u.matches("link.transition"):return p({type:"EDIT"}),null;case u.matches("active"):{let t=s?.overlay;if(null==t)return null;return ep.createPortal(ev.createElement(VH,{...e.menuState,documentId:i,style:r,toggleMark:e.toggleMark,indentNode:e.indentNode,outdentNode:e.outdentNode,addLink:g,highlight:null}),t)}case u.matches("link"):{let t=s?.overlay;if(null==t)return null;return ep.createPortal(ev.createElement(eI.ThemeProvider,{theme:m},ev.createElement(Vy,{...e.menuState,nodeID:u.context.nodeID,style:u.context.style,url:u.context.url,selection:u.context.selection,error:u.context.error,onInput:()=>{p({type:"TYPING"})},onInputBlur:()=>{p({type:"BLUR"})},onInputError:()=>{p({type:"ERROR",payload:{error:"validation"}})}})),t)}default:return null}};if(a(33827).Z){let{userAgent:e}=window.navigator;for(let t of[["edge",/Edge\/([0-9\._]+)/],["chrome",/(?!Chrom.*OPR)C(?:hrome|hromium|riOS)\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["android",/Android\s([0-9\.]+)/],["safari",/Version\/([0-9\._]+).*Safari/]]){let[a,l]=t;if(l.test(e)){n=a;break}}for(let t of[["ios",/os ([\.\_\d]+) like mac os/i],["macos",/mac os x/i],["android",/android/i],["firefoxos",/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],["windows",/windows\s*(?:nt)?\s*([\.\_\d]+)/i],["linux",/linux/i]]){let[a,n]=t;if(n.test(e)){l=a;break}}}let VY="firefox"===n,VQ="safari"===n,VJ="ios"===l||"android"===l;function VX(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.is;return function(a,n){if(Object.is(a,n))return!0;if("object"!=typeof a||null===a||"object"!=typeof n||null===n)return!1;let l=Object.keys(a),r=Object.keys(n);if(l.length!==r.length)return!1;for(let r of l){let l=e[r]??t;if(!Object.prototype.hasOwnProperty.call(n,r)||!l(a[r],n[r]))return!1}return!0}}class V0 extends ev.Component{static propTypes={menuState:l7().shape({nodeID:l7().string.isRequired,bold:l7().bool.isRequired,italic:l7().bool.isRequired,underline:l7().bool.isRequired,highlight:l7().string.isRequired,selection:l7().shape({end:l7().number.isRequired,start:l7().number.isRequired}).isRequired}),selectingItems:l7().instanceOf(tz.OrderedSet).isRequired,selectedItems:l7().instanceOf(tz.OrderedSet).isRequired,isSelecting:l7().bool.isRequired,indentNode:l7().func.isRequired,outdentNode:l7().func.isRequired,toggleMark:l7().func.isRequired,doc:l7().shape({space:l7().shape({color:l7().string})}),documentId:l7().string};static defaultProps={menuState:null};constructor(e){super(e),this.state={style:void 0}}componentDidMount(){let e=gt();eu()(e)||e.addEventListener("resize",this.positionMenu),eu()(ec()(this.props,["menuState","nodeID"]))||this.positionMenu()}componentDidUpdate(e){(ge(e,this.props,["menuState","nodeID"])||ge(e,this.props,["menuState","selection","start"])||ge(e,this.props,["menuState","selection","end"]))&&this.positionMenu()}componentWillUnmount(){let e=gt();eu()(e)||e.removeEventListener("resize",this.positionMenu)}calculateMenuPosition=()=>{let{menuState:e}=this.props;if(eu()(e))return;let t=function(){if("undefined"!=typeof document)return document}(),a=gt();if(eu()(t)||eu()(a))return;let n=a.getSelection();if(eu()(n)||0===n.rangeCount)return;let l=t.getElementById(`hover-menu-${e.nodeID}`);if(eu()(l))return;let r=n.getRangeAt(0).getBoundingClientRect(),{offsetHeight:o,offsetWidth:i}=l,s=0,d=Math.round(r.left+a.scrollX-i/2+r.width/2),c=Math.round(VJ?r.bottom+a.scrollY:r.top+a.scrollY-o);return i/2+10>r.left+r.width/2&&(d=10,s=r.left-i/2+r.width/2-10),i/2+r.right-r.width/2>a.innerWidth-10&&(d=a.innerWidth-i-10,s=r.right+i/2-a.innerWidth-r.width/2+10),{menuLeft:`${d}px`,inputMenuLeft:`${d+80}px`,menuTop:`${c}px`,caretLeft:`${s}px`}};positionMenu=()=>{this.setState(()=>({style:this.calculateMenuPosition()}))};render(){let{doc:e,documentId:t,isSelecting:a}=this.props,n=null!=this.props.menuState&&!a,l=n&&(!this.props.selectingItems.isEmpty()||!this.props.selectedItems.isEmpty());return ev.createElement(VK,{primaryColor:e?.space?.color,documentId:t,positionMenu:this.positionMenu,style:this.state.style,menuState:this.props.menuState,isOpened:n,isMultiselecting:l,toggleMark:this.props.toggleMark,indentNode:this.props.indentNode,outdentNode:this.props.outdentNode})}}let V1=VX({doc:function(e,t){return e?.space?.color===t?.space?.color}}),V2=(0,ek.qC)(Vm(),(0,e$.connect)(function(e,t){return{doc:dV(e,t),menuState:i8(e)}},function(e){return(0,ek.DE)({indentNode:m$,outdentNode:mC,toggleMark:mj},e)},void 0,V1))(V0),V5="user",V3="project",V4=(0,la.ZP)` + query AutocompleteProjects($query: String!) { + allProjects(filterby: { query: $query }, first: 10) { + edges { + cursor + node { + id + info + view_path + shared_preferences + } + } + } + } +`,V6=(0,eL.default)(tn.Icon).attrs({icon:"dd_project"}).withConfig({displayName:"ProjectIcon__DefaultProjectIcon",componentId:"sc-ae880d49-0"})` + align-self: center; + margin-right: 12px; + display: flex; + flex-shrink: 0; + align-self: flex-start; + transform: var(--menu-item-icon-scale); + margin-right: var(--menu-item-gap); +`,V8=eL.default.div.withConfig({displayName:"ProjectIcon__EmojiWrapper",componentId:"sc-ae880d49-1"})` + display: flex; + width: 20px; + height: 20px; + justify-content: center; + font-size: 16px; + line-height: 21px; + margin-right: var(--menu-item-gap); + align-self: flex-start; +`,V7=function(e){let{project:t}=e,a=nQ(t);return ev.createElement(ev.Fragment,null,null!=a?ev.createElement(V8,null,a):ev.createElement(V6,null))},V9=eL.default.div.withConfig({displayName:"Project__Container",componentId:"sc-289bf347-0"})` + display: flex; + align-items: center; + padding: var(--menu-item-padding); + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.md}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,qe=eL.default.span.withConfig({displayName:"Project__Title",componentId:"sc-289bf347-1"})` + color: ${e=>e.theme.textColors.hex(e.$isUntitled?60:10)}; + ${e1.UiTypography.sm}; +`,qt=function(e){let{morseChildProps:t}=e,a=t.data,n=ev.useRef(null);ev.useEffect(()=>{t.focused&&n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]);let l=null==a.info.title||0===a.info.title.length;return ev.createElement(V9,{ref:n,$active:t.focused,onClick:t.activate},ev.createElement(V7,{project:a}),ev.createElement(qe,{$isUntitled:l},a.info.title||"Untitled"))},qa=eL.default.div.withConfig({displayName:"User__Container",componentId:"sc-66b753a8-0"})` + display: flex; + align-items: center; + padding: var(--menu-item-padding); + gap: calc(var(--menu-item-gap) + 2px); + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,qn=eL.default.div.withConfig({displayName:"User__NameContainer",componentId:"sc-66b753a8-1"})` + display: -webkit-inline-box; + text-overflow: ellipsis; + white-space: pre-wrap; + overflow-wrap: break-word; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-height: 20px; + color: ${e=>e.theme.textColors.hex(40)}; +`,ql=eL.default.span.withConfig({displayName:"User__Handle",componentId:"sc-66b753a8-2"})` + margin-right: 5px; + color: ${e=>e.theme.textColors.hex(10)}; +`,qr=eL.default.span.withConfig({displayName:"User__DisplayName",componentId:"sc-66b753a8-3"})` + ${e1.UiTypography.sm}; +`,qo=function(e){let{morseChildProps:t}=e,a=t.data,n=ev.useRef(null);return ev.useEffect(()=>{t.focused&&n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(qa,{ref:n,$active:t.focused,onClick:t.activate},ev.createElement(ao,{avatars_v2:a.avatars_v2,handle:a.handle,userID:parseInt(a.id,10),size:16,presenceSize:4}),ev.createElement(qn,null,ev.createElement(ql,null,a.handle),ev.createElement(qr,null,a.display_name)))},qi="ProjectMemberItem",qs="ProjectItem",qd={[qi]:e=>ev.createElement(qo,{morseChildProps:e}),[qs]:e=>ev.createElement(qt,{morseChildProps:e})},qc=(0,la.ZP)` + query AutocompleteDocumentsAndMembersQuery($documentID: ID!) { + document(id: $documentID) { + id + space { + id + memberships { + id + user { + ...BasicUserFields + } + } + documents_v2(first: 20, orderby: { sort: "recent", direction: "desc" }) { + edges { + cursor + node { + id + info + view_path + shared_preferences + } + } + } + } + members( + first: 10 + filterby: { roles: ["owner", "maintainer", "collaborator", "participant", "viewer"] } + ) { + edges { + node { + ...ProjectMemberParts + } + } + } + } + } + ${up} + ${yC} +`,qm=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-4bd42977-0"})` + width: 380px; + display: flex; + flex-direction: column; + + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; +`,qu=eL.default.div.withConfig({displayName:"styled__ScrollbarWrapper",componentId:"sc-4bd42977-1"})` + max-height: calc(100vh / 2); + overflow-y: auto; + pointer-events: auto; + cursor: pointer; + ${tM} +`,qp=eL.default.p.withConfig({displayName:"styled__Hint",componentId:"sc-4bd42977-2"})` + padding: 0.5rem 1rem 0; + margin: 5px 0; + color: ${e=>e.theme.textColors.hex(60)}; + + ${e1.UiTypography.sm}; +`,qg=eL.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-4bd42977-3"})` + width: 100%; + background: ${e=>e.theme.appColors.hex(70)}; + height: 1px; + margin: 4.5px 0px 0px; +`,qf=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),qh=ev.forwardRef(function(e,t){let{projectId:a,nodeId:n,query:l,cancelCommandMonitor:r}=e,o=ev.useRef(null),i=ev.useCallback(e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r()}},[r]);ev.useImperativeHandle(t,()=>({handleKeyDownCapture:i}));let s=function(e,t){let a=(0,eK.Z)(),{data:n}=(0,eB.a)(qc,{variables:{documentID:e},skip:null==e}),l=ev.useMemo(()=>{if(null==n)return[];let e=new Map;for(let t of n.document?.members?.edges??[])null!=t.node&&e.set(t.node.user.id,t.node.user);for(let t of n.document?.space?.memberships??[])e.set(t.user.id,t.user);return[...e.values()]},[n]),r=ev.useMemo(()=>{let e=a.formatMessage({id:"general.users",defaultMessage:"Users"});return{type:"section",label:e,items:l.map(t=>{let a=[e,t.handle];return null!=t.display_name&&a.push(t.display_name),{itemType:V5,label:t.handle,values:a,render:qi,data:t}})}},[a,l]),o=ev.useMemo(()=>(n?.document?.space?.documents_v2.edges??[]).map(e=>e.node).filter(e=>null!=e),[n]),i=ev.useMemo(()=>{let e=a.formatMessage({id:"general.recent_projects",defaultMessage:"Recent Projects"});return{type:"section",label:e,items:(0===t.length?o:[]).map(t=>{let a=t.info.title||"Untitled";return{itemType:V3,label:a,values:[e,a],render:qs,data:t}})}},[a,t,o]);return ev.useMemo(()=>[r,i],[r,i])}(a,l.value),d=function(e,t,a){let n=(0,e$.useDispatch)();return ev.useCallback(l=>{switch(l.itemType){case V5:n({type:c8,payload:{nodeID:e,handle:l.data.handle,range:t.selection}}),a();break;case V3:n({type:c6,payload:{nodeID:e,projectTitle:function(e){let t=e.data.info.title||"Untitled",a=nQ(e.data);return null==a?t:`${a} ${t}`}(l),data:{url:new URL(`/d/${l.data.id}`,"https://www.taskade.com").toString()},range:t.selection}}),a()}},[n,e,t.selection,a])}(n,l,r),c=function(){let e=(0,eK.Z)(),t=(0,ll.x)();return ev.useCallback(async a=>{let{data:n}=await t.query({query:V4,variables:{query:a}}),l=(n?.allProjects?.edges??[]).map(e=>e.node).filter(e=>null!=e),r=e.formatMessage({id:"general.projects",defaultMessage:"Projects"});return[{type:"section",label:r,items:l.map(e=>{let t=e.info.title||"Untitled";return{itemType:V3,label:t,values:[r,t],render:qs,data:e}})}]},[t,e])}();return ev.useEffect(()=>{let e=l.value;if(e.length>=2){let t=e[e.length-1],a=e[e.length-2];if(" "===t&&" "===a){r();return}}if(e.length>=25){r();return}},[r,l.value]),ev.createElement(qm,{onMouseDown:e=>{e.preventDefault()}},ev.createElement(qp,null,ev.createElement(eY.Z,{id:"general.mention_people_projects",defaultMessage:"Mention people or projects..."})),ev.createElement(qg,null),ev.createElement(qu,null,ev.createElement(tT,{ref:o,data:s,term:l.value,search:qf,renderMap:qd,onActivate:d,generate:c})))}),qy=function(e){let{children:t,query:a}=e,n=ev.useRef(null),[l]=ev.useState(()=>({getBoundingClientRect:()=>n.current?.getBoundingClientRect()??DOMRect.fromRect()})),r=ev.useRef(l),o=ev.useRef(null),i=(0,eI.usePopper)({referenceElementRef:r,popperElementRef:o,visible:!0,placement:"bottom-start"}),s=ev.useMemo(()=>{if(null==i.state)return{ref:o,style:{visibility:"hidden"}};let{attributes:e,styles:t}=i.state;return{...e.popper,ref:o,style:t.popper}},[i.state]);ev.useEffect(()=>{let e=(0,RV.zg)(a.selection);n.current=e,i.instanceRef.current?.forceUpdate()},[i.instanceRef,a.selection]);let d=ev.useContext(eI.LayersContext),c=d?.overlay??("undefined"!=typeof document?document.body:void 0);return null==c?null:ep.createPortal(ev.createElement("div",s,t),c)},qb=(e,t)=>new to.Z(t,{keys:["values"],threshold:.3}).search(e).map(e=>e.item);function qv(e){return{type:"fragment",children:[{type:"text",format:{node:li.FORMAT_HEADING1},text:{ops:[{insert:"Title"},{insert:"\n",attributes:{paragraph:!0}}]},children:[{type:"text",format:{node:e},text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},children:[]},{type:"text",format:{node:e},text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},children:[]},{type:"text",format:{node:e},text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},children:[]}]}]}}function qk(e,t,a){return function(n,l){let r=l();if(null==t){let{contents:a}=r,n=a.findParentNodeByID(e);if(null==n)return;t=n.id}let o=r.contents.getIn(["nodes",e,"format"]),i={type:"fragment",children:[{type:"text",text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},format:o?.toJS(),children:[]}]};n(!0===a?Da({id:e,parentId:t,position:"beforebegin"},i):Da({id:e,parentId:t,position:"afterend"},i))}}function qE(e,t){return(a,n)=>{let l=n(),r=dV(l),o=t7(l),i=iA(l,{nodeID:e});if(null==o){a(rh({isOpen:!0,activeView:rI}));return}if(null==r){a(Fd());return}let s=r?.id;if(null==s)return;if(t.isPaywallEnabled){a(d4(t.id));return}let d=(i?.media?.total??0)+(i?.media?.uploadingAttachments?.length??0);if(d>=12){a((0,l3.error)({uid:"attachment-upload-error",message:m4,position:"tc",autoDismiss:8,dismissible:!1}));return}let c=t.taskadePlanType??"free",m=fR.Vl.getFeature("upload.size");(0,ei.assert)("GB"===m.unit);let u=1e3*m.plans[c]*1048576;a(uN.actions.toggleCloudUploadDialog({documentId:s,nodeId:e,restrictions:{allowedFileTypes:Ba,maxFileSize:u,maxNumberOfFiles:12-d},uploadType:D.AddonFile}))}}function qx(e){return(t,a)=>{let n=a(),l=dV(n);if(null==t7(n)){t(rh({isOpen:!0,activeView:rI}));return}if(null==l){t(Fd());return}t($L({documentID:l.id,nodeID:e}))}}function q_(e){return(t,a)=>{let n=a(),l=dV(n);if(null==t7(n)){t(rh({isOpen:!0,activeView:rI}));return}if(null==l){t(Fd());return}t(Zl.actions.toggleEmbedModalDialog({documentID:l.id,nodeID:e}))}}let qw="date",qN="date_suggestion",qC="assign",qM="addons",qS="upload",qI="format",qD="highlight",qT="add_block",q$="reaction",qP="timer",qF="action",qA="sort",qR="space_agent",qj="create_space_agent",qO=(0,la.ZP)` + mutation ProjectNodesCountdownUpdateMutation($input: ProjectNodesCountdownUpdateInput!) { + projectNodesCountdownUpdate(input: $input) { + clientMutationId + ok + } + } +`,qU=(0,la.ZP)` + mutation ($input: ProjectNodesReactionUpdateInput!) { + projectNodesReactionUpdate(input: $input) { + clientMutationId + } + } +`;var qZ=a(46178);function qL(e){return"native"in e}let qB=eL.default.div.withConfig({displayName:"GenericItem__Wrapper",componentId:"sc-313f4f2c-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,qz=function(e){let{morseChildProps:t,icon:a,color:n}=e,l=ev.useRef(null);return ev.useEffect(()=>{t.focused&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(qB,{ref:l,$active:t.focused,onClick:t.activate,$color:n},ev.createElement(tn.Icon,{icon:a}),t.label)},qV={add_task_above:"dd_add_above",add_task_below:"dd_add_below",check:"dd_check",check_all:"dd_checkall",copy_link:"dd_copylink",delete:"dd_delete",duplicate:"dd_duplicate",add_note:"dd_note"},qq=function(e){let{morseChildProps:t}=e,a=qV[t.data]??"dd_duplicate",n="delete"===t.data?eI.ThemeColors.danger:void 0;return ev.createElement(qz,{icon:a,morseChildProps:t,color:n})},qW=function(e){let{morseChildProps:t}=e,{agentId:a}=t.data,n=(0,e$.useDispatch)(),l=ev.useRef(null);return ev.useEffect(()=>{t.focused&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:l,className:og()("group flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":t.focused}),onClick:t.activate},ev.createElement(tn.Icon,{className:"shrink-0 scale-80",icon:"dd_ai"}),ev.createElement("div",{className:"flex items-center"},t.label),ev.createElement("button",{className:"ml-auto text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),n(TS.actions.toggleEditSpaceAgentDialog({agentId:a,tab:"commands"}))}},ev.createElement(tn.Icon,{className:"scale-80 opacity-0 group-hover:opacity-100",icon:"agent_edit"})))},qH=eL.default.div.withConfig({displayName:"AiItem__Wrapper",componentId:"sc-4ae4f12b-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,qG={rewrite:"dd_ai_rewrite",expand:"dd_ai_expand",summarize:"dd_ai_summarize",ask:"dd_ai_ask"},qK=function(e){let{morseChildProps:t}=e,{type:a,agentBadge:n}=t.data,l=ev.useMemo(()=>null!=a&&a in qG?qG[a]:"dd_ai",[a]),r=ev.useRef(null);return ev.useEffect(()=>{t.focused&&r.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(qH,{ref:r,$active:t.focused,onClick:t.activate},ev.createElement(tn.Icon,{icon:l}),ev.createElement("div",{className:"flex items-center"},t.label,n&&ev.createElement("span",{className:"ml-1.5 rounded-xl border border-appcolor-400 bg-appcolor-0 px-2 py-0.5 text-2xs font-medium uppercase text-textcolor-600"},ev.createElement(eY.Z,{id:"general.agent",defaultMessage:"AI Agent"}))))},qY=eL.default.div.withConfig({displayName:"AssigneeItem__Wrapper",componentId:"sc-c03e477c-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + min-height: 28px; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,qQ=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"AssigneeItem__CheckIcon",componentId:"sc-c03e477c-1"})` + min-width: 20px; + margin-left: auto; +`,qJ=eL.default.span.withConfig({displayName:"AssigneeItem__AssigneeName",componentId:"sc-c03e477c-2"})` + margin-left: 4px; +`,qX=eL.default.span.withConfig({displayName:"AssigneeItem__NameSpan",componentId:"sc-c03e477c-3"})` + margin-left: -5px; + + font-size: 0.8rem; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + + color: ${e=>e.theme.appColors.hex(50)}; +`,q0=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]);let{user:n,isAssigned:l}=t.data;if(!(null!=n&&"object"==typeof n&&"__typename"in n&&"User"===n.__typename))return null;let r=parseInt(n.id,10);return ev.createElement(qY,{ref:a,$active:t.focused,onClick:t.activate},ev.createElement(ao,{avatars_v2:n.avatars_v2,handle:n.handle,userID:r,size:16,presenceSize:5}),ev.createElement(qJ,null,n.handle),ev.createElement(qX,null,n.default_name),l&&ev.createElement(qQ,null))},q1=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{className:og()("flex items-center gap-x-[var(--menu-item-gap)] p-[var(--menu-item-padding)] text-sm text-textcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200",t.focused&&"bg-appcolor-200"),ref:a,onClick:t.activate},ev.createElement(tn.Icon,{icon:"dd_ai",className:"scale-80"}),ev.createElement("div",{className:"flex items-center"},t.label))},q2=eL.default.div.withConfig({displayName:"DateSuggestionIten__Wrapper",componentId:"sc-badebe8-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,q5=function(e){let{morseChildProps:t,icon:a,color:n}=e,l=ev.useRef(null);return ev.useEffect(()=>{t.focused&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(q2,{ref:l,$active:t.focused,onClick:t.activate,$color:n},ev.createElement(tn.Icon,{icon:a}),t.label)},q3=eL.default.div.withConfig({displayName:"DueDateItem__Wrapper",componentId:"sc-9470bb22-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,q4=eL.default.span.withConfig({displayName:"DueDateItem__DateSpan",componentId:"sc-9470bb22-1"})` + margin-left: -5px; + font-size: 0.8rem; + color: ${e=>e.theme.appColors.hex(50)}; +`,q6=function(e){let{morseChildProps:t,icon:a,color:n}=e,l=ev.useRef(null);ev.useEffect(()=>{t.focused&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]);let r=ev.useMemo(()=>{if(null!=t.data)return cc()(t.data.start.date).format("MMMM D")},[t.data]);return ev.createElement(q3,{ref:l,$active:t.focused,onClick:t.activate,$color:n},ev.createElement(tn.Icon,{icon:a}),t.label,ev.createElement(q4,null," — ",r))},q8={[li.FORMAT_HEADING1]:(0,te.Em)({id:"general.large_heading",defaultMessage:"Large Heading"}),[li.FORMAT_HEADING2]:(0,te.Em)({id:"general.small_heading",defaultMessage:"Small Heading"}),[li.FORMAT_CHECKBOX]:(0,te.Em)({id:"general.square_checklist",defaultMessage:"Check 1"}),[li.FORMAT_CIRCLE_CHECK]:(0,te.Em)({id:"general.circle_checklist",defaultMessage:"Check 2"}),[li.FORMAT_HEART]:(0,te.Em)({id:"general.heart_checklist",defaultMessage:"Check 3"}),[li.FORMAT_BULLET]:(0,te.Em)({id:"general.circle_bulletlist",defaultMessage:"Bullet 1"}),[li.FORMAT_TRIANGLE]:(0,te.Em)({id:"general.triangle_bulletlist",defaultMessage:"Bullet 2"}),[li.FORMAT_SQUARE]:(0,te.Em)({id:"general.square_bulletlist",defaultMessage:"Bullet 3"}),[li.FORMAT_NUMBER]:(0,te.Em)({id:"general.number_orderedlist",defaultMessage:"Number"}),[li.FORMAT_ALPHA]:(0,te.Em)({id:"general.alpha_orderedlist",defaultMessage:"Letter"}),[li.FORMAT_TEXT]:(0,te.Em)({id:"general.paragraph",defaultMessage:"Paragraph"})},q7={[li.FORMAT_HEADING1]:"dd_format_heading1",[li.FORMAT_HEADING2]:"dd_format_heading2",[li.FORMAT_CHECKBOX]:"dd_format_check1",[li.FORMAT_CIRCLE_CHECK]:"dd_format_check2",[li.FORMAT_HEART]:"dd_format_check3",[li.FORMAT_BULLET]:"dd_format_bullet1",[li.FORMAT_TRIANGLE]:"dd_format_bullet2",[li.FORMAT_SQUARE]:"dd_format_bullet3",[li.FORMAT_TEXT]:"dd_format_paragraph",[li.FORMAT_NUMBER]:"dd_format_number",[li.FORMAT_ALPHA]:"dd_format_order"},q9=function(e){let{morseChildProps:t}=e,a=q7[t.data]??"dd_format_heading1";return ev.createElement(qz,{icon:a,morseChildProps:t})},We=eL.default.div.withConfig({displayName:"HighlightItem__Wrapper",componentId:"sc-df07af24-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + + color: ${e=>e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,Wt=(0,eL.default)(tn.Icon).attrs({icon:"dd_highlight"}).withConfig({displayName:"HighlightItem__StyledIcon",componentId:"sc-df07af24-1"})` + transform: var(--menu-item-icon-scale); + + box-shadow: 0 2px 0 0 ${e=>e.$color}; + path { + fill: ${e=>e.theme.appColors.hex(10)}; + } +`,Wa=function(e){let{morseChildProps:t}=e,a=(0,eI.getHslColorScale)(t.data).hex(80),n=ev.useRef(null);return ev.useEffect(()=>{t.focused&&n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(We,{ref:n,$active:t.focused,onClick:t.activate},ev.createElement(Wt,{icon:"dd_highlight",$color:a}),t.label)},Wn=eL.default.div.withConfig({displayName:"ReactionItem__Wrapper",componentId:"sc-6cd99058-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + + color: ${e=>e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,Wl=eL.default.div.withConfig({displayName:"ReactionItem__EmojiWrapper",componentId:"sc-6cd99058-1"})` + display: flex; + width: 20px; + height: 20px; + transform: var(--menu-item-icon-scale); +`,Wr=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]);let{data:n}=(0,eB.a)(TM),l=n?.me??null,r=l?.preferences?.emojiSkin??1;return ev.createElement(Wn,{ref:a,$active:t.focused,onClick:t.activate},ev.createElement(Wl,null,ev.createElement(go.dy,{size:18,emoji:t.data,skin:r})),t.data.name)},Wo={completed:"dd_check",uncompleted:"dd_unchecked",a_to_z:"dd_asc",z_to_a:"dd_desc",tag:"dd_tag",mention:"dd_mention",due_date:"dd_date"},Wi=function(e){let{morseChildProps:t}=e,a=Wo[t.data]??"dd_duplicate";return ev.createElement(qz,{icon:a,morseChildProps:t})},Ws=function(e){let{morseChildProps:t}=e;return ev.createElement(qz,{icon:"dd_timer",morseChildProps:t})},Wd=eL.default.div.withConfig({displayName:"UploadItem__Wrapper",componentId:"sc-922e056b-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,Wc={computer:"dd_upload",google_drive:"dd_upload_google_drive",dropbox:"dd_upload_dropbox",instagram:"dd_upload_instagram",box:"dd_upload_box"},Wm=function(e){let{morseChildProps:t}=e,{type:a,proBadge:n}=t.data,l=ev.useMemo(()=>null!=a&&a in Wc?Wc[a]:"dd_upload",[a]),r=ev.useRef(null);return ev.useEffect(()=>{t.focused&&r.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(Wd,{ref:r,$active:t.focused,onClick:t.activate},ev.createElement(tn.Icon,{icon:l}),ev.createElement("div",{className:"flex items-center"},t.label),n&&ev.createElement("div",{className:"flex flex-auto flex-row-reverse"},ev.createElement("span",{className:"flex"},ev.createElement(e1.UpgradeBadge,null))))},Wu="ActionItem",Wp="AssigneeItem",Wg="DateItem",Wf="DateSuggestionItem",Wh="CommentItem",Wy="EmbedItem",Wb="UploadItem",Wv="FormatItem",Wk="HighlightItem",WE="AddBlockItem",Wx="ReactionItem",W_="TimerItem",Ww="AiItem",WN="AgentCommandItem",WC="SortItem",WM="CreateSpaceAgentItem",WS="HideSection",WI={[Wu]:e=>ev.createElement(qq,{morseChildProps:e}),[Wp]:e=>ev.createElement(q0,{morseChildProps:e}),[Wg]:e=>ev.createElement(q6,{icon:"dd_date",morseChildProps:e}),[Wf]:e=>ev.createElement(q5,{icon:"dd_date",morseChildProps:e}),[Wh]:e=>ev.createElement(qz,{icon:"dd_comment",morseChildProps:e}),[Wy]:e=>ev.createElement(qz,{icon:"dd_embed",morseChildProps:e}),[Wb]:e=>ev.createElement(Wm,{morseChildProps:e}),[Wv]:e=>ev.createElement(q9,{morseChildProps:e}),[Wk]:e=>ev.createElement(Wa,{morseChildProps:e}),[WE]:e=>ev.createElement(q9,{morseChildProps:e}),[Wx]:e=>ev.createElement(Wr,{morseChildProps:e}),[W_]:e=>ev.createElement(Ws,{morseChildProps:e}),[Ww]:e=>ev.createElement(qK,{morseChildProps:e}),[WC]:e=>ev.createElement(Wi,{morseChildProps:e}),[WN]:e=>ev.createElement(qW,{morseChildProps:e}),[WM]:e=>ev.createElement(q1,{morseChildProps:e})},WD={[WS]:()=>ev.createElement(ev.Fragment,null)},WT={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SlashCommandSpaceAgentsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]},W$=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-983ec2d3-0"})` + width: 260px; + background-color: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + overflow: clip; +`,WP=eL.default.div.withConfig({displayName:"styled__LoadingState",componentId:"sc-983ec2d3-1"})` + padding: var(--menu-padding); +`,WF=eL.default.div.withConfig({displayName:"styled__EmptyState",componentId:"sc-983ec2d3-2"})` + ${e1.UiTypography.sm}; + + padding: var(--menu-item-padding); + color: ${e=>e.theme.textColors.hex(40)}; +`;(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-983ec2d3-3"})` + margin-right: 15px; + flex-shrink: 0; +`;let WA=eL.default.div.withConfig({displayName:"styled__ScrollbarWrapper",componentId:"sc-983ec2d3-4"})` + max-height: calc(100vh / 2); + overflow-y: auto; + pointer-events: auto; + cursor: pointer; + ${tM} +`;eL.default.div.withConfig({displayName:"styled__EmojiWrapper",componentId:"sc-983ec2d3-5"})` + margin-right: calc(var(--menu-item-gap) + 4px); +`;let WR=(0,e$.connect)(function(e,t){let a=iq(),n=iK(),l=a(e,{nodeID:t.nodeID}),r=l?.children.size??0,o=n(e,{nodeID:t.nodeID}),i=dU(e);return{node:l,attachments:iA(e,t),nodeHasChildren:r>0,areDescendantsCompleted:o,spaceId:i}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{query:a,node:n,nodeID:l,cancelCommandMonitor:r,attachments:o,nodeHasChildren:i,areDescendantsCompleted:s,spaceId:d}=e,c=(0,e$.useDispatch)(),m=ev.useRef(null),u=null!=n&&n.completed,p=ev.useRef(null),g=ev.useCallback(e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),p.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),p.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(p.current?.getVisibleItemCount()===0){r();return}e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),p.current?.activateCurrentItem();break;case eI.KeyboardKeys.Space:return;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r()}},[r]);ev.useImperativeHandle(t,()=>({handleKeyDownCapture:g})),ev.useEffect(()=>{let e=a.value;if(e.length>=2){let t=e[e.length-1],a=e[e.length-2];if(" "===t&&" "===a){r();return}}if(e.length>=25){r();return}},[r,a.value]);let f=ev.useCallback(()=>{c(mU(l,"",a.selection))},[c,l,a.selection]),h=ev.useContext(jz),y=function(e){let{isChecked:t,attachments:a,nodeHasChildren:n,areDescendantsCompleted:l,areCommentsDisabled:r,spaceId:o}=e,i=(0,eK.Z)(),s=(0,eF.$B)("/d/:documentID"),{isPaywallEnabled:d}=gV(),c=s?.params.documentID,{data:m,loading:u}=(0,eB.a)(bA,null!=c?{variables:{document_id:c,projectMembersLimit:30}}:{skip:!0}),{data:p,loading:g}=(0,eB.a)(WT,null!=o?{variables:{filterby:{spaceId:o}}}:{skip:!0}),f=ev.useMemo(()=>g?{type:"section",label:"default",render:WS,items:[]}:{type:"section",label:"default",render:WS,items:[{itemType:qj,label:i.formatMessage({id:"general.create_agent",defaultMessage:"Create Agent"}),values:[],data:{},render:WM}]},[i,g]),h=ev.useMemo(()=>{if(g||null==p||0===p.spaceAgents.totalCount)return[];let e=p.spaceAgents.edges,t=[];for(let a of e){let e=hR.Sx.safeParse(a.node.data);e.success&&t.push({id:a.node.id,name:a.node.name,data:e.data})}return t.map(e=>({type:"section",label:e.name,items:e.data.commands.map(t=>({itemType:qR,label:t.name,values:[e.name,t.name],data:{agentId:e.id,commandId:t.id,isBackgroundJob:t.isBackgroundJob},render:WN}))}))},[p,g]),y=ev.useMemo(()=>{if(u)return[];let e=m?.document;if(null==e)return[];let t=new Map;if(null!=e.members.edges)for(let a of e.members.edges){if(null==a.node)continue;let{user:e}=a.node;t.set(e.id,e)}if(null!=e.space)for(let a of e.space.memberships){let{user:e}=a;t.set(e.id,e)}return[...t.values()]},[m?.document,u]),b=ev.useMemo(()=>{let e=i.formatMessage({id:"general.due_date",defaultMessage:"Due Date"});return{type:"section",label:e,items:[{itemType:qw,label:i.formatMessage({id:"general.today",defaultMessage:"Today"}),values:[e,"today"],data:{start:ez.MomentHelpers.toDateTimeDesc(eG()().startOf("day"),{timeMode:"truncate"})},render:Wg},{itemType:qw,label:i.formatMessage({id:"general.date_tomorrow",defaultMessage:"Tomorrow"}),values:[e,"tomorrow"],data:{start:ez.MomentHelpers.toDateTimeDesc(eG()().startOf("day").add(1,"day"),{timeMode:"truncate"})},render:Wg},{itemType:qw,label:i.formatMessage({id:"general.date_next_week",defaultMessage:"Next week"}),values:[e,"next week"],data:{start:ez.MomentHelpers.toDateTimeDesc(eG()().startOf("day").add(1,"week"),{timeMode:"truncate"})},render:Wg}]}},[i]),v=ev.useMemo(()=>{let e=a?.assignees?.attachments??[];return aR()(e,"data.assignee.id")},[a]),k=ev.useMemo(()=>{let e=i.formatMessage({id:"general.assign",defaultMessage:"Assign"});return{type:"section",label:e,items:y.map(t=>{let a=null!=v[t.id];return{itemType:qC,label:t.handle,values:[e,t.handle,t.default_name],data:{user:t,isAssigned:a},render:Wp}})}},[v,i,y]),E=ev.useMemo(()=>{let e=i.formatMessage({id:"general.addons",defaultMessage:"Addons"});return r?{type:"section",label:e,items:[{itemType:qM,label:"Embed",values:[e,"embed"],data:"embed",render:Wy}]}:{type:"section",label:e,items:[{itemType:qM,label:"Comment",values:[e,"comment"],data:"comment",render:Wh},{itemType:qM,label:"Embed",values:[e,"embed"],data:"embed",render:Wy}]}},[r,i]),x=ev.useMemo(()=>{let e=i.formatMessage({id:"general.upload",defaultMessage:"Upload"});return{type:"section",label:e,items:[{itemType:qS,label:"Computer",values:[e,"computer"],data:{type:"computer",proBadge:!1},render:Wb},{itemType:qS,label:"Google Drive",values:[e,"google drive"],data:{type:"google_drive",proBadge:d},render:Wb},{itemType:qS,label:"Dropbox",values:[e,"dropbox"],data:{type:"dropbox",proBadge:d},render:Wb},{itemType:qS,label:"Instagram",values:[e,"instagram"],data:{type:"instagram",proBadge:d},render:Wb},{itemType:qS,label:"Box",values:[e,"box"],data:{type:"box",proBadge:d},render:Wb}]}},[i,d]),_=ev.useMemo(()=>{let e=i.formatMessage({id:"general.turn_to",defaultMessage:"Turn To"});return{type:"section",label:e,items:li.NODE_FORMATS.map(t=>t===li.FORMAT_CHECKBOX?{itemType:qI,label:i.formatMessage(q8[t]),values:[e,i.formatMessage(q8[t]),t,"todo","task"],data:t,render:Wv}:{itemType:qI,label:i.formatMessage(q8[t]),values:[e,i.formatMessage(q8[t]),t],data:t,render:Wv})}},[i]),w=ev.useMemo(()=>{let e=i.formatMessage({id:"general.add_block",defaultMessage:"Add Block"});return{type:"section",label:e,items:li.CHILDREN_FORMATS.map(t=>({itemType:qT,label:i.formatMessage(q8[t]),values:[e,i.formatMessage(q8[t])],data:t,render:WE}))}},[i]),N=ev.useMemo(()=>{let e=i.formatMessage({id:"general.highlight",defaultMessage:"Highlight"});return{type:"section",label:e,items:PB.map(t=>{let a=i.formatMessage(PV[t]);return{itemType:qD,label:a,values:[e,t,a],data:t,render:Wk}})}},[i]),C=ev.useMemo(()=>{let e=i.formatMessage({id:"general.actions",defaultMessage:"Actions"}),a=[{itemType:qF,label:i.formatMessage({id:"general.add_task_above",defaultMessage:"Add task above"}),values:[e,i.formatMessage({id:"general.add_task_above",defaultMessage:"Add task above"})],data:"add_task_above",render:Wu},{itemType:qF,label:i.formatMessage({id:"general.add_task_below",defaultMessage:"Add task below"}),values:[e,i.formatMessage({id:"general.add_task_below",defaultMessage:"Add task below"})],data:"add_task_below",render:Wu},{itemType:qF,label:i.formatMessage({id:"general.copylink",defaultMessage:"Copy link"}),values:[e,i.formatMessage({id:"general.copylink",defaultMessage:"Copy link"})],data:"copy_link",render:Wu},{itemType:qF,label:t?i.formatMessage({id:"general.uncheck",defaultMessage:"Uncheck"}):i.formatMessage({id:"general.check",defaultMessage:"Check"}),values:[e,t?i.formatMessage({id:"general.uncheck",defaultMessage:"Uncheck"}):i.formatMessage({id:"general.check",defaultMessage:"Check"})],data:"check",render:Wu},{itemType:qF,label:i.formatMessage({id:"general.delete",defaultMessage:"Delete"}),values:[e,i.formatMessage({id:"general.delete",defaultMessage:"Delete"})],data:"delete",render:Wu}];if(n){let n=t&&l;a.push({itemType:qF,label:n?i.formatMessage({id:"general.uncheck_all",defaultMessage:"Uncheck all"}):i.formatMessage({id:"general.check_all",defaultMessage:"Check all"}),values:[e,n?i.formatMessage({id:"general.uncheck_all",defaultMessage:"Uncheck all"}):i.formatMessage({id:"general.check_all",defaultMessage:"Check all"})],data:"check_all",render:Wu})}return{type:"section",label:e,items:a}},[l,i,t,n]),M=ev.useMemo(()=>{let e=i.formatMessage({id:"general.timer",defaultMessage:"Timer"});return{type:"section",label:e,items:[{itemType:qP,label:i.formatMessage({id:"general.timer_15_minutes",defaultMessage:"15 minutes"}),data:"PT15M",values:[e,i.formatMessage({id:"general.timer_15_minutes",defaultMessage:"15 minutes"})],render:W_},{itemType:qP,label:i.formatMessage({id:"general.timer_25_minutes",defaultMessage:"25 minutes"}),values:[e,i.formatMessage({id:"general.timer_25_minutes",defaultMessage:"25 minutes"})],data:"PT25M",render:W_},{itemType:qP,label:i.formatMessage({id:"general.timer_30_minutes",defaultMessage:"30 minutes"}),values:[e,i.formatMessage({id:"general.timer_30_minutes",defaultMessage:"30 minutes"})],data:"PT30M",render:W_},{itemType:qP,label:i.formatMessage({id:"general.timer_1_hour",defaultMessage:"1 hour"}),values:[e,i.formatMessage({id:"general.timer_1_hour",defaultMessage:"1 hour"})],data:"PT1H",render:W_},{itemType:qP,label:i.formatMessage({id:"general.timer_2_hours",defaultMessage:"2 hours"}),values:[e,i.formatMessage({id:"general.timer_2_hours",defaultMessage:"2 hours"})],data:"PT2H",render:W_}]}},[i]),S=ev.useMemo(()=>{let e=i.formatMessage({id:"general.agents",defaultMessage:"Agents"}),t="agents";return{type:"section",label:e,items:[{itemType:"ai",label:i.formatMessage({id:"general.research",defaultMessage:"Research"}),values:[e,i.formatMessage({id:"general.research",defaultMessage:"Research"}),t,"research"],data:{type:"research",agentBadge:!0},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.roundtable",defaultMessage:"Roundtable"}),values:[e,i.formatMessage({id:"general.roundtable",defaultMessage:"Roundtable"}),t,"roundtable"],data:{type:"roundtable",agentBadge:!0},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.seo",defaultMessage:"SEO"}),values:[e,i.formatMessage({id:"general.seo",defaultMessage:"SEO"}),t,"seo"],data:{type:"seo",agentBadge:!0},render:Ww}]}},[i]),I=ev.useMemo(()=>{let e=i.formatMessage({id:"general.ai",defaultMessage:"AI"});return{type:"section",label:e,items:[{itemType:"ai",label:i.formatMessage({id:"general.ai_assistant",defaultMessage:"AI Assistant"}),values:[e,i.formatMessage({id:"general.ai_assistant",defaultMessage:"AI Assistant"}),"ai"],data:{},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.subtask",defaultMessage:"Subtask"}),values:[e,i.formatMessage({id:"general.subtask",defaultMessage:"Subtask"}),"ai","subtask"],data:{type:"subtask"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.brainstorm",defaultMessage:"Brainstorm"}),values:[e,i.formatMessage({id:"general.brainstorm",defaultMessage:"Brainstorm"}),"ai","brainstorm"],data:{type:"brainstorm"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.outline",defaultMessage:"Outline"}),values:[e,i.formatMessage({id:"general.outline",defaultMessage:"Outline"}),"ai","outline"],data:{type:"outline"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.expand",defaultMessage:"Expand"}),values:[e,i.formatMessage({id:"general.expand",defaultMessage:"Expand"}),"ai","expand"],data:{type:"expand"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.rewrite",defaultMessage:"Rewrite"}),values:[e,i.formatMessage({id:"general.rewrite",defaultMessage:"Rewrite"}),"ai","rewrite"],data:{type:"rewrite"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.summarize",defaultMessage:"Summarize"}),values:[e,i.formatMessage({id:"general.summarize",defaultMessage:"Summarize"}),"ai","summarize"],data:{type:"summarize"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.ask",defaultMessage:"Ask"}),values:[e,i.formatMessage({id:"general.ask",defaultMessage:"Ask"}),"ai","ask"],data:{type:"ask"},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.translate",defaultMessage:"Translate"}),values:[e,i.formatMessage({id:"general.translate",defaultMessage:"Translate"}),"ai","translate"],data:{},render:Ww},{itemType:"ai",label:i.formatMessage({id:"general.fix_spelling_grammar",defaultMessage:"Fix Spelling and Grammar"}),values:[e,i.formatMessage({id:"general.fix_spelling_grammar",defaultMessage:"Fix Spelling and Grammar"}),"ai","fix_spelling_grammar"],data:{type:"fix_spelling_grammar"},render:Ww}]}},[i]),D=ev.useMemo(()=>{let e=i.formatMessage({id:"general.sort_by",defaultMessage:"Sort By"}),t="sort";return{type:"section",label:e,items:[{itemType:qA,label:i.formatMessage({id:"general.sort_completed",defaultMessage:"Completed"}),values:[e,i.formatMessage({id:"general.sort_completed",defaultMessage:"Completed"}),t],data:"completed",render:WC},{itemType:qA,label:i.formatMessage({id:"general.sort_uncompleted",defaultMessage:"Uncompleted"}),values:[e,i.formatMessage({id:"general.sort_uncompleted",defaultMessage:"Uncompleted"}),t],data:"uncompleted",render:WC},{itemType:qA,label:i.formatMessage({id:"general.sort_AZ",defaultMessage:"A to Z"}),values:[e,i.formatMessage({id:"general.sort_AZ",defaultMessage:"A to Z"}),t],data:"a_to_z",render:WC},{itemType:qA,label:i.formatMessage({id:"general.sort_ZA",defaultMessage:"Z to A"}),values:[e,i.formatMessage({id:"general.sort_ZA",defaultMessage:"Z to A"}),t],data:"z_to_a",render:WC},{itemType:qA,label:i.formatMessage({id:"general.sort_tag",defaultMessage:"Tag"}),values:[e,i.formatMessage({id:"general.sort_tag",defaultMessage:"Tag"}),t],data:"tag",render:WC},{itemType:qA,label:i.formatMessage({id:"general.sort_mention",defaultMessage:"Mention"}),values:[e,i.formatMessage({id:"general.sort_mention",defaultMessage:"Mention"}),t],data:"mention",render:WC},{itemType:qA,label:i.formatMessage({id:"general.sort_due_date",defaultMessage:"Due Date"}),values:[e,i.formatMessage({id:"general.sort_due_date",defaultMessage:"Due Date"}),t],data:"due_date",render:WC}]}},[i]);return ev.useMemo(()=>[f,...h,S,I,b,k,E,x,_,w,N,M,C,D],[f,h,S,I,b,k,E,x,_,w,N,M,C,D])}({isChecked:u,attachments:o,nodeHasChildren:i,areDescendantsCompleted:s,areCommentsDisabled:h?.commentsMode==="disabled",spaceId:d}),b=function(e,t,a){let n=(0,eF.$B)("/d/:documentID"),l=n?.params.documentID,{data:r}=(0,eB.a)(TM),o=r?.me??null,i=(0,e$.useDispatch)(),s=gV(),[d]=(0,cs.D)(qO),[c]=(0,cs.D)(qU),m=ev.useCallback(()=>{i(rh({isOpen:!0,activeView:rI,enableCopyList:void 0}))},[i]),u=Fp(l),{setDueDate:p}=FS(l??null);return ev.useCallback(n=>{if(null==l){i(Fd()),a();return}if(n.itemType===qR){if(null==o){m(),a();return}a();let t=i(Vj([e])),r=(0,lD.textDeltaToString)(t.children[0].text);i(DT.actions.toggleAiAssistantDialog({nodeId:e,nodeText:r,command:{type:n.data.isBackgroundJob?"custom_background":"custom",agentId:n.data.agentId,commandId:n.data.commandId},projectId:l}))}if("ai"===n.itemType){if(null==o){m(),a();return}a();let t=i(Vj([e])),r=(0,lD.textDeltaToString)(t.children[0].text);if(null==n.data.type){i(DT.actions.toggleAiAssistantDialog({nodeId:e,nodeText:r,projectId:l}));return}i(DT.actions.toggleAiAssistantDialog({nodeId:e,nodeText:r,command:{type:n.data.type,language:n.data.language},projectId:l}))}switch(n.itemType){case qw:case qN:if(null==o){m();return}p([e],n.data);break;case qC:if(null==o){m();return}u([e],n.data.user.id);break;case qM:if(null==o){m();return}switch(n.data){case"comment":i(qx(e));break;case"embed":i(q_(e))}break;case q$:{if(null==o){m();return}let t=n.data.id,a=n.data.skin;c({variables:{input:{projectId:l,nodeIds:[e],clientMutationId:(0,ld.Z)(),emojiName:t,emojiSkin:a}}});break}case qI:{let t=n.data;i(mZ(e,li.FORMAT_TYPE_NODE,t));break}case qD:i(mj(e,"highlight",{colorName:n.data}));break;case qT:i(Da({id:e,position:"afterend"},qv(n.data)));break;case qS:i(qE(e,s));break;case qF:switch(n.data){case"duplicate":i(mT(e));break;case"add_task_above":i(qk(e,void 0,!0));break;case"add_task_below":i(qk(e));break;case"copy_link":{let t=new URL("https://www.taskade.com");t.pathname=`/d/${l}`,t.hash=`#node-${e}`,R4()(t.href)}break;case"check":i(P0(e));break;case"check_all":i(mA(e));break;case"delete":i(mM(e))}break;case qP:if(null==o){m();return}d({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:l,nodeIds:[e],operation:"quick_start",duration:n.data}}});break;case qA:switch(n.data){case"completed":i(Du(e,O.CompleteAsc));break;case"uncompleted":i(Du(e,O.CompleteDesc));break;case"a_to_z":i(Du(e,O.AlphabeticalAsc));break;case"z_to_a":i(Du(e,O.AlphabeticalDesc));break;case"tag":i(Du(e,O.Tag));break;case"mention":i(Du(e,O.Mention));break;case"due_date":i(Du(e,O.DueDate))}break;case qj:null!=t&&i(TN.actions.toggleCreateSpaceAgentDialog({spaceId:t}))}a()},[a,o,i,m,e,s,l,u,d,c,p,t])}(l,d,f),v=function(){let e=(0,eK.Z)();return ev.useCallback(async t=>{let a=[],n=(0,qZ.extractFromText)(t,eG()());if(null!=n){let t=ez.DateDuration.fromDateRangeDesc({start:n.start}).toReadableFormat();a.push({type:"section",label:e.formatMessage({id:"general.date_suggestion",defaultMessage:"Date Suggestion"}),items:[{itemType:qN,label:t,data:n,render:Wf,values:[t]}]})}let l=go.bj.search(t);return null!=l&&l.length>0&&a.push({type:"section",label:e.formatMessage({id:"general.reaction",defaultMessage:"Reaction"}),items:l.filter(qL).slice(0,3).map(e=>({itemType:q$,label:e.native,data:e,render:Wx,values:[e.name]}))}),a},[e])}();return ev.createElement(W$,{onMouseDown:e=>{e.preventDefault()}},ev.createElement(WA,{ref:m},ev.createElement(tT,{ref:p,term:a.value,data:y,renderMap:WI,sectionRenderMap:WD,search:qb,onActivate:b,generate:v,renderLoading:ev.createElement(WP,null,ev.createElement(eI.Spinner,{size:20})),renderEmptyState:ev.createElement(WF,null,ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}))})))})),Wj=eL.default.div.withConfig({displayName:"Tag__Container",componentId:"sc-37a42db9-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + overflow: hidden; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,WO=(0,eL.default)(tn.Icon).attrs({icon:"dd_tag"}).withConfig({displayName:"Tag__TagIcon",componentId:"sc-37a42db9-1"})` + flex-shrink: 0; + transform: var(--menu-item-icon-scale); +`,WU=eL.default.div.withConfig({displayName:"Tag__TagContainer",componentId:"sc-37a42db9-2"})` + display: -webkit-inline-box; + text-overflow: ellipsis; + white-space: pre-wrap; + overflow-wrap: break-word; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-height: 20px; +`,WZ=eL.default.span.withConfig({displayName:"Tag__TagText",componentId:"sc-37a42db9-3"})` + overflow: hidden; + text-overflow: ellipsis; + white-space: pre-wrap; +`,WL=function(e){let{morseChildProps:t}=e,a=t.data,n=ev.useRef(null);return ev.useEffect(()=>{t.focused&&n.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(Wj,{ref:n,$active:t.focused,onClick:t.activate},ev.createElement(WO,null),ev.createElement(WU,null,ev.createElement(WZ,null,a)))},WB="ProjectTagItem",Wz={[WB]:e=>ev.createElement(WL,{morseChildProps:e})},WV=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-6bc81536-0"})` + width: 240px; + display: flex; + flex-direction: column; + + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; +`,Wq=eL.default.div.withConfig({displayName:"styled__ScrollbarWrapper",componentId:"sc-6bc81536-1"})` + max-height: calc(100vh / 2); + overflow-y: auto; + pointer-events: auto; + cursor: pointer; + ${tM} +`,WW=eL.default.div.withConfig({displayName:"styled__Hint",componentId:"sc-6bc81536-2"})` + padding: 12px 16px; + color: ${e=>e.theme.textColors.hex(60)}; + + ${e1.UiTypography.sm}; +`,WH=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),WG=ev.forwardRef(function(e,t){let{nodeId:a,query:n,cancelCommandMonitor:l}=e,r=ev.useRef(null),o=ev.useCallback(e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l()}},[l]);ev.useImperativeHandle(t,()=>({handleKeyDownCapture:o}));let i=ev.useMemo(()=>(function(){if("undefined"==typeof document)return new Set;let e=document.getElementsByClassName("hashtag"),t=new Set;for(let a of e){if(!(a instanceof HTMLElement))continue;let e=a.dataset.hashtagText;null!=e&&0!==e.length&&t.add(e.replace(/#/,""))}return t})(),[]),s=function(e){let t=(0,eK.Z)(),a=ev.useMemo(()=>{let a=t.formatMessage({id:"general.hashtags",defaultMessage:"Hashtags"});return{type:"section",label:a,items:Array.from(e,e=>({itemType:"tag",label:e,values:[a,e],render:WB,data:e}))}},[e,t]);return ev.useMemo(()=>[a],[a])}(i),d=function(e,t,a){let n=(0,e$.useDispatch)();return ev.useCallback(l=>{"tag"===l.itemType&&(n({type:c7,payload:{nodeID:e,tag:l.data,range:t.selection}}),a())},[a,n,e,t.selection])}(a,n,l),c=function(e){let t=(0,eK.Z)();return ev.useCallback(async a=>{let n=[];return e.has(a)||n.push({type:"section",label:t.formatMessage({id:"general.new_tag",defaultMessage:"New tag"}),items:[{itemType:"tag",label:a,values:[a],render:WB,data:a}]}),n},[t,e])}(i);if(n.value.includes(" ")){l();return}return ev.createElement(WV,{onMouseDown:e=>{e.preventDefault()}},ev.createElement(WW,null,ev.createElement(eY.Z,{id:"general.filter_or_create_tags",defaultMessage:"Filter or create tags"})),ev.createElement(Wq,null,ev.createElement(tT,{ref:r,term:n.value,data:s,search:WH,renderMap:Wz,onActivate:d,generate:c,renderEmptyState:ev.createElement(ev.Fragment,null)})))});function WK(e,t){let a=0,n=t,l=e.ops[a];for(;null!=l;)if("object"==typeof l.insert){if(n<1)return l;n-=1,a+=1,l=e.ops[a]}else if("string"==typeof l.insert){let t=l.insert.length;if(n ","square"]]);function WJ(e,t){var a,n;let l=t.end-t.start;if(l<2||l>8)return null;let r=WK(e,t.start);if(null==r||"object"==typeof r.insert)return null;if(WY.has(r.insert)){let a=new(CI())(e).slice(t.start,t.end),n=(0,lD.textDeltaToString)(a),l=WQ.get(n)??null;return null==l?null:{type:l,range:t}}if((a=r.insert.charCodeAt(0))>=48&&a<=57){let a=WK(e,t.end-2);if(null==a||"object"==typeof a.insert||"."!==a.insert)return null;let n=new(CI())(e).slice(t.start,t.end),l=(0,lD.textDeltaToString)(n);return/^[0-9]\.\s$/.test(l)?{type:"number",range:t}:null}if(!((n=r.insert.charCodeAt(0))>=97)||!(n<=122))return null;{let a=WK(e,t.end-2);if(null==a||"object"==typeof a.insert||"."!==a.insert)return null;let n=new(CI())(e).slice(t.start,t.end),l=(0,lD.textDeltaToString)(n);return/^[a-z]\.\s$/.test(l)?{type:"alpha",range:t}:null}}function WX(e,t){let{ops:a}=e;if(1!==a.length)return null;let n=a[0];if(!(0,li.isNodeTextDeltaOp)(n)||t!==n.p[1])return null;let l=n.o;switch(l.ops.length){case 1:{let e=l.ops[0];if(!(0,li.isDeltaInsertOp)(e)||"object"==typeof e.insert||1!==e.insert.length)return null;let t=e.insert,a=t.length;return{value:t,start:0,end:a}}case 2:{let e=l.ops[0];if(!(0,li.isDeltaRetainOp)(e))return null;let t=l.ops[1];if(!(0,li.isDeltaInsertOp)(t)||"object"==typeof t.insert||1!==t.insert.length)return null;let a=t.insert,n=e.retain,r=e.retain+a.length;return{value:a,start:n,end:r}}default:return null}}var W0=a(9292);let W1=(0,lb.C)({context:{command:null},tsTypes:{},schema:{context:{},events:{}},id:"command",initial:"idle",states:{idle:{invoke:{src:"onChangeInIdle",id:"onChangeInIdle"},on:{COMMAND_PRESSED:{actions:"commandPressed",target:"#command.command"},QUICK_FORMAT:{actions:"quickFormat"},TOGGLE_AI_ASSISTANT:{actions:"toggleAiAssistant"}}},command:{exit:"commandExit",invoke:{src:"onChangeInCommand",id:"onChangeInCommand"},on:{CHANGED:{actions:"changed"},CANCEL:{target:"#command.idle"}}}}},{actions:{commandExit:(0,lv.assign)((e,t)=>({command:null})),commandPressed:(0,lv.assign)((e,t)=>{let{key:a,nodeId:n,textDelta:l,textValue:r,change:o,query:i}=t.payload;return{command:{key:a,nodeId:n,textDelta:l,textValue:r,change:o,query:i}}}),changed:(0,lv.assign)((e,t)=>{let{query:a}=t.payload;return{command:{...e.command,query:a}}})}});var W2=a(29127);function W5(e,t,a){let n=function(e){let{selection:t}=e;if(null==t.anchorKey||null==t.focusKey)return null;let a=null,n=null,l=0,r=e.document.getTexts();for(let e=0;e=a?n:a,length:l}}(a);if(null==n||e.end>n.endOffset)return null;let l=function(e,t,a){let n=0,l={},r=e.document.getTexts();for(let e=0;e=n&&t<=n+i&&(l.anchorKey=o.key,l.anchorOffset=t-n),a>=n&&a<=n+i&&(l.focusKey=o.key,l.focusOffset=a-n),n+=i}return null==l.anchorKey||null==l.focusKey?null:(l.isBackward=ae.focusNodeValue),W6=(0,W3.E)(e=>e.lastSavedChange),W8=(0,a(94975).h)(e=>null!=e),W7=(0,W2.U)(e=>{let{focusNodeId:t,focusNodeText:a,focusNodeValue:n,lastSavedChange:l}=e;if(null==t||null==a||null==n||null==l)return null;let r=WX(l,t);if(null==r)return null;switch(r.value){case eI.KeyboardKeys.Space:{let e=WJ(a,{start:0,end:r.end});if(null!=e)return{type:"QUICK_FORMAT",payload:{...e,nodeId:t}};if(0===r.start&&1===r.end){let e=W5(r,a,n);if(null==e)return null;return{type:"TOGGLE_AI_ASSISTANT",payload:{nodeId:t,query:e}}}return null}case"#":case"@":case"/":{let e=W5(r,a,n);if(null==e)return null;return{type:"COMMAND_PRESSED",payload:{key:r,nodeId:t,textDelta:a,textValue:n,change:l,query:e}}}default:return null}}),W9=(0,e$.connect)(function(e){let t=i5(e);if(null==t||iR(e)===t)return{focusNodeId:null,focusNodeText:null,focusNodeValue:null,lastSavedChange:null};let a=e.contents.findNodeByID(t);if(null==a)return{focusNodeId:null,focusNodeText:null,focusNodeValue:null,lastSavedChange:null};let n=e.slate.get(t);if(null==n)return{focusNodeId:null,focusNodeText:null,focusNodeValue:null,lastSavedChange:null};let l=a.text,r=n.text;return null==r?{focusNodeId:null,focusNodeText:null,focusNodeValue:null,lastSavedChange:null}:{focusNodeId:t,focusNodeText:l,focusNodeValue:r,lastSavedChange:e.history.lastSavedChange}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let a=(0,e$.useDispatch)(),n=function(e,t,a,n){let l=ev.useRef(null),[r]=ev.useState(()=>new W0.y(e=>(l.current=t=>{e.next(t)},()=>{l.current=null})));return ev.useEffect(()=>{l.current?.({focusNodeId:e,focusNodeText:t,focusNodeValue:a,lastSavedChange:n})},[e,t,a,n]),r}(e.focusNodeId,e.focusNodeText,e.focusNodeValue,e.lastSavedChange),[l,r]=(0,ls.e)(W1,{actions:{quickFormat:(e,t)=>{let{nodeId:n,range:l,type:r}=t.payload;a({type:I6,payload:{nodeId:n,range:l,nodeFormat:r}})},toggleAiAssistant:(t,n)=>{let{nodeId:l,query:r}=n.payload,{documentId:o,focusNodeText:i}=e;if(null==o||null==i)return;let s=(0,lD.textDeltaToString)(i);1===s.length&&(a(mU(l,"",r.selection)),a(DT.actions.toggleAiAssistantDialog({nodeId:l,nodeText:s,projectId:o})))}},services:{onChangeInIdle:()=>n.pipe(W6,W7,W8),onChangeInCommand:(e,t)=>{let{nodeId:a,key:l}=t.payload;return n.pipe(W4,(0,W2.U)(e=>{let{focusNodeId:t,focusNodeText:n,focusNodeValue:r,lastSavedChange:o}=e;if(null==t||null==n||null==r||null==o||t!==a)return{type:"CANCEL"};let i=W5(l,n,r);return null==i?{type:"CANCEL"}:{type:"CHANGED",payload:{query:i}}}))}}}),o=ev.useCallback(()=>{r({type:"CANCEL"})},[r]);if(!l.matches("command")||null==l.context.command)return null;{let{key:a,query:n,nodeId:r}=l.context.command;if(r!==e.focusNodeId)return console.warn(new ei.TaskadeError({message:"The nodeId and focusNodeId should be the same. Do check the state changes that was triggered before this render.",scope:{extras:{nodeId:r,focusNodeId:e.focusNodeId,"xstate.value":l.value,"xstate.context":JSON.stringify(l.context)}}}).message),null;switch(a.value){case"/":return ev.createElement(qy,{query:n},ev.createElement(WR,{ref:t,commandKey:a,query:n,nodeID:r,projectId:e.documentId,cancelCommandMonitor:o}));case"@":return ev.createElement(qy,{query:n},ev.createElement(qh,{ref:t,query:n,projectId:e.documentId,nodeId:r,cancelCommandMonitor:o}));case"#":{let{lastSavedChange:a,focusNodeId:l,focusNodeText:i}=e;if(function(e,t,a){if(null==e||null==t||null==a)return!1;let n=WX(e,t);if(null==n)return!1;let l=WJ(a,{start:0,end:n.end});return null!=l&&(l.type===li.FORMAT_HEADING1||l.type===li.FORMAT_HEADING2)}(a,l,i))return o(),null;return ev.createElement(qy,{query:n},ev.createElement(WG,{ref:t,projectId:e.documentId,nodeId:r,query:n,cancelCommandMonitor:o}))}default:return null}}})),He=dw.z.object({text:dw.z.string()});function Ht(e){return(0,lb.C)({context:e,schema:{context:{},events:{}},tsTypes:{},id:"preview",initial:"idle",states:{idle:{on:{MAKE_REQUEST:{actions:["clearDisplayResult","clearError","createAbortController"],target:"streaming"},TOGGLE_PREV:{actions:"handleTogglePrev"},TOGGLE_NEXT:{actions:"handleToggleNext"}}},streaming:{invoke:{src:(e,t)=>async a=>{if("MAKE_REQUEST"!==t.type)return;let{abortController:n}=e;if(null==n)throw Error("abortController should not be null");let{requestBody:l}=t.payload,r=await fetch(e.requestUrl,{method:"POST",credentials:"same-origin",body:JSON.stringify(l),headers:{"Content-Type":"application/json"},signal:n.signal});if(!r.ok){let e=new ei.FetchError(r);throw await e.toTaskadeError()??e}if(null==r.body)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"response body is null"});let o=r.body.getReader(),i=new TextDecoder;function s(e){if(e)try{let t=JSON.parse(e),n=He.safeParse(t);if(!n.success)return;a({type:"UPDATE_DISPLAY_RESULT",payload:{newResult:n.data.text}})}catch(e){throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Error parsing line"})}}let d=!1,c="";for(;!d;){let e=await o.read();if(d=e.done,e.value){c+=i.decode(e.value);for(let e=c.indexOf("\n");e>=0;e=c.indexOf("\n")){let t=c.slice(0,e);c=c.slice(e+1),s(t)}}}if(c){let e=c;c="",s(e)}a({type:"STREAM_FINISHED"})},onError:[{cond:"isAbortError",actions:"handleAbortError",target:"idle"},{cond:"hasPastResults",actions:["handleError","showPastResult"],target:"idle"},{actions:"handleError",target:"failed"}]},on:{UPDATE_DISPLAY_RESULT:{actions:"updateDisplayResult"},STOP_STREAM:{actions:"stopStream"},STREAM_FINISHED:{actions:"handleStreamFinished",target:"idle"}}},failed:{}}},{guards:{isAbortError:(e,t)=>$_(t.data),hasPastResults:e=>e.pastResults.length>0},actions:{clearDisplayResult:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.displayResult=""})),clearError:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.error=void 0})),createAbortController:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.abortController=new AbortController})),handleTogglePrev:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{currentIndex:t,pastResults:a}=e;if(0===t)return e;let n=t-1;e.currentIndex=n,e.displayResult=a[n]})),handleToggleNext:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{currentIndex:t,pastResults:a}=e,n=t+1;if(n>=a.length)return e;e.currentIndex=n,e.displayResult=a[n]})),handleError:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>{e.error=t.data})),showPastResult:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let t=CP()(e.pastResults);if(null==t)return e;e.displayResult=t})),handleAbortError:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.currentIndex=e.pastResults.length,e.pastResults=[...e.pastResults,e.displayResult]})),stopStream:e=>{if(null==e.abortController)throw Error("abortController should not be null");e.abortController.abort()},handleStreamFinished:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.currentIndex=e.pastResults.length,e.pastResults=[...e.pastResults,e.displayResult]}))}})}let Ha=[["mindmap",["mindmap","mind map","flowchart","flow chart","ideate","brainstorm","workflow","okr"]],["actionsheet",["actionsheet","table","spreadsheet","grid","dataset"]],["board",["board","sprint","kanban","agile","backlog","scrum","epic","story","swimlane"]],["orgchart",["orgchart","organization chart","org chart","hierarchy"]]];function Hn(e){let t=new to.Z([e],{threshold:.2,ignoreLocation:!0,includeScore:!0}),a=new Map;for(let[e,n]of Ha)for(let l of n){let n=t.search(l);if(n.length>0){let t=n[0].score??1,l=a.get(e);null==l?a.set(e,t):a.set(e,l*t)}}let n=Array.from(a.entries()).sort((e,t)=>e[1]-t[1])[0];return null==n?null:n[0]}let Hl={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectsCreateWithTaskastMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectsCreateWithTaskastInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectsCreateWithTaskast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"trees"}},{kind:"Field",name:{kind:"Name",value:"spaceId"}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]}}]},Hr="ActionItem",Ho="create_project",Hi="continue_writing",Hs="make_longer",Hd="ActionSection",Hc=function(e){let t;let{morseChildProps:a}=e,n=ev.useRef(null);switch(ev.useEffect(()=>{a.focused&&n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[a.focused]),a.data.action.itemType){case Ho:t="dd_newtemplate";break;case Hi:t="dd_edit";break;default:t="dd_ai_outline"}return ev.createElement("button",{ref:n,onClick:a.activate,className:og()("flex h-7 w-full items-center px-3 py-2 text-sm text-appcolor-500")},ev.createElement("div",{className:og()("flex h-7 w-full items-center rounded-md px-3 hover:bg-appcolor-200 hover:text-appcolor-800",a.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{className:"scale-90",icon:t}),ev.createElement("span",{className:"pl-3"},a.label),a.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"})))},Hm={[Hr]:e=>ev.createElement(Hc,{morseChildProps:e})},Hu={[Hd]:()=>ev.createElement(ev.Fragment,null)},Hp=(e,t)=>new to.Z(t,{keys:["values"],threshold:.2}).search(e).map(e=>e.item),Hg=Ht({requestUrl:"/web-api/ai/create-project",displayResult:"",pastResults:[],currentIndex:0}),Hf=function(e){var t;let{onExit:a,outputType:n,persona:l,prompt:r,sourceMedias:o,spaceId:i,tone:s}=e,d=(0,eF.k6)(),c=ev.useRef(null),m=ev.useRef(null);ev.useEffect(()=>{c?.current?.focus()},[]);let[u,p]=(0,ls.e)(Hg,{actions:{updateDisplayResult:(0,lv.assign)((e,t)=>(null!=m.current&&(m.current.scrollTop=m.current.scrollHeight),(0,es.ZP)(e,e=>{e.displayResult=t.payload.newResult})))}}),{displayResult:g,error:f,pastResults:h,currentIndex:y}=u.context,b=(0,eK.Z)(),[v,k]=ev.useState(""),[E,x]=ev.useState(null);D$({error:f,onError:a}),ev.useEffect(()=>{E?.focus()},[E]);let[_,{data:w,loading:N}]=(0,cs.D)(Hl);ev.useEffect(()=>{if(null==w)return;let e=w.projectsCreateWithTaskast?.documents.edges?.[0]?.node?.id;null!=e&&(a(),d.push(`/d/${e}`))},[d,a,w]);let C=ev.useRef(null),M=ev.useCallback(()=>{let e=o.map(e=>({type:"spacemedia",id:e.id}));p({type:"MAKE_REQUEST",payload:{requestBody:hR.Mm.parse({input:{command:{type:"create-project",data:{type:"user-input",content:r,outputType:n??void 0,persona:l??void 0,tone:s??void 0,sources:e}}},spaceId:i})}})},[n,l,r,p,o,i,s]);ev.useEffect(()=>{h.length>0||M()},[M,h.length]);let S=ev.useCallback(e=>{let t=o.map(e=>({type:"spacemedia",id:e.id}));p({type:"MAKE_REQUEST",payload:{requestBody:hR.Mm.parse({input:{command:{type:"create-project",data:{type:"user-input",content:e,contentHistory:null!=g?[g]:void 0,outputType:n??void 0,persona:l??void 0,tone:s??void 0,sources:t}}},spaceId:i})}}),k(""),c.current?.focus()},[n,l,p,o,i,g,s]),I=[{type:"section",label:"actions",items:[{label:"Create project",itemType:Ho},{label:"Continue writing",itemType:Hi},{label:"Make longer",itemType:Hs}].map(e=>{let{label:t,itemType:a}=e;return{label:t,values:[t],data:{action:e},itemType:a,render:Hr}}),render:Hd}],D=(t=()=>{let e=(0,lo.markdownTextToTaskastFragment)(g,{shouldRemoveCodeFence:!0}),t=JSON.stringify((0,lo.fragmentToRoot)(e)),a=Hn(r);_({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:i,trees:[t],defaultView:a}}})},ev.useCallback(e=>{switch(e.data.action.itemType){case Ho:t();break;case Hi:S("Continue writing");break;case Hs:S("Make longer")}},[t,S]));return ev.createElement("div",{ref:c,onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),C.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),C.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),C.current?.getVisibleItemCount()===0){if(0===v.length)return;S(v)}C.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:if(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u.matches("streaming")){p({type:"STOP_STREAM"});return}a()}},tabIndex:0,className:"group"},u.matches("idle")&&null!=f&&ev.createElement("div",{className:"m-2 rounded-lg border border-danger p-2 text-center text-xs text-danger"},f.message),ev.createElement("div",{ref:m,className:"max-h-[60vh] min-h-[30vh] overflow-y-auto border-b-2 border-appcolor-200 px-5 py-4"},u.matches("failed")?ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},f?.message):ev.createElement(DA,{value:g,shouldRemoveCodeFence:!0})),u.matches("streaming")&&ev.createElement("div",{className:"relative flex w-full justify-end pr-4 opacity-0 transition duration-150 ease-in-out group-hover:opacity-100"},ev.createElement("button",{className:"absolute -top-14 flex items-center gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-200",onClick:()=>{p({type:"STOP_STREAM"})}},ev.createElement(tn.Icon,{icon:"ai_stop"}),ev.createElement(eY.Z,{id:"general.ai.stop_generating",defaultMessage:"Stop generating"}))),N&&ev.createElement("div",{className:"my-3"},ev.createElement(eI.Spinner,null)),u.matches("idle")&&!N&&null==w&&ev.createElement("div",null,ev.createElement("div",{className:"flex items-center gap-x-3 border-b border-solid border-appcolor-300 py-3 pl-4 pr-5"},ev.createElement(tn.Icon,{className:"-mt-1 ml-1 shrink-0",icon:"dd_ai"}),ev.createElement(Dx.Z,{ref:x,className:"w-full resize-none bg-transparent pr-4 text-sm",placeholder:b.formatMessage({id:"general.ai_create_project_reprompt_placeholder",defaultMessage:"What would you like to do next?"}),value:v,onChange:e=>{k(e.target.value)},minRows:1,maxRows:4}),h.length>1&&ev.createElement("div",{className:"mr-2 flex min-w-fit items-center text-sm text-appcolor-500"},ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_prev",onClick:()=>{p({type:"TOGGLE_PREV"})}}),ev.createElement("p",null,y+1," of ",h.length),ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_next",onClick:()=>{p({type:"TOGGLE_NEXT"})}})),ev.createElement("button",{className:"flex items-center text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),0!==v.length&&S(v)}},ev.createElement(tn.Icon,{icon:"message_send"}))),ev.createElement(tT,{ref:C,term:v,data:I,renderMap:Hm,onActivate:D,search:Hp,renderEmptyState:ev.createElement(ev.Fragment,null),sectionRenderMap:Hu})))},Hh={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceMediaCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMediaCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceMediaCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}},{kind:"Field",name:{kind:"Name",value:"media"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMediaParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]},Hy={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MediadeWebpageReadMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MediadeWebpageReadInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mediadeWebpageRead"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"file"}}]}}]}}]},Hb=function(e){let t=(0,ll.x)(),{exit:a,spaceId:n,onSelectMedia:l}=e,[r,o]=ev.useState(""),[i,s]=ev.useState(void 0),[d,c]=ev.useState(!1),m=(0,eB.a)(sW),u=m.data?.me?.id??null,p=T_((0,eI.useTheme)()),g=async()=>{(0,ei.assert)(null!=u),c(!0);try{s(void 0);let e=await t.mutate({mutation:Hy,variables:{input:{clientMutationId:(0,ld.Z)(),url:r}}});if(null==e.data)throw new ei.HttpError({code:"BAD_REQUEST"});let o=e.data.mediadeWebpageRead.file,i=await t.mutate({mutation:Hh,variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:n,fileDesc:o}}});(0,ei.assert)(null!=i.data);let{media:d}=i.data.spaceMediaCreate;l(d),c(!1),a()}catch(e){s((0,ei.getMessageFromError)(e)),c(!1)}};return ev.createElement("div",{className:"flex max-h-96 w-full max-w-sm flex-col gap-4 rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 p-8",style:p},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("h1",{className:"text-md flex items-center text-appcolor-1000"},ev.createElement(tn.Icon,{className:"mr-2 shrink-0",icon:"ai_url"}),ev.createElement(eY.Z,{id:"agent.add_link",defaultMessage:"Add Link"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.media_link_description",defaultMessage:"Add knowledge from a URL to crawl the content. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),null!=i&&ev.createElement("div",{className:"mt-2 rounded-xl border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,i)),ev.createElement("div",{className:"flex flex-col rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{className:"resize-vertical bg-transparent px-3 py-3 placeholder:text-appcolor-500",placeholder:"Type or paste a URL...",minRows:4,value:r,onChange:e=>o(e.target.value)})),ev.createElement("div",{className:"flex w-full items-center justify-end gap-1 border-t border-solid border-appcolor-300 pt-5"},ev.createElement("button",{className:"flex items-center rounded-xl px-4 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:()=>{a()}},ev.createElement(eY.Z,{id:"agent.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{type:"submit",className:"flex h-8 items-center self-end rounded-xl border border-solid border-transparent bg-primary px-6 py-2 text-sm font-medium text-white transition duration-150 ease-in-out hover:bg-primary/80 disabled:border-appcolor-400 disabled:bg-appcolor-300 disabled:text-appcolor-500",onClick:g},d?ev.createElement("div",{className:"scale-75"},ev.createElement(eI.Spinner,null)):ev.createElement(eY.Z,{id:"agent.add_to_knowledge",defaultMessage:"Add to knowledge"}))))},Hv=function(e){let{state:t,onClose:a,onSelectMedia:n}=e;return t.isOpen?ev.createElement(eI.ModalDialog,{backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:a,isOpen:t.isOpen,autofocus:!1,dialogBackdropValue:"second"},e=>{let{exit:a}=e;return ev.createElement(Hb,{exit:a,spaceId:t.spaceId,onSelectMedia:n})}):null},Hk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceMediasQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMediaFiltering"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderby"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMediaOrdering"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"media"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"orderby"},value:{kind:"Variable",name:{kind:"Name",value:"orderby"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMediaParts"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]};var HE=a(21762);let Hx=function(e){let{onLoadMoreCb:t}=e,a=ev.useRef(null),n=ev.useCallback(e=>{let a=e[0];console.log(a),a.isIntersecting&&t()},[t]);return ev.useEffect(()=>{let e=a.current;if(null==e)return;let t=new IntersectionObserver(n);return t.observe(e),()=>{t.unobserve(e),t.disconnect()}},[n]),ev.createElement("tr",{ref:a,className:"border-b border-appcolor-300"},ev.createElement("td",{colSpan:4,className:"text-gray-900 whitespace-normal py-2 text-sm font-medium"},ev.createElement(eI.Spinner,null)))},H_=function(e){let{mediaKind:t,transcriptEmbeddingStatus:a}=e,n=og()("flex mx-auto w-fit rounded-full px-3 py-1 text-xs");switch(a){case ei.StatusCode.OK:return ev.createElement("span",{className:og()(n,"bg-success text-white")},ev.createElement(eY.Z,{id:"agent.status.ready",defaultMessage:"Ready"}));case ei.StatusCode.ACCEPTED:return ev.createElement("span",{className:og()(n,"bg-appcolor-300 text-appcolor-500")},ev.createElement(eY.Z,{id:"agent.status.training",defaultMessage:"Training"}));case ei.StatusCode.BAD_REQUEST:return ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.the_source_is_invalid_and_will_be_excluded_from_knowledge",defaultMessage:"The source is invalid and will be excluded from knowledge."}))},ev.createElement("span",{className:og()(n,"bg-appcolor-300 text-appcolor-500")},ev.createElement(eY.Z,{id:"agent.status.not_trainable",defaultMessage:"Not Trainable"})));case ei.StatusCode.NOT_FOUND:return ev.createElement("span",{className:og()(n,"bg-appcolor-300 text-appcolor-800")},ev.createElement(eY.Z,{id:"agent.status.not_ready",defaultMessage:"Not Ready"}));default:return ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement("span",null,"webpage"===t?ev.createElement(eY.Z,{id:"agent.tooltip.crawling_failed_unable_to_process_the_link_provided",defaultMessage:"Crawling Failed: Unable to process the link provided."}):"youtube"===t?ev.createElement(eY.Z,{id:"agent.tooltip.transcription_failed_unable_to_process_the_youtube_link_provided",defaultMessage:"Transcription Failed: Unable to process the YouTube link provided."}):ev.createElement(eY.Z,{id:"agent.tooltip.there_is_a_problem_processing_this_source",defaultMessage:"There's a problem processing this source."})))},ev.createElement(tn.Icon,{className:"text-danger",icon:"automate_warning"}))}},Hw=function(e){let{spaceMedia:t,onSelect:a}=e,n=(0,cx.computeMediaKind)(t.data.fileDesc.mimetype),l=ev.useMemo(()=>{let e=$k(t.data.fileDesc)??"",a=(0,sX.extractFileExtension)(e),n=a.length>0?e.slice(0,-1*(a.length+1)):e;return`${n}.${a}`},[t.data.fileDesc]),r=t.data.fileDesc.extension,o=Td(t.data.fileDesc,"h_200,w_200","xhdpi")??"/images/file-placeholder2.png";return ev.createElement("tr",{className:"duration-250 cursor-pointer border-b border-appcolor-300 transition ease-in-out hover:bg-appcolor-200",onClick:()=>{a(t)}},ev.createElement("td",{className:"text-gray-900 w-8/12 truncate whitespace-normal py-2 text-sm font-medium"},ev.createElement("div",{className:"flex items-center gap-4 whitespace-normal pr-2"},ev.createElement("img",{className:"h-6 w-6 rounded-lg object-cover",alt:l,title:l,src:o}),ev.createElement("span",null,l??"Untitled"))),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},ev.createElement(H_,{mediaKind:n,transcriptEmbeddingStatus:t.transcriptEmbeddingStatus})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},r))},HN=function(e){let{spaceMedia:t,onSelect:a}=e,{s3KeyOriginal:n}=t.data.fileDesc,l=(0,wo.a)(["ogp",n],async()=>{let e=`https://files.taskade.com/${n}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),r=l.data?.ogTitle,o=ev.useMemo(()=>{if(null!=r)return r;let e=(0,cx.getMediaLocationDesc)(t.data.fileDesc.id);return null==e?"Youtube (Unknown)":"youtube"!==e.type?"Unknown":`Youtube (${e.id})`},[r,t.data.fileDesc.id]),i=l.data?.ogImage?.[0]?.url??"/images/file-placeholder2.png";return ev.createElement("tr",{className:"cursor-pointer border-b border-appcolor-300 transition duration-150 ease-in-out hover:bg-appcolor-200",onClick:()=>{a(t)}},ev.createElement("td",{className:"text-gray-900 w-8/12 truncate whitespace-normal py-2 text-sm font-medium"},ev.createElement("div",{className:"flex items-center gap-4 whitespace-normal pr-2"},ev.createElement("img",{className:"h-6 w-6 rounded-lg object-cover",alt:o,title:o,src:i}),ev.createElement("span",null,o??"Untitled"))),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},ev.createElement(H_,{mediaKind:"youtube",transcriptEmbeddingStatus:t.transcriptEmbeddingStatus})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.type.link",defaultMessage:"link"})))},HC=function(e){let{spaceMedia:t,onSelect:a}=e,{s3KeyOriginal:n}=t.data.fileDesc,l=(0,wo.a)(["ogp",n],async()=>{let e=`https://files.taskade.com/${n}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),r=l.data?.ogTitle,o=ev.useMemo(()=>{if(null!=r)return r;let e=(0,cx.getMediaLocationDesc)(t.data.fileDesc.id);return null==e?"Youtube (Unknown)":"youtube"!==e.type?"Unknown":`Youtube (${e.id})`},[r,t.data.fileDesc.id]),i=l.data?.ogImage?.[0]?.url??"/images/file-placeholder2.png";return ev.createElement("tr",{className:"cursor-pointer border-b border-appcolor-300 transition duration-150 ease-in-out hover:bg-appcolor-200",onClick:()=>{a(t)}},ev.createElement("td",{className:"text-gray-900 w-8/12 truncate whitespace-normal py-2 text-sm font-medium"},ev.createElement("div",{className:"flex items-center gap-4 whitespace-normal pr-2"},ev.createElement("img",{className:"h-6 w-6 rounded-lg object-cover",alt:o,title:o,src:i}),ev.createElement("span",null,o??"Untitled"))),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},ev.createElement(H_,{mediaKind:"youtube",transcriptEmbeddingStatus:t.transcriptEmbeddingStatus})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.type.youtube",defaultMessage:"youtube"})))},HM=function(e){let{connection:t,fetchMore:a,loading:n,onSelectMedia:l}=e,{edges:r,pageInfo:o}=t,i=ev.useMemo(()=>o.hasNextPage&&null!=o.endCursor?n?()=>{}:()=>{a({variables:{after:o.endCursor}})}:void 0,[a,n,o.endCursor,o.hasNextPage]);return ts()(r)?ev.createElement("div",{className:"flex h-full items-center justify-center py-12"},ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(lT.UC,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.no_media_files_yet",defaultMessage:"No media files!"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.files_attached_to_tasks_can_be_used_to_add_knowledge",defaultMessage:"Files attached to tasks can be used to add knowledge."})))):ev.createElement("div",{className:"mt-4 overflow-x-auto"},ev.createElement("table",{className:"min-w-full table-auto"},ev.createElement("thead",{className:"border-b border-appcolor-300"},ev.createElement("tr",null,ev.createElement("th",{className:"min-w-8/12 sticky top-0 bg-appcolor-0/90 py-3 text-left text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(HE.R,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.title",defaultMessage:"Enhance your agent's knowledge with documents, links, or video transcripts."}))},ev.createElement(eY.Z,{id:"agent.title",defaultMessage:"Title"}))),ev.createElement("th",{className:"min-w-3/12 sticky top-0 bg-appcolor-0/90 py-3 pr-4 text-center text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(HE.R,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.status",defaultMessage:"Only 'Trained' knowledge is accessible by the agent."}))},ev.createElement(eY.Z,{id:"agent.status",defaultMessage:"Status"}))),ev.createElement("th",{className:"min-w-1/12 sticky top-0 bg-appcolor-0/90 py-3 pr-4 text-left text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(HE.R,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.type",defaultMessage:"Knowledge types can be documents, links, or video transcripts."}))},ev.createElement(eY.Z,{id:"agent.type",defaultMessage:"Type"}))))),ev.createElement("tbody",null,r.map(e=>{let{node:t}=e,a=(0,cx.computeMediaKind)(t.data.fileDesc.mimetype);return"webpage"===a?ev.createElement(HN,{key:t.id,spaceMedia:t,onSelect:l}):"youtube"===a?ev.createElement(HC,{key:t.id,spaceMedia:t,onSelect:l}):ev.createElement(Hw,{key:t.id,spaceMedia:t,onSelect:l})}),null!=i&&ev.createElement(Hx,{onLoadMoreCb:i}))))},HS=function(e){let{spaceId:t,onSelectMedia:a}=e,{data:n,error:l,fetchMore:r,loading:o}=(0,eB.a)(Hk,{variables:{spaceID:t,filterby:{canAskAi:!0},orderby:{sort:M.CreatedAt,direction:"desc"}},fetchPolicy:"network-only",notifyOnNetworkStatusChange:!0}),i=n?.membership;if(null==i&&o)return ev.createElement("div",{className:"flex h-full items-center justify-center py-12"},ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(eI.Spinner,null)));if(null!=l)return ev.createElement("div",{className:"flex h-full items-center justify-center py-12"},ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(lT.UC,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.error_loading_media",defaultMessage:"Error loading media!"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.unable_to_load_media_files_please_try_again",defaultMessage:"Unable to load media files. Please try again."}))));if(null==i)return ev.createElement("div",{className:"flex h-full items-center justify-center py-12"},ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(lT.UC,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.error_loading_media",defaultMessage:"Error loading media!"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.unable_to_load_media_files_please_verify_your_permissions",defaultMessage:"Unable to load media files. Please verify your permissions."}))));let s=i.space.media;return ev.createElement(HM,{connection:s,fetchMore:r,loading:o,onSelectMedia:a})},HI=function(e){let{exit:t,spaceId:a,onSelectMedia:n}=e,l=T_((0,eI.useTheme)());return ev.createElement("div",{className:"flex h-full flex-col items-stretch p-8",style:l},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("h1",{className:"text-md flex items-center text-appcolor-1000"},ev.createElement(tn.Icon,{className:"mr-2 shrink-0",icon:"ai_media"}),ev.createElement(eY.Z,{id:"agent.add_media",defaultMessage:"Add Media"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.media_knowledge_description",defaultMessage:"Add knowledge from your workspace media. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),ev.createElement(HS,{spaceId:a,onSelectMedia:e=>{n(e),t()}}))},HD=function(e){let{state:t,onClose:a,onSelectMedia:n}=e;return t.isOpen?ev.createElement(eI.ModalDialog,{backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:a,isOpen:t.isOpen,autofocus:!1,dialogBackdropValue:"second",className:"h-full max-h-dialog w-full max-w-3xl rounded-xl border border-solid border-appcolor-300 bg-appcolor-0"},e=>{let{exit:a}=e;return ev.createElement(HI,{exit:a,spaceId:t.spaceId,onSelectMedia:n})}):null},HT=function(e){let t=(0,ll.x)(),{exit:a,spaceId:n,onSelectMedia:l}=e,[r,o]=ev.useState(""),[i,s]=ev.useState(void 0),[d,c]=ev.useState(!1),m=(0,eB.a)(sW),u=m.data?.me?.id??null,p=T_((0,eI.useTheme)()),g=async()=>{(0,ei.assert)(null!=u),c(!0);try{s(void 0);let e=await t.mutate({mutation:Hy,variables:{input:{clientMutationId:(0,ld.Z)(),url:r}}});if(null==e.data)throw new ei.HttpError({code:"BAD_REQUEST"});let o=e.data.mediadeWebpageRead.file,i=await t.mutate({mutation:Hh,variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:n,fileDesc:o}}});(0,ei.assert)(null!=i.data);let{media:d}=i.data.spaceMediaCreate;l(d),c(!1),a()}catch(e){s((0,ei.getMessageFromError)(e)),c(!1)}};return ev.createElement("div",{className:"flex max-h-96 w-full max-w-sm flex-col gap-4 rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 p-8",style:p},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("h1",{className:"text-md flex items-center text-appcolor-1000"},ev.createElement(tn.Icon,{className:"mr-2 shrink-0",icon:"ai_youtube"}),ev.createElement(eY.Z,{id:"agent.youtube_add",defaultMessage:"Add YouTube"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.add_youtube_knowledge_description",defaultMessage:"Add YouTube transcripts as knowledge. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),null!=i&&ev.createElement("div",{className:"mt-2 rounded-xl border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,i)),ev.createElement("div",{className:"flex flex-col rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{className:"resize-vertical bg-transparent px-3 py-3 placeholder:text-appcolor-500",placeholder:"Type or paste a Youtube link...",minRows:4,value:r,onChange:e=>o(e.target.value)})),ev.createElement("div",{className:"flex w-full items-center justify-end gap-1 border-t border-solid border-appcolor-300 pt-5"},ev.createElement("button",{className:"flex items-center rounded-xl px-4 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:()=>{a()}},ev.createElement(eY.Z,{id:"agent.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{type:"submit",className:"flex h-8 items-center self-end rounded-xl border border-solid border-transparent bg-primary px-6 py-2 text-sm font-medium text-white transition duration-150 ease-in-out hover:bg-primary/80 disabled:border-appcolor-400 disabled:bg-appcolor-300 disabled:text-appcolor-500",onClick:g},d?ev.createElement("div",{className:"scale-75"},ev.createElement(eI.Spinner,null)):ev.createElement(eY.Z,{id:"agent.add_to_knowledge",defaultMessage:"Add to knowledge"}))))},H$=function(e){let{state:t,onClose:a,onSelectMedia:n}=e;return t.isOpen?ev.createElement(eI.ModalDialog,{backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:a,isOpen:t.isOpen,autofocus:!1,dialogBackdropValue:"second"},e=>{let{exit:a}=e;return ev.createElement(HT,{exit:a,spaceId:t.spaceId,onSelectMedia:n})}):null},HP=function(e){let{value:t,name:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,value:t,name:a});return ev.createElement("button",{className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",...r.props},n)},HF=function(e){let{onSelectItem:t,selected:a}=e,n=ev.useRef(null),l=ev.useRef(null),r=function(){let e=(0,eK.Z)();return[{value:"default",label:e.formatMessage({id:"general.default_persona",defaultMessage:"Default Persona"})},{value:"marketing-expert",label:e.formatMessage({id:"general.ai_chat_persona_marketing_expert",defaultMessage:"\uD83D\uDCCA Marketing Expert"})},{value:"financial-advisor",label:e.formatMessage({id:"general.ai_chat_persona_financial_advisor",defaultMessage:"\uD83D\uDCB0 Financial Advisor"})},{value:"product-manager",label:e.formatMessage({id:"general.ai_chat_persona_product_manager",defaultMessage:"\uD83D\uDCE6 Product Manager"})},{value:"startup-tech-lawyer",label:e.formatMessage({id:"general.ai_chat_persona_legal_advisor",defaultMessage:"⚖️ Legal Advisor"})},{value:"software-developer",label:e.formatMessage({id:"general.ai_chat_persona_software_developer",defaultMessage:"\uD83D\uDCBB Software Developer"})},{value:"graphic-designer",label:e.formatMessage({id:"general.ai_chat_persona_graphic_designer",defaultMessage:"\uD83C\uDFA8 Graphic Designer"})},{value:"hr-consultant",label:e.formatMessage({id:"general.ai_chat_persona_hr_consultant",defaultMessage:"\uD83D\uDC65 HR Consultant"})},{value:"tech-writer",label:e.formatMessage({id:"general.ai_chat_persona_copywriter",defaultMessage:"✍️ Copywriter"})},{value:"startup-idea-generator",label:e.formatMessage({id:"general.ai_chat_persona_idea_architect",defaultMessage:"\uD83D\uDCA1 Idea Architect"})},{value:"professional-salesperson",label:e.formatMessage({id:"general.ai_chat_persona_sales_expert",defaultMessage:"\uD83D\uDECD️ Sales Expert"})},{value:"career-counselor",label:e.formatMessage({id:"general.ai_chat_persona_career_counselor",defaultMessage:"\uD83D\uDCBC Career Counselor"})},{value:"life-coach",label:e.formatMessage({id:"general.ai_chat_persona_life_coach",defaultMessage:"\uD83C\uDF1F Life Coach"})},{value:"customer-support-agent",label:e.formatMessage({id:"general.ai_chat_persona_customer_support_agent",defaultMessage:"\uD83D\uDCDE Customer Support Agent"})},{value:"mindfulness-coach",label:e.formatMessage({id:"general.ai_chat_persona_mindfulness_coach",defaultMessage:"\uD83E\uDDD8‍♀️ Mindfulness Coach"})},{value:"life-hacker",label:e.formatMessage({id:"general.ai_chat_persona_life_hacker",defaultMessage:"⚡ Life Hacker"})},{value:"nutritionist",label:e.formatMessage({id:"general.ai_chat_persona_nutritionist",defaultMessage:"\uD83C\uDF4F Nutritionist"})},{value:"personal-trainer",label:e.formatMessage({id:"general.ai_chat_persona_personal_trainer",defaultMessage:"\uD83D\uDCAA Personal Trainer"})},{value:"travel-guide",label:e.formatMessage({id:"general.ai_chat_persona_travel_guide",defaultMessage:"\uD83D\uDDFA️ Travel Guide"})},{value:"journalist",label:e.formatMessage({id:"general.ai_chat_persona_journalist",defaultMessage:"\uD83D\uDCF0 Journalist"})},{value:"diy-expert",label:e.formatMessage({id:"general.ai_chat_persona_diy_expert",defaultMessage:"\uD83D\uDD28 DIY Expert"})},{value:"professional-chef",label:e.formatMessage({id:"general.ai_chat_persona_professional_chef",defaultMessage:"\uD83D\uDC68‍\uD83C\uDF73 Professional Chef"})},{value:"academic-researcher",label:e.formatMessage({id:"general.ai_chat_persona_researcher",defaultMessage:"\uD83E\uDDE0 Researcher"})},{value:"language-tutor",label:e.formatMessage({id:"general.ai_chat_persona_tutor",defaultMessage:"\uD83D\uDCDA Tutor"})},{value:"entrepreneur",label:e.formatMessage({id:"general.ai_chat_persona_entrepreneur",defaultMessage:"\uD83D\uDE80 Entrepreneur"})},{value:"ecommerce-strategist",label:e.formatMessage({id:"general.ai_chat_persona_ecommerce_strategist",defaultMessage:"\uD83D\uDED2 E-Commerce Strategist"})},{value:"seo-expert",label:e.formatMessage({id:"general.ai_chat_persona_seo_expert",defaultMessage:"\uD83D\uDD0D SEO Expert"})},{value:"programming-genius",label:e.formatMessage({id:"general.ai_chat_persona_programming_genius",defaultMessage:"\uD83D\uDCBB Programmer"})},{value:"content-creator",label:e.formatMessage({id:"general.ai_chat_persona_content_creator",defaultMessage:"✍️ Content Creator"})},{value:"socialmedia-influencer",label:e.formatMessage({id:"general.ai_chat_persona_social_media_influencer",defaultMessage:"\uD83D\uDCF1 Influencer"})},{value:"investor",label:e.formatMessage({id:"general.ai_chat_persona_investor",defaultMessage:"\uD83D\uDCC8 Investor"})},{value:"pr-specialist",label:e.formatMessage({id:"general.ai_chat_persona_pr_specialist",defaultMessage:"\uD83D\uDDE3️ PR Specialist"})},{value:"business-mentor",label:e.formatMessage({id:"general.ai_chat_persona_business_mentor",defaultMessage:"\uD83E\uDDE0 Business Coach"})},{value:"negotiator",label:e.formatMessage({id:"general.ai_chat_persona_negotiator",defaultMessage:"\uD83E\uDD1D Negotiation Expert"})}]}(),o=ev.useMemo(()=>new Map(r.map(e=>[e.value,e])),[r]),i=null!=a?o.get(a):null,[s,d]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),c=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:s,placement:"bottom-start"}),m=(0,eI.useMenuButton)({ref:n,state:s,dispatch:d}),u=ev.useCallback(e=>{if("Activate"===e.type){let{value:a}=e.payload;"default"===a?t(null):t(a)}d({type:"Collapse"})},[t]);return ev.createElement("div",null,ev.createElement("button",{...m.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),s.expanded?d({type:"Collapse"}):d({type:"Expand"})},className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-1 text-sm text-appcolor-600 hover:border-appcolor-500"},null==i?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"ai_persona"}),ev.createElement(eY.Z,{id:"ai.persona",defaultMessage:"Persona"})):ev.createElement("span",{className:"pl-1"},i.label),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),s.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:d,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:u},ev.createElement(eI.Menu,{className:"flex max-h-80 w-60 flex-col overflow-y-scroll rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0},r.map(e=>ev.createElement(HP,{name:e.value,key:e.value,value:e.value},e.label))))))},HA=function(e){let{value:t,name:a,children:n,disabled:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a});return ev.createElement("button",{className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"opacity-50":l}),...o.props},n)},HR=function(e){let{onMediaSelected:t}=e,a=ev.useRef(null),n=ev.useRef(null),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),o=(0,eI.usePopup)({referenceElementRef:a,popupElementRef:n,state:l,placement:"bottom-start"}),i=(0,eI.useMenuButton)({ref:a,state:l,dispatch:r}),s=ev.useCallback(e=>{if("Activate"===e.type){let{name:a}=e.payload;switch(a){case"add_file":case"add_link":case"add_media":case"add_youtube":t?.(a)}}r({type:"Collapse"})},[t]);return ev.createElement("div",null,ev.createElement("button",{...i.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),l.expanded?r({type:"Collapse"}):r({type:"Expand"})},className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"ai_add"}),ev.createElement(eY.Z,{id:"ai.add_source",defaultMessage:"Add source"})),l.expanded&&ev.createElement(eI.Popup,{...o.props,dispatch:r,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:s},ev.createElement(eI.Menu,{className:"flex w-fit flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0},ev.createElement(HA,{name:"add_file"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"ai_upload"}),ev.createElement(eY.Z,{id:"ai.add_file",defaultMessage:"Upload (.pdf, .csv, .txt)"})),ev.createElement(HA,{name:"add_media"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"ai_media"}),ev.createElement(eY.Z,{id:"ai.add_media",defaultMessage:"Add from media"})),ev.createElement(HA,{name:"add_link"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"ai_url"}),ev.createElement(eY.Z,{id:"ai.add_link",defaultMessage:"Add link"})),ev.createElement(HA,{name:"add_youtube"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"ai_youtube"}),ev.createElement("span",{className:"truncate"},ev.createElement(eY.Z,{id:"ai.add_youtube",defaultMessage:"Youtube"}))),ev.createElement(HA,{name:"add_text",disabled:!0},ev.createElement(tn.Icon,{className:"shrink-0",icon:"ai_text"}),ev.createElement(eY.Z,{id:"ai.paste_text",defaultMessage:"Paste text"}),ev.createElement("span",{className:"ml-auto flex h-5 items-center rounded-full bg-appcolor-200 px-2 text-xs"},ev.createElement(eY.Z,{id:"ai.coming_soon",defaultMessage:"Coming soon"})))))))},Hj=function(e){let{value:t,name:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,value:t,name:a});return ev.createElement("button",{className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",...r.props},n)},HO=function(e){let{onSelectItem:t,selected:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=function(){let e=(0,eK.Z)();return[{value:"default",label:e.formatMessage({id:"general.default_tone",defaultMessage:"Default Tone"})},{value:"creative",label:e.formatMessage({id:"general.ai_chat_persona_creative",defaultMessage:"\uD83C\uDFA8 Creative"})},{value:"inspiring",label:e.formatMessage({id:"general.ai_chat_persona_inspiring",defaultMessage:"\uD83D\uDCA1 Inspiring"})},{value:"casual",label:e.formatMessage({id:"general.ai_chat_persona_casual",defaultMessage:"\uD83D\uDE0E Casual"})},{value:"confident",label:e.formatMessage({id:"general.ai_chat_tone_confident",defaultMessage:"\uD83D\uDCBC Confident"})},{value:"authoritative",label:e.formatMessage({id:"general.ai_chat_tone_authoritative",defaultMessage:"\uD83D\uDC51 Authoritative"})},{value:"friendly",label:e.formatMessage({id:"general.ai_chat_tone_friendly",defaultMessage:"\uD83D\uDE0A Friendly"})},{value:"empathetic",label:e.formatMessage({id:"general.ai_chat_tone_empathetic",defaultMessage:"\uD83D\uDC95 Empathetic"})},{value:"optimistic",label:e.formatMessage({id:"general.ai_chat_tone_optimistic",defaultMessage:"\uD83C\uDF08 Optimistic"})},{value:"formal",label:e.formatMessage({id:"general.ai_chat_tone_formal",defaultMessage:"\uD83D\uDC54 Formal"})},{value:"serious",label:e.formatMessage({id:"general.ai_chat_tone_serious",defaultMessage:"\uD83D\uDC69‍\uD83D\uDCBC Serious"})},{value:"warm",label:e.formatMessage({id:"general.ai_chat_tone_warm",defaultMessage:"\uD83D\uDD25 Warm"})},{value:"humourous",label:e.formatMessage({id:"general.ai_chat_tone_humourous",defaultMessage:"\uD83D\uDE02 Humourous"})},{value:"informal",label:e.formatMessage({id:"general.ai_chat_tone_informal",defaultMessage:"\uD83D\uDC5F Informal"})},{value:"clinical",label:e.formatMessage({id:"general.ai_chat_tone_clinical",defaultMessage:"\uD83D\uDC89 Clinical"})},{value:"playful",label:e.formatMessage({id:"general.ai_chat_tone_playful",defaultMessage:"\uD83C\uDF88 Playful"})},{value:"emotional",label:e.formatMessage({id:"general.ai_chat_tone_emotional",defaultMessage:"\uD83D\uDE2D Emotional"})},{value:"sympathetic",label:e.formatMessage({id:"general.ai_chat_tone_sympathetic",defaultMessage:"\uD83D\uDE22 Sympathetic"})},{value:"tentative",label:e.formatMessage({id:"general.ai_chat_tone_tentative",defaultMessage:"\uD83D\uDC63 Tentative"})},{value:"cold",label:e.formatMessage({id:"general.ai_chat_tone_cold",defaultMessage:"\uD83E\uDDCA Cold"})},{value:"cynical",label:e.formatMessage({id:"general.ai_chat_tone_cynical",defaultMessage:"\uD83D\uDE12 Cynical"})},{value:"ironic",label:e.formatMessage({id:"general.ai_chat_tone_ironic",defaultMessage:"\uD83D\uDE43 Ironic"})},{value:"sarcastic",label:e.formatMessage({id:"general.ai_chat_tone_sarcastic",defaultMessage:"\uD83D\uDE0F Sarcastic"})},{value:"pessimistic",label:e.formatMessage({id:"general.ai_chat_tone_pessimistic",defaultMessage:"☔ Pessimistic"})}]}(),c=ev.useMemo(()=>new Map(d.map(e=>[e.value,e])),[d]),m=null!=a?c.get(a):null,u=ev.useCallback(e=>{if("Activate"===e.type){let{value:a}=e.payload;"default"===a?t(null):t(a)}o({type:"Collapse"})},[t]);return ev.createElement("div",null,ev.createElement("button",{...s.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),r.expanded?o({type:"Collapse"}):o({type:"Expand"})},className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-1 text-sm text-appcolor-600 hover:border-appcolor-500"},null==m?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"ai_tone"}),ev.createElement("span",null,ev.createElement(eY.Z,{id:"ai.tone",defaultMessage:"Tone"}))):ev.createElement("span",{className:"pl-1"},m.label),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:u},ev.createElement(eI.Menu,{className:"flex max-h-80 w-52 flex-col overflow-y-scroll rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0},d.map(e=>ev.createElement(Hj,{name:e.value,key:e.value,value:e.value},e.label))))))},HU=function(e){let{value:t,name:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,value:t,name:a});return ev.createElement("button",{className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",...r.props},n)},HZ=function(e){let{outputType:t}=e;switch(t){case"workflow":return ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_ai_spark"}),ev.createElement(eY.Z,{id:"ai.workflows",defaultMessage:"Workflows"}));case"mindmap":return ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_ai_spark"}),ev.createElement(eY.Z,{id:"ai.mindmaps",defaultMessage:"Mind Maps"}));case"project":return ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_ai_spark"}),ev.createElement(eY.Z,{id:"ai.projects",defaultMessage:"Projects"}));case"content":return ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_ai_spark"}),ev.createElement(eY.Z,{id:"ai.content",defaultMessage:"Content"}));case"note":return ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_ai_spark"}),ev.createElement(eY.Z,{id:"ai.notes",defaultMessage:"Notes"}));default:return ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_ai_spark",className:"shrink-0 scale-90"}),ev.createElement(eY.Z,{id:"ai.workflows",defaultMessage:"Workflows"}))}},HL=function(e){let{onSelectItem:t,selected:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{if("Activate"===e.type){let{name:a}=e.payload,n=hR.$b.safeParse(a);n.success&&t(n.data)}o({type:"Collapse"})},[t]);return ev.createElement("div",null,ev.createElement("button",{...s.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),r.expanded?o({type:"Collapse"}):o({type:"Expand"})},className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-1 text-sm text-appcolor-600 hover:border-appcolor-500"},ev.createElement(HZ,{outputType:a}),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(eI.Menu,{className:"flex w-52 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0},ev.createElement(HU,{name:"workflow"},ev.createElement(HZ,{outputType:"workflow"})),ev.createElement(HU,{name:"mindmap"},ev.createElement(HZ,{outputType:"mindmap"})),ev.createElement(HU,{name:"project"},ev.createElement(HZ,{outputType:"project"})),ev.createElement(HU,{name:"content"},ev.createElement(HZ,{outputType:"content"})),ev.createElement(HU,{name:"note"},ev.createElement(HZ,{outputType:"note"}))))))};function HB(e){let t=(0,sX.extractFileExtension)(e),a=t.length>0?e.slice(0,-1*(t.length+1)):e;return{ext:t,name:a}}let Hz=function(e){let{media:t,onDeleteMedia:a}=e,{name:n,ext:l}=HB($k(t.data.fileDesc)??"Untitled"),[r,{data:o,loading:i,error:s,called:d}]=(0,cs.D)($v),c=ev.useCallback(()=>{t.transcriptEmbeddingStatus!==ei.StatusCode.OK&&r({variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:t.id}}})},[t.id,t.transcriptEmbeddingStatus,r]),m=ev.useMemo(()=>{if(i)return ei.StatusCode.ACCEPTED;if(null!=s){let e=bH(s,["spaceMediaTrain"]);return console.log({error:s,graphqlError:e}),ei.StatusCode.INTERNAL_SERVER_ERROR}return o?.spaceMediaTrain.spaceMedia.transcriptEmbeddingStatus??t.transcriptEmbeddingStatus},[o?.spaceMediaTrain.spaceMedia.transcriptEmbeddingStatus,s,i,t.transcriptEmbeddingStatus]);ev.useEffect(()=>{d||c()},[d,c]);let{s3KeyOriginal:u}=t.data.fileDesc,p=(0,wo.a)(["ogp",u],async()=>{let e=`https://files.taskade.com/${u}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),g=p.data?.ogTitle,f=p.data?.ogImage?.[0]?.url??"/images/file-placeholder2.png",h=p.data?.ogUrl??"",y=ev.useRef(null),b=ev.useRef(null),v=ev.useRef(null),[k,E]=ev.useState(!1),{arrowProps:x,popperProps:_,referenceProps:w}=(0,eI.useControlledTooltip)({referenceElementRef:y,arrowElementRef:b,popperElementRef:v,placement:"top",visible:k});return ev.createElement(ev.Fragment,null,ev.createElement("div",{...w,onMouseEnter:()=>{E(!0)},onMouseLeave:()=>{E(!1)},className:og()("flex cursor-default items-center gap-x-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-1 text-sm",m===ei.StatusCode.OK?"text-appcolor-800":m===ei.StatusCode.ACCEPTED?"text-warning":"text-danger")},null!=f?ev.createElement("img",{className:"h-5 w-5 rounded-lg object-cover",alt:h,title:h,src:f}):ev.createElement(tn.Icon,{className:"scale-75",icon:"dd_project"}),null!=g?ev.createElement("span",{className:"max-w-[10rem] truncate"},g):ev.createElement(ev.Fragment,null,ev.createElement("span",{className:"max-w-[10rem] truncate"},n),l.length>0&&ev.createElement("span",{className:"text-appcolor-500"},".",l)),ev.createElement("button",{className:"ml-auto pl-1",onClick:()=>a(t)},ev.createElement(tn.Icon,{className:"shrink-0 scale-75 text-appcolor-500 hover:text-appcolor-800",icon:"dd_delete"}))),k&&ev.createElement(eI.Tooltip,{arrowProps:x,popperProps:_},m===ei.StatusCode.OK?ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"ai.tooltip.source_ready",defaultMessage:"Source will be included."})):m===ei.StatusCode.ACCEPTED?ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"ai.tooltip.source_training",defaultMessage:"Source is being trained at the moment."})):ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"ai.tooltip.issue_with_source",defaultMessage:"There's a problem with this source and will be excluded."}))))},HV=function(e){let{media:t,onDeleteMedia:a}=e,{name:n,ext:l}=HB($k(t.data.fileDesc)??"Untitled"),[r,{data:o,loading:i,error:s,called:d}]=(0,cs.D)($v),c=ev.useCallback(()=>{t.transcriptEmbeddingStatus!==ei.StatusCode.OK&&r({variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:t.id}}})},[t.id,t.transcriptEmbeddingStatus,r]),m=ev.useMemo(()=>{if(i)return ei.StatusCode.ACCEPTED;if(null!=s){let e=bH(s,["spaceMediaTrain"]);return console.log({error:s,graphqlError:e}),ei.StatusCode.INTERNAL_SERVER_ERROR}return o?.spaceMediaTrain.spaceMedia.transcriptEmbeddingStatus??t.transcriptEmbeddingStatus},[o?.spaceMediaTrain.spaceMedia.transcriptEmbeddingStatus,s,i,t.transcriptEmbeddingStatus]);ev.useEffect(()=>{d||c()},[d,c]);let u=ev.useRef(null),p=ev.useRef(null),g=ev.useRef(null),[f,h]=ev.useState(!1),{arrowProps:y,popperProps:b,referenceProps:v}=(0,eI.useControlledTooltip)({referenceElementRef:u,arrowElementRef:p,popperElementRef:g,placement:"top",visible:f});return ev.createElement(ev.Fragment,null,ev.createElement("div",{...v,onMouseEnter:()=>{h(!0)},onMouseLeave:()=>{h(!1)},className:og()("flex cursor-default items-center gap-x-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-1 text-sm",m===ei.StatusCode.OK?"text-appcolor-800":m===ei.StatusCode.ACCEPTED?"text-appcolor-500":"text-danger")},m===ei.StatusCode.OK?ev.createElement(tn.Icon,{className:"scale-75",icon:"dd_project"}):m===ei.StatusCode.ACCEPTED?ev.createElement("div",{className:"mr-1"},ev.createElement(eI.Spinner,{size:15,width:15,height:15})):ev.createElement(tn.Icon,{className:"scale-75",icon:"automate_warning"}),ev.createElement("span",{className:"max-w-[10rem] truncate"},n),l.length>0&&ev.createElement("span",{className:"text-appcolor-500"},".",l),ev.createElement("button",{className:"ml-auto pl-1",onClick:()=>a(t)},ev.createElement(tn.Icon,{className:"shrink-0 scale-75 text-appcolor-500 hover:text-appcolor-800",icon:"dd_delete"}))),f&&ev.createElement(eI.Tooltip,{arrowProps:y,popperProps:b},m===ei.StatusCode.OK?ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"ai.tooltip.source_ready",defaultMessage:"Source will be included."})):m===ei.StatusCode.ACCEPTED?ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"ai.tooltip.source_training",defaultMessage:"Source is being trained at the moment."})):ev.createElement("div",{className:"max-w-xs text-center"},ev.createElement(eY.Z,{id:"ai.tooltip.issue_with_source",defaultMessage:"There's a problem with this source and will be excluded."}))))},Hq=function(e){let{media:t,onDeleteMedia:a}=e,n=(0,cx.computeMediaKind)(t.data.fileDesc.mimetype);return"webpage"===n||"youtube"===n?ev.createElement(Hz,{media:t,onDeleteMedia:a}):ev.createElement(HV,{media:t,onDeleteMedia:a})},HW=function(e){let t=(0,ll.x)(),{mutate:a}=(0,wu.D)({mutationFn:async e=>{let{id:a,spaceId:n,file:l}=e,r=await OI("space_file",l.name,l.size,void 0,n);if(!r.ok)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Something went wrong. Please try again."});let o=r.payload,{s3ObjectKey:i}=await OD(l,o,l.name),s=await OS(i,o),d=await t.mutate({mutation:Hh,variables:{input:{clientMutationId:a,spaceId:n,fileDesc:{...s.data}}}});(0,ei.assert)(null!=d.data);let{clientMutationId:c,media:m}=d.data.spaceMediaCreate;return{clientMutationId:c,media:m}},onSuccess(t){let{clientMutationId:a,media:n}=t;e.onMediaCreate?.(a,n)}});ev.useEffect(()=>{a(e.pendingFileUpload)},[a,e.pendingFileUpload]);let{ext:n,name:l}=function(e){let t=e.name??"",a=(0,sX.extractFileExtension)(e.name),n=a.length>0?t.slice(0,-1*(a.length+1)):t;return{base:t,ext:a,name:n}}(e.pendingFileUpload.file);return ev.createElement("div",{className:"flex cursor-default items-center gap-x-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-3 py-1 text-sm text-appcolor-500"},ev.createElement("div",{className:"mr-1"},ev.createElement(eI.Spinner,{size:15,width:15,height:15})),ev.createElement("span",{className:"max-w-[10rem] truncate"},l),ev.createElement("span",{className:"text-appcolor-500"},".",n))},HH="PromptSection",HG="PromptItem";function HK(e){let t=(0,eK.Z)(),a=[{label:`${t.formatMessage({id:"general.create_a_task_list_for",defaultMessage:"Create a task list for "})}...`,value:t.formatMessage({id:"general.create_a_task_list_for",defaultMessage:"Create a task list for "})},{label:`${t.formatMessage({id:"general.design_a_flow_chart_for",defaultMessage:"Design a flow chart for "})}...`,value:t.formatMessage({id:"general.design_a_flow_chart_for",defaultMessage:"Design a flow chart for "})},{label:`${t.formatMessage({id:"general.automate_a_process_for",defaultMessage:"Automate a process for "})}...`,value:t.formatMessage({id:"general.automate_a_process_for",defaultMessage:"Automate a process for "})},{label:`${t.formatMessage({id:"general.map_out_a_weekly_plan_for",defaultMessage:"Map out a weekly plan for "})}...`,value:t.formatMessage({id:"general.map_out_a_weekly_plan_for",defaultMessage:"Map out a weekly plan for "})},{label:`${t.formatMessage({id:"general.build_a_client_intake_flow_for",defaultMessage:"Build a client intake flow for "})}...`,value:t.formatMessage({id:"general.build_a_client_intake_flow_for",defaultMessage:"Build a client intake flow for "})},{label:`${t.formatMessage({id:"general.create_an_onboarding_flow_for",defaultMessage:"Create an onboarding flow for "})}...`,value:t.formatMessage({id:"general.create_an_onboarding_flow_for",defaultMessage:"Create an onboarding flow for "})},{label:`${t.formatMessage({id:"general.build_a_pipeline_management_flow_for",defaultMessage:"Build a pipeline management flow for "})}...`,value:t.formatMessage({id:"general.build_a_pipeline_management_flow_for",defaultMessage:"Build a pipeline management flow for "})}],n=[{label:`${t.formatMessage({id:"general.brainstorm_ideas_for",defaultMessage:"Brainstorm ideas for "})}...`,value:t.formatMessage({id:"general.brainstorm_ideas_for",defaultMessage:"Brainstorm ideas for "})},{label:`${t.formatMessage({id:"general.design_a_content_outline_for",defaultMessage:"Design a content outline for "})}...`,value:t.formatMessage({id:"general.design_a_content_outline_for",defaultMessage:"Design a content outline for "})},{label:`${t.formatMessage({id:"general.construct_a_decision_tree_for",defaultMessage:"Construct a decision tree for "})}...`,value:t.formatMessage({id:"general.construct_a_decision_tree_for",defaultMessage:"Construct a decision tree for "})},{label:`${t.formatMessage({id:"general.develop_a_writing_workflow_for",defaultMessage:"Develop a writing workflow for "})}...`,value:t.formatMessage({id:"general.develop_a_writing_workflow_for",defaultMessage:"Develop a writing workflow for "})},{label:`${t.formatMessage({id:"general.draft_a_problem_solving_framework_for",defaultMessage:"Draft a problem-solving framework for "})}...`,value:t.formatMessage({id:"general.draft_a_problem_solving_framework_for",defaultMessage:"Draft a problem-solving framework for "})},{label:`${t.formatMessage({id:"general.plan_a_visual_content_promotion_workflow_for",defaultMessage:"Plan a visual content promotion workflow for "})}...`,value:t.formatMessage({id:"general.plan_a_visual_content_promotion_workflow_for",defaultMessage:"Plan a visual content promotion workflow for "})},{label:`${t.formatMessage({id:"general.formulate_a_standard_operating_procedure_for",defaultMessage:"Formulate a Standard Operating Procedure (SOP) for "})}...`,value:t.formatMessage({id:"general.formulate_a_standard_operating_procedure_for",defaultMessage:"Formulate a Standard Operating Procedure (SOP) for "})}],l=[{label:`${t.formatMessage({id:"general.plan_a_project_for",defaultMessage:"Plan a project for "})}...`,value:t.formatMessage({id:"general.plan_a_project_for",defaultMessage:"Plan a project for "})},{label:`${t.formatMessage({id:"general.create_a_sprint_for",defaultMessage:"Create a sprint for "})}...`,value:t.formatMessage({id:"general.create_a_sprint_for",defaultMessage:"Create a sprint for "})},{label:`${t.formatMessage({id:"general.create_a_project_timeline_for",defaultMessage:"Create a project timeline for "})}...`,value:t.formatMessage({id:"general.create_a_project_timeline_for",defaultMessage:"Create a project timeline for "})},{label:`${t.formatMessage({id:"general.create_an_editorial_calendar_for",defaultMessage:"Create an editorial calendar for "})}...`,value:t.formatMessage({id:"general.create_an_editorial_calendar_for",defaultMessage:"Create an editorial calendar for "})},{label:`${t.formatMessage({id:"generate.create_a_team_agenda_for",defaultMessage:"Create a team meeting agenda for "})}...`,value:t.formatMessage({id:"generate.create_a_team_agenda_for",defaultMessage:"Create a team meeting agenda for "})},{label:`${t.formatMessage({id:"general.develop_project_risk_management_plan_for",defaultMessage:"Develop project risk management plan for "})}...`,value:t.formatMessage({id:"general.develop_project_risk_management_plan_for",defaultMessage:"Develop project risk management plan for "})},{label:`${t.formatMessage({id:"general.develop_project_team_roles_and_responsibilities_for",defaultMessage:"Develop project team roles and responsibilities for "})}...`,value:t.formatMessage({id:"general.develop_project_team_roles_and_responsibilities_for",defaultMessage:"Develop project team roles and responsibilities for "})}];return[{type:"section",label:"prompts",items:({workflow:a,mindmap:n,project:l,content:[{label:`${t.formatMessage({id:"general.write_an_article_for",defaultMessage:"Write an article for "})}...`,value:t.formatMessage({id:"general.write_an_article_for",defaultMessage:"Write an article for "})},{label:`${t.formatMessage({id:"general.compose_an_email_for",defaultMessage:"Compose an email for "})}...`,value:t.formatMessage({id:"general.compose_an_email_for",defaultMessage:"Compose an email for "})},{label:`${t.formatMessage({id:"general.craft_a_compelling_story_for",defaultMessage:"Craft a compelling story for "})}...`,value:t.formatMessage({id:"general.craft_a_compelling_story_for",defaultMessage:"Craft a compelling story for "})},{label:`${t.formatMessage({id:"general.create_social_media_posts_for",defaultMessage:"Create social media posts for "})}...`,value:t.formatMessage({id:"general.create_social_media_posts_for",defaultMessage:"Create social media posts for "})},{label:`${t.formatMessage({id:"general.write_a_product_description_for",defaultMessage:"Write a product description for "})}...`,value:t.formatMessage({id:"general.write_a_product_description_for",defaultMessage:"Write a product description for "})},{label:`${t.formatMessage({id:"general.generate_seo_outline_for",defaultMessage:"Generate SEO optimized outline for "})}...`,value:t.formatMessage({id:"general.generate_seo_keywords_for",defaultMessage:"Generate SEO optimized outline for "})},{label:`${t.formatMessage({id:"general.produce_a_content_marketing_strategy_for",defaultMessage:"Produce a content marketing strategy for "})}...`,value:t.formatMessage({id:"general.produce_a_content_marketing_strategy_for",defaultMessage:"Produce a content marketing strategy for "})}],note:[{label:`${t.formatMessage({id:"general.draft_an_outline_for",defaultMessage:"Draft an outline for "})}...`,value:t.formatMessage({id:"general.draft_an_outline_for",defaultMessage:"Draft an outline for "})},{label:`${t.formatMessage({id:"general.construct_a_mindmap_for",defaultMessage:"Construct a mindmap for "})}...`,value:t.formatMessage({id:"general.construct_a_mindmap_for",defaultMessage:"Construct a mindmap for "})},{label:`${t.formatMessage({id:"general.generate_bulleted_lists_for",defaultMessage:"Generate bulleted lists for "})}...`,value:t.formatMessage({id:"general.formulate_bulleted_lists_for",defaultMessage:"Generate bulleted lists for "})},{label:`${t.formatMessage({id:"general.create_structured_notes_for",defaultMessage:"Create structured notes for "})}...`,value:t.formatMessage({id:"general.create_structured_notes_for",defaultMessage:"Create structured notes for "})},{label:`${t.formatMessage({id:"general.prepare_a_meeting_agenda_for",defaultMessage:"Prepare a meeting agenda for "})}...`,value:t.formatMessage({id:"general.prepare_a_meeting_agenda_for",defaultMessage:"Prepare a meeting agenda for "})},{label:`${t.formatMessage({id:"general.establish_a_knowledge_base_for",defaultMessage:"Establish a knowledge base for "})}...`,value:t.formatMessage({id:"general.establish_a_knowledge_base_for",defaultMessage:"Establish a knowledge base for "})},{label:`${t.formatMessage({id:"general.condense_an_article_or_webpage_for",defaultMessage:"Condense an article or webpage for "})}...`,value:t.formatMessage({id:"general.condense_an_article_or_webpage_for",defaultMessage:"Condense an article or webpage for "})}]})[e].map(e=>{let{label:t}=e;return{label:t,values:[t],data:{prompt:e},render:HG}}),render:HH}]}let HY=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-3 mb-1 flex h-7 items-center rounded-md px-2 py-1 text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{icon:"dd_ai_spark"}),ev.createElement("span",{className:"pl-3"},t.label),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},HQ={[HG]:e=>ev.createElement(HY,{morseChildProps:e})},HJ={[HH]:()=>ev.createElement(ev.Fragment,null)},HX=(e,t)=>((0,ei.assert)(null!=e),e.length>32)?[]:new to.Z(t,{keys:["values"],threshold:0}).search(e).map(e=>e.item),H0=function(e){var t;let{onExit:a,onDeleteMedia:n,onSelectMedia:l,onSelectOutput:r,onSelectPersona:o,onSelectTone:i,outputType:s,persona:d,sourceMedias:c,spaceId:m,submitPrompt:u,tone:p}=e,[g,f]=ev.useState([]),h=ev.useMemo(()=>[...Bn,...Bl].map(e=>`.${e}`).join(","),[]),[y,b]=ev.useState(""),[v,k]=ev.useState({isOpen:!1}),[E,x]=ev.useState({isOpen:!1}),[_,w]=ev.useState({isOpen:!1}),N=ev.useRef(null),C=ev.useRef(null),M=(0,e$.useDispatch)();ev.useEffect(()=>{N.current?.focus()},[]);let S=ev.useMemo(()=>g.length>0,[g]),I=(e,t)=>{f(t=>{let a=t.findIndex(t=>t.id===e);return -1===a?t:Ml()(t,{$splice:[[a,1]]})}),l(t)},D=ev.useCallback(e=>{switch(e){case"add_media":k({isOpen:!0,spaceId:m});break;case"add_file":C.current?.click();break;case"add_link":x({isOpen:!0,spaceId:m});break;case"add_youtube":w({isOpen:!0,spaceId:m})}},[m]),T=ev.useRef(null),$=HK(s??"workflow"),P=(t=e=>{b(`${e.value} `),N.current?.focus()},ev.useCallback(e=>{t(e.data.prompt)},[t])),F=ev.useCallback(async e=>{if(null==e.currentTarget.files)return;let t=e.currentTarget.files[0];null!=t&&f(e=>Ml()(e,{$push:[{id:(0,ld.Z)(),spaceId:m,file:t}]}))},[m]),A=(0,eK.Z)();return ev.createElement(ev.Fragment,null,ev.createElement("div",{onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),T.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),T.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),T.current?.getVisibleItemCount()===0?S||u(y):T.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),a()}}},ev.createElement("div",{className:"flex items-center gap-x-3 border-b border-appcolor-300 py-2 pl-4 pr-5"},ev.createElement(Dx.Z,{ref:N,className:"w-full resize-none bg-transparent py-2 pr-4 text-sm",placeholder:A.formatMessage({id:"general.enter_your_goal_task_or_next_big_project",defaultMessage:"Enter your goal, task, or next big project ..."}),value:y,onChange:e=>{b(e.target.value)},minRows:3,maxRows:12}),ev.createElement("button",{disabled:S,className:"flex items-center text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),T.current?.getVisibleItemCount()===0?0===g.length&&u(y):T.current?.activateCurrentItem()}},ev.createElement(tn.Icon,{icon:"message_send"}))),ev.createElement("div",{className:"flex flex-wrap gap-1 px-3 py-3"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>{M(co.actions.toggleAiPromptTemplatesDialog())}},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"})),ev.createElement(HL,{selected:s,onSelectItem:e=>{r(e),N.current?.focus()}}),ev.createElement(HF,{selected:d,onSelectItem:e=>{o(e),N.current?.focus()}}),ev.createElement(HO,{selected:p,onSelectItem:e=>{i(e),N.current?.focus()}}),c.map(e=>ev.createElement(Hq,{key:e.id,media:e,onDeleteMedia:n})),g.map(e=>ev.createElement(HW,{key:e.id,pendingFileUpload:e,onMediaCreate:I})),ev.createElement(HR,{onMediaSelected:D}),ev.createElement("div",null,ev.createElement("input",{ref:C,accept:h,onChange:F,type:"file",title:"",disabled:g.length>0,className:"absolute h-0 w-0 cursor-pointer opacity-0"}))),ev.createElement("div",null,ev.createElement(tT,{ref:T,term:y,data:$,renderMap:HQ,onActivate:P,sectionRenderMap:HJ,search:HX,renderEmptyState:ev.createElement("div",{className:"hidden py-4"})}))),ev.createElement(HD,{state:v,onClose:()=>{k({isOpen:!1})},onSelectMedia:l}),ev.createElement(Hv,{state:E,onClose:()=>{x({isOpen:!1})},onSelectMedia:l}),ev.createElement(H$,{state:_,onClose:()=>{w({isOpen:!1})},onSelectMedia:l}))},H1=eL.default.div.withConfig({displayName:"AiCreateProjectDialogBody__Container",componentId:"sc-f0bbd7dd-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,H2=function(e){let{spaceId:t,onExit:a}=e,[n,l]=ev.useState(null),[r,o]=ev.useState(null),[i,s]=ev.useState(null),[d,c]=ev.useState(null),[m,u]=ev.useState([]),p=ev.useCallback(e=>{u(t=>t.filter(t=>t.id!==e.id))},[]),g=ev.useCallback(e=>{u(t=>{let a=t.findIndex(t=>t.id===e.id);return a>=0?Ml()(t,{[a]:{$set:e}}):[...t,e]})},[]);return ev.createElement(H1,{className:"w-full rounded-xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement("div",{className:"w-full rounded-xl p-4"},ev.createElement("div",{className:"w-full overflow-clip rounded-xl border-[1px] border-appcolor-300"},null!=n&&n.trim().length>0?ev.createElement(Hf,{outputType:r,persona:i,prompt:n,sourceMedias:m,spaceId:t,tone:d,onExit:a}):ev.createElement(H0,{onExit:a,onDeleteMedia:p,onSelectMedia:g,onSelectOutput:o,onSelectPersona:s,onSelectTone:c,outputType:r,persona:i,sourceMedias:m,spaceId:t,submitPrompt:e=>{l(e)},tone:d}))))},H5=(0,e$.connect)(function(e){return e.dialogs.aiCreateProject})(function(e){let{isOpen:t,dispatch:a}=e,{spaceId:n}=e;return t&&null!=n?ev.createElement(eI.ModalDialog,{backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:()=>{a(Nj.actions.toggleAiCreateProjectDialog())},isOpen:t,autofocus:!1,className:"flex w-full max-w-3xl justify-center"},e=>{let{exit:t}=e;return ev.createElement(H2,{spaceId:n,onExit:t})}):null}),H3=(0,la.ZP)` + query ProjectCommitsQuery($documentId: ID!, $last: Int!, $before: String!) { + document(id: $documentId) { + id + commits(last: $last, before: $before) { + edges { + node { + id + document_id + revision + changeset + created_at + createdOn + author { + ...BasicUserFields + } + } + cursor + } + pageInfo { + hasPreviousPage + endCursor + } + } + } + } + ${up} +`,H4=(0,la.ZP)` + query ProjectLatestCommitsQuery($documentId: ID!, $last: Int!) { + document(id: $documentId) { + id + revision + contents + space { + id + } + commits(last: $last) { + edges { + node { + id + document_id + revision + changeset + created_at + createdOn + author { + ...BasicUserFields + } + } + cursor + } + pageInfo { + hasPreviousPage + endCursor + } + } + } + } + ${up} +`,H6=function(e,t){let a=e.pages[t.payload.id];return null!=a&&a.options.skip?Ml()(e,{pages:{[t.payload.id]:{options:{skip:{$set:!1}}}}}):e},H8=function(e,t){let{id:a,document:n}=t.payload,l=e.pages[a];if(null==l||null!=l.data||n.id!==e.documentId)return e;if(0===a){let t=n.contents,l=n.revision;if(null==t||null==l)return e;let r=n.commits,o=[];for(let e of r.edges)o.push(e.node);let i=li.Contents.deserialize(t),s={id:e.documentId,contents:i,revision:l};Mr(s,o.slice().reverse());{let t=e;if(t=Ml()(t,{pages:{[a]:{data:{$set:{commits:o,contents:s.contents,revision:s.revision}}}}}),r.pageInfo.hasPreviousPage&&null!=r.pageInfo.endCursor){let e={query:H3,options:{skip:!0,variables:{documentId:t.documentId,last:100,before:r.pageInfo.endCursor}},data:null};t=Ml()(t,{pages:{$push:[e]}})}return Ml()(t,{contents:{$set:i},latestRevision:{$set:n.revision},spaceId:{$set:n.space?.id??null}})}}{let t=e.pages[a-1].data;if(null==t)return e;let l=t.contents,r=t.revision;if(null==r||null==l)return e;let o=n.commits,i=[];for(let e of o.edges)i.push(e.node);let s={id:e.documentId,contents:l,revision:r};Mr(s,i.slice().reverse());{let t=e;if(t=Ml()(t,{pages:{[a]:{data:{$set:{commits:i,contents:s.contents,revision:s.revision}}}}}),o.pageInfo.hasPreviousPage&&null!=o.pageInfo.endCursor){let e={query:H3,options:{skip:!0,variables:{documentId:t.documentId,last:100,before:o.pageInfo.endCursor}},data:null};t=Ml()(t,{pages:{$push:[e]}})}return t}}},H7=function(e,t){switch(t.type){case"LOAD":return H6(e,t);case"LOADED":return H8(e,t);default:return e}},H9=function(e){return{documentId:e.documentId,spaceId:null,contents:null,latestRevision:null,pages:[{query:H4,options:{skip:!1,variables:{documentId:e.documentId,last:100,before:null},fetchPolicy:"network-only"},data:null}]}},Ge=function(e){let{commit:t,onClickPreview:a,index:n,selectedCommitId:l,latestRevision:r,onRestore:o,timezone:i,timeFormat:s}=e,d=(0,eK.Z)(),c=CR(t.created_at,i),m=eG().tz(t.created_at,i).format(s),u=t.id===l,p=r===t.endRevision,g=u&&!p,f=t.authors.map(e=>e.handle);return null!=t.guests&&t.guests.length>0&&f.push(d.formatMessage({id:"general.guest_count",defaultMessage:"{number, plural, one {# guest} other {# guests}}"},{number:t.guests.length})),ev.createElement(Gt,null,ev.createElement(Gn,{onClick:()=>{a(t.id,n)},$isSelected:u},ev.createElement(Ga,null),ev.createElement(Gr,null,p?ev.createElement(eY.Z,{id:"history_revert.current_version",defaultMessage:"Current Version"}):ev.createElement(ev.Fragment,null,`${c} at ${m}`)),!p&&ev.createElement(Gl,null,d.formatMessage({id:"history_revert.authors",defaultMessage:"edited by {authors}"},{authors:f.length>0?d.formatList(f,{style:"long",type:"conjunction"}):d.formatMessage({id:"general.guest",defaultMessage:"Guest"})}))),g&&ev.createElement(Go,{onClick:()=>{o(t.created_at,m)}},ev.createElement(eY.Z,{id:"history_revert.restore_button",defaultMessage:"Restore"})))},Gt=eL.default.div.withConfig({displayName:"CommitRow__Wrapper",componentId:"sc-9950713e-0"})` + display: flex; + justify-content: space-between; + position: relative; + align-items: center; + margin-bottom: 12px; +`,Ga=eL.default.div.withConfig({displayName:"CommitRow__CommitRing",componentId:"sc-9950713e-1"})` + display: flex; + width: 16px; + height: 16px; + border-radius: 16px; + position: absolute; + left: -21px; + top: 3px; + background: ${e=>e.theme.isNightMode?"#1C1F21":"#fbfbfb"}; + transition: border-color 0.2s ease-in-out, transform 0.2s ease-in-out; +`,Gn=eL.default.button.withConfig({displayName:"CommitRow__Button",componentId:"sc-9950713e-2"})` + border: none; + cursor: pointer; + background: none; + padding: 1px 12px; + text-align: left; + + display: flex; + flex: 1; + flex-direction: column; + color: ${e=>e.theme.textColors.hex("10")}; + + ${e1.UiTypography.sm} + + &:focus { + outline: 0; + } + + ${Ga} { + transform: ${e=>e.$isSelected?"scale(1.2)":"inherit"}; + border: 2px solid + ${e=>e.$isSelected?e.theme.primaryColorScheme?.base:e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + } + &:hover { + color: ${e=>e.theme.textColors.hex("10")}; + ${Ga} { + border-color: ${e=>e.theme.primaryColorScheme?.base}; + } + } +`,Gl=eL.default.span.withConfig({displayName:"CommitRow__Authors",componentId:"sc-9950713e-3"})` + margin-top: 0.25rem; + color: ${e=>e.theme.textColors.hex("50")}; + + /* todo (dionis@taskade.com) replace with handmade */ + font-size: 13px; + line-height: 16px; +`,Gr=eL.default.span.withConfig({displayName:"CommitRow__Date",componentId:"sc-9950713e-4"})` + font-weight: 500; +`,Go=eL.default.button.withConfig({displayName:"CommitRow__RestoreButton",componentId:"sc-9950713e-5"})` + display: flex; + border-radius: 26px; + border: none; + cursor: pointer; + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + color: ${e=>e.theme.primaryColorScheme?.base}; + padding: 6px 16px; + transition: background-color 0.2s ease-in-out; + + ${e1.UiTypography.sm} + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha30}; + } + + &:focus { + outline: 0; + } +`,Gi=function(e){let{pageData:t,setContents:a,selectedCommitId:n,setSelectedCommitId:l,latestRevision:r,onRestore:o,timezone:i,timeFormat:s}=e,d=ev.useMemo(()=>(function(e){let t=[],a=null;for(let n of e){if(null!=a){let e=CP()(a);CF(null!=e,"Expected last commit to not be nullish");let l=function(e,t){let a=t-Date.parse(e);return a<6e4?5e3:a<36e5?1e4:a<864e5?36e5:864e5}(e.created_at,Date.now());Date.parse(e.created_at)-Date.parse(n.created_at)>l&&(CF(null!=CT()(a),"Expected first commit edge to not be nullish"),t.push(a),a=null)}null==a?a=[n]:a.push(n)}null!=a&&(CF(null!=CT()(a),"Expected first commit edge to not be nullish"),t.push(a),a=null);let n=[];for(let e of t){let t=function(e){let t=CT()(e),a=CP()(e);if(null==t||null==a)return null;let n=[],l=new Set;for(let t of e)null!=t.author&&l.add(t.author),n.push(t.changeset);let r=n.slice().reverse(),o=(0,li.compactChangesets)(r),i=new Set;for(let e of o.metadata)for(let t of e.guests)i.add(t);return{authors:Array.from(l),guests:Array.from(i),changeset:o,createdOn:t.createdOn,created_at:t.created_at,endRevision:t.revision,id:t.id}}(e);null!=t&&n.push(t)}return n})(t.commits),[t.commits]),c=(e,n)=>{let r=t.contents;d?.[n]!=null&&(d.slice(n,d.length).reverse().forEach(e=>{r=r.apply(e.changeset)}),a(r),l(e))};return ev.createElement(Gs,null,d.map((e,a)=>ev.createElement(ev.Fragment,null,ev.createElement(Ge,{onClickPreview:c,key:e.id,index:a,commit:e,selectedCommitId:n,latestRevision:r,onRestore:o,timezone:i,timeFormat:s}),1===d.length&&r===e.endRevision&&0===t.revision&&ev.createElement(Gm,null,ev.createElement(Gd,null,ev.createElement(Gc,null,ev.createElement(lT.j0,null)))))))},Gs=eL.default.div.withConfig({displayName:"CommitsPageData__Timeline",componentId:"sc-5da951c-0"})` + display: flex; + flex-direction: column; + border-left: 1px solid ${e=>e.theme.borderColorHex}; + margin-left: 20px; + margin: 0 0 0 16px; + padding-left: 12px; +`,Gd=eL.default.div.withConfig({displayName:"CommitsPageData__TimelinePlaceholderWrapper",componentId:"sc-5da951c-1"})` + display: flex; + width: 183px; + overflow: hidden; + left: -21px; + position: relative; +`,Gc=eL.default.div.withConfig({displayName:"CommitsPageData__TimelinePlaceholder",componentId:"sc-5da951c-2"})` + display: flex; + flex: 1 0 auto; + transform: ${e=>e.theme.isNightMode?"translateX(-183px)":"translateX(0)"}; +`,Gm=eL.default.div.withConfig({displayName:"CommitsPageData__TimelinePlaceholderContainer",componentId:"sc-5da951c-3"})` + position: relative; + + &:before { + background: ${e=>e.theme.isNightMode?"linear-gradient(rgba(29, 31, 33, 0), rgba(29, 31, 33, 1))":"linear-gradient(rgba(251, 251, 251, 0), rgba(251, 251, 251, 1))"}; + content: ''; + display: block; + position: absolute; + left: -21px; + right: 0; + bottom: 0; + top: 0; + z-index: 1; + } +`,Gu=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)();return ev.createElement("div",{className:"mx-1 my-2 flex gap-x-1 rounded-md border border-appcolor-300 px-4 py-5 text-sm"},ev.createElement(eY.Z,{id:"general.upgrade_to_unlock_longer_project_history",defaultMessage:"Upgrade to unlock longer project history."}),ev.createElement("div",{className:"flex w-44 cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75",onClick:()=>{a(d4(t))}},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))},Gp=eL.default.button.withConfig({displayName:"CommitsPage__StyledLoadMoreButton",componentId:"sc-c55be7fd-0"})` + width: 100%; + padding: 12px; + border: 1px solid ${e=>e.theme.borderColorHex}; + color: ${e=>e.theme.textColors.hex("50")}; + background: none; + border-radius: 10px; + margin-top: 20px; + cursor: pointer; + text-align: center; + + /* todo (dionis@taskade.com) replace with handmade */ + font-size: 16px; + line-height: 18px; + + &:hover, + &:focus { + border-color: ${e=>e.theme.isNightMode?"#363C41":"#ccc"}; + color: ${e=>e.theme.textColors.hex("10")}; + } + + &:focus { + outline: 0; + } +`,Gg=eL.default.div.withConfig({displayName:"CommitsPage__Note",componentId:"sc-c55be7fd-1"})` + padding: 0; + margin-bottom: 20px; + color: ${e=>e.theme.textColors.hex("50")}; + + ${e1.UiTypography.sm} + + align-items: center; + justify-content: center; + height: 60vh; + display: flex; + padding: 1em; +`,Gf=eL.default.h4.withConfig({displayName:"CommitsPage__Heading",componentId:"sc-c55be7fd-2"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,Gh=eL.default.p.withConfig({displayName:"CommitsPage__Description",componentId:"sc-c55be7fd-3"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(60)}; + margin: 0 0 16px; +`,Gy=eL.default.div.withConfig({displayName:"CommitsPage__EmptyImageWrapper",componentId:"sc-c55be7fd-4"})` + margin-bottom: 24px; + opacity: 40%; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,Gb=eL.default.div.withConfig({displayName:"CommitsPage__EmptyWrapper",componentId:"sc-c55be7fd-5"})` + text-align: center; + padding: 1em; +`,Gv=function(e){let{dispatch:t,id:a,page:n,setContents:l,selectedCommitId:r,setSelectedCommitId:o,latestRevision:i,onRestore:s,timezone:d,timeFormat:c}=e,{data:m,loading:u,error:p}=(0,eB.a)(n.query,n.options),g=m?.document;if((0,ev.useEffect)(()=>{u||null==g||t({type:"LOADED",payload:{id:a,document:g}})},[t,g,a,u]),n.options.skip)return ev.createElement(Gp,{onClick:e=>{e.preventDefault(),e.stopPropagation(),t({type:"LOAD",payload:{id:a}})}},"Load More");if(u)return ev.createElement(Gg,null,ev.createElement(eI.Spinner,null));if(null!=p){let e=p.graphQLErrors[0];if(null!=e&&CN(e)){let t=e.extensions.spaceId;if(null!=t)return ev.createElement(Gu,{spaceId:t})}}return null==n.data?ev.createElement(Gg,null,ev.createElement(eY.Z,{id:"history_revert.project_not_found",defaultMessage:"Project not found."})):0===n.data.commits.length?ev.createElement(Gg,null,ev.createElement(Gb,null,ev.createElement(Gy,null,ev.createElement(lT.O8,null)),ev.createElement(Gf,null,ev.createElement(eY.Z,{id:"history_revert.empty_title",defaultMessage:"No history for this project"})),ev.createElement(Gh,null,ev.createElement(eY.Z,{id:"history_revert.empty_description",defaultMessage:"See changes made to this project or time travel with version history."})))):ev.createElement(Gi,{pageData:n.data,setContents:l,selectedCommitId:r,setSelectedCommitId:o,latestRevision:i,onRestore:s,timezone:d,timeFormat:c})};class Gk extends ev.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){er.$e(a=>{if(null!=e.scope){if(null!=e.scope.contexts)for(let[t,n]of Object.entries(e.scope.contexts))a.setContext(t,n);if(null!=e.scope.extras)for(let[t,n]of Object.entries(e.scope.extras))a.setExtra(t,n);if(null!=e.scope.tags)for(let[t,n]of Object.entries(e.scope.tags))a.setTag(t,n)}a.setContext("errorInfo",t),er.Tb(e)})}render(){return null!=this.state.error?ev.createElement(Gg,null,ev.createElement(eY.Z,{id:"history_dropdown.error_loading",defaultMessage:"There's an error loading history. Please try again later."})):this.props.children}}let GE=function(e){let{shouldShowPaywall:t}=e,a=(0,e$.useDispatch)();return t?ev.createElement("div",{className:"mx-1 flex items-center gap-1 rounded-md border border-appcolor-300 px-2 py-5 text-sm"},ev.createElement(eY.Z,{id:"general.access_full_version_history",defaultMessage:"Upgrade to access the full version history."}),ev.createElement("div",{className:"flex cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade px-4 py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75",onClick:()=>{a(d4())}},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))):null},Gx=(0,d9.oM)({name:"dialogs.projectAiAddBlock",initialState:{isOpen:!1},reducers:{toggleProjectAiAddBlockDialog:(e,t)=>e.isOpen?{isOpen:!1}:{isOpen:!0,nodeId:t?.payload?.nodeId}}}),G_=function(e){let{onClick:t,name:a,value:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({onClick:t,stopRef:l,name:a,value:n});return ev.createElement("button",{...r.props,className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":r.navigated})},ev.createElement("span",{className:"animate-color-rainbow"},ev.createElement(tn.Icon,{className:"shrink-0 scale-80",icon:"dd_ai_spark"})),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ai_generator",defaultMessage:"AI Generator"})))},Gw=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(cF,o.props,t)},GN=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-e1be3015-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background-color: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + + & .block-check path { + stroke: #0977ff; + } + & .block-bullet path { + fill: #efab37; + } + & .block-number path { + fill: #e33534; + } + & .block-text path { + fill: #ab29eb; + } +`,GC=function(e){let{children:t,className:a,nodeId:n}=e,l=(0,e$.useDispatch)(),r=(0,ev.useCallback)(e=>{let t=qv(e);null==n?l(Da({id:null,position:"beforeend"},t)):l(Da({id:n,position:"beforebegin"},t))},[l,n]),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=ev.useRef(null),d=ev.useRef(null),c=ev.useCallback(()=>{s.current?.focus()},[]);(0,eI.usePopupEvents)({state:o,onCollapse:c});let m=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:o,placement:"bottom"}),u=(0,eI.useMenuButton)({dispatch:i,ref:s,state:o}),p=ev.useCallback(e=>{if("Activate"===e.type&&"add_block"===e.payload.name&&null!=e.payload.value){let{value:t}=e.payload;r(t)}"ai_generator"===e.payload.name&&l(Gx.actions.toggleProjectAiAddBlockDialog({nodeId:n})),i({type:"Collapse"})},[l,r,n]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()(a,{"opacity-100":o.expanded}),...u.props},ev.createElement("span",{className:"divider flex h-px w-full bg-appcolor-300"}),t,ev.createElement("span",{className:"divider flex h-px w-full bg-appcolor-300"})),o.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:i,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:p},ev.createElement(GN,{initialFocus:m.initialFocus,loop:!0},ev.createElement(G_,{name:"ai_generator",value:"ai_generator"}),li.CHILDREN_FORMATS.map(e=>ev.createElement(Gw,{key:e,name:"add_block",value:e},ev.createElement(tn.Icon,{icon:q7[e]}),ev.createElement(eY.Z,q8[e])))))))},GM=(0,eL.css)` + /* Hide Original Checkbox */ + & [type='checkbox']:not(:checked), + & [type='checkbox']:checked { + position: absolute; + display: none; + } + + & [type='checkbox'] + label:before { + background: none; + } + + & [type='checkbox']:not(:checked) + label, + & [type='checkbox']:checked + label { + opacity: 1; + float: left; + width: 1.25rem; + min-height: 1.375rem; + + position: relative; + top: 0.1875rem; + left: 0; + z-index: 2; + cursor: pointer; + } + + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + content: ''; + position: absolute; + left: 0px; + top: 0px; + width: 1.125rem; + height: 1.125rem; + } + /* Not Checked Style */ + & [type='checkbox']:not(:checked) + label:before { + } + + /* Not Checked: Hover */ + & [type='checkbox']:not(:checked) + label:hover:before { + } + + /* Checked Style */ + & [type='checkbox']:checked + label:before { + } + + /* Checked: Hover */ + & [type='checkbox']:checked + label:hover:before { + } + + /* Checkbox Icon: Check Icon */ + & [type='checkbox']:not(:checked) + label:after, + & [type='checkbox']:checked + label:after { + position: absolute; + font-size: 0.875rem; + line-height: 0.8; + } + + /* Checkbox Icon: Not Checked */ + & [type='checkbox']:not(:checked) + label:after { + opacity: 0; + transform: scale(0); + content: url('/../images/check_selected3.svg'); + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + /* Checkbox Icon: Not Checked Hover */ + & [type='checkbox']:not(:checked) + label:hover:after { + } + + /* Checkbox Icon: Checked */ + & [type='checkbox']:checked + label:after { + } +`,GS=(0,eL.css)` + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + border-radius: 6px; + content: ''; + } + /* Checked Style */ + & [type='checkbox']:checked + label:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + } + /* Checked: Hover */ + & [type='checkbox']:checked + label:hover:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + } + /* Checkbox Icon: Check Icon */ + & [type='checkbox']:not(:checked) + label:after, + & [type='checkbox']:checked + label:after { + content: url('/../images/check_selected3.svg'); + top: 0.25rem; + left: 0.25rem; + } + /* Checkbox Icon: Not Checked */ + & [type='checkbox']:not(:checked) + label:after { + opacity: 0; + transform: scale(0); + content: url('/../images/check_selected3.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + & [type='checkbox']:not(:checked) + label:hover:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected3.svg":"/../images/check_hover3.svg"}); + opacity: 1; + transform: scale(1); + } + /* Checkbox Icon: Checked */ + & [type='checkbox']:checked + label:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_selected3.svg'); + } +`,GI=(0,eL.css)` + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + border-radius: 25px; + content: ''; + } + /* Checked Style */ + & [type='checkbox']:checked + label:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + } + /* Checked: Hover */ + & [type='checkbox']:checked + label:hover:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + } + /* Checkbox Icon: Check Icon */ + & [type='checkbox']:not(:checked) + label:after, + & [type='checkbox']:checked + label:after { + content: url('/../images/check_selected3.svg'); + top: 0.25rem; + left: 0.25rem; + } + /* Checkbox Icon: Not Checked */ + & [type='checkbox']:not(:checked) + label:after { + opacity: 0; + transform: scale(0); + content: url('/../images/check_selected3.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + & [type='checkbox']:not(:checked) + label:hover:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected3.svg":"/../images/check_hover3.svg"}); + opacity: 1; + transform: scale(0.9); + } + /* Checkbox Icon: Checked */ + & [type='checkbox']:checked + label:after { + opacity: 1; + transform: scale(0.9); + content: url('/../images/check_selected3.svg'); + } +`,GD=(0,eL.css)` + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + border-radius: 25px; + content: ''; + } + /* Checkbox Icon: Check Icon */ + & [type='checkbox']:not(:checked) + label:after, + & [type='checkbox']:checked + label:after { + content: url('/../images/check_heart2.svg'); + top: 2px; + left: 0px; + } + /* Checkbox Icon: Not Checked */ + & [type='checkbox']:not(:checked) + label:after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_heart2.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + & [type='checkbox']:not(:checked) + label:hover:after { + content: url('/../images/check_heart_selected2.svg'); + opacity: 1; + transform: scale(1); + } + /* Checkbox Icon: Checked */ + & [type='checkbox']:checked + label:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_heart_selected2.svg'); + } +`,GT=(0,eL.css)` + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + left: 0.375rem; + top: 0.375rem; + width: 0.5rem; + height: 0.5rem; + border-radius: 25px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + & [type='checkbox']:not(:checked) + label:hover:before { + transform: scale(1.6); + } + /* Checked Style */ + & [type='checkbox']:checked + label:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + & [type='checkbox']:checked + label:hover:before { + transform: scale(1.6); + } +`,G$=(0,eL.css)` + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + border-radius: 25px; + content: ''; + } + /* Checkbox Icon: Check Icon */ + & [type='checkbox']:not(:checked) + label:after, + & [type='checkbox']:checked + label:after { + content: url('/../images/check_triangle.svg'); + left: 0.375rem; + top: 0.1875rem; + } + /* Checkbox Icon: Not Checked */ + & [type='checkbox']:not(:checked) + label:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_triangle.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + & [type='checkbox']:not(:checked) + label:hover:after { + content: url('/../images/check_triangle.svg'); + opacity: 1; + transform: scale(1.4); + } + /* Checkbox Icon: Checked */ + & [type='checkbox']:checked + label:after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_triangle_selected.svg'); + } +`,GP=(0,eL.css)` + /* Checkbox: Box + We use label:before to create the new box + */ + & [type='checkbox'] + label:before { + left: 0.375rem; + top: 0.375rem; + width: 0.5rem; + height: 0.5rem; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + border-radius: 1px; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + & [type='checkbox']:not(:checked) + label:hover:before { + transform: scale(1.6); + } + /* Checked Style */ + & [type='checkbox']:checked + label:before { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + & [type='checkbox']:checked + label:hover:before { + transform: scale(1.6); + } +`,GF=(0,eL.css)` + & > .title { + margin-bottom: 0.625rem; + + & > .format-controls { + display: none; + } + & .content { + font-size: 1rem; + padding-top: 0.125rem; + } + } + + &.has-child > .children { + margin-left: 0; + padding-left: 0; + } +`,GA=(0,eL.css)` + & > .title { + & > .format-controls { + display: none; + } + padding-bottom: 0.25rem; + + & .content { + font-weight: bold; + font-size: 1.25rem; + line-height: 1.625rem; + padding-top: 0.0625rem; + } + } + + &.has-child > .children { + margin-left: 0; + padding-left: 0; + } +`,GR=(0,eL.css)` + & > .title { + & > .format-controls { + display: none; + } + padding-bottom: 0.25rem; + + & .content { + font-size: 1.125rem; + font-weight: bold; + line-height: 1.75rem; + } + } + + &.has-child > .children { + margin-left: 0; + padding-left: 0; + } +`,Gj=(0,eL.css)` + & > .content { + padding-left: 1.625rem; + } + /* Position Label + This is what we style since label's for attribute will + check the correct checkbox input + */ + & [type='checkbox']:not(:checked) + label, + & [type='checkbox']:checked + label { + opacity: 1; + float: left; + top: 0.1875rem; + left: 0; + font-size: 1.0675rem; + line-height: 1.125rem; + color: ${e=>e.theme.appColors.hex(50)}; + text-align: center; + white-space: nowrap; + letter-spacing: 0; + } + & label:before { + color: ${e=>e.theme.appColors.hex(50)}; + float: left; + display: inline-block; + text-align: center; + padding-left: 0; + font-size: 0.9375rem; + width: inherit; + position: inherit; + } + & label:hover:before { + text-decoration: line-through; + } +`,GO=eL.default.div.withConfig({displayName:"styled__ProjectRootNode",componentId:"sc-402c6a6a-0"})` + display: flex; + + /* Formatting */ + & > .children { + border-left: none; + + & .node .title { + ${GM}; + } + + /* Format Mixins: Check */ + & .node.node-format-check > .title, + & .children.children-format-checklist > .node:not([class*='node-format']) > .title { + ${GS}; + } + + & .node.node-format-check2 > .title, + & .children.children-format-check2list > .node:not([class*='node-format']) > .title { + ${GI}; + } + + & .node.node-format-heart > .title, + & .children.children-format-heartlist > .node:not([class*='node-format']) > .title { + ${GD}; + } + + /* Format Mixins: Bullet */ + & .node.node-format-bullet > .title, + & .children.children-format-bulletlist > .node:not([class*='node-format']) > .title { + ${GT}; + } + + & .node.node-format-triangle > .title, + & .children.children-format-trianglelist > .node:not([class*='node-format']) > .title { + ${G$}; + } + + & .node.node-format-square > .title, + & .children.children-format-squarelist > .node:not([class*='node-format']) > .title { + ${GP}; + } + + /*Format Mixins: Headings / Text */ + & .node.node-format-text > .title, + & .children.children-format-textlist > .node:not([class*='node-format']) > .title { + ${GF}; + } + + & .node.node-format-text { + ${GF}; + } + & .node.node-format-h1 { + ${GA}; + } + & .node.node-format-h2 { + ${GR}; + } + + /* Format Mixins: Number/Alpha List */ + & .children.children-format-numberlist > .node:not([class*='node-format']) > .title, + & .children.children-format-alphalist > .node:not([class*='node-format']) > .title { + ${Gj}; + } + + & .children.children-format-numberlist { + counter-reset: nodeCounter; + & > .node:not([class*='node-format']) > .title > .format-controls > label:before { + counter-increment: nodeCounter; + content: counter(nodeCounter, decimal) '.'; + min-width: 26px; + padding-right: 4px; + } + + & > .node:is([class*='node-format-number']) > .title > .format-controls > label:before { + counter-increment: nodeCounter !important; + content: counter(nodeCounter, decimal) '.' !important; + } + } + + & .children.children-format-alphalist { + counter-reset: nodeCounter; + & > .node:not([class*='node-format']) > .title > .format-controls > label:before { + counter-increment: nodeCounter; + content: counter(nodeCounter, lower-alpha) '.'; + min-width: 26px; + padding-right: 4px; + } + + & > .node:is([class*='node-format-alpha']) > .title > .format-controls > label:before { + counter-increment: nodeCounter !important; + content: counter(nodeCounter, lower-alpha) '.' !important; + } + } + } + + /* Top-Level Children */ + counter-reset: nodeCounterNumber nodeCounterAlpha; + + & .node.node-format-number > .title, + & .node.node-format-alpha > .title { + ${Gj}; + } + & .node.node-format-number > .title > .format-controls label:before { + counter-increment: nodeCounterNumber; + content: counter(nodeCounterNumber, decimal) '.'; + min-width: 26px; + padding-right: 4px; + line-height: 1.05rem; + } + & .node.node-format-alpha > .title > .format-controls label:before { + counter-increment: nodeCounterAlpha; + content: counter(nodeCounterAlpha, lower-alpha) '.'; + min-width: 26px; + padding-right: 4px; + line-height: 1.05rem; + } + + & .node:not(.node-format-alpha, .node-format-number), + & .node:is(.node-format-alpha) + .node:is(.node-format-number), + & .node:is(.node-format-number) + .node:is(.node-format-alpha), + & .node:not(.node-format-alpha, .node-format-number) + .node { + counter-reset: nodeCounterNumber nodeCounterAlpha; + } + + & .children { + counter-reset: nodeCounterNumber nodeCounterAlpha; + } + + /* Paragraph top spacing */ + & .node + .node[class*='node-format-text'] { + margin-top: 8px; + } + + /* Formatting */ + & > .children { + & .node.node-format-h1 > .title .node-drag-handle { + height: 28px; + } + & .node.node-format-h1 > .title .node-fold-button { + height: 1.8rem; + } + & .node.node-format-h2 > .title .node-drag-handle { + height: 30px; + } + & .node.node-format-h2 > .title .node-fold-button { + height: 1.8rem; + } + + /* Override orgchat/mindmap zoom in smaller views because they revert to list styling */ + @media screen and (max-width: 767px) { + transform: scale(1) !important; + } + + /* Visual Hierarchy */ + & > .children { + & > .node > .title > .left-controls { + .node-unfold-button, + .node-fold-button { + & svg { + transform: scale(1.3) translateY(0px); + } + } + } + } + + /* Hide Root Guideline */ + & > .children > .node.has-child > .children:before { + //background: transparent; + //transition: background-color ease-in-out 150ms; + } + & > .children { + & > .node .node.has-child { + & .left-controls { + .node-unfold-button, + .node-fold-button { + & svg { + transform: translateY(-1px); + transition: opacity ease-in-out 150ms; + } + } + } + + & .left-controls { + .node-fold-button { + & svg { + opacity: 50%; + } + } + } + & .left-controls { + .node-unfold-button { + & svg { + opacity: 50%; + } + } + } + + &:hover > .children:before { + background: ${e=>e.theme.appColors.hex(50)}; + } + + &:hover .left-controls { + .node-unfold-button, + .node-fold-button { + & svg { + opacity: 100%; + } + + &:hover { + & svg { + opacity: 100%; + } + } + } + } + } + } +`,GU=eL.default.div.withConfig({displayName:"styled__ProjectTitle",componentId:"sc-402c6a6a-1"})` + display: inline-block; + width: 100%; + flex-direction: column; + min-height: 1.75rem; + position: relative; + margin-bottom: 20px; + padding: 0 26px; + + & .content { + width: 100%; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 1.375rem; + line-height: 1.75rem; + font-weight: normal; + cursor: text; + padding-right: 10px; + word-break: break-word; + } + + z-index: 3; +`,GZ=eL.default.div.withConfig({displayName:"styled__RightSide",componentId:"sc-402c6a6a-2"})` + display: flex; + width: 100%; + flex-direction: column; + + & > div:first-of-type { + display: flex; + } +`,GL=eL.default.div.withConfig({displayName:"styled__ProjectTitleWrapper",componentId:"sc-402c6a6a-3"})` + display: flex; + width: 100%; +`,GB=eL.default.div.withConfig({displayName:"styled__NodeChildren",componentId:"sc-402c6a6a-4"})` + .children { + } +`,Gz=eL.default.button.withConfig({displayName:"styled__AddSiblingButton",componentId:"sc-402c6a6a-5"})` + @media (min-width: 768px) { + margin: 0; + padding: 0; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + + width: 30px; + height: 30px; + } + + @media print { + display: none !important; + } +`,GV=eL.default.button.withConfig({displayName:"styled__AddChildButton",componentId:"sc-402c6a6a-6"})` + /* Guidelines should be disabled by default */ + display: none; + + @media (min-width: 768px) { + margin: 0; + padding: 0; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + + color: ${e=>e.theme.primaryColorScheme?.base} !important; + width: 30px; + height: 30px; + + &:focus { + outline: 0; + } + } +`,Gq=eL.default.span.withConfig({displayName:"styled__GuidelinePath",componentId:"sc-402c6a6a-7"})` + /* Guidelines should be disabled by default */ + display: none; +`,GW=eL.default.span.withConfig({displayName:"styled__GuidelineTo",componentId:"sc-402c6a6a-8"})` + /* Guidelines should be disabled by default */ + display: none; +`,GH=eL.default.span.withConfig({displayName:"styled__GuidelineFrom",componentId:"sc-402c6a6a-9"})` + /* Guidelines should be disabled by default */ + display: none; +`,GG=eL.default.div.withConfig({displayName:"styled__NodeAddBlockContainer",componentId:"sc-402c6a6a-10"})` + display: flex; + position: relative; + + @media print { + display: none; + } +`,GK=eL.default.div.withConfig({displayName:"styled__GuidelineBlockTo",componentId:"sc-402c6a6a-11"})` + position: absolute; + display: none; +`,GY=eL.default.div.withConfig({displayName:"styled__GuidelineBlockFrom",componentId:"sc-402c6a6a-12"})` + position: absolute; + display: none; +`,GQ=eL.default.div.withConfig({displayName:"styled__AddBlockTitle",componentId:"sc-402c6a6a-13"})` + display: flex; + flex: 1 0 auto; + height: fit-content; + + & .divider { + display: flex; + width: inherit; + height: 1px; + background: ${e=>e.theme.appColors.hex(80)}; + } +`,GJ=eL.default.div.withConfig({displayName:"styled__ProjectNode",componentId:"sc-402c6a6a-14"})` + /* Default */ + word-wrap: break-word; + word-break: break-word; + position: relative; + + /* Guideline */ + &.has-child > .children:before { + display: flex; + content: ' '; + height: calc(100% - 1.75rem); + width: 0.0625rem; + position: absolute; + z-index: 1; + left: 0.5rem; + top: 1.75rem; + background: ${e=>e.theme.appColors.hex(60)}; + } + + /* Recursive Indentation */ + &.has-child .children { + margin-left: 1.875rem; + } + + /* Format Controls */ + .format-controls { + margin-right: 0.5rem; + } + + /* Node Completed */ + &.completed > .title .content, + &.completed > .title .hashtag, + &.completed > .title .mention, + &.completed > .title .hashtag .highlight, + &.completed > .title .mention .highlight { + color: ${e=>e.theme.isNightMode?"#666":"#bfbfbf"}; + } + &.completed > .title .anchor, + &.completed > .title .anchor .highlight { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } + &.completed > .title .content { + text-decoration: line-through; + } + &.completed:hover > .title .content { + text-decoration: inherit; + } + &.completed > .title .highlight { + border-color: ${e=>e.theme.isNightMode?"#666":"#eee"}; + background: none; + text-decoration: none; + } + &.completed > .title .hashtag:hover .highlight, + &.completed > .title .mention:hover .highlight, + &.completed > .title .anchor:hover .highlight, + &.completed > .title .hashtag:hover, + &.completed > .title .mention:hover, + &.completed > .title .anchor:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + + &.completed > .title .attachment-wrapper .attachment-item { + filter: grayscale(1); + &:hover { + filter: grayscale(0); + } + } + + /* Node Hover */ + & > .title { + &:hover { + background: ${e=>e.theme.appColors.hex(90)}; + } + } + &.node-create .title:hover { + background: ${e=>e.theme.isNightMode?"#282828":"#f8f8f8"}; + } +`,GX=eL.default.div.withConfig({displayName:"styled__AddBlock",componentId:"sc-402c6a6a-15"})` + display: flex; + width: 100%; + height: 0; +`,G0=(0,eL.default)(GC).withConfig({displayName:"styled__StyledInsertBlock",componentId:"sc-402c6a6a-16"})` + display: flex; + height: 1.875rem; + color: ${e=>e.theme.textColors.hex(50)}; + justify-content: center; + opacity: 1; + margin: 0; + padding: 0; + background: none; + border: 0; + cursor: pointer; + + position: absolute; + top: -20px; +`,G1=eL.default.div.withConfig({displayName:"styled__AddonWrapper",componentId:"sc-402c6a6a-17"})` + display: flex; + flex-direction: column; + width: 100%; + position: relative; + margin-top: 0.125rem; + + & .attachment-items-wrapper { + display: flex; + margin-bottom: 0.1875rem; + + & > div { + display: inline-flex; + flex-wrap: wrap; + gap: 0.625rem; + padding-bottom: 0.625rem; + } + + & .attachment-upload { + margin: 0.625rem 0 0 0.625rem; + } + + & .attachment-item, + & .attachment-upload { + display: flex; + flex-direction: column; + width: 10rem; + position: relative; + overflow: hidden; + border-radius: 0.75rem; + cursor: pointer; + margin: 0; + background: ${e=>e.theme.appColors.hex(10)}; + + & .file-actions { + opacity: 0; + transition: opacity 0.2s ease-in-out; + } + + & .details { + display: flex; + pointer-events: none; + width: 100%; + flex-direction: column; + padding: 8px 8px; + position: absolute; + bottom: 0; + background: rgba(0, 0, 0, 0.66); + transition: + transform 0.2s ease-in-out, + opacity 0.2s ease-in-out; + color: #fff; + font-size: 15px; + + & .embed-badge { + margin-top: -24px; + & > svg { + width: 36px; + } + } + + & .extension-badge { + display: flex; + align-self: flex-start; + padding: 3px 6px; + border-radius: 10px; + margin: 0 0 2px -2px; + font-weight: 500; + text-transform: uppercase; + background: #000; + } + + & .filename { + display: inline; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + + &:hover { + .file-actions, + .retry { + opacity: 1; + } + } + } + & .attachment-item { + img { + object-fit: cover; + width: 10rem; + height: 10rem; + } + } + } + + & .addon-badges { + display: flex; + flex-wrap: wrap; + flex-direction: row; + } +`,G2=eL.default.div.withConfig({displayName:"styled__AddonBadge",componentId:"sc-402c6a6a-18"})``,G5=eL.default.div.withConfig({displayName:"styled__ReactionWrapper",componentId:"sc-402c6a6a-19"})` + display: contents; +`,G3=eL.default.div.withConfig({displayName:"styled__AddonBadgeUpload",componentId:"sc-402c6a6a-20"})``,G4=eL.default.div.withConfig({displayName:"styled__AddonBadgeAssign",componentId:"sc-402c6a6a-21"})``,G6=eL.default.div.withConfig({displayName:"styled__EmptyWrapper",componentId:"sc-8779357d-0"})` + background: ${e=>e.theme.appColors.hex(100)}; + + display: flex; + flex: 1 1 auto; + flex-direction: row; + justify-content: space-between; + align-items: stretch; + min-height: 0; + min-width: 0; + z-index: 0; + + .tc-container { + display: flex; + position: relative; + flex: 1 1 auto; + min-width: 0; + } +`,G8=eL.default.div.withConfig({displayName:"styled__ProjectWrapper",componentId:"sc-8779357d-1"})` + display: flex; + flex-direction: column; + position: relative; + + /* Note: Default is hidden (mobile web), controlled by mindmap/orgchart */ + & .node-toggle-button { + display: none; + } + & .node-add-block { + margin: 20px 0 0 8px; + } + + & .add-sibling-button { + display: none; + } + + & .node-drag-handle { + display: none; + } + + & .root.node > .children .node.collapsed > .title .attachment-items-wrapper { + display: none; + } + + & .right-side { + & .node-unfold-button { + opacity: 1 !important; + } + } + + & .update-status { + margin-bottom: 40px; + } + + /* Add Block Between (Hidden for all views except list/actionsheet) */ + .add-block-wrapper { + display: none; + + & .add-block { + display: ${e=>e.$isReadOnly?"none":"flex"}; + width: 95%; + align-items: center; + justify-content: space-evenly; + transition: opacity 0.1s ease-in-out; + color: ${e=>e.theme.primaryColorScheme?.base}; + ${e1.UiTypography.sm}; + position: relative; + top: -30px; + opacity: 0; + margin: 0 auto; + + & .divider { + display: flex; + width: inherit; + height: 1px; + background: ${e=>e.theme.appColors.hex(80)}; + } + & .icon-text { + display: flex; + white-space: nowrap; + padding: 0px 20px; + align-items: center; + & svg { + margin-right: 4px; + } + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } + + &:focus { + outline: 0; + } + + &:hover { + opacity: 1; + } + + &.is-open { + opacity: 1; + } + } + } + + /* Global Selection todo remove */ + & .root.node { + &.selected { + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + & .title:hover { + background: none; + } + } + & > .children > .node:first-child > .add-block-wrapper { + display: flex; + } + } + + /* Add Block Display Rules */ + & .root.node { + & > .children > .node.has-child:is(.node-format-h1), + & > .children > .node.has-child:is(.node-format-h2) { + margin-top: 30px; + + & > .add-block-wrapper { + display: flex; + } + } + & > .children > .node:first-child { + margin-top: 0 !important; + } + } + + /* Panning Styles */ + .nodes-wrapper { + pointer-events: none; + + & .title, + & .project-title-wrapper, + & .project-addons, + & .toggle-completed, + & .progress-bar, + & .starred-badge, + & .node-add-block, + & .add-block, + & .add-sibling-button, + & .add-child-button { + pointer-events: fill; + } + } + + width: 100%; + + & .root.node { + flex-direction: column; + padding: 0 0 40px; + } + + & .addon-badges { + & > div:empty { + display: none; + } + } + + box-shadow: ${e=>e.$isVersionHistory?"none !important":"inherit"}; + + & .root.node > .children > .node.has-child.node-format-h1 + .node, + & .root.node > .children > .node.has-child.node-format-h2 + .node { + margin-top: 30px; + } + + /* Note: Mobile Web Selection */ + & .root.node > .children .node { + &.selected { + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + & .title:hover { + background: none; + } + } + &.node-isfocused:focus-within { + & > .title { + background: ${e=>e.theme.appColors.hex(90)}; + } + & > .title:hover { + background: ${e=>e.theme.appColors.hex(90)}; + } + &.selected { + & .title { + background: none; + } + } + } + } + + @media (min-width: 768px) { + padding: 0 10px; + /* Note: Default is visible (mobile web), hidden for desktop, controlled by views */ + & .project-alerts { + display: none; + } + & .update-status { + display: none; + } + & .toggle-completed { + display: none; + } + + & .node-drag-handle { + display: flex; + align-items: center; + justify-content: center; + opacity: 0; + width: 18px; + height: 23px; + cursor: grab; + + & svg path { + fill: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + } + + &:active { + cursor: grabbing; + cursor: -moz-grabbing; + cursor: -webkit-grabbing; + } + + &:hover { + & svg path { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } + } + /* Note: Show drag handle on hover */ + & .title:hover { + .node-drag-handle { + opacity: 1 !important; + } + } + + width: 100%; + align-items: center; + + & .root.node { + flex-direction: column; + width: 100%; + max-width: 1200px; + } + & .project-alerts { + display: flex; + } + & .update-status { + display: flex; + } + & .toggle-completed { + display: flex; + } + & .node-add-block { + margin-left: 8px; + margin-top: 20px; + } + & .nodes-wrapper { + display: -webkit-box; + flex-direction: column; + align-items: center; + width: 100%; + max-width: 1200px; + -webkit-flex-direction: column; + -webkit-box-orient: vertical; + + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.98)":"rgba(255,255,255,0.98)"}; + border-radius: 20px; + padding-left: 60px; + padding-right: 60px; + } + } +`,G7=eL.default.div.withConfig({displayName:"styled__UpdateStatus",componentId:"sc-8779357d-2"})` + ${e1.UiTypography.xs}; + color: ${e=>e.theme.textColors.hex(50)}; + display: none; + margin-top: 16px; + justify-content: flex-end; + max-width: 1000px; + + @media print { + display: none !important; + } +`,G9=eL.default.div.withConfig({displayName:"styled__ToolbarContainer",componentId:"sc-8779357d-3"})` + z-index: 10; + position: fixed; + left: 0; + bottom: 0; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + pointer-events: none; + margin-bottom: 40px; + + @media print { + display: none; + } +`,Ke=eL.default.div.withConfig({displayName:"styled__ToolbarWrapper",componentId:"sc-8779357d-4"})` + width: fit-content; + background-color: transparent; +`,Kt=(0,eL.default)(lT.mq).withConfig({displayName:"styled__DefaultProjectIcon",componentId:"sc-8bc23b58-0"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,Ka=eL.default.div.withConfig({displayName:"styled__ProjectIcon",componentId:"sc-8bc23b58-1"})` + display: flex; + flex-shrink: 0; + width: 60px; + height: 60px; + border-radius: 16px; + font-size: 32px; + line-height: 40px; + justify-content: center; + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(80):e.theme.appColors.hex(100)}; + transition: transform 0.1s ease-in-out; + align-items: center; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); + + &:hover { + transform: scale(1.1); + } +`,Kn=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-8bc23b58-2"})` + display: flex; + background: none; + margin: 0; + padding: 0; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + height: auto; + width: auto; + justify-content: center; + + & > span { + font-size: 36px; + } + + &:focus { + outline: 0; + } +`,Kl=function(e){let{document:t}=e,a=null;return null!=t&&(a=nQ(t)),ev.createElement(Ka,null,null!=a?a:ev.createElement(Kt,null))},Kr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectAvatarDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectAvatarDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectAvatarDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]}}]},Ko={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectAvatarEmojiSaveMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectAvatarEmojiSaveInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectAvatarEmojiSave"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]}}]},Ki=function(e){let t;let{document:a}=e,{search:n}=(0,eF.TH)(),l=s4(n);null!=a&&(t=null!=a.__typename?a.shared_preferences:a.sharedPreferences);let r=(0,ev.useRef)(null),o=(0,ev.useRef)(null),[i,s]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),d=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:i,placement:"bottom",computeModifiersCallback:tr}),c=(0,eI.useMenuButton)({ref:r,state:i,dispatch:s}),[m]=(0,cs.D)(Ko),[u]=(0,cs.D)(Kr),p=(0,ev.useCallback)(async e=>{if(s({type:"Collapse"}),null!=e&&null!=a){let n=(0,ld.Z)();await m({optimisticResponse:{__typename:"Mutation",projectAvatarEmojiSave:{__typename:"ProjectAvatarEmojiSavePayload",clientMutationId:n,document:{__typename:"Document",id:a.id,shared_preferences:{...t,avatar:{type:"emoji",value:e.native}}}}},variables:{input:{clientMutationId:n,documentId:a.id,emoji:e.native,shareToken:l}}})}},[a,t,m,l,s]),g=ev.useMemo(()=>{if(null!=a&&null!=nQ(a))return async()=>{s({type:"Collapse"});let e=(0,ld.Z)();await u({optimisticResponse:{__typename:"Mutation",projectAvatarDelete:{__typename:"ProjectAvatarDeletePayload",clientMutationId:e,document:{__typename:"Document",id:a.id,shared_preferences:{...t,avatar:null}}}},variables:{input:{clientMutationId:e,documentId:a.id}}})}},[u,a,t,s]);return ev.createElement(ev.Fragment,null,ev.createElement(Kn,c.props,ev.createElement(Kl,{document:a})),i.expanded&&ev.createElement(gp,{dispatch:s,onEmojiPick:p,onEmojiRemove:g,popupProps:d.props}))},Ks=eL.default.div.withConfig({displayName:"ProjectIcon__Container",componentId:"sc-37c9d4e8-0"})` + cursor: pointer; + margin-right: 16px; +`,Kd=function(e){let t=(0,eF.$B)(),a=t.params.documentID,n=(0,e$.useDispatch)(),{search:l}=(0,eF.TH)(),r=s4(l),{data:o}=(0,eB.a)(s3,null!=a?{variables:{documentId:a,shareToken:r}}:{skip:!0}),i=o?.document??null,s=ev.useCallback(()=>{null==i&&n(Fd())},[n,i]);return null==i||null!=t.params.isNewDocument||e.readOnly?null==i?ev.createElement(Ks,{className:"project-icon-container",onClick:s},ev.createElement(Kl,{document:i})):ev.createElement(Ks,{className:"project-icon-container"},ev.createElement(Kl,{document:i})):ev.createElement(Ks,{className:"project-icon-container"},ev.createElement(Ki,{document:i}))},Kc=eL.default.button.withConfig({displayName:"styled__NodeFoldToggle",componentId:"sc-a904bd21-0"})` + display: flex; + align-items: center; + justify-content: center; + width: 1.25rem; + height: 1.5rem; + position: relative; + z-index: 2; + color: ${e=>e.theme.appColors.hex(10)}; +`,Km=(0,eL.default)(Kc).withConfig({displayName:"styled__NodeFoldButton",componentId:"sc-a904bd21-1"})` + display: flex; +`,Ku=(0,eL.default)(Kc).withConfig({displayName:"styled__NodeUnfoldButton",componentId:"sc-a904bd21-2"})` + display: flex; +`,Kp=eL.default.div.withConfig({displayName:"styled__LeftControls",componentId:"sc-a904bd21-3"})` + display: flex; + width: 1.75rem; + height: 1.75rem; + justify-content: flex-end; + padding-right: 0.625rem; +`,Kg=eL.default.div.withConfig({displayName:"styled__NodeTitleRight",componentId:"sc-a904bd21-4"})` + display: flex; + width: 100%; + flex-direction: column; + flex: 1 1 auto; +`,Kf=eL.default.div.withConfig({displayName:"styled__NodeTitleWrapper",componentId:"sc-a904bd21-5"})` + display: flex; + position: relative; + border-radius: 10px; + cursor: auto; + + /* Content Default */ + .content { + position: relative; + min-height: 28px; + color: ${e=>e.theme.textColors.hex(10)}; + + transition: color cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s; + -webkit-transition: color cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s; + + & span[contenteditable='false'] { + line-height: 18px; + } + } + + /* Content Styles */ + .content .bold { + font-weight: bold; + } + .content .bold .italic { + font-weight: bold; + font-style: italic; + } + .content .italic { + font-style: italic; + } + .content .italic .bold { + font-weight: bold; + font-style: italic; + } + .content .underline { + text-decoration: underline; + } + + .content .hashtag:hover, + .content .mention:hover, + .content .anchor:hover { + cursor: pointer; + text-decoration: underline; + } + + .content .hashtag, + .content .mention, + .content .anchor, + .content .hashtag .highlight, + .content .mention .highlight, + .content .anchor .highlight { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + + /* Node Menu (Reveal) */ + &:hover { + & .right-side { + & > * { + opacity: 1; + } + } + } +`;eL.default.div.withConfig({displayName:"styled__AddonMenu",componentId:"sc-a904bd21-6"})` + display: flex; + width: 30px; + height: 30px; + background: ${e=>e.theme.primaryColorScheme?.base}; +`;let Kh=eL.default.div.withConfig({displayName:"styled__RightSide",componentId:"sc-a904bd21-7"})` + display: flex; + max-height: 28px; + transition: opacity 0.2s ease-in-out; + + & > * { + opacity: 0; + } +`,Ky=eL.default.div.withConfig({displayName:"styled__NodeEditorWrapper",componentId:"sc-a904bd21-8"})` + display: flex; + + & > .content { + width: 100%; + padding-top: 1px; + font-size: 0.96875rem; + } +`,Kb=eL.default.div.withConfig({displayName:"styled__Dropzone",componentId:"sc-a904bd21-9"})` + position: absolute; + pointer-events: none; + top: 0; + left: 0; + right: 0; + bottom: 0; + + display: flex; + align-items: center; + justify-content: center; + border-radius: 10px; + + &:after { + display: flex; + align-items: center; + justify-content: center; + content: 'Drop files here to upload'; + color: ${e=>e.theme.textColors.hex(10)}; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: ${e=>e.theme.isNightMode?"rgba(29, 31, 34, 0.9)":"rgba(247, 247, 247, 0.9)"}; + color: ${e=>e.theme.appColors.hex(10)}; + border-radius: 10px; + ${O$} + } +`;eL.default.span.withConfig({displayName:"styled__GuidelinePath",componentId:"sc-a904bd21-10"})` + /* Guidelines should be disabled by default */ + display: none; +`;let Kv=function(e){let{nodeID:t,completed:a}=e;return ev.createElement("div",{className:"format-controls"},ev.createElement("input",{id:`revert-checkbox-${t}`,type:"checkbox",className:"left",checked:a}),ev.createElement("label",{htmlFor:`revert-checkbox-${t}`}))},Kk=function(e){let{contents:t,nodeId:a}=e,n=t.getIn(["nodes",a]),l=n.getIn(["format","node"],null),r=(0,eq.get)(li.FORMAT_CLASS_NAMES,[l],li.CLASS_NAME_CHECKBOX),o=og()("node",{completed:n.completed,"has-child":n.hasChild},r),i=n.getIn(["format","children"],null),s=(0,eq.get)(li.CHILDREN_FORMAT_CLASS_NAMES,[i],li.CLASS_NAME_CHILDREN_CHECKBOX),d=og()("children",s),c=Array.from((0,li.makeTextDeltaIterable)(n.text,{captureException:e=>{er.$e(t=>{let a=e.scope?.extras;null!=a&&t.setExtras(a),er.Tb(e)})}}));return ev.createElement(GJ,{className:o},ev.createElement(Kf,{className:"title"},ev.createElement(Kp,{className:"left-controls",$hasChild:n.hasChild},ev.createElement("div",{className:"drag-controls"},ev.createElement("span",{className:"node-drag-handle"},ev.createElement(lT.VW,null))),n.hasChild&&ev.createElement(Km,{className:"node-fold-button"},ev.createElement(tn.Icon,{icon:"default_caret_down"}))),ev.createElement(Kv,{nodeID:a,completed:n.completed}),ev.createElement(Kg,{className:"node-title-right"},ev.createElement(Ky,{className:"node-editor"},ev.createElement("div",{className:"content"},c.map((e,t)=>{let a;let{attributes:l,insert:r}=e;return null!=l&&(a=l),ev.createElement(KE,{key:`${t}`,...a,completed:n.completed},r)}))))),ev.createElement(GB,{className:d},n.children.map(e=>ev.createElement(Kk,{nodeId:e,contents:t,key:e}))))},KE=eL.default.span.withConfig({displayName:"Node__NodeSpan",componentId:"sc-b974a8a9-0"})` + border-bottom: 5px solid ${e=>e.highlight?e.highlight:"transparent"}; + font-weight: ${e=>e.bold?"bold":"inherit"}; + font-style: ${e=>e.italic?"italic":"none"}; + text-decoration: ${e=>e.underline?"underline":"none"}; +`,Kx=function(e){let{contents:t}=e,a=t.getIn(["nodes",t.rootID]),n=(0,li.deltaToString)(a.text);return ev.createElement(G8,{className:"project-wrapper",$documentView:"list",$isVersionHistory:!0},ev.createElement(GO,{className:"root node"},ev.createElement(GU,{className:"project-title"},ev.createElement(GL,null,ev.createElement(Kd,{readOnly:!0}),ev.createElement("div",{className:"content"},0===n.length?ev.createElement(eY.Z,{id:"general.untitled",defaultMessage:"Untitled"}):n))),ev.createElement(GB,{className:"children"},a.children.map(e=>ev.createElement(Kk,{key:e,nodeId:e,contents:t})))))},K_=function(e){let{exit:t,documentId:a,isReadOnly:n}=e,l=(0,e$.useDispatch)(),[r,o]=ev.useReducer(H7,{documentId:a},H9),[i,s]=ev.useState(null),{data:d,loading:c}=(0,eB.a)(Cw,null!=r.spaceId?{variables:{spaceID:r.spaceId}}:{skip:!0}),m=ev.useMemo(()=>!c&&"free"===(d?.membership?.space?.taskadePlan?.type??"free"),[d?.membership?.space?.taskadePlan?.type,c]),[u,p]=ev.useState("");ev.useEffect(()=>{null!=r.contents&&s(r.contents)},[r.contents]),ev.useEffect(()=>{let e=CT()(r.pages);if(null==e||null==e.data)return;let t=CT()(e.data.commits);null==t||u||p(t.id)},[r.pages,u]);let{data:g}=(0,eB.a)(sN),f=g?.me?.timezone??eG().tz.guess(),h=g?.me?.preferences?.timeFormat??"h:mm A",y=(e,a)=>{var o,s;if(n||null==i)return;l({type:I4,payload:{contents:i}}),o=r.documentId,s=r.spaceId,u$?.track("Project Reverted",{version:2},{context:{projectId:o,groupId:s}}),t();let d=eG()(e).tz(f).format("LL"),c=`history-revert-${(0,ld.Z)()}`,m=ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"history_revert.success_notification",defaultMessage:"Successfully restored to {date} at {time}.",values:{date:d,time:a}}));l((0,l3.success)({position:"br",autoDismiss:5,dismissible:!1,uid:c,children:m}))};return ev.createElement(KN,null,ev.createElement(Gk,null,ev.createElement(Kw,null,null!=i?ev.createElement(Kx,{contents:i}):ev.createElement(KD,null,ev.createElement(KT,null,ev.createElement(lT.K,null)),ev.createElement(K$,null,ev.createElement(eY.Z,{id:"history_revert.sample_project_title",defaultMessage:"Sample Project Title"})),ev.createElement(KP,null,ev.createElement(eY.Z,{id:"history_revert.sample_block_title_1",defaultMessage:"\uD83C\uDF7F Sample Block Title"})),ev.createElement(KF,null,ev.createElement(lT.S6,null)),ev.createElement(KP,null,ev.createElement(eY.Z,{id:"history_revert.sample_block_title_2",defaultMessage:"\uD83D\uDE99 Sample Block Title"})),ev.createElement(KF,null,ev.createElement(lT.S6,null)))),ev.createElement(KC,null,ev.createElement(KM,null,ev.createElement(tn.Icon,{className:"mr-2",icon:"dd_version_history"}),ev.createElement(eY.Z,{id:"history_revert.version_history",defaultMessage:"Version History"}),m&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:()=>{l(d4(r.spaceId))}})),ev.createElement(KS,null,ev.createElement(eY.Z,{id:"history_revert.version_history_desc",defaultMessage:"View or restore to any point in the project's full history. Learn More",values:{help:e=>ev.createElement(KI,{target:"_blank",rel:"noopener noreferrer",href:"https://link.taskade.com/version-history"},e)}})),r.pages.map((e,t)=>ev.createElement(Gv,{dispatch:o,key:`${t}`,id:t,page:e,setContents:s,selectedCommitId:u,setSelectedCommitId:p,latestRevision:r.latestRevision,onRestore:y,timezone:f,timeFormat:h})),ev.createElement(GE,{shouldShowPaywall:m}))))},Kw=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__ContentsContainer",componentId:"sc-7c7f5bb-0"})` + flex: 1; + overflow: auto; + height: 80vh; + background: ${e=>e.theme.backgroundColorHex}; + ${tM}; + padding: 20px 40px 30px; + + & > .project-wrapper { + margin-top: 40px; + padding: 0; + } +`,KN=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__StyledPopoverBody",componentId:"sc-7c7f5bb-1"})` + position: relative; + width: 80vw; + max-width: 1200px; + border-radius: 10px; + display: flex; + flex-direction: row; + overflow: hidden; +`,KC=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__CommitsContainer",componentId:"sc-7c7f5bb-2"})` + width: 30%; + overflow-y: auto; + height: 80vh; + border-left: 1px solid ${e=>e.theme.borderColorHex}; + padding: 24px 20px; + background: ${e=>e.theme.isNightMode?"#1C1F21":"#fbfbfb"}; + ${tM}; +`,KM=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__Heading",componentId:"sc-7c7f5bb-3"})` + display: flex; + align-items: center; + color: ${e=>e.theme.textColors.hex("10")}; + margin-bottom: 0.5rem; + + ${e1.UiTypography.lg} +`,KS=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__Description",componentId:"sc-7c7f5bb-4"})` + color: ${e=>e.theme.textColors.hex("50")}; + margin-bottom: 20px; + + ${e1.UiTypography.sm} +`,KI=eL.default.a.withConfig({displayName:"HistoryRevertDialogBody__StyledLink",componentId:"sc-7c7f5bb-5"})` + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + + &:hover, + :visited { + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + } + + &:hover { + opacity: 0.8; + } +`,KD=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__EmptyPlaceholderWrapper",componentId:"sc-7c7f5bb-6"})` + flex-direction: column; + width: 100%; + max-width: 1000px; + padding: 20px 100px; + position: relative; + &:before { + background: ${e=>e.theme.isNightMode?"linear-gradient(rgba(23, 25, 28, 0), rgba(23, 25, 28, 1))":"linear-gradient(rgba(251, 251, 251, 0), rgba(251, 251, 251, 1))"}; + content: ''; + display: block; + position: absolute; + left: -21px; + right: 0; + bottom: 0; + top: 0; + z-index: 1; + } +`,KT=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__ProjectIconWrapper",componentId:"sc-7c7f5bb-7"})` + align-items: center; + background: ${e=>e.theme.isNightMode?"#25282d":"#fff"}; + box-shadow: 0px 2px 4px rgb(0 0 0 / 10%); + border-radius: 16px; + display: flex; + height: 60px; + justify-content: center; + margin-bottom: 10px; + transition: transform 0.1s ease-in-out; + width: 60px; +`,K$=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__ProjectTitle",componentId:"sc-7c7f5bb-8"})` + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.ArticleTypography.heading3} + line-height: 36px; + font-weight: normal; + cursor: text; + padding-right: 10 px; + word-break: break-word; + margin-bottom: 40px; + width: 100%; +`,KP=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__BlockTitle",componentId:"sc-7c7f5bb-9"})` + color: ${e=>e.theme.textColors.hex(10)}; + left: 0; + padding-left: 0; + ${e1.ArticleTypography.heading4} + font-weight: bold; + line-height: 22px; + display: block; + position: relative; + min-height: 28px; + margin-bottom: 20px; + + &:after { + background: ${e=>e.theme.isNightMode?"linear-gradient(to right,rgba(51, 51, 51, 1) 0%,rgba(51, 51, 51, 0.5) 50%,rgba(51, 51, 51, 0) 80%,rgba(51, 51, 51, 0) 100%)":"linear-gradient(to right,rgba(229,229,229,1) 0%,rgba(229,229,229,0.5) 50%,rgba(229,229,229,0) 80%,rgba(229,229,229,0) 100%)"}; + content: ''; + display: block; + height: 1px; + width: 100%; + position: relative; + bottom: -8px; + } +`,KF=eL.default.div.withConfig({displayName:"HistoryRevertDialogBody__EmptyImageProjectContent",componentId:"sc-7c7f5bb-10"})` + opacity: ${e=>e.theme.isNightMode?"30%":"80%"}; + margin-bottom: 32px; +`,KA=(0,e$.connect)(function(e){return{isReadOnly:dq(e),dialogState:e.dialogs.historyRevert}})(function(e){let t=(0,e$.useDispatch)(),{dialogState:a,isReadOnly:n}=e,l=ev.useCallback(()=>{t(C_.actions.toggleHistoryRevertDialog())},[t]);if(!(a.isOpen&&null!=a.documentId))return null;let{isOpen:r,documentId:o}=a;return ev.createElement(eI.ModalDialog,{isOpen:r,close:l,autofocus:!0},e=>{let{exit:t}=e;return ev.createElement(K_,{documentId:o,exit:t,isReadOnly:n})})}),KR=eL.default.div.withConfig({displayName:"Body__TextBody",componentId:"sc-ad5bbf5a-0"})` + display: grid; + white-space: pre-wrap; + color: ${e=>e.theme.textColors.hex("10")}; + + & > strong { + font-weight: 500; + } + & > .paragraph { + display: block; + word-break: break-word; + margin-bottom: 18px; + &:last-of-type { + margin-bottom: 0; + } + font-size: ${e=>e.$emojiOnly?"48px":"inherit"}; + letter-spacing: ${e=>e.$emojiOnly?"12px":"inherit"}; + } +`,Kj=eL.default.p.withConfig({displayName:"Body__FilePreview",componentId:"sc-ad5bbf5a-1"})` + display: inline-block !important; + max-width: 100%; + box-sizing: border-box; + color: ${e=>e.theme.textColors.hex(10)}; + margin-bottom: 0; + word-wrap: break-word; + position: relative; + padding: 0; + text-align: left; + border-radius: 5px; + overflow: hidden; + margin-top: 5px; + + width: 120px; + cursor: pointer; + min-height: 152px; +`,KO=eL.default.span.withConfig({displayName:"Body__FileExtension",componentId:"sc-ad5bbf5a-2"})` + display: block; + padding: 2px 5px; + background: rgba(0, 0, 0, 0.2); + color: #fff; + position: absolute; + z-index: 1; + top: 5px; + right: 5px; + text-transform: uppercase; + font-weight: 500; + font-size: 15px; + pointer-events: none; +`,KU=eL.default.span.withConfig({displayName:"Body__FileName",componentId:"sc-ad5bbf5a-3"})` + display: inline-block; + width: 120px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + padding: 4px 0 0; + font-size: 15px; + + color: ${e=>e.theme.isNightMode?"#ccc":"#999"}; +`,KZ=function(e){let{comment:t,onClickComment:a,timezone:n}=e,{body:l}=t.data,r=(0,ev.useMemo)(()=>"text"===l.type&&Lb.test(l.value),[l]),o=(0,ev.useCallback)(()=>{null!=a&&a(t)},[t,a]);switch(l.type){case m5:return ev.createElement(KR,{$emojiOnly:r},ev.createElement(L_,null,ev.createElement(Pa,{value:l.value})),t.data.editedAt&&ev.createElement(Lk,{editedAt:t.data.editedAt,timezone:n}));case m3:{let e=(0,sX.extractFileExtension)(l.data.file.filename);return ev.createElement(Kj,{onClick:o},ev.createElement(KO,null,e),ev.createElement(Lx,{alt:l.data.file.filename,downloadUrl:l.data.url.download,previewUrl:l.data.url.preview,title:l.data.file.filename}),ev.createElement(KU,null,l.data.file.filename))}default:return null}},KL="@@taskade/drafts/SET_COMMENT_DRAFT";function KB(e,t,a){return{type:KL,payload:{documentID:e,nodeID:t,draft:a}}}let Kz=function(e){let{onClick:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement("button",{type:"button",onClick:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",...d},ev.createElement(tn.Icon,{icon:"message_audio"}),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.audio",defaultMessage:"Audio"})))},KV=function(e){let{onClick:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement("button",{type:"button",onClick:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",...d},ev.createElement(tn.Icon,{icon:"message_camera"}),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.camera",defaultMessage:"Camera"})))},Kq=ev.forwardRef(function(e,t){let[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1}),l=ev.useCallback(()=>{n({type:"Collapse"})},[]),r=ev.useCallback(()=>a.expanded,[a.expanded]);return ev.useImperativeHandle(t,()=>({closePicker:l,isPickerOpen:r}),[l,r]),ev.createElement(gf,{onEmojiPick:e.onEmojiPick,state:a,dispatch:n})}),KW=function(e){let{onClick:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement("button",{type:"button",onClick:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",...d},ev.createElement(tn.Icon,{icon:"dd_upload_screencast"}),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.screencast",defaultMessage:"Screencast"})))},KH=function(e){let{onCloudUpload:t,onFileClick:a}=e,n=e.isDisabled??!1,l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=(0,eI.useMenuButton)({dispatch:s,ref:o,state:i}),c=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:r,state:i,placement:"top"}),{arrowProps:m,popperProps:u,referenceProps:p,setVisible:g,visible:f}=(0,eI.useTooltip)({placement:"top"}),h=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:n}=e.payload;switch(n){case $.Cloud:t();break;case $.Computer:a()}s({type:"Collapse",payload:"none"});break}case"Dismiss":s({type:"Collapse"})}},[s,t,a]),y=ev.useCallback(()=>{g(!1)},[g]),b=ev.useCallback(()=>{i.expanded||g(!0)},[i,g]),v=ev.useCallback(e=>{"f"===e.key&&(e.stopPropagation(),e.preventDefault(),h({type:"Activate",payload:{name:$.Computer}}))},[h]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",...d.props,type:"button",disabled:n},ev.createElement("span",{...p,onMouseEnter:b,onMouseLeave:y},ev.createElement(tn.Icon,{icon:"message_upload"}))),i.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:s,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:h},ev.createElement(Bv,{ref:l,initialFocus:c.initialFocus,isSubmenu:!1,onKeyDown:v}))),f&&!i.expanded&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(eY.Z,{id:"general.upload_file",defaultMessage:"Upload File"})))},KG=eL.default.div.withConfig({displayName:"FormElements__EditCommentActionsContainer",componentId:"sc-e600c3ac-0"})` + display: flex; + justify-content: flex-end; + padding: 0 0 10px; +`,KK=eL.default.button.withConfig({displayName:"FormElements__EditCommentButton",componentId:"sc-e600c3ac-1"})` + background: none; + margin: 0; + padding: 0; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + + display: flex; + padding: 6px 18px; + line-height: inherit; + align-content: center; + font-weight: 500; + border-radius: 5px; + box-shadow: none; + + &:focus { + outline: 0; + } +`,KY=e=>{let{entity:{id:t,native:a}}=e;return ev.createElement(KJ,null,ev.createElement(KQ,null,`${a}`),`:${t}`)},KQ=eL.default.div.withConfig({displayName:"FormElements__EmojiSpan",componentId:"sc-e600c3ac-2"})` + display: flex; + width: 18px; + height: 18px; + margin-right: var(--menu-item-gap); +`,KJ=eL.default.div.withConfig({displayName:"FormElements__AutoCompleteEmoji",componentId:"sc-e600c3ac-3"})` + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; +`,KX=(0,eL.default)(KK).withConfig({displayName:"FormElements__EditCommentSaveButton",componentId:"sc-e600c3ac-4"})` + background: ${e=>e.theme?.primaryColorScheme?.base}; + color: #fff; + + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } +`,K0=(0,eL.default)(KK).withConfig({displayName:"FormElements__EditCommentCancelButton",componentId:"sc-e600c3ac-5"})` + color: ${e=>(e.theme?.isNightMode,"#999")}; + &:hover { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + } +`,K1=(0,eL.default)(Lw.Z).withConfig({displayName:"FormElements__Textarea",componentId:"sc-e600c3ac-6"})` + display: flex; + width: 100%; + border: 0; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + font-size: 15px; + resize: vertical; + height: auto; + padding: 0 18px 16px; + background: none; + + &::-webkit-input-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + &::-moz-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + &:-ms-input-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + &:-moz-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } +`,K2=(0,eL.default)(K1).withConfig({displayName:"FormElements__StyledTextarea",componentId:"sc-e600c3ac-7"})` + margin: 0; + padding: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 5px; +`,K5=eL.default.div.withConfig({displayName:"FormElements__CommentActionsContainer",componentId:"sc-e600c3ac-8"})` + display: ${e=>e.isEdit?"none":"grid"}; + grid-template-columns: 30px 30px 30px 30px 30px 30px auto; + padding: 8px 12px 8px; + align-items: center; + justify-items: center; +`,K3=eL.default.div.withConfig({displayName:"FormElements__Wrapper",componentId:"sc-e600c3ac-9"})` + display: flex; + flex-direction: column; + width: 100%; + + ${e=>e.isEdit?(0,eL.css)` + margin-bottom: 10px; + margin-top: 10px; + `:""} +`,K4=eL.default.div.withConfig({displayName:"FormElements__RTAItem",componentId:"sc-e600c3ac-10"})` + & .rta__user { + & > .name { + color: ${e=>(e.theme.isNightMode,"#999")}; + } + & > .char { + color: ${e=>e.theme.textColors.hex(10)}; + } + } +`,K6=(0,eL.default)(Bt.Z).withConfig({displayName:"FormElements__ReactTextareaAutocompleteStyled",componentId:"sc-e600c3ac-11"})` + & ~ .rta__autocomplete { + border-radius: 10px 10px 0 0; + background: ${e=>e.theme.appColors.hex(100)}; + border-top: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + + .rta__entity { + background: none; + } + .rta__entity--selected { + background: ${e=>e.theme.isNightMode?"#272C30":"#f8f8f8"}; + } + } +`,K8=e=>{let{handle:t,avatars_v2:a,display_name:n,id:l}=e.entity,r=parseInt(l,10);return ev.createElement(K4,null,ev.createElement("div",{className:"rta__avatar"},ev.createElement(ao,{avatars_v2:a,handle:t,userID:r,size:28})),ev.createElement("div",{className:"rta__user"},ev.createElement("span",{className:"char"},t),n&&ev.createElement("span",{className:"name"},n)))},K7=()=>ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.loading.loading",defaultMessage:"Loading…"})),K9=e=>{let[t,a]=ev.useState(!1),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),{arrowProps:o,popperProps:i,referenceProps:s}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"top",visible:t});return ev.createElement("button",{type:"button",...e,onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",...s},ev.createElement(tn.Icon,{icon:"message_mention"}),t&&ev.createElement(eI.Tooltip,{arrowProps:o,popperProps:i},ev.createElement(eY.Z,{id:"general.mention",defaultMessage:"Mention"})))};class Ye extends ev.Component{static propTypes={change:l7().func.isRequired,form:l7().shape({change:l7().func.isRequired}).isRequired,isActive:l7().bool.isRequired,isEdit:l7().bool.isRequired,isUploading:l7().bool.isRequired,handleSubmit:l7().func.isRequired,mentionChoices:l7().arrayOf(l7().shape()),onPasteUpload:l7().func,onDropzoneOpen:l7().func.isRequired,onCommentChange:l7().func.isRequired,onClickCancelEdit:l7().func.isRequired,onToggleCloudUpload:l7().func.isRequired,submitting:l7().bool.isRequired,submitError:l7().shape()};static defaultProps={submitError:null,mentionChoices:[],onPasteUpload:void 0};emojiPickerRef=ev.createRef();commentTextarea=null;setCommentTextarea=e=>{this.commentTextarea=e};handleOnClickCancelEdit=()=>{let{onClickCancelEdit:e}=this.props;e()};handleOnPaste=e=>{let{onPasteUpload:t}=this.props;e.clipboardData?.files?.length>0&&t&&t(e.clipboardData.files)};handleFileAttachmentButtonClick=()=>{let{onDropzoneOpen:e}=this.props;e()};handleTextareaClick=e=>{e.preventDefault()};handleTextareaKeydown=e=>{let{isEdit:t}=this.props;if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}switch(e.key){case eI.KeyboardKeys.Escape:if(this.emojiPickerRef.current?.isPickerOpen()===!0){e.preventDefault(),e.stopPropagation(),this.emojiPickerRef.current?.closePicker();break}if(t){let{onClickCancelEdit:t}=this.props;e.preventDefault(),e.stopPropagation(),t()}break;case eI.KeyboardKeys.Enter:if(!e.shiftKey){let{handleSubmit:t}=this.props;e.preventDefault(),this.emojiPickerRef.current?.isPickerOpen()===!0&&this.emojiPickerRef.current?.closePicker(),t()}}};insertText=e=>{let{form:t}=this.props,{commentTextarea:a}=this,{start:n,end:l}=oN(a),r=a.value.length>0?gl(a.value,e,n,l):e;t.change("comment",r),a.focus()};insertMentionSymbol=()=>{this.insertText("@")};insertEmoji=e=>{this.insertText(e.native)};focus(){this.commentTextarea.focus(),ow(this.commentTextarea)}replyToUser(e){let{form:t}=this.props,{start:a,end:n}=oN(this.commentTextarea),l="";l=this.commentTextarea.value.length>0?gl(this.commentTextarea.value,e,a,n):e,t.change("comment",l),this.commentTextarea.focus()}render(){let{isEdit:e,isUploading:t,handleSubmit:a,onCommentChange:n,onToggleCloudUpload:l,mentionChoices:r,submitting:o,submitError:i}=this.props,s=function(e){let{isActive:t,isUploading:a,submitting:n}=e;return a||!t||n}(this.props);return ev.createElement("form",{onSubmit:a,autoComplete:"off"},!o&&i&&ev.createElement("div",{className:"chat-error",role:"alert"},i),ev.createElement(K3,{isEdit:e},!e&&ev.createElement(K5,null,ev.createElement(K9,{id:"comment-insert-mention",onClick:this.insertMentionSymbol}),ev.createElement(Kq,{onEmojiPick:this.insertEmoji,ref:this.emojiPickerRef}),ev.createElement(KH,{isDisabled:s,onCloudUpload:l,onFileClick:this.handleFileAttachmentButtonClick}),ev.createElement(KV,{onClick:l}),ev.createElement(Kz,{onClick:l}),ev.createElement(KW,{onClick:l}),t?ev.createElement("button",{className:"ml-auto mr-2",type:"button",disabled:!0},ev.createElement(eI.Spinner,null)):ev.createElement("button",{className:"ml-auto flex h-8 w-8 items-center justify-center rounded-lg hover:bg-appcolor-200",type:"submit",disabled:s},ev.createElement(tn.Icon,{icon:"message_send"}))),ev.createElement(r$.gN,{name:"comment"},a=>{let{input:l}=a;return ev.createElement(K6,{...l,onChange:e=>{l.onChange(e),n(e)},onKeyDown:this.handleTextareaKeydown,onPaste:this.handleOnPaste,loadingComponent:K7,placeholder:t?"Uploading file…":"Type '@' to mention or add a comment...",minChar:0,rows:1,innerRef:this.setCommentTextarea,maxLength:4096,trigger:{"@":{dataProvider:e=>vH()(r,t=>t.handle.toLowerCase().includes(e.toString().toLowerCase())),component:K8,output:(e,t)=>`@${e.handle}`},":":{dataProvider:e=>0===e.length?[]:go.bj.search(e).map(e=>{let{id:t,native:a}=e;return{id:t,native:a}}),component:KY,output:(e,t)=>e.native}},textAreaComponent:{component:e?K2:K1,ref:"innerRef"}})})),e&&ev.createElement(KG,null,ev.createElement(K0,{type:"button",onClick:this.handleOnClickCancelEdit},"Cancel"),ev.createElement(KX,{type:"submit",disabled:s},"Save")))}}let Yt=eL.default.textarea.withConfig({displayName:"FormPlaceholder__Textarea",componentId:"sc-693adbae-0"})` + display: flex; + width: 100%; + border: 0; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 15px; + resize: vertical; + height: auto; + padding: 0 18px 16px; + background: none; + + &::-webkit-input-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + &::-moz-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + &:-ms-input-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + &:-moz-placeholder { + color: ${e=>e.theme?.isNightMode?"#666":"#ccc"}; + } + + margin: 0; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 5px; +`,Ya=function(e){let{onClick:t}=e,a=(0,eK.Z)(),n=ev.useRef(null);return ev.useEffect(()=>{n.current?.focus()},[]),ev.createElement("div",{className:"flex w-full flex-col",ref:n,onClick:t,tabIndex:-1},ev.createElement("div",{className:"flex items-center justify-center px-3 py-2"},ev.createElement("div",{className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_mention"})),ev.createElement("div",{className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_emoji"})),ev.createElement("div",{className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_upload"})),ev.createElement("div",{className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_camera"})),ev.createElement("div",{className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_audio"})),ev.createElement("div",{className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"dd_upload_screencast"})),ev.createElement("div",{className:"ml-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"message_send"}))),ev.createElement(Yt,{placeholder:a.formatMessage({id:"general.type_at_to_mention_or_add_a_comment",defaultMessage:"Type '@' to mention or add a comment..."}),rows:1,readOnly:!0}))},Yn=function(e){let{user:t,commentDraft:a,stateCommentDraft:n,isActive:l,isEdit:r,isUploading:o,mentionChoices:i,onFileUpload:s,onClickCancelEdit:d,onCommentSend:c,onGuestClick:m,formElementsRef:u,dropZoneRef:p,documentID:g,setCommentDraft:f,nodeID:h}=e,y=(0,e$.useDispatch)(),b=gV(),v=(0,ev.useCallback)(()=>{p?.current?.open()},[p]),k=(0,ev.useCallback)(e=>{null!=g&&null!=h&&f?.(g,h,e)},[g,h,f]),E=(0,ev.useCallback)(e=>{k(e.target.value)},[k]),x=(0,ev.useCallback)(()=>{let e=b.taskadePlanType??"free",t=fR.Vl.getFeature("upload.size");(0,ei.assert)("GB"===t.unit);let a=1e3*t.plans[e]*1048576;if(b.isPaywallEnabled){y(d4(b.id));return}y(uN.actions.toggleCloudUploadDialog({documentId:g,nodeId:h,restrictions:{allowedFileTypes:Ba,maxFileSize:a},uploadType:D.Comment}))},[y,g,h,b]),_=(0,ev.useCallback)(e=>ev.createElement(Ye,{...e,isActive:l,isEdit:r,isUploading:o,mentionChoices:i,onClickCancelEdit:d,onPasteUpload:s,onDropzoneOpen:v,onCommentChange:E,onToggleCloudUpload:x,ref:u}),[x,l,r,o,i,d,s,v,E,u]),w=(0,ev.useCallback)((e,t,a)=>{eu()(a)?(t(),k(""),e.reset()):t(a);let{current:n}=u;eu()(n)||n.focus()},[u,k]),N=(0,ev.useCallback)((e,t,a)=>{let{comment:n}=e,l=e=>{w(t,a,e)};n?c({type:"text",value:n},l):l()},[w,c]),C=(0,ev.useCallback)(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),m?.(e)},[m]);return eu()(t)?ev.createElement(Ya,{onClick:C}):ev.createElement(r$.l0,{onSubmit:N,render:_,initialValues:{comment:a||n}})};Yn.defaultProps={mentionChoices:[],user:null};let Yl=(0,e$.connect)(function(e,t){let{documentID:a,nodeID:n}=t;return{stateCommentDraft:ec()(e,["drafts","comments",a,n],"")}},function(e){return(0,ek.DE)({setCommentDraft:KB},e)})(Yn),Yr=eL.default.img.withConfig({displayName:"CommentHead__Avatar",componentId:"sc-f1df3319-0"})` + display: flex; + flex: 1 0 auto; + width: 36px; + height: 36px; + border-radius: 50px; + background: transparent; +`,Yo=function(e){let{user:t}=e,{initial:a,smallAvatar:n}=(0,ev.useMemo)(()=>({initial:t.handle.substr(0,2).toUpperCase(),smallAvatar:t.smallAvatar}),[t]);return ev.createElement(Yr,{src:n,alt:a})},Yi=eL.default.div.withConfig({displayName:"Menu__CommentMenu",componentId:"sc-57af358d-0"})` + display: none; + position: absolute; + top: -12px; + right: 0px; + padding: 1.5px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + overflow: hidden; + z-index: 1; +`,Ys=function(e){let{comment:t,hasDeletePermission:a,me:n,onClickEdit:l,onClickReply:r,onDelete:o,showReplyButton:i}=e,s=(0,eK.Z)();t.data.createdBy.handle;let d=a||n===t.data.createdBy.id,c=t.data.body.type===m5&&n===t.data.createdBy.id,m=(0,ev.useCallback)(()=>{null!=o&&confirm("Are you sure you want to delete this comment?")&&o(t)},[t,o]),u=(0,ev.useCallback)(()=>{l(t)},[t,l]),p=(0,ev.useCallback)(()=>{r(t)},[t,r]);return ev.createElement(Yi,{className:"menu-button"},i&&ev.createElement(Lz,{onClick:p,tooltip:s.formatMessage({id:"comments.reply",defaultMessage:"Reply"})},ev.createElement(lT._K,null)),c&&ev.createElement(Lz,{onClick:u,tooltip:s.formatMessage({id:"comments.edit",defaultMessage:"Edit"})},ev.createElement(lT.K4,null)),d&&ev.createElement(Lz,{onClick:m,tooltip:s.formatMessage({id:"comments.delete",defaultMessage:"Delete"})},ev.createElement(lT.tP,null)))},Yd=eL.default.div.withConfig({displayName:"Timestamp__TimeContainer",componentId:"sc-a9b81b36-0"})` + display: flex; + flex-direction: row; + align-items: center; +`,Yc=eL.default.span.withConfig({displayName:"Timestamp__TimeWrapper",componentId:"sc-a9b81b36-1"})` + display: inline-block; + color: ${(0,eI.getHslColorScale)(eI.ColorNames.White).hex("10")}; + font-size: 14px; + vertical-align: middle; +`,Ym=function(e){let{comment:t,timezone:a}=e,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"top",visible:n}),m=ev.useCallback(()=>{l(!0)},[l]),u=ev.useCallback(()=>{l(!1)},[l]),p=ev.useMemo(()=>null!=a?eG()(t.data.at).tz(a):eG()(t.data.at),[t.data.at,a]),g=ev.useMemo(()=>eG()().diff(p,"days")>0?"L":"LT",[p]);return ev.createElement("time",{className:"mb-0.75 ml-1 text-xs text-textcolor-300 hover:underline",dateTime:p.toISOString(),...c,onMouseEnter:m,onMouseLeave:u},p.format(g),n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(Yd,null,ev.createElement(Yc,null,p.calendar(null,{sameElse:"llll"})))))},Yu=eL.default.div.withConfig({displayName:"Comment__CommentBody",componentId:"sc-d9044296-0"})` + display: flex; + width: 100%; + flex-direction: column; + padding-left: 8px; + position: relative; + + & p { + display: inline; + margin-bottom: 0; + white-space: pre-wrap; + word-break: break-word; + + & a { + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } + } +`,Yp=eL.default.div.withConfig({displayName:"Comment__CommentFrom",componentId:"sc-d9044296-1"})` + display: flex; + align-items: flex-end; + position: relative; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + font-weight: 500; +`,Yg=eL.default.div.withConfig({displayName:"Comment__Wrapper",componentId:"sc-d9044296-2"})` + display: flex; + flex-direction: row; + justify-content: stretch; + padding: 6px 16px; + font-size: 15px; + + ${function(e){let{isEditOn:t}=e;return!0===t?(0,eL.css)` + background: ${e=>e.theme.isNightMode?"#1A1C1D":"#f8f8f8"}; + `:(0,eL.css)` + background: transparent; + `}} + + &:hover { + background: ${e=>e.theme?.isNightMode?"#272C30":"#f8f8f8"}; + + .menu-button { + display: flex; + } + } +`,Yf=function(e){let{comment:t,documentID:a,nodeID:n,hasDeletePermission:l,hasAttachPermission:r,isEditOn:o,me:i,mentionChoices:s,onClickCancelEdit:d,onClickEdit:c,onClickReply:m,showReplyButton:u,timezone:p}=e,g=(0,ev.useMemo)(()=>new tH(t.data.createdBy),[t.data.createdBy]),f=(0,ev.useRef)(null),h=(0,e$.useDispatch)(),y=(0,ev.useCallback)((e,n)=>{h({type:mo,payload:{documentID:a,attachment:{id:t.id,data:{type:t.data.type,body:e}},callback:n}}),d()},[t.data.type,t.id,a,h,d]),b=(0,ev.useCallback)(e=>{h(N6(e))},[h]),v=(0,ev.useCallback)(()=>{a&&n&&t&&h(mB(a,{id:t.id,type:t.data.type,nodeID:n}))},[h,a,n,t]),k=(0,ev.useCallback)(()=>{ZN(t)&&h(Z$.actions.toggleMediaDialog({media:[t]}))},[h,t]);return ev.createElement(Yg,{isEditOn:o,className:"comment"},ev.createElement(Yo,{online:!1,user:g}),ev.createElement(Yu,null,r&&ev.createElement(Ys,{comment:t,hasDeletePermission:l,me:i,onDelete:v,onClickEdit:c,onClickReply:m,showReplyButton:u}),ev.createElement(Yp,null,ev.createElement("p",null,g.handle),ev.createElement(Ym,{comment:t,timezone:p})),!o&&ev.createElement(KZ,{comment:t,onClickComment:k,onClickMention:b,timezone:p}),o&&ev.createElement(Yl,{commentDraft:t?.data?.body?.value,formElementsRef:f,isActive:!0,isEdit:!0,isUploading:!1,mentionChoices:s,onCommentSend:y,onClickCancelEdit:d,user:g})))},Yh=(0,eL.default)(RV.ML).withConfig({displayName:"NodeTextPreview__StyledEditor",componentId:"sc-147aa8cf-0"})` + ${RQ} + + .mention, .hashtag { + pointer-events: none; + color: ${e=>e.theme.textColors.hex(10)}; + } +`,Yy=(0,e$.connect)(function(e,t){return{editorText:iV(e,t)}})(function(e){let{editorText:t}=e;return null==t?ev.createElement("div",null,"NODE NOT FOUND"):ev.createElement(Yh,{className:"mousetrap notranslate",value:t,renderMark:PX,decorateNode:PC,readOnly:!0})}),Yb={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"DocumentStatusParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Document"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"archived_at"}},{kind:"Field",name:{kind:"Name",value:"pinned_at"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}}]}}]},Yv=function(e){let{children:t,edges:a,getDate:n,timezone:l}=e,r=(0,ev.useMemo)(()=>{let e;let r=[];for(let o of a){let a=SI(e,o,n,l);null!=a&&r.push(t({item:o,unixTimestampMs:a})),r.push(t({item:o})),e=o}return r},[t,a,n,l]);return ev.createElement(ev.Fragment,null,r)};function Yk(e,t){let a=null;return null!=e&&(e.data?.at!=null&&(a=eG()(e.data.at)),null!=a&&null!=t&&(a=a.tz(t))),a}let YE=eL.default.div.withConfig({displayName:"CommentDropzone__DropzoneContainer",componentId:"sc-f7423c4c-0"})` + display: block; + width: 100%; + height: 100%; + background: ${e=>e.theme.isNightMode?"rgba(29, 31, 34, 0.9)":"rgba(247, 247, 247, 0.9)"}; + color: ${e=>e.theme.appColors.hex(10)}; + position: absolute; + top: 0; + left: 100%; + z-index: 10; + opacity: 0; + padding: 10px; + pointer-events: none; + border-radius: 10px; + + ${e=>e.$isVisible?(0,eL.css)` + opacity: 1; + left: 0; + pointer-events: fill; + `:""} +`,Yx=eL.default.div.withConfig({displayName:"CommentDropzone__InnerWrapper",componentId:"sc-f7423c4c-1"})` + text-align: center; + display: inline-block; + width: auto; + position: absolute; + top: 50%; + margin-top: -57px; + left: 50%; + margin-left: -75px; +`,Y_=eL.default.p.withConfig({displayName:"CommentDropzone__DisplayText",componentId:"sc-f7423c4c-2"})` + font-size: 20px; + width: 150px; + color: ${e=>e.theme.appColors.hex(10)}; + line-height: 24px; + text-align: center; + margin: 0 auto; + + &.note { + font-size: 16px; + color: ${e=>e.theme.textColors.hex(50)}; + line-height: 18px; + margin-top: 2px; + } +`,Yw=eL.default.div.withConfig({displayName:"CommentDropzone__DragArea",componentId:"sc-f7423c4c-3"})` + ${O$} + width: 100%; + height: 100%; + border-radius: 10px; + padding: 20px; + font-size: 17px; + + ${e=>e.$isHovered?(0,eL.css)` + border-color: ${e.theme.isNightMode?"#666":"#ccc"}; + `:(0,eL.css)` + border-color: #999; + `} + + transition: border-color 120ms ease-in-out; +`,YN=(0,eL.default)(lT.Bu).withConfig({displayName:"CommentDropzone__UploadImage",componentId:"sc-f7423c4c-4"})` + display: inline-block; + width: 60px; + height: 60px; + margin: 0 auto; + + & path { + stroke: ${e=>(e.theme.isNightMode,"#ccc")}; + } +`,YC=ev.forwardRef(function(e,t){let{uploadStatus:a,blockUpload:n,onBlockUpload:l,onUpload:r}=e,o=(0,ev.useRef)(!1),i=(0,ev.useRef)(null),[s,d]=(0,ev.useState)(!1),[c,m]=(0,ev.useState)(!1),u=(0,e$.useDispatch)(),p=a===uE,g=(0,ev.useCallback)(()=>{null!=i.current&&(clearTimeout(i.current),i.current=null)},[]);(0,ev.useEffect)(()=>()=>{null!=i.current&&clearTimeout(i.current)},[]);let f=(0,ev.useCallback)(e=>{g(),o.current=!0,e.preventDefault()},[g]),h=(0,ev.useCallback)(e=>{e.preventDefault(),g(),o.current=!0,s||p||d(!0)},[s,p,g]),y=(0,ev.useCallback)(e=>{o.current=!1,e.preventDefault(),i.current=setTimeout(()=>{!o.current&&s&&d(!1)},500)},[s]),b=(0,ev.useCallback)(e=>{e.preventDefault(),d(!1)},[]);(0,ev.useEffect)(()=>(document.addEventListener("dragenter",f,!1),document.addEventListener("dragover",h,!1),document.addEventListener("dragleave",y,!1),document.addEventListener("drop",b,!1),()=>{document.removeEventListener("dragenter",f),document.removeEventListener("dragover",h),document.removeEventListener("dragleave",y),document.removeEventListener("drop",b)}),[b,f,h,y]);let v=(0,ev.useCallback)(e=>{d(!1),m(!1),n?l():r(e)},[l,r,n]),k=(0,ev.useCallback)(e=>{u((0,l3.error)(ZL("comment-dnd-rejected-files",e)))},[u]);return ev.createElement(YE,{$isVisible:s},ev.createElement(OM.Z,{ref:t,disablePreview:!0,multiple:!0,onDrop:v,onDropRejected:k,onDragOver:()=>{d(!0),m(!0)},onDragLeave:()=>{m(!1)},noDragEventsBubbling:!0,accept:cN},e=>{let{getRootProps:t,getInputProps:a}=e;return ev.createElement(Yw,{...t(),$isHovered:c},ev.createElement("input",a()),ev.createElement(Yx,null,ev.createElement(YN,null),ev.createElement(Y_,null,ev.createElement(eY.Z,{id:"general.drop_your_file_here_to_upload",defaultMessage:"Drop your file here to upload"}))))}))}),YM=eL.default.div.withConfig({displayName:"styled__StyledPopoverBody",componentId:"sc-f9aad564-0"})` + padding: 0; + position: relative; + max-width: 640px; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; +`,YS=eL.default.div.withConfig({displayName:"styled__DayDividerWrapper",componentId:"sc-f9aad564-1"})` + display: flex; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#f8f8f8"}; + justify-content: center; + height: 16px; + margin-bottom: 16px; + margin-top: 5px; +`,YI=eL.default.div.withConfig({displayName:"styled__DayDivider",componentId:"sc-f9aad564-2"})` + display: flex; + height: 32px; + background: ${e=>e.theme.isNightMode?"#272C30":"#f8f8f8"}; + color: ${e=>e.theme.isNightMode?"#f8f8f8":"#333"}; + font-weight: 500; + padding: 2px 12px; + border-radius: 30px; + font-size: 13px; + position: relative; + border: 4px solid ${e=>e.theme.isNightMode?"#1A1C1D":"#fff"}; +`,YD=eL.default.div.withConfig({displayName:"styled__CommentHeader",componentId:"sc-f9aad564-3"})` + padding: 16px 20px; + font-size: 16px; + line-height: 20px; + color: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333"}; + border-bottom: 1px solid ${e=>e.theme?.isNightMode?"#262A2D":"#e5e5e5"}; + position: relative; + top: 1px; + word-break: break-word; +`,YT=eL.default.div.withConfig({displayName:"styled__CommentsWrapper",componentId:"sc-f9aad564-4"})` + display: flex; + flex-direction: column; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + max-height: 50vh; + overflow-y: auto; + ${tM} + + & .comment:first-child { + margin-top: 10px; + } +`;function Y$(e,t){return{attachments:iA(e,t),user:t7(e)}}(0,e$.connect)(Y$);let YP=(0,e$.connect)(Y$)(function(e){let{nodeID:t,documentID:a,attachments:n,user:l}=e,{data:r}=(0,$y.J)({from:{__typename:"Document",id:a},fragment:Yb}),o=(0,e$.useDispatch)(),i=(0,ev.useRef)(null),s=(0,ev.useRef)(null),d=(0,ev.useRef)(null),c=n?.comments?.fetchStatus??uv,m=n?.comments?.uploadStatus??uv,u=(0,ev.useMemo)(()=>n?.comments?.attachments??[],[n]),p=UZ((0,eq.last)(u)),{users:g}=aN({projectId:a});(0,ev.useEffect)(()=>(o({type:mp,payload:{documentID:a,nodeID:t}}),o(mK(t,!0)),()=>{o(mK(t,!1))}),[o,a,t]),(0,ev.useEffect)(()=>{let e=(0,eq.last)(u);p?.id!==e?.id&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[u,p]),(0,ev.useEffect)(()=>()=>{o($L())},[a,o]);let f=Ck({role:r?.role,action:{project:"delete_comment"}}),h=Ck({role:r?.role,action:{project:"attach_comment"}}),[y,b]=(0,ev.useState)(null),v=(0,ev.useCallback)(e=>{b(e.id)},[]),k=(0,ev.useCallback)(()=>{b(null)},[]),E=(0,ev.useCallback)(()=>{o($L()),o(rh({isOpen:!0,activeView:rI,enableCopyList:void 0}))},[o]),x=(0,ev.useCallback)(e=>{if(null!=l){let t=function(e){switch(e.data.body.type){case"text":{let t=e.data.body.value.split("\n").map(e=>`>${e}`).join("\n");return`${t} + +@${e.data.createdBy.handle} `}case"file":return`> _**${e.data.body.data.file.filename}**_ + +@${e.data.createdBy.handle} `}}(e);i.current?.replyToUser(t)}else E()},[i,E,l]),_=(0,ev.useCallback)(()=>{E()},[E]),w=(0,ev.useCallback)((e,n)=>{a&&t&&e&&o(mL(a,{nodeID:t,data:{type:m2,body:e}},n))},[o,a,t]),N=(0,ev.useCallback)(()=>{E()},[E]),C=(0,ev.useCallback)(e=>{a&&t&&e&&o({type:mm,payload:{documentID:a,nodeID:t,files:Array.from(e)}})},[o,a,t]),M=c===uk;(0,ev.useLayoutEffect)(()=>{M&&i.current?.focus()},[i,M]);let S=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return ev.createElement(YM,{onMouseDown:S},ev.createElement(YC,{ref:s,blockUpload:null==l,onBlockUpload:N,onUpload:C,uploadStatus:m}),ev.createElement(YD,null,ev.createElement(Yy,{nodeID:t})),ev.createElement(YT,{ref:d,className:"notranslate"},ev.createElement(Yv,{edges:u,getDate:Yk,timezone:l?.timezone??null},e=>{let{item:n,unixTimestampMs:r}=e;return null!=r?ev.createElement(YS,{key:`comment-date-separator-${n.id}`},ev.createElement(YI,null,CR(r))):ev.createElement(Yf,{key:n.id,comment:n,documentID:a,nodeID:t,hasDeletePermission:f,hasAttachPermission:h,isEditOn:y===n.id,onClickCancelEdit:k,onClickEdit:v,onClickReply:x,me:l?.id??null,mentionChoices:g,showReplyButton:!0,timezone:l?.timezone??null})})),h&&ev.createElement(Yl,{documentID:a,nodeID:t,dropZoneRef:s,formElementsRef:i,isActive:M,isUploading:m===uE,onGuestClick:_,isEdit:!1,mentionChoices:g,user:l,onCommentSend:w,onFileUpload:C}))});function YF(e){return e.modal.nodeComments}let YA=function(){let e=(0,e$.useSelector)(YF),t=e.nodeID,a=(0,e$.useDispatch)(),n=ev.useCallback(()=>{(0,e$.batch)(()=>{null!=t&&a(mI(t,null)),a($L())})},[a,t]);return null!=e&&e.isOpen?ev.createElement(eI.ModalDialog,{isOpen:e.isOpen,close:n,autofocus:!1},()=>ev.createElement(YP,{documentID:e.documentID,nodeID:e.nodeID})):null},YR="PromptSection",Yj="ActionItem",YO="insert_block",YU=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-3 mb-px flex h-7 items-center rounded-md px-2 py-px text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_newtemplate"}),ev.createElement("span",{className:"pl-3"},t.label),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},YZ={[Yj]:e=>ev.createElement(YU,{morseChildProps:e})},YL={[YR]:()=>ev.createElement(ev.Fragment,null)},YB=(e,t)=>new to.Z(t,{keys:["values"],threshold:.2}).search(e).map(e=>e.item),Yz=Ht({requestUrl:"/web-api/ai",displayResult:"",pastResults:[],currentIndex:0}),YV=function(e){var t;let{prompt:a,projectId:n,rootNodeId:l,nodeId:r,onExit:o,style:i,handleToggleAiPromptTemplates:s}=e,d=ev.useRef(null),c=ev.useRef(null),m=(0,eK.Z)(),[u,p]=ev.useState(""),[g,f]=ev.useState(null);ev.useEffect(()=>{g?.focus()},[g]);let[h,y]=(0,ls.e)(Yz,{actions:{updateDisplayResult:(0,lv.assign)((e,t)=>(null!=c.current&&(c.current.scrollTop=c.current.scrollHeight),(0,es.ZP)(e,e=>{e.displayResult=e.displayResult+t.payload.newResult})))}}),{displayResult:b,error:v,pastResults:k,currentIndex:E}=h.context,x=(0,e$.useDispatch)();D$({error:v,onError:o}),ev.useEffect(()=>{d?.current?.focus()},[]);let _=ev.useRef(null),w=ev.useCallback(()=>{let e=Tl.safeParse({projectId:n,nodeId:null==r?l:r,data:{type:"add_block",content:a}});e.success&&y({type:"MAKE_REQUEST",payload:{requestBody:e.data}})},[r,n,a,l,y]);ev.useEffect(()=>{w()},[w]);let N=[{type:"section",label:"actions",items:[{label:"Insert Block",itemType:YO}].map(e=>{let{label:t}=e;return{label:t,values:[t],data:{action:e},render:Yj}}),render:YR}],C=(t=()=>{if(null==b)return;let e=(0,lo.markdownTextToTaskastFragment)(b,{shouldRemoveCodeFence:!0});null==r?x(Da({id:null,position:"beforeend"},e)):x(Da({id:r,position:"beforebegin"},e)),o()},ev.useCallback(e=>{e.data.action.itemType===YO&&t()},[t])),M=()=>{if(0===u.length)return;p("");let e=Tl.safeParse({projectId:n,nodeId:null==r?l:r,data:{type:"reprompt",content:u,previousMessage:b}});e.success&&(y({type:"MAKE_REQUEST",payload:{requestBody:e.data}}),d.current?.focus())};return ev.createElement("div",{ref:d,onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),_.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),_.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),_.current?.getVisibleItemCount()===0?M():_.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:if(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),h.matches("streaming")){y({type:"STOP_STREAM"});return}o()}},tabIndex:0,className:"group",style:i},h.matches("idle")&&null!=v&&ev.createElement("div",{className:"m-2 rounded-lg border border-danger p-2 text-center text-xs text-danger"},v.message),ev.createElement("div",{ref:c,className:"max-h-[60vh] min-h-[30vh] overflow-y-auto px-4 pb-4"},h.matches("failed")?ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},v?.message):ev.createElement(DA,{value:b,shouldRemoveCodeFence:!0})),h.matches("streaming")&&ev.createElement("div",{className:"relative flex w-full justify-end pr-4 opacity-0 transition duration-150 ease-in-out group-hover:opacity-100"},ev.createElement("button",{className:"absolute -top-14 flex items-center gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-200",onClick:()=>{y({type:"STOP_STREAM"})}},ev.createElement(tn.Icon,{icon:"ai_stop"}),ev.createElement(eY.Z,{id:"general.ai.stop_generating",defaultMessage:"Stop generating"}))),h.matches("idle")&&ev.createElement("div",{className:"relative rounded-xl border border-solid border-appcolor-400 bg-appcolor-100"},ev.createElement("div",{className:"flex w-full flex-col gap-1 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{ref:f,className:"w-full bg-transparent p-4",placeholder:m.formatMessage({id:"general.ai_add_block_reprompt_placeholder",defaultMessage:"What would you like to do next?"}),value:u,onChange:e=>{p(e.target.value)},minRows:4,maxRows:8})),ev.createElement("div",{className:"flex px-4 pb-3"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:s},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"})),ev.createElement("button",{className:"ml-auto flex items-center text-appcolor-500 hover:text-primary",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),0!==u.length&&M()}},ev.createElement(tn.Icon,{icon:"message_send"}))),k.length>1&&ev.createElement("div",{className:"mr-2 flex min-w-fit items-center text-sm text-appcolor-500"},ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_prev",onClick:()=>{y({type:"TOGGLE_PREV"})}}),ev.createElement("p",null,E+1," of ",k.length),ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_next",onClick:()=>{y({type:"TOGGLE_NEXT"})}})),ev.createElement("div",{className:"border-t border-solid border-appcolor-300"},ev.createElement(tT,{ref:_,term:u,data:N,renderMap:YZ,onActivate:C,sectionRenderMap:YL,search:YB,renderEmptyState:ev.createElement("div",{className:"hidden py-4"})}))))},Yq="PromptSection",YW="PromptItem",YH=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-3 mb-px flex h-7 items-center rounded-md px-2 py-px text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{icon:"dd_ai_spark"}),ev.createElement("span",{className:"pl-3"},t.label),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},YG={[YW]:e=>ev.createElement(YH,{morseChildProps:e})},YK={[Yq]:()=>ev.createElement(ev.Fragment,null)},YY=(e,t)=>new to.Z(t,{keys:["values"],threshold:0}).search(e).map(e=>e.item),YQ=function(e){var t;let{onExit:a,submitPrompt:n,style:l,handleToggleAiPromptTemplates:r}=e,[o,i]=ev.useState(""),s=ev.useRef(null);ev.useEffect(()=>{s.current?.focus()},[]);let d=ev.useRef(null),c=function(){let e=(0,eK.Z)();return[{type:"section",label:"prompts",items:[{label:e.formatMessage({id:"general.project_ai_add_block_checklist",defaultMessage:"Checklist for ..."}),value:"Checklist for "},{label:e.formatMessage({id:"general.project_ai_add_block_project_plan",defaultMessage:"Project plan for ..."}),value:"Project plan for "},{label:e.formatMessage({id:"general.project_ai_add_block_project_meeting_agenda",defaultMessage:"Meeting agenda for ..."}),value:"Meeting agenda for "},{label:e.formatMessage({id:"general.project_ai_add_block_project_brainstorm",defaultMessage:"Brainstorm for ..."}),value:"Brainstorm for "},{label:e.formatMessage({id:"general.project_ai_add_block_project_roadmap",defaultMessage:"Roadmap for ..."}),value:"Roadmap for "},{label:e.formatMessage({id:"general.project_ai_add_block_project_notes",defaultMessage:"Notes for ..."}),value:"Notes on "},{label:e.formatMessage({id:"general.project_ai_add_block_project_okr",defaultMessage:"OKR for ..."}),value:"OKR for "}].map(e=>{let{label:t}=e;return{label:t,values:[t],data:{prompt:e},render:YW}}),render:Yq}]}(),m=(t=e=>{i(e.value)},ev.useCallback(e=>{t(e.data.prompt)},[t])),u=(0,eK.Z)();return ev.createElement("div",{onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d.current?.getVisibleItemCount()===0?n(o):d.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),a()}},className:"relative rounded-xl border border-solid border-appcolor-400 bg-appcolor-100",style:l},ev.createElement("div",{className:"flex w-full flex-col gap-1 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{ref:s,className:"w-full bg-transparent p-4",placeholder:u.formatMessage({id:"general.project_ai_add_block_placeholder",defaultMessage:"Create a block for ..."}),value:o,onChange:e=>{i(e.target.value)},minRows:4,maxRows:8}),ev.createElement("div",{className:"flex px-4 pb-3"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:r},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"})),ev.createElement("button",{className:"ml-auto flex cursor-pointer items-center text-appcolor-500 hover:text-primary",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d.current?.getVisibleItemCount()===0?n(o):d.current?.activateCurrentItem()}},ev.createElement(tn.Icon,{icon:"message_send"}))),ev.createElement("div",{className:"border-t border-solid border-appcolor-300"},ev.createElement(tT,{ref:d,term:o,data:c,renderMap:YG,onActivate:m,sectionRenderMap:YK,search:YY,renderEmptyState:ev.createElement("div",{className:"hidden py-4"})}))))},YJ=eL.default.div.withConfig({displayName:"ProjectAiAddBlockDialogBody__Container",componentId:"sc-ab63433c-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + backdrop-filter: blur(7px); + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,YX=function(e){let{projectId:t,nodeId:a,rootNodeId:n,onExit:l}=e,[r,o]=ev.useState(null),i=T_((0,eI.useTheme)()),s=(0,e$.useDispatch)(),d=()=>{s(co.actions.toggleAiPromptTemplatesDialog())};return ev.createElement(YJ,{className:"w-full max-w-3xl rounded-xl bg-appcolor-0 p-5 md:w-192"},ev.createElement("div",{className:"w-full rounded-xl"},ev.createElement("div",{className:"w-full overflow-clip rounded-xl"},null==r?ev.createElement(YQ,{onExit:l,submitPrompt:e=>{o(e)},style:i,handleToggleAiPromptTemplates:d}):ev.createElement(YV,{projectId:t,nodeId:a,rootNodeId:n,prompt:r,onExit:l,style:i,handleToggleAiPromptTemplates:d}))))},Y0=(0,e$.connect)(function(e){return{rootNodeId:iR(e),projectId:dP(e),dialogState:e.dialogs.projectAiAddBlock}})(function(e){let{dialogState:t,projectId:a,rootNodeId:n}=e,l=(0,e$.useDispatch)(),{isOpen:r,nodeId:o}=t,i=()=>{l(Gx.actions.toggleProjectAiAddBlockDialog())};return r&&null!=a?ev.createElement(eI.ModalDialog,{close:i,isOpen:r,autofocus:!1,disableBackground:!0},()=>ev.createElement(YX,{projectId:a,nodeId:o,rootNodeId:n,onExit:i})):null});var Y1=a(57762);function Y2(e){return e.search.query}let Y5=(0,eV.ZP)("mod+f"),Y3=(0,eV.ZP)("mod+enter"),Y4=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-3396d15-0"})` + width: 100%; + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; + pointer-events: none; +`,Y6=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-3396d15-1"})` + width: 100%; + max-width: 500px; + margin: 0 20px; + display: flex; + flex-direction: column; + background-color: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.2); + pointer-events: all; +`,Y8=eL.default.div.withConfig({displayName:"styled__Section",componentId:"sc-3396d15-2"})` + width: 100%; + display: flex; + flex-direction: row; + justify-content: space-between; +`,Y7=(0,eL.default)(Y8).withConfig({displayName:"styled__BottomSection",componentId:"sc-3396d15-3"})` + display: flex; + justify-content: flex-start; + border-top: 1px solid ${e=>e.theme.isNightMode?"#1A1C1D":"#e5e5e5"}; + color: #999999; + font-size: 14px; + gap: 12px; +`,Y9=eL.default.div.withConfig({displayName:"styled__InputWrapper",componentId:"sc-3396d15-4"})` + width: 100%; + display: flex; + flex-direction: row; +`,Qe=eL.default.input.withConfig({displayName:"styled__StyledInput",componentId:"sc-3396d15-5"})` + width: 100%; + border: 0; + margin: 0 10px; + caret-color: ${e=>e.theme.isNightMode?"#e5e5e5":"#292929"}; +`,Qt=(0,eL.default)(lT.jI).withConfig({displayName:"styled__StyledSearch",componentId:"sc-3396d15-6"})` + height: 30px; + width: 30px; + + path { + stroke: #666; + } +`,Qa=eL.default.div.withConfig({displayName:"styled__StyledText",componentId:"sc-3396d15-7"})` + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +`,Qn=eL.default.button.withConfig({displayName:"styled__StyledClearButton",componentId:"sc-3396d15-8"})` + padding: 0; + width: 30px; + height: 30px; + border: 0; + background-color: transparent; + cursor: pointer; +`,Ql=(0,eL.default)(lT.SS).withConfig({displayName:"styled__StyledIconClearSrc",componentId:"sc-3396d15-9"})` + & > path { + fill: ${e=>e.theme.isNightMode?"#666666":"#e5e5e5"}; + } + :hover { + & > path { + fill: #999999; + } + } +`,Qr=(0,eL.default)(eI.Shortcut.Combo).attrs({fontSize:"10px",padding:"3px",gap:"4px"}).withConfig({displayName:"styled__StyledCombo",componentId:"sc-3396d15-10"})` + margin: 0 5px; +`,Qo=eL.default.span.withConfig({displayName:"styled__StyledSpan",componentId:"sc-3396d15-11"})` + display: flex; +`,Qi={transition:"opacity 100ms ease-in-out, margin 100ms ease-in-out",opacity:0,margin:"-20px 0 0 0"},Qs={entering:{opacity:0},entered:{opacity:1,margin:"10px 0 0 0"},exiting:{opacity:0},exited:{opacity:0},unmounted:{}},Qd=function(e){let t=(0,e$.useSelector)(Y2),a=(0,eK.Z)(),n=ev.useRef(null),[l,r]=ev.useState(t),o=(0,eF.k6)(),i=(0,e$.useDispatch)();return ev.useEffect(()=>{n.current?.focus()},[]),ev.useEffect(()=>{r(t)},[t]),ev.createElement(Y4,{style:{...Qi,...Qs[e.state]},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(Y6,{className:"rounded-xl border border-solid border-appcolor-300"},ev.createElement(Y8,{className:"border-b border-solid border-appcolor-300 px-2 py-2"},ev.createElement(Y9,null,ev.createElement(Qt,null),ev.createElement(Qe,{className:"tc-search bg-transparent text-sm",type:"text",placeholder:a.formatMessage({id:"project.filter_placeholder",defaultMessage:"Filter by word, @mention, #tag or assignee..."}),value:l,onChange:e=>{r(e.target.value),i(N3(e.target.value))},onKeyDown:e=>{if(null!=om(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();return}if(Y3(e.nativeEvent)){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.push({pathname:"/search",search:t?`?${tL.stringify({q:t})}`:void 0});return}},ref:n})),ev.createElement(Qn,{type:"button",className:"clear-ShortcutChip",onClick:e=>{e.stopPropagation(),r(""),i(N3("")),i(N4())}},ev.createElement(Ql,null))),ev.createElement(Y7,{className:"px-4 py-3"},ev.createElement(Qa,null,ev.createElement(Qo,{className:"text-textcolor-500"},ev.createElement(eY.Z,{id:"general.filter.advanced_search",defaultMessage:"Advanced Search"})),ev.createElement(Qr,null,ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"↵"))),ev.createElement(Qa,null,ev.createElement(Qo,{className:"text-textcolor-500"},ev.createElement(eY.Z,{id:"general.filter.browser_search",defaultMessage:"Browser Search"})),ev.createElement(Qr,null,ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"F"))))))},Qc=(0,e$.connect)(function(e){return{isOpen:e.search.isOpen}})(function(e){let{isOpen:t}=e,a=ev.useContext(eI.LayersContext),n=(0,e$.useDispatch)(),l=ev.useCallback(e=>{e.stopPropagation(),e.stopImmediatePropagation(),rV(e)?(t&&(e.preventDefault(),n(N4())),n(N3(""))):Y5(e)&&(t||e.preventDefault(),n(N4()),n(N3("")))},[n,t]);ev.useEffect(()=>(document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}),[l]);let r=a?.overlay;return null==r?null:ep.createPortal(ev.createElement(Y1.ZP,{in:t,timeout:100,unmountOnExit:!0},e=>ev.createElement(Qd,{state:e})),r)});var Qm=a(90057);let Qu=["brand","red","blue","green","purple","pink","yellow"],Qp=e=>{let t=0;for(let a=0;ae.point.x+0}px, ${e=>e.point.y}px); + width: 40px; + height: 20px; + justify-content: center; + margin-top: 2px; + flex-direction: row-reverse; + + & > svg:first-child { + transform: translateX(0) !important; + z-index: 1; + position: relative; + } + & > img:first-child { + transform: translateX(0) !important; + z-index: 1; + position: relative; + } + & > svg:only-child { + flex: inherit !important; + transform: translateX(0) !important; + } + & > img:only-child { + flex: inherit !important; + transform: translateX(0) !important; + } + + ${e=>e.$shouldHidePresence&&(0,eL.css)` + display: none; + `} +`,Qf=(0,eL.css)` + display: flex; + height: 20px; + width: 20px; + border-radius: 20px; + flex: 1 0 auto; + transform: translateX(8px); +`,Qh=eL.default.img.withConfig({displayName:"NodePresence__StyledAvatar",componentId:"sc-ae5c2011-1"})` + ${Qf} +`,Qy=(0,eL.default)(lT.I_).withConfig({displayName:"NodePresence__StyledAnonAvatar",componentId:"sc-ae5c2011-2"})` + ${Qf} + background: ${e=>e.color}; + + path { + fill: #fff; + } +`,Qb=eL.default.span.withConfig({displayName:"NodePresence__StyledName",componentId:"sc-ae5c2011-3"})` + display: block; + padding: 3px 0; +`,Qv=VX({presences(e,t){if(e===t)return!0;if(null==e||null==t||e.length!==t.length)return!1;for(let a=0;a{let e=[];if(null==l)return e;for(let t of l){let a=null;if(r?.id!==t.userID){try{a=s.readFragment({id:`User:${t.userID}`,fragment:up,fragmentName:"BasicUserFields"})}catch(e){er.Tb(e)}if(null==a){e.push({type:"guest",presenceID:t.presenceID});continue}e.push({type:"user",presenceID:t.presenceID,...a})}}return e},[l,r?.id,s]),[c,m]=ev.useState(!1),u=ev.useRef(null),p=ev.useRef(null),g=ev.useRef(null),{arrowProps:f,popperProps:h,referenceProps:y}=(0,eI.useControlledTooltip)({referenceElementRef:u,arrowElementRef:p,popperElementRef:g,placement:"top",visible:c}),b=ev.useCallback(()=>{m(!i&&!n&&d.length>0)},[i,n,d.length]),v=ev.useCallback(()=>{m(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement(Qg,{...y,point:t,$shouldHidePresence:"mindmap"===o||"orgchart"===o,onMouseEnter:b,onMouseLeave:v},i?d.slice(0,2).map((e,t)=>ev.createElement(Qy,{key:e.presenceID,index:t,color:Su(Qu[Qp(e.presenceID)]).base})):d.slice(0,2).map((e,t)=>{switch(e.type){case"guest":return ev.createElement(Qy,{key:e.presenceID,index:t,color:Su(Qu[Qp(e.presenceID)]).base});case"user":return ev.createElement(Qh,{key:e.presenceID,index:t,src:e.avatars_v2?.small?.ldpi.url})}})),c&&ev.createElement(eI.Tooltip,{arrowProps:f,popperProps:h},d.map(e=>{switch(e.type){case"guest":return ev.createElement(Qb,{key:e.presenceID},ev.createElement(eY.Z,{id:"general.guest_editor",defaultMessage:"Guest Editor"}));case"user":return ev.createElement(Qb,{key:e.presenceID},e.handle)}})))}),QE=function(e){let{documentID:t,nodeID:a,ancestorRef:n,counter:l}=e,[r,o]=(0,Qm.x)(null);return((0,ev.useEffect)(()=>{let e=n.current;if(null==e){o(()=>null);return}let t=document.getElementById(`node-${a}`);if(null==t){o(()=>null);return}let l=t.querySelector(":scope .right-side");if(null==l){o(()=>null);return}let r=l.getBoundingClientRect(),i=e.getBoundingClientRect(),s=r.right-i.left,d=r.top-i.top;o(e=>null==e?{x:s,y:d}:(e.x=s,e.y=d,e))},[n,a,o,l]),null==r)?null:ev.createElement(Qk,{documentID:t,nodeID:a,point:r})},Qx=eL.default.div.withConfig({displayName:"PresenceOverlay__Container",componentId:"sc-4717986d-0"})` + pointer-events: none; + position: absolute; + top: 0; + left: 0; + + @media print { + opacity: 0; + } +`,Q_=(0,e$.connect)(function(e){return{nodes:e.presence.nodes}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{documentID:a,nodes:n}=e,[l,r]=(0,ev.useState)(0),o=(0,ev.useRef)(null);return(0,ev.useImperativeHandle)(t,()=>({forceUpdate:()=>{r(e=>e+1)}}),[]),ev.createElement(Qx,{ref:o},Object.keys(n).map(e=>ev.createElement(QE,{key:e,ancestorRef:o,documentID:a,nodeID:e,counter:l})))})),Qw=eL.default.div.withConfig({displayName:"sync-indicator__StyledSyncIndicator",componentId:"sc-248fe471-0"})` + position: sticky; + top: 0; + left: 0; + pointer-events: none; + z-index: 5; + background-color: ${eI.ThemeColors.danger}; + padding: 12px 0 13px; + width: 100%; + ${e1.UiTypography.md}; + text-align: center; + color: #fff; + opacity: 0.95; +`,QN=ev.memo(function(){return(0,e$.useSelector)(dR)!==Nb?null:ev.createElement(Qw,null,ev.createElement(eY.Z,{id:"general.the_project_is_not_syncing",defaultMessage:"The project is not syncing, check your connection or refresh the page to continue."}))}),QC=function(e){let{documentId:t,isChatModeEnabled:a}=e,n=(0,e$.useDispatch)(),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useState(!1),{arrowProps:d,popperProps:c,referenceProps:m}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:i});return ev.createElement(ev.Fragment,null,ev.createElement("button",{...m,"aria-label":"Toggle chat",onClick:()=>{a?n(xk(t)):n(M1.actions.toggleProjectSettingsDialog({projectId:t,page:"admin"})),s(!1)},onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},className:"fixed bottom-5 right-5 z-1 hidden items-center justify-center rounded-xl bg-appcolor-100 p-3 text-appcolor-800 transition duration-300 ease-in-out hover:scale-110 hover:text-appcolor-500 md:flex"},ev.createElement(tn.Icon,{icon:"dd_chat",className:"scale-110 animate-color-rainbow"})),i&&ev.createElement(eI.Tooltip,{arrowProps:d,popperProps:c},ev.createElement(IN,null,a?ev.createElement(ev.Fragment,null,ev.createElement(eY.Z,{id:"chat.toggle_chat",defaultMessage:"Toggle Chat"}),ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"\\"))):ev.createElement(eY.Z,{id:"chat.disabled",defaultMessage:"Chat (Disabled)"}))))},QM={"bg-color-1":"#ffb2b9","bg-color-2":"#ffdfb8","bg-color-3":"#b8ffc7","bg-color-4":"#b9e1ff","bg-color-5":"#FC5C65","bg-color-6":"#FD9644","bg-color-7":"#FED330","bg-color-8":"#26DE81","bg-color-9":"#2BCBBA","bg-color-10":"#45AAF2","bg-color-11":"#4B7BEC","bg-color-12":"#A55EEA","bg-color-13":"#D1D8E0","bg-color-14":"#778CA3","bg-color-15":"#333333","bg-color-16":"#F6C647","bg-color-17":"#CBE45A","bg-color-18":"#5EC8C3","bg-color-19":"#F1ABDC","bg-color-20":"#DB586A","bg-color-21":"#EBA342","bg-color-22":"#ABCA53","bg-color-23":"#3F87A4","bg-color-24":"#CD84F3","bg-color-25":"#A73E70","bg-color-26":"#DD6437","bg-color-27":"#419240","bg-color-28":"#2151D5","bg-color-29":"#9581F3","bg-color-30":"#7A396E","bg-color-31":"#D73934","bg-color-32":"#296165","bg-color-33":"#1A1460","bg-color-34":"#5758B5","bg-color-35":"#66244F","bg-color-36":"#F1A886","bg-color-37":"#61C9F3","bg-color-38":"#E2B759","bg-color-39":"#80E3C3","bg-color-40":"#CCD3C9","bg-color-41":"#E9865C","bg-color-42":"#499AF5","bg-color-43":"#F7F0C0","bg-color-44":"#6FAFA0","bg-color-45":"#2F3A46","bg-color-46":"#A54170","bg-color-47":"#3B3B93","bg-color-48":"#EC7A77","bg-color-49":"#ADEADC","bg-color-50":"#CEA4E4","bg-color-51":"#65274E","bg-color-52":"#1D2C5E","bg-color-53":"#E9537C","bg-color-54":"#BFC589","bg-color-55":"#7C5A9B","bg-color-56":"#84ECC7","bg-color-57":"#9CEAEB","bg-color-58":"#84B7F9","bg-color-59":"#A19BF7","bg-color-60":"#E0E6E9","bg-color-61":"#53B596","bg-color-62":"#5DCBC8","bg-color-63":"#3A82DC","bg-color-64":"#6A5DDF","bg-color-65":"#B4BEC3","bg-color-66":"#FCEBAF","bg-color-67":"#EFB4A4","bg-color-68":"#EE7E79","bg-color-69":"#ED81A7","bg-color-70":"#656E72","bg-color-71":"#F5CD7C","bg-color-72":"#D3765C","bg-color-73":"#C5403A","bg-color-74":"#D65191","bg-color-75":"#2E3436","bg-color-76":"#F2A4EF","bg-color-77":"#F6CC6B","bg-color-78":"#ED7470","bg-color-79":"#76D8F7","bg-color-80":"#63CEA4","bg-color-81":"#E271DB","bg-color-82":"#F2A456","bg-color-83":"#DD5D59","bg-color-84":"#55BADF","bg-color-85":"#4FAA87","bg-color-86":"#5FCFD2","bg-color-87":"#669EF8","bg-color-88":"#582BC5","bg-color-89":"#CBD6E4","bg-color-90":"#5A6573","bg-color-91":"#49A1A3","bg-color-92":"#4784D8","bg-color-93":"#312091","bg-color-94":"#8795A5","bg-color-95":"#252F3D","bg-color-96":"#DE6279","bg-color-97":"#595FC8","bg-color-98":"#72CCF6","bg-color-99":"#73E4E3","bg-color-100":"#6BE58B","bg-color-101":"#E24C5C","bg-color-102":"#3C40BF","bg-color-103":"#55B9F4","bg-color-104":"#62D5D5","bg-color-105":"#59C174","bg-color-106":"#F6C35F","bg-color-107":"#FADE70","bg-color-108":"#ED695E","bg-color-109":"#D4DAE1","bg-color-110":"#4B545F","bg-color-111":"#F3AC3D","bg-color-112":"#F8D553","bg-color-113":"#EB5141","bg-color-114":"#838E9A","bg-color-115":"#20272D"},QS=new Map(Object.entries(QM)),QI=eL.default.div.withConfig({displayName:"ProjectBanner__NewBackground",componentId:"sc-75fbe2b-0"})` + width: 100%; + flex: 0 0 220px; + pointer-events: none; + border-bottom: 1px solid ${e=>e.theme.primaryColorScheme?.alpha10}; + background: ${e=>e.theme.appColors.hex(90)} no-repeat center; + background-size: cover; + + ${e=>{switch(e.$backgroundState.type){case"image":return` + background-image: url("${e.$backgroundState.value}"); + `;case"color":if(e.$backgroundState.value in QM)return` + background-image: none; + background-color: ${QS.get(e.$backgroundState.value)}; + `;return` + margin-top: 12px; + `;case"none":return` + flex: 0 0 0px; + margin-bottom: 60px; + background: ${e.theme.appColors.hex(100)}; + border: none; + `;default:return` + //margin-top: 12px; + `}}} +`,QD=function(){let e=(0,eF.$B)(),t=e.params.documentID,a=(0,ev.useContext)(jz),n=ev.useMemo(()=>jU(a.background),[a.background]),l=ev.useMemo(()=>!(e?.path!=null&&e.path.startsWith("/embed/")),[e.path]);return ev.createElement(ev.Fragment,null,ev.createElement(QN,null),ev.createElement(QI,{$backgroundState:n,className:"cover-image"}),null!=t&&l&&ev.createElement(QC,{documentId:t,isChatModeEnabled:a.chatMode===R.ENABLED}))},QT=(0,eL.createGlobalStyle)` + @-webkit-keyframes focusNodeHighlight { + from { + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + border: 2px solid ${e=>e.theme.primaryColorScheme?.alpha50}; + } + to { + } + } + + @keyframes focusNodeHighlight { + from { + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + border: 2px solid ${e=>e.theme.primaryColorScheme?.alpha50}; + } + to { + } + } + + .lightbox-wrapper .react-pdf__Document > div { + ${tM} + } + + ${e=>null!=e.$nodeId&&(0,eL.css)` + #node-${e.$nodeId} > .title { + &:focus-within:before { + animation-fill-mode: forwards; + animation-play-state: running; + } + + &:before { + display: flex; + border-radius: 10px; + content: ''; + width: 100%; + height: 100%; + position: absolute; + top: 0px; + left: 0px; + z-index: 1; + pointer-events: none; + + animation-name: focusNodeHighlight; + animation-duration: 3ms; + animation-fill-mode: backwards; + animation-play-state: paused; + } + } + `} +`,Q$=function(e){let{fetchStatus:t}=e,a=(0,e$.useDispatch)(),{hash:n}=(0,eF.TH)(),l=(0,ev.useMemo)(()=>{if(ts()(n))return null;let e=n.match(/^#node-([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/);return null==e?null:e[1]},[n]),[r,o]=(0,ev.useState)(null);return(0,ev.useLayoutEffect)(()=>{if(null==r)return;let e=window.requestAnimationFrame(()=>{let e=document.getElementById(`node-${r}`);null!=e&&e.scrollIntoView({block:"center",inline:"center"})});return()=>{window.cancelAnimationFrame(e)}},[r]),(0,ev.useLayoutEffect)(()=>{if(t===uk){if(null==l){o(null);return}null==document.getElementById(`node-${l}`)&&a({type:I5,payload:{nodeId:l}}),o(l)}},[a,t,l]),ev.createElement(QT,{$nodeId:l})};function QP(e){return null!=e&&!!e.id&&!e.editPath}function QF(e){return(t,a)=>{let n=dV(a());QP(n)||t(mS(n?.id,e))}}let QA="insert",QR="replace",Qj="regenerate",QO=function(e){let t;let{label:a,isFocused:n,itemType:l,activate:r}=e,o=ev.useRef(null);switch(ev.useEffect(()=>{n&&o.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[n]),l){case QA:t="dd_new";break;case QR:t="ai_replace";break;case Qj:t="dd_ai_rewrite";break;default:t="dd_ai"}return ev.createElement("button",{ref:o,onClick:r,className:"flex h-7 w-full items-center px-3 py-2 text-sm text-appcolor-500"},ev.createElement("div",{className:og()("flex h-7 w-full items-center rounded-md px-1 hover:bg-appcolor-200 hover:text-appcolor-800",n&&"bg-appcolor-200 text-appcolor-800")},ev.createElement(tn.Icon,{className:"scale-90",icon:t}),ev.createElement("span",{className:"pl-3"},a),n&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"})))},QU=ev.forwardRef(function(e,t){let{term:a,onActivate:n}=e,[l,r]=ev.useState(0),o=ev.useRef(0),i=ev.useRef(new Map),s=ev.useRef(null),d=function(){let e=(0,eK.Z)();return[{label:e.formatMessage({id:"general.insert",defaultMessage:"Insert"}),itemType:QA},{label:e.formatMessage({id:"general.replace",defaultMessage:"Replace"}),itemType:QR},{label:e.formatMessage({id:"general.regenerate",defaultMessage:"Regenerate"}),itemType:Qj}]}(),c=ev.useMemo(()=>{let e=0,t=0===a.length?d:new to.Z(d,{keys:["label"],threshold:.2}).search(a).map(e=>e.item);for(let a of t)i.current.set(e,a),e+=1;return o.current=e-1,t},[d,a]);return(ev.useImperativeHandle(t,()=>({focusPrevItem(){r(e=>Math.max(0,e-1)),l<=1&&null!=s.current&&(s.current.scrollTop=0)},focusNextItem(){r(e=>Math.min(o.current,e+1))},activateCurrentItem(){let e=i.current.get(l);null!=e&&n(e)},getVisibleItemCount:()=>c.length})),0===c.length)?null:ev.createElement("div",{className:"border-b-xl gap-px rounded-b-xl border border-solid border-appcolor-300 py-2"},c.map((e,t)=>ev.createElement(QO,{key:t,isFocused:l===t,label:e.label,itemType:e.itemType,activate:()=>{r(t),n(e)}})))}),QZ=(0,lb.C)({context:{result:"",error:null,pastResults:[],currentIndex:0},schema:{context:{},events:{}},tsTypes:{},id:"request",initial:"idle",states:{idle:{on:{MAKE_REQUEST:{actions:"clearResult",target:"#request.streaming"},TOGGLE_PREV:{actions:"handleTogglePrev"},TOGGLE_NEXT:{actions:"handleToggleNext"}}},streaming:{invoke:{src:(e,t)=>async e=>{if("MAKE_REQUEST"!==t.type)return;let{input:a}=t.payload,n="custom"===a.data.type?"/web-api/ai/custom-command":"/web-api/ai",l=await fetch(n,{method:"POST",credentials:"same-origin",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}});if(!l.ok){let e=new ei.FetchError(l);throw await e.toTaskadeError()??e}if(null==l.body)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"response body is null"});let r=l.body.getReader(),o=new TextDecoder;function i(t){if(t)try{let a=JSON.parse(t),n=Tn.safeParse(a);if(!n.success)return;e({type:"UPDATE_RESULT",payload:{chunk:n.data.text}})}catch(e){throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Error parsing line"})}}let s=!1,d="";for(;!s;){let e=await r.read();if(s=e.done,e.value){d+=o.decode(e.value);for(let e=d.indexOf("\n");e>=0;e=d.indexOf("\n")){let t=d.slice(0,e);d=d.slice(e+1),i(t)}}}if(d){let e=d;d="",i(e)}e({type:"STREAM_FINISHED"})},onError:[{actions:"handleError",target:"#request.failed"}]},on:{UPDATE_RESULT:{actions:"updateResult"},STREAM_FINISHED:{actions:"handleStreamFinished",target:"#request.idle"}}},failed:{}}}),QL=function(e){let{inputText:t,insertNodeId:a,projectId:n,command:l,shouldInsertPromptIntoNode:r,onExit:o,onBackButtonClick:i,onReplaceText:s,onInsertFragment:d,updatePopperPosition:c}=e,m=(0,e$.useDispatch)(),[u,p]=(0,ls.e)(QZ,{actions:{updateResult:(0,lv.assign)((e,t)=>{let{chunk:a}=t.payload;return(0,es.ZP)(e,e=>{e.result=e.result+a})}),handleStreamFinished:(0,lv.assign)(e=>(c(),(0,es.ZP)(e,e=>{e.currentIndex=e.pastResults.length,e.pastResults=[...e.pastResults,e.result]}))),clearResult:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{e.result=""})),handleError:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleTogglePrev:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{currentIndex:t,pastResults:a}=e;if(0===t)return e;let n=t-1;e.currentIndex=n,e.result=a[n]})),handleToggleNext:(0,lv.assign)(e=>(0,es.ZP)(e,e=>{let{currentIndex:t,pastResults:a}=e,n=t+1;if(n>=a.length)return e;e.currentIndex=n,e.result=a[n]}))}}),g=u.context.result,f=(0,eI.useTheme)(),h=(0,eF.k6)(),[y,b]=ev.useState(null),v=ev.useRef(null),k=ev.useRef(null),E=(0,eK.Z)(),[x,_]=ev.useState(""),w=ev.useMemo(()=>"custom"===l.type?DO(t,l,{projectId:n,nodeId:a}):Dj(t,l,{projectId:n,nodeId:a}),[l,a,t,n]),N=ev.useCallback(()=>{p({type:"MAKE_REQUEST",payload:{input:w}})},[w,p]);ev.useEffect(()=>{N()},[N]),D$({error:u.context.error,onError:()=>{m(DT.actions.toggleAiAssistantDialog())}});let C=ev.useCallback(e=>{let n=u.context.error;if(null!=n){402===(0,ei.getStatusCodeFromError)(n)&&("ACTIVATION_REQUIRED"===(0,ei.getCodeFromError)(n)?h.push("/settings/plans"):m(d4())),o();return}if(null!=g){if("insert"===e){let{markdownText:e}=(0,lo.plainTextToMarkdownText)(g),n=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});if((0,lr.isFragmentEmpty)(n))return;d(n),r&&m(DR(a,t))}else{let{markdownText:e}=(0,lo.plainTextToMarkdownText)(g),t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});if((0,lr.isFragmentEmpty)(t))return;s(t)}o()}},[m,h,t,a,u.context.error,o,d,s,r,g]),M=()=>{N()},S=()=>{0!==x.length&&(_(""),p({type:"MAKE_REQUEST",payload:{input:{projectId:n,nodeId:a,data:{type:"reprompt",content:x,previousMessage:g}}}}))};ev.useEffect(()=>{let e=v.current;null!=e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[g]);let I=e=>{null==g||u.matches("streaming")||(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),k.current?.getVisibleItemCount()===0?S():k.current?.activateCurrentItem())};return ev.useEffect(()=>{y?.focus()},[y]),ev.createElement("div",null,ev.createElement("div",{className:"w-full rounded-xl rounded-b-none border border-b-0 border-solid border-appcolor-300",onKeyDownCapture:e=>{if((0,eV.ZP)("shift+enter")(e)){if(null==g||u.matches("streaming"))return;e.preventDefault(),C("replace");return}switch(e.key){case eI.KeyboardKeys.Enter:I(e);break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),k.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),k.current?.focusNextItem();break;case eI.KeyboardKeys.Escape:o()}}},ev.createElement("div",{className:"flex max-h-80 min-h-60 w-full overflow-y-auto px-5 py-4 text-sm leading-relaxed",ref:v,tabIndex:0},u.matches("failed")?ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},u.context?.error?.message):null!=g&&ev.createElement("div",{className:"mb-10"},ev.createElement(DA,{value:g,shouldRemoveCodeFence:!0}))),ev.createElement("div",{className:"w-full"},ev.createElement("div",{className:"flex h-full w-full items-center justify-between border-y border-solid border-appcolor-300 px-4 py-2"},u.matches("streaming")?ev.createElement("div",{className:"ml-auto"},ev.createElement(eI.Spinner,{color:f.primaryColor})):ev.createElement(ev.Fragment,null,u.matches("idle")&&null!=g&&ev.createElement("div",{className:"flex w-full flex-col"},ev.createElement("div",{className:"flex w-full items-center gap-x-3 py-2"},ev.createElement(tn.Icon,{className:"-mt-1 shrink-0 scale-90",icon:"dd_ai"}),ev.createElement(Dx.Z,{ref:b,className:"w-full resize-none bg-transparent pr-4 text-sm",placeholder:E.formatMessage({id:"general.ai_assistant_reprompt_placeholder",defaultMessage:"Instruct Taskade AI on what to do next...."}),value:x,onChange:e=>{_(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},minRows:1}),ev.createElement("button",{className:"flex items-center text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:I},ev.createElement(tn.Icon,{icon:"message_send"})),u.context.pastResults.length>1&&ev.createElement("div",{className:"mr-2 flex min-w-fit items-center text-sm text-appcolor-500"},ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_prev",onClick:()=>{p({type:"TOGGLE_PREV"})}}),ev.createElement("p",null,`${u.context.currentIndex+1} of ${u.context.pastResults.length}`),ev.createElement(tn.Icon,{className:"scale-75 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-800",icon:"caret_next",onClick:()=>{p({type:"TOGGLE_NEXT"})}})))),u.matches("failed")&&null!=u.context.error&&ev.createElement("div",{className:"flex w-full items-center"},ev.createElement("div",{className:"mr-auto flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-appcolor-400 px-3 text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{i()}},ev.createElement(eY.Z,{id:"general.back",defaultMessage:"Back"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"B")),402===(0,ei.getStatusCodeFromError)(u.context.error)&&ev.createElement("div",{className:"flex h-7 cursor-pointer items-center rounded-lg bg-upgrade px-4 text-[#0c0500] hover:bg-upgrade/80",onClick:()=>{C("insert")}},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1 mt-0.5"}),"ACTIVATION_REQUIRED"===(0,ei.getCodeFromError)(u.context.error)?ev.createElement(eY.Z,{id:"general.activate",defaultMessage:"Activate"}):ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))))))),u.matches("idle")&&g.length>0&&ev.createElement(QU,{ref:k,term:x,onActivate:e=>{switch(e.itemType){case QA:C("insert");break;case QR:C("replace");break;case Qj:M()}}}))},QB="space_agent",Qz="create_space_agent",QV=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-2 mb-px flex h-7 items-center gap-2 rounded-md px-2 py-px text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement("span",null,t.label),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},Qq=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{className:og()("mx-2 mb-px flex h-7 items-center gap-2 rounded-md px-2 py-px text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800"),ref:a,onClick:t.activate},ev.createElement(tn.Icon,{icon:"dd_ai",className:"scale-80"}),t.label,t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},QW="CommandItem",QH="CreateSpaceAgentItem",QG="HideSection",QK={[QW]:e=>ev.createElement(QV,{morseChildProps:e}),[QH]:e=>ev.createElement(Qq,{morseChildProps:e})},QY={[QG]:()=>ev.createElement(ev.Fragment,null)},QQ=function(e){let{spaceId:t,onExit:a}=e,n=(0,e$.useDispatch)(),{data:l}=(0,eB.a)(ZX,{variables:{spaceID:t}}),r=pW({role:l?.membership?.role,action:"create_space_agent"});return ev.createElement("div",{className:"w-full max-w-2xl rounded-lg rounded-b-none border border-b-0 border-appcolor-300 bg-applight-0 px-4 py-5 dark:bg-appdark-0/60"},ev.createElement("div",{className:"flex flex-col items-center text-center"},ev.createElement(lT.H7,{className:"mb-8 text-appcolor-500"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.create_your_first_agent",defaultMessage:"Create your first agent!"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.build_an_agent_and_personalize",defaultMessage:"Build and train your virtual workforce and team: Craft personas, enrich with knowledge, build custom AI commands, select tools like web browsing, and more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}})),r&&ev.createElement("button",{className:"group mt-8 flex items-center gap-3 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm font-semibold transition duration-150 ease-in-out hover:border-appcolor-400",onClick:()=>{a(),n(TN.actions.toggleCreateSpaceAgentDialog({spaceId:t}))}},ev.createElement(tn.Icon,{icon:"ai_add",className:"text-appcolor-400 transition duration-150 ease-in-out group-hover:text-appcolor-800"}),ev.createElement(eY.Z,{id:"agent.create_agent",defaultMessage:"Create agent"}))))},QJ=function(e){let{isReadyForFocus:t,menuItems:a,onCommandActivated:n,onExit:l,spaceId:r}=e,o=ev.useRef(null),i=T_((0,eI.useTheme)()),s=function(e){let{onExit:t,onSelectCommand:a,spaceId:n}=e,l=(0,e$.useDispatch)();return ev.useCallback(e=>{switch(e.itemType){case QB:a(e.data);break;case Qz:null!=n&&l(TN.actions.toggleCreateSpaceAgentDialog({spaceId:n})),t()}},[l,t,a,n])}({onExit:l,onSelectCommand:e=>{n(e)},spaceId:r}),d=ev.useRef(null);return ev.useEffect(()=>{t&&d.current?.focus()},[t]),ev.createElement("div",{className:"w-full overflow-clip rounded-xl border border-solid border-appcolor-300",onMouseDown:e=>{e.preventDefault()},ref:d,onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l()}},tabIndex:0,style:i},ev.createElement("div",{className:"max-h-80 overflow-y-auto py-2"},ev.createElement(tT,{ref:o,term:"",data:a,renderMap:QK,sectionRenderMap:QY,search:(e,t)=>t,onActivate:s,renderLoading:ev.createElement("div",{className:"flex items-center justify-center py-20"},ev.createElement(eI.Spinner,{size:20})),renderEmptyState:ev.createElement(QQ,{spaceId:r,onExit:l})})),ev.createElement("div",{className:"flex h-14 w-full items-center justify-between border-t border-appcolor-300 bg-appcolor-100/60 px-4"},ev.createElement("div",{className:"flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-appcolor-400 px-3 text-sm text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{l()}},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"ESC")),ev.createElement("div",{className:"group flex cursor-pointer items-center",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/22256943362323--Custom-AI-Agents","_blank","noopener,noreferrer")}},ev.createElement("span",{className:"mr-0.5 text-sm text-appcolor-500 group-hover:text-appcolor-800"},ev.createElement(eY.Z,{id:"general.ai_dialog_learn_more",defaultMessage:"Learn more"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 group-hover:fill-appcolor-800",icon:"dd_help"}))))},QX=function(e){let{command:t,inputText:a,insertNodeId:n,isReadyForFocus:l,onBackButtonClick:r,onCommandActivated:o,onInsertFragment:i,onReplaceText:s,onExit:d,projectId:c,spaceId:m}=e,u=function(e){let{spaceId:t}=e,a=(0,eK.Z)(),{data:n,loading:l}=(0,eB.a)(WT,null!=t?{variables:{filterby:{spaceId:t}}}:{skip:!0}),r=ev.useMemo(()=>l?{type:"section",label:"default",render:QG,items:[]}:{type:"section",label:"default",render:QG,items:[{itemType:Qz,label:a.formatMessage({id:"general.create_agent",defaultMessage:"Create Agent"}),values:[],data:{},render:QH}]},[a,l]),o=ev.useMemo(()=>{if(l||null==n||0===n.spaceAgents.totalCount)return[];let e=n.spaceAgents.edges,t=[];for(let a of e){let e=hR.Sx.safeParse(a.node.data);e.success&&t.push({id:a.node.id,name:a.node.name,data:e.data})}return t.map(e=>({type:"section",label:e.name,items:e.data.commands.map(t=>({itemType:QB,label:t.name,values:[e.name,t.name],data:{agentId:e.id,commandId:t.id,type:"custom"},render:QW}))}))},[n,l]);return ev.useMemo(()=>0===o.length?[]:[...o,r],[r,o])}({spaceId:m}),p=T_((0,eI.useTheme)()),g=0===a.trim().length;return null==t?ev.createElement("div",{style:p,className:"w-full rounded-xl bg-applight-0 p-4 dark:bg-appdark-0/60"},ev.createElement(QJ,{menuItems:u,isReadyForFocus:l,onCommandActivated:o,onExit:d,spaceId:m})):"custom"===t.type?ev.createElement("div",{style:p,className:"w-full rounded-xl bg-applight-0 p-4 dark:bg-appdark-0/60"},ev.createElement(QL,{command:t,inputText:a,insertNodeId:n,projectId:c,onExit:d,onReplaceText:s,onInsertFragment:i,onBackButtonClick:r,shouldInsertPromptIntoNode:g,updatePopperPosition:()=>{}})):null},Q0=eL.default.div.withConfig({displayName:"AiAgentBody__Container",componentId:"sc-23e68131-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + + backdrop-filter: blur(7px); + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,Q1=function(e){let{selectedIds:t,projectId:a,rootNodeId:n,spaceId:l,isReadyForFocus:r,onExit:o,clearSelection:i}=e,[s,d]=ev.useState(null),c=(0,e$.useDispatch)(),m=CP()(t),u=ev.useMemo(()=>{let e=c(Vj(t)),a=(0,lo.taskastToMdast)(e);return(0,lo.mdastToMarkdownText)(a)},[c,t]);return null==m?null:ev.createElement("div",{onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(Q0,{className:"w-160 overflow-clip rounded-xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement(QX,{command:s,inputText:u,insertNodeId:m,isReadyForFocus:r,onBackButtonClick:()=>{d(null)},onCommandActivated:e=>{d({...e})},onInsertFragment:e=>{m===n?c(Da({id:m,position:"beforeend"},e)):c(Da({id:m,position:"afterend"},e)),i()},onReplaceText:e=>{m!==n&&(i(),c(Da({id:m,position:"afterend"},e)),c(QF(t)))},onExit:o,projectId:a,spaceId:l})))},Q2=eL.default.div.withConfig({displayName:"AiAgentButton__TooltipReference",componentId:"sc-c22b47f5-0"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,Q5=ev.forwardRef(function(e,t){let[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"relative flex h-7 items-center justify-center rounded-lg px-2 hover:bg-appcolor-200",...e,ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},ev.createElement("div",{className:"flex animate-color-rainbow items-center gap-2 text-sm"},ev.createElement(tn.Icon,{className:"flex items-start",icon:"dd_ai"}),ev.createElement(eY.Z,{id:"general.ai_agent",defaultMessage:"AI Agent"})),ev.createElement(Q2,d)),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.ai_agent",defaultMessage:"AI Agent"})))}),Q3=(0,e$.connect)(function(e){return{currentUser:t7(e),projectId:dP(e),rootNodeId:iR(e),spaceId:dU(e)}})(function(e){let{selectedIds:t,currentUser:a,projectId:n,rootNodeId:l,clearSelection:r,spaceId:o}=e,[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=ev.useRef(null),c=ev.useRef(null),m=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:i,placement:"top"}),u=(0,eI.useMenuButton)({dispatch:s,ref:d,state:i}),p=(0,e$.useDispatch)(),g=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),f=u.props.onClick,h=ev.useCallback(e=>{null==a?p(rE()):f(e)},[a,p,f]);if(null==n||null==o)return null;let y=null!=m.initialFocus;return ev.createElement(ev.Fragment,null,ev.createElement(Q5,{...u.props,onClick:h,onMouseDown:g}),i.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:s,modal:!0,onBackdropMouseDown:g},ev.createElement(Q1,{selectedIds:t,projectId:n,spaceId:o,rootNodeId:l,isReadyForFocus:y,onExit:()=>{s?.({type:"Collapse"})},clearSelection:r})))}),Q4={generate_action_items:(0,te.Em)({id:"general.generate_action_items",defaultMessage:"Turn into Action Items"}),prioritize:(0,te.Em)({id:"general.prioritize",defaultMessage:"Prioritize"}),summarize:(0,te.Em)({id:"general.summarize",defaultMessage:"Summarize"}),brainstorm:(0,te.Em)({id:"general.brainstorm",defaultMessage:"Brainstorm"}),continue_writing:(0,te.Em)({id:"general.continue_writing",defaultMessage:"Continue Writing"}),rewrite:(0,te.Em)({id:"general.rewrite",defaultMessage:"Rewrite"}),outline:(0,te.Em)({id:"general.outline",defaultMessage:"Outline"}),research:(0,te.Em)({id:"general.research",defaultMessage:"Research"}),fix_spelling_grammar:(0,te.Em)({id:"general.fix_spelling_grammar",defaultMessage:"Fix Spelling and Grammar"}),seo:(0,te.Em)({id:"general.seo",defaultMessage:"SEO"})},Q6=[{type:"summarize"},{type:"research",agentBadge:!0},{type:"fix_spelling_grammar"},{type:"generate_action_items"},{type:"seo",agentBadge:!0},{type:"prioritize"},{type:"rewrite"},{type:"outline"},{type:"brainstorm"},{type:"continue_writing"}],Q8=function(e){let{morseChildProps:t}=e,a=ev.useRef(null),{command:n}=t.data;return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-2 mb-[1px] flex h-7 items-center rounded-md px-2 py-[1px] text-sm text-appcolor-500 hover:bg-appcolor-200 hover:text-appcolor-800",t.focused&&"bg-appcolor-200 text-appcolor-800")},ev.createElement("span",{className:"pl-2.5"},t.label),n.agentBadge&&ev.createElement("span",{className:"ml-1.5 rounded-xl border border-appcolor-400 bg-appcolor-0 px-2 py-0.5 text-2xs font-medium uppercase text-textcolor-600"},ev.createElement(eY.Z,{id:"general.agent",defaultMessage:"AI Agent"})),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},Q7={CommandItem:e=>ev.createElement(Q8,{morseChildProps:e})},Q9={CommandSection:e=>ev.createElement(ev.Fragment,null)},Je=function(e){var t;let{isReadyForFocus:a,menuItems:n,onCommandActivated:l,onExit:r}=e,o=ev.useRef(null),i=(t=e=>{l(e)},ev.useCallback(e=>{t(e.data.command)},[t])),s=ev.useRef(null);return ev.useEffect(()=>{a&&s.current?.focus()},[a]),ev.createElement("div",{className:"w-full overflow-clip rounded-xl border border-solid border-appcolor-300",onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r()}},ref:s,tabIndex:0},ev.createElement("div",{className:"max-h-80 py-2"},ev.createElement(tT,{ref:o,term:"",data:n,search:(e,t)=>t,renderMap:Q7,onActivate:i,sectionRenderMap:Q9})),ev.createElement("div",{className:"flex h-14 w-full items-center justify-between border-t border-appcolor-300 bg-appcolor-100/60 px-4"},ev.createElement("div",{className:"flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-appcolor-400 px-3 text-sm text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{r()}},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"ESC")),ev.createElement("div",{className:"group flex cursor-pointer items-center",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/12067565458067--Taskade-AI","_blank","noopener,noreferrer")}},ev.createElement("span",{className:"mr-0.5 text-sm text-appcolor-500 group-hover:text-appcolor-800"},ev.createElement(eY.Z,{id:"general.ai_dialog_learn_more",defaultMessage:"Learn more"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 group-hover:fill-appcolor-800",icon:"dd_help"}))))},Jt=function(e){let{inputText:t,insertNodeId:a,projectId:n,command:l,isReadyForFocus:r,onExit:o,onBackButtonClick:i,onReplaceText:s,onInsertFragment:d}=e,c=(0,e$.useDispatch)(),m=(0,eL.useTheme)(),u=(0,eF.k6)(),p=ev.useRef(null),[g,f]=ev.useState(!1),h=ev.useMemo(()=>(function(e,t,a){let{projectId:n,nodeId:l}=a;switch(t.type){case"summarize":return{projectId:n,nodeId:l,data:{type:"summarize",content:e}};case"generate_action_items":return{projectId:n,nodeId:l,data:{type:"generate_action_items",content:e}};case"prioritize":return{projectId:n,nodeId:l,data:{type:"prioritize",content:e}};case"continue_writing":return{projectId:n,nodeId:l,data:{type:"continue_writing",content:e}};case"brainstorm":return{projectId:n,nodeId:l,data:{type:"brainstorm",topic:e}};case"rewrite":return{projectId:n,nodeId:l,data:{type:"rewrite",content:e}};case"outline":return{projectId:n,nodeId:l,data:{type:"outline",topic:e}};case"fix_spelling_grammar":return{projectId:n,nodeId:l,data:{type:"fix_spelling_grammar",content:e}};case"research":return{projectId:n,nodeId:l,data:{type:"research",topic:e}};case"seo":return{projectId:n,nodeId:l,data:{type:"seo",topic:e}};default:throw new ei.HttpError({code:"NOT_IMPLEMENTED"})}})(t,l,{projectId:n,nodeId:a}),[l,a,t,n]),[y,{loading:b,error:v}]=$N(ev.useCallback(e=>{let t=Tn.safeParse(e);t.success&&x(e=>`${e}${t.data.text}`)},[]));ev.useEffect(()=>{null!=v&&uT(v,uI)},[v]),D$({error:v,onError:o});let k=ev.useCallback(()=>{x(""),y("/web-api/ai",{method:"POST",credentials:"same-origin",body:JSON.stringify(h),headers:{"Content-Type":"application/json"}})},[h,y]);ev.useEffect(()=>{k()},[k]);let[E,x]=ev.useState(null),_=ev.useCallback(e=>{if(null!=v){402===(0,ei.getStatusCodeFromError)(v)&&("ACTIVATION_REQUIRED"===(0,ei.getCodeFromError)(v)?u.push("/settings/plans"):c(d4())),o();return}if(null!=E){if("insert"===e){let{markdownText:e}=(0,lo.plainTextToMarkdownText)(E),t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});if((0,lr.isFragmentEmpty)(t))return;d(t)}else{let{markdownText:e}=(0,lo.plainTextToMarkdownText)(E),t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0});if((0,lr.isFragmentEmpty)(t))return;s(t)}o()}},[c,v,u,o,d,s,E]),w=()=>{k()};ev.useEffect(()=>{let e=p.current;null!=e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[E]);let N=()=>{null!=E&&(navigator.clipboard.writeText(E),f(!0),setTimeout(()=>{f(!1)},1e3))};return ev.useEffect(()=>{r&&p?.current!=null&&p?.current?.focus()},[r]),ev.createElement("div",{className:"w-full rounded-xl border border-solid border-appcolor-300",onKeyDownCapture:e=>{if((0,eV.ZP)("shift+enter")(e)){if(null==E||b)return;e.preventDefault(),_("replace");return}switch(e.key){case eI.KeyboardKeys.Enter:if(null==E||b)return;e.preventDefault(),_("insert");break;case"r":if(null==E||b)return;w(),e.preventDefault();break;case"c":if(null==E||b)return;N(),e.preventDefault();break;case eI.KeyboardKeys.Escape:o();break;case"b":i(),e.preventDefault()}}},ev.createElement("div",{className:"flex max-h-80 min-h-60 w-full overflow-y-auto px-5 py-4 text-sm leading-relaxed",ref:p,tabIndex:0},null!=v?ev.createElement(ev.Fragment,null,"CONTEXT_LENGTH_EXCEEDED"===(0,ei.getCodeFromError)(v)?ev.createElement("div",{className:"flex w-full flex-col justify-start gap-4 text-sm"},ev.createElement("span",{className:"flex"},ev.createElement(eY.Z,{id:"general.model_limit",defaultMessage:"Oops! Your content exceeds our processing limit for Taskade AI. If you're frequently running into this limit and have more significant tasks, consider our Enterprise Plan, which offers tailored solutions to meet your needs. "})),ev.createElement("span",{className:"inline"},ev.createElement(eY.Z,{id:"general.contact_enterprise_plan",defaultMessage:"\uD83D\uDD17 Contact Sales for the Enterprise Plan.",values:{contact:e=>ev.createElement("a",{className:"text-primary transition duration-150 ease-in-out hover:opacity-80",href:"/request-demo",target:"_blank",rel:"noopener noreferrer"},e)}}))):ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},v.message)):null!=E&&ev.createElement("div",{className:"mb-10"},ev.createElement(DA,{value:E,shouldRemoveCodeFence:!0}))),ev.createElement("div",{className:"mr-5 h-14 w-full"},ev.createElement("div",{className:"flex h-full w-full items-center justify-between border-t border-appcolor-300 px-4"},b?ev.createElement("div",{className:"ml-auto"},ev.createElement(eI.Spinner,{color:m.primaryColor})):ev.createElement(ev.Fragment,null,null==v&&null!=E&&ev.createElement("div",{className:"flex w-full gap-2 text-sm"},ev.createElement("div",{className:"mr-auto flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-appcolor-400 px-3 text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{i()}},ev.createElement(eY.Z,{id:"general.back",defaultMessage:"Back"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"B")),ev.createElement("div",{onClick:N,className:"flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-appcolor-400 px-3 text-textcolor-900 hover:bg-appcolor-200"},g?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(ev.Fragment,null,ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"C"))),"translate"!==l.type&&ev.createElement("div",{className:"flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-appcolor-400 px-3 text-textcolor-900 hover:bg-appcolor-200",onClick:w},ev.createElement(eY.Z,{id:"chat.retry",defaultMessage:"Retry"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"R")),ev.createElement("div",{className:"flex h-8 cursor-pointer items-center gap-2 rounded-lg bg-primary px-3 text-white hover:bg-primary/80",onClick:()=>{_("replace")}},ev.createElement(eY.Z,{id:"general.replace",defaultMessage:"Replace"}),ev.createElement("span",{className:"text-xs text-applight-300"},"⇧ + ↵")),ev.createElement("div",{className:"flex h-8 cursor-pointer items-center gap-2 rounded-lg bg-primary px-3 text-white hover:bg-primary/80",onClick:()=>{_("insert")}},ev.createElement(eY.Z,{id:"general.insert",defaultMessage:"Insert"}),ev.createElement("span",{className:"text-xs text-applight-300"},"↵"))),null!=v&&ev.createElement(ev.Fragment,null,ev.createElement("div",null,ev.createElement("div",{className:"flex cursor-pointer gap-2 rounded-lg border border-appcolor-400 px-4 py-1 text-textcolor-900 hover:bg-appcolor-200",onClick:()=>{i()}},ev.createElement(eY.Z,{id:"general.back",defaultMessage:"Back"}),ev.createElement("span",{className:"text-xs text-appcolor-500"},"B"))),ev.createElement("div",{className:"flex"},402===(0,ei.getStatusCodeFromError)(v)&&ev.createElement("div",{className:"flex"},ev.createElement("div",{className:" flex cursor-pointer rounded-lg bg-upgrade px-4 py-1 text-[#0c0500] hover:bg-upgrade/80",onClick:()=>{_("insert")}},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1 mt-0.5"}),"ACTIVATION_REQUIRED"===(0,ei.getCodeFromError)(v)?ev.createElement(eY.Z,{id:"general.activate",defaultMessage:"Activate"}):ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))))))))},Ja=function(e){let{command:t,menuItems:a,insertNodeId:n,inputText:l,projectId:r,isReadyForFocus:o,onReplaceText:i,onInsertFragment:s,onBackButtonClick:d,onCommandActivated:c,onExit:m}=e,u=(0,eL.useTheme)(),p=ev.useMemo(()=>gW()(u.primaryColor??eI.Colors.BRAND).rgb().join(" "),[u.primaryColor]);return ev.createElement("div",{style:{"--color-primary":p},className:"w-full rounded-xl bg-applight-0 p-4 dark:bg-appdark-0/60"},t?.type==null?ev.createElement(Je,{menuItems:a,isReadyForFocus:o,onCommandActivated:c,onExit:m}):ev.createElement(Jt,{insertNodeId:n,inputText:l,projectId:r,command:t,isReadyForFocus:o,onExit:m,onReplaceText:i,onInsertFragment:s,onBackButtonClick:()=>{d()}}))},Jn=eL.default.div.withConfig({displayName:"AiAssistantBody__Container",componentId:"sc-cad6201e-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + + backdrop-filter: blur(7px); + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,Jl=function(e){let{selectedIds:t,projectId:a,rootNodeId:n,isReadyForFocus:l,onExit:r,clearSelection:o}=e,[i,s]=ev.useState(null),d=(0,e$.useDispatch)(),c=function(){let e=(0,eK.Z)();return[{type:"section",label:"ai",items:Q6.map(t=>{let a=Q4[t.type],n=e.formatMessage(a);return{label:n,values:[t.type,n],data:{command:t},render:DN}}),render:DC}]}(),m=CP()(t),u=ev.useMemo(()=>{let e=d(Vj(t)),a=(0,lo.taskastToMdast)(e);return(0,lo.mdastToMarkdownText)(a)},[d,t]);return null==m?null:ev.createElement("div",{onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(Jn,{className:"w-160 overflow-clip rounded-xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement(Ja,{command:i,menuItems:c,insertNodeId:m,inputText:u,projectId:a,isReadyForFocus:l,onReplaceText:e=>{m!==n&&(o(),d(Da({id:m,position:"afterend"},e)),d(QF(t)))},onInsertFragment:e=>{m===n?d(Da({id:m,position:"beforeend"},e)):d(Da({id:m,position:"afterend"},e)),o()},onBackButtonClick:()=>{s(null)},onCommandActivated:e=>{s({...e})},onExit:r})))},Jr=eL.default.div.withConfig({displayName:"AiAssistantButton__TooltipReference",componentId:"sc-1766c077-0"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,Jo=ev.forwardRef(function(e,t){let[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"relative flex h-7 items-center justify-center rounded-lg px-2 hover:bg-appcolor-200",...e,ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},ev.createElement("div",{className:"flex animate-color-rainbow items-center gap-2 text-sm"},ev.createElement(tn.Icon,{className:"flex items-start",icon:"dd_ai_spark"}),ev.createElement(eY.Z,{id:"general.ai_assistant",defaultMessage:"AI Assistant"})),ev.createElement(Jr,d)),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.ai_assistant",defaultMessage:"AI Assistant"})))}),Ji=(0,e$.connect)(function(e){return{currentUser:t7(e),projectId:dP(e),rootNodeId:iR(e)}})(function(e){let{selectedIds:t,currentUser:a,projectId:n,rootNodeId:l,clearSelection:r}=e,[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=ev.useRef(null),d=ev.useRef(null),c=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:o,placement:"top"}),m=(0,eI.useMenuButton)({dispatch:i,ref:s,state:o}),u=(0,e$.useDispatch)(),p=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),g=m.props.onClick,f=ev.useCallback(e=>{null==a?u(rE()):g(e)},[a,u,g]);if(null==n)return null;let h=null!=c.initialFocus;return ev.createElement(ev.Fragment,null,ev.createElement(Jo,{...m.props,onClick:f,onMouseDown:p}),o.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:i,modal:!0,onBackdropMouseDown:p},ev.createElement(Jl,{selectedIds:t,projectId:n,rootNodeId:l,isReadyForFocus:h,onExit:()=>{i?.({type:"Collapse"})},clearSelection:r})))}),Js=(0,eL.default)(Cg).withConfig({displayName:"styled__StyledAssignButton",componentId:"sc-b825525f-0"})` + position: relative; + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + color: ${e=>e.theme.appColors.hex(10)}; +`,Jd=eL.default.div.withConfig({displayName:"styled__TooltipReference",componentId:"sc-b825525f-1"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,Jc=eL.default.div.withConfig({displayName:"styled__BodyWrapper",componentId:"sc-b825525f-2"})` + min-width: var(--menu-min-width); + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: var(--menu-border-radius); + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + margin-bottom: 20px; + overflow: hidden; +`,Jm=ev.forwardRef(function(e,t){let[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement(Js,{...e,ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},ev.createElement(tn.Icon,{icon:"dd_assign"}),ev.createElement(Jd,d)),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.assign_to",defaultMessage:"Assign to"})))}),Ju=function(){let e=(0,aK.useRovingTabindexState)(),t=(0,aK.useRovingTabindexDispatch)();return(0,ev.useEffect)(()=>{0!==e.stops.length&&requestAnimationFrame(()=>{t({type:aK.ActionTypes.First})})},[e.stops.length,t]),null},Jp=function(e){let{user:t,isChecked:a,onClick:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({onClick:n,stopRef:l,name:"user",value:t.id});return ev.createElement(Fv,r.props,ev.createElement(ao,{avatars_v2:t.avatars_v2,handle:t.handle,userID:parseInt(t.id,10),size:20}),ev.createElement(Fy,null,t.handle),t.display_name&&ev.createElement(Fb,null,t.display_name),a&&ev.createElement(Fh,null))},Jg=(0,tB.P1)([iF,function(e,t){return t.nodeIds}],(e,t)=>{let a={};for(let n of t)for(let t of e?.[n]?.assignees?.attachments??[]){let e=t.assignee.id,n=a[e];null==n&&(n=[],a[e]=n),n.push(t)}return a}),Jf=(0,e$.connect)(function(e,t){return{assignmentsByUserId:Jg(e,t)}})(function(e){let{projectId:t,nodeIds:a,assignmentsByUserId:n}=e,{data:l,loading:r,error:o}=(0,eB.a)(bA,null!=t?{variables:{document_id:t,projectMembersLimit:30}}:{skip:!0}),i=ev.useMemo(()=>{let e={allChoices:[],currentUserId:null,spaceId:null,isPaywallAllowed:d6(),isSpaceTypePaid:null};if(r)return e;let t=l?.me,a=l?.document;if(null==a)return e;let n=new Map;if(null!=a.members.edges)for(let e of a.members.edges){if(null==e.node)continue;let{user:t}=e.node;n.set(t.id,t)}if(null!=a.space){for(let e of a.space.memberships){let{user:t}=e;n.set(t.id,t)}e.spaceId=a.space.id}let o=[];if(null!=t){e.currentUserId=t.id;let a=n.get(t.id);null!=a&&(o.push(a),n.delete(t.id))}for(let e of n.values())o.push(e);e.allChoices=o;let i=a.space_type??a.space?.type??null;return e.isSpaceTypePaid=hA(i),e},[l,r]),s=(0,e$.useDispatch)(),d=Fp(t),c=i.isPaywallAllowed&&!i.isSpaceTypePaid,m=(e,n)=>{if(null!=t){if(c&&n.id!==i.currentUserId){null!=i.spaceId&&s(d4(i.spaceId));return}d(a,n.id)}};return i.isPaywallAllowed&&!1===i.isSpaceTypePaid&&a.length?ev.createElement("div",{className:"w-64 rounded-lg bg-appcolor-0 shadow-md"},ev.createElement("div",{className:"overflow-hidden"},ev.createElement("img",{src:"/images/tooltips/multi-select-assign-paywall.png"})),ev.createElement("div",{className:"flex flex-col p-6"},ev.createElement("div",{className:"mb-3 flex items-center justify-start"},ev.createElement("p",{className:"mr-2 text-sm font-medium"},ev.createElement(eY.Z,{id:"general.multi_assign",defaultMessage:"Multi-Assign"})),ev.createElement(e1.UpgradeBadge,null)),ev.createElement("div",{className:"mb-6 text-sm"},ev.createElement(eY.Z,{id:"general.multi_select_assign_paywall",defaultMessage:"Distribute tasks among team members and delegate responsibilities with just a click."})),ev.createElement("div",null,ev.createElement(EI,{className:"w-28"})))):ev.createElement(eI.Menu,{initialFocus:"first",loop:!0,className:"py-2"},ev.createElement(Fg,null,ev.createElement(eY.Z,{id:"general.assign_to",defaultMessage:"Assign to"})),i.allChoices.map(e=>ev.createElement(Jp,{key:e.id,user:e,isChecked:n[e.id]?.length===a.length,onClick:t=>m(t,e)})),i.allChoices.length>0&&ev.createElement(Ju,null),r&&ev.createElement(eI.Spinner,{size:36}),null!=o&&ev.createElement(Ff,null,"An error occurred"))}),Jh=(0,tB.P1)([iL,function(e,t){return t.selectedIds}],(e,t)=>{let a=[],n=[...t];for(;n.length>0;){let t=n.shift();if(null==t)continue;let l=e.findNodeByID(t);if(null==l)continue;a.push(t);let r=l.children;r.isEmpty()||n.unshift(...r)}return a}),Jy=(0,e$.connect)(function(e,t){return{projectId:dP(e),completeSelectedIds:Jh(e,t)}})(function(e){let{projectId:t,completeSelectedIds:a}=e,n=ev.useContext(z2),l=ev.useContext(eI.PopupDispatchContext),r=ev.useCallback(e=>{switch(e.type){case"Activate":break;case"Dismiss":l?.({type:"Collapse"})}},[l]),o=ev.useCallback(()=>{l?.({type:"Collapse"}),n?.clearSelection()},[n,l]);return ev.createElement(Jc,{onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(eI.MenuGroupContext.Provider,{value:r},ev.createElement(Jf,{nodeIds:a,projectId:t,onExit:o})))}),Jb=(0,e$.connect)(function(e){return{currentUser:t7(e)}})(function(e){let{selectedIds:t,currentUser:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:n,placement:"top"}),s=(0,eI.useMenuButton)({dispatch:l,ref:r,state:n}),d=(0,e$.useDispatch)(),c=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),m=s.props.onClick,u=ev.useCallback(e=>{null==a?d(rE()):m(e)},[a,d,m]);return ev.createElement(ev.Fragment,null,ev.createElement(Jm,{...s.props,onClick:u,onMouseDown:c}),n.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:l,modal:!0,onBackdropMouseDown:c},ev.createElement(Jy,{initialFocus:i.initialFocus,selectedIds:t})))});function Jv(e,t,a,n){let l=e.findNextNodeId(a,{skipDescendants:n});if(!t.hideCompleted)return l;for(;null!=l&&!t.isNodeIDVisible(l);)l=e.findNextNodeId(l);return l}function Jk(e,t,a){let n=e.findPreviousNodeID(a);if(!t.hideCompleted)return n;for(;null!=n&&!(n===e.rootID||t.isNodeIDVisible(n));)n=e.findPreviousNodeID(n);return n}function JE(e,t){return function(a,n){let{contents:l,documentPreferences:r}=n(),o=t?.shouldFocusNode??!0,i=[],s=Array.from(e);for(;s.length>0;){let e=s.shift();i.push(e);let t=l.findNodeByID(e);if(null!=t){let e=t.children;e.isEmpty()||s.unshift(...e)}}if(a(mP(...i)),!o)return;let d=CP()(e);if(null==d)return;let c=Jv(l,r,d,!0);if(null!=c){a(mI(c,null));return}let m=CT()(e);if(null==m)return;let u=Jk(l,r,m);null!=u&&a(mI(u,null))}}let Jx=(0,eL.default)(Vv).withConfig({displayName:"CheckAllButton__StyledButton",componentId:"sc-d8224fef-0"})` + margin-right: 5px; + width: 30px; + height: 30px; + & svg { + margin-top: -4px; + } +`,J_=function(e){let{className:t,selectedIds:a,isHideCompleted:n,clearSelection:l}=e,r=null==a,o=(0,e$.useDispatch)(),{arrowProps:i,popperProps:s,referenceProps:d,visible:c,setVisible:m}=(0,eI.useTooltip)({placement:"bottom"}),u=(0,ev.useCallback)(()=>{r||m(!0)},[r,m]),p=(0,ev.useCallback)(()=>{m(!1)},[m]),g=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r||(n?(l(),o(JE(a))):o(JE(a,{shouldFocusNode:!1})),m(!1))},[l,r,o,n,a,m]);return ev.createElement(ev.Fragment,null,ev.createElement(Jx,{className:t,...d,onMouseEnter:u,onMouseLeave:p,onMouseDown:g},ev.createElement(tn.Icon,{icon:"dd_checkall"})),c&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.check_all",defaultMessage:"Check all"}),ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"Enter")))))},Jw=(0,eL.default)(Cg).withConfig({displayName:"styled__StyledDueDateButton",componentId:"sc-822af41a-0"})` + position: relative; + width: 30px; + height: 30px; + color: ${e=>e.theme.appColors.hex(10)}; + display: flex; + justify-content: center; + align-items: center; +`,JN=eL.default.div.withConfig({displayName:"styled__TooltipReference",componentId:"sc-822af41a-1"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,JC=eL.default.div.withConfig({displayName:"styled__BodyWrapper",componentId:"sc-822af41a-2"})` + width: ${eI.UiSpacing.getPx(64)}; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + margin-bottom: 20px; + padding: var(--menu-padding); +`;(0,eL.default)(e1.Notice).withConfig({displayName:"styled__StyledNotice",componentId:"sc-822af41a-3"})` + max-width: 280px; + margin: 20px; + cursor: pointer; + ${e1.UiTypography.sm}; +`,eL.default.span.withConfig({displayName:"styled__StyledPaywallUpgradeLink",componentId:"sc-822af41a-4"})` + color: ${eI.ThemeColors.upgrade}; + &:hover { + text-decoration: underline; + } +`;let JM=ev.forwardRef(function(e,t){let[a,n]=(0,ev.useState)(!1),l=(0,ev.useRef)(null),r=(0,ev.useRef)(null),o=(0,ev.useRef)(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement(Jw,{...e,ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},ev.createElement(tn.Icon,{icon:"dd_date"}),ev.createElement(JN,d)),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})))}),JS=(0,la.ZP)` + query DocumentSpaceTypeQuery($id: ID!) { + document(id: $id) { + id + space { + id + } + space_type + } + } +`,JI=(0,tB.P1)([iL,function(e,t){return t.selectedIds}],(e,t)=>{let a=[],n=[...t];for(;n.length>0;){let t=n.shift();if(null==t)continue;let l=e.findNodeByID(t);if(null==l)continue;a.push(t);let r=l.children;r.isEmpty()||n.unshift(...r)}return a}),JD=(0,e$.connect)(function(e,t){return{completeSelectedIds:JI(e,t)}})(function(e){let{completeSelectedIds:t,onExit:a,projectId:n}=e;return ev.createElement(Rk,{projectId:n,nodeIds:t,onExit:a})}),JT=function(e){let{selectedIds:t,projectId:a,onExit:n}=e,{data:l}=(0,eB.a)(JS,{variables:{id:a}});return!hA(l?.document?.space_type??null)&&d6()?ev.createElement(JC,{className:"overflow-hidden !p-0"},ev.createElement("div",null,ev.createElement("img",{src:"/images/tooltips/multi-select-due-date-paywall.png"})),ev.createElement("div",{className:"flex flex-col p-6"},ev.createElement("div",{className:"mb-3 flex items-center justify-start"},ev.createElement("p",{className:"mr-2 text-sm font-medium"},ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})),ev.createElement(e1.UpgradeBadge,null)),ev.createElement("div",{className:"mb-6 text-sm font-normal"},ev.createElement(eY.Z,{id:"general.upgrade_to_bulk_assign_due_dates",defaultMessage:" Adding a due date to multiple tasks saves time and ensures timely completion."})),ev.createElement("div",null,ev.createElement(EI,{className:"w-28"})))):ev.createElement(JC,null,ev.createElement(JD,{projectId:a,selectedIds:t,onExit:n}))},J$=(0,e$.connect)(function(e){return{currentUser:t7(e),projectId:dP(e)}})(function(e){let{selectedIds:t,currentUser:a,projectId:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"top"}),d=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),c=(0,e$.useDispatch)(),m=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),u=d.props.onClick,p=ev.useCallback(e=>{null==a?c(rE()):u(e)},[a,c,u]),g=ev.useCallback(()=>{r?.({type:"Collapse"})},[r]);return null==n?null:ev.createElement(ev.Fragment,null,ev.createElement(JM,{...d.props,onClick:p,onMouseDown:m}),l.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:r,modal:!0,onBackdropMouseDown:m},ev.createElement(eI.Menu,{initialFocus:s.initialFocus,loop:!0,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(JT,{projectId:n,selectedIds:t,onExit:g}))))}),JP=(0,tB.P1)([iL,i5,function(e,t){return t.selectedItems}],(e,t,a)=>{if(null!=t||a.isEmpty())return null;{let t=a.toArray(),n=0;for(;t.length>0;){let a=t.shift();n+=1;let l=e.findNodeByID(a);if(null!=l){let e=l.children;e.isEmpty()||t.unshift(...e)}}return n}}),JF=(0,tB.P1)([i5,i3,i4],(e,t,a)=>iT(e,t,a,!0)),JA=(0,tB.P1)([function(e,t){return t.selectedIds},st,iL],(e,t,a)=>{if("string"==typeof e){if(null==t||t.nodeID!==e)return null;let n=li.FORMAT_TYPE_NODE,l=e,r=a.getIn(["nodes",l,"format",n])??li.FORMAT_CHECKBOX;return{formatId:l,scope:n,value:r}}if(!Array.isArray(e))return null;{let t=e[0];if(null==t)return null;if(t===a.rootID){let t=a.rootID,n=a.getIn(["nodes",t,"children"]);if(null==n||0===n.size)return null;e=n.toJS();let l=[t],r=l.length>1?li.FORMAT_TYPE_CHILDREN:li.FORMAT_TYPE_NODE,o=(r===li.FORMAT_TYPE_CHILDREN?[l[1]]:e)[0],i=a.getIn(["nodes",o,"format",r])??li.FORMAT_CHECKBOX;return{formatId:o,scope:r,value:i}}{let n=a.findAncestorsForNode(t);if(0===n.length)return null;let l=CP()(n);if(null==l)return null;for(let t of e){let[e]=a.validateAncestors([l,t]);if(!e)return null}let r=li.FORMAT_TYPE_NODE,o=e[0],i=a.getIn(["nodes",o,"format",r])??li.FORMAT_CHECKBOX;return{formatId:o,scope:r,value:i}}}}),JR=function(e){let{format:t,formatScope:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({stopRef:n,name:a,value:t});return ev.createElement("button",{...l.props,className:"flex w-56 flex-row items-center justify-start border-none bg-transparent p-[var(--menu-item-padding)] leading-5 hover:cursor-pointer hover:bg-appcolor-200 focus:outline-none",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(Vw,null,ev.createElement(tn.Icon,{icon:q7[t]})),ev.createElement("span",{className:"text-sm text-textcolor-900"},ev.createElement(eY.Z,q8[t])))},Jj=function(e){let{formatScope:t,initialFocus:a}=e;return ev.createElement(eI.Menu,{className:"left-16 flex flex-col rounded-xl border border-appcolor-300 bg-appcolor-0 py-3",initialFocus:a,loop:!0},"node"===t?li.NODE_FORMATS.map(e=>ev.createElement(JR,{key:e,format:e,formatScope:"node"})):"children"===t?li.CHILDREN_FORMATS.map(e=>ev.createElement(JR,{key:e,format:e,formatScope:"children"})):ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.no_node_selected",defaultMessage:"No node selected"})))},JO=eL.default.button.withConfig({displayName:"FormatMenu__StyledMenuButton",componentId:"sc-24244683-0"})` + margin-right: 10px; + padding: 0; + height: 34px; + width: 80px; + border: 0; + border-radius: 50px; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + opacity: ${e=>e.disabled?"0.2":"1"}; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + cursor: ${e=>e.disabled?"default":"pointer"}; + + &:hover { + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + :focus { + outline: none; + } +`,JU=(0,e$.connect)(function(e,t){return{formatState:JA(e,t)}})(function(e){let{formatState:t,selectedIds:a}=e,n=null==a,l=(0,e$.useDispatch)(),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1}),i=ev.useRef(null),s=ev.useRef(null),d=ev.useCallback(()=>{i.current?.focus()},[]);(0,eI.usePopupEvents)({state:r,onCollapse:d});let c=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:r,placement:"bottom"}),m=(0,eI.useMenuButton)({dispatch:o,ref:i,state:r}),u=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:n}=e.payload,r=li.FormatTypeZchema.safeParse(t);if(!r.success)return;let o=li.FormatNameZchema.safeParse(n);if(!o.success)return;let i=r.data,s=o.data;"string"==typeof a?l(mZ(a,i,s)):Array.isArray(a)&&l(mZ(a,i,s))}o({type:"Collapse"})},[l,a]),{arrowProps:p,popperProps:g,referenceProps:f,visible:h,setVisible:y}=(0,eI.useTooltip)({placement:"bottom"});ev.useEffect(()=>{r.expanded&&n&&o({type:"Collapse"})},[n,r.expanded]);let b=(0,ev.useCallback)(()=>{n||y(!0)},[n,y]),v=(0,ev.useCallback)(()=>{y(!1)},[y]),k=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),null!=n&&(r.expanded?o({type:"Collapse"}):(y(!1),o({type:"Expand"})))},[n,r.expanded,y]),E=(0,ev.useCallback)(e=>{e.preventDefault()},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...f,onMouseEnter:b,onMouseLeave:v},ev.createElement(JO,{type:"button",disabled:n,...m.props,onMouseDown:k,onClick:E},ev.createElement(Vx,null,null!=t&&ev.createElement(tn.Icon,{icon:q7[t.value]})),ev.createElement(V_,null,ev.createElement(tn.Icon,{icon:"caret_down"})))),r.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:u},ev.createElement(Jj,{formatScope:t?.scope,initialFocus:c.initialFocus}))),h&&ev.createElement(eI.Tooltip,{arrowProps:p,popperProps:g},n?ev.createElement(eY.Z,{id:"general.select_something",defaultMessage:"Select Something"}):ev.createElement(eY.Z,{id:"general.change_format",defaultMessage:"Change Format"})))});function JZ(e){let{selected:t,className:a,onMouseDown:n,children:l,tooltipMessage:r,disabled:o,suffix:i}=e,{arrowProps:s,popperProps:d,referenceProps:c,visible:m,setVisible:u}=(0,eI.useTooltip)({placement:"bottom"});return ev.createElement(ev.Fragment,null,ev.createElement(Vb,{selected:t,className:a,...c,onMouseEnter:()=>{o||u(!0)},onMouseLeave:()=>{o||u(!1)},onMouseDown:n,disabled:o},l),!o&&m&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(IN,null,r,i)))}JZ.defaultProps={selected:!1,suffix:"",disabled:!1},JZ.propTypes={selected:l7().bool,className:l7().string.isRequired,onMouseDown:l7().func.isRequired,children:l7().node.isRequired,disabled:l7().bool,tooltipMessage:l7().string.isRequired,suffix:l7().string};let JL=(0,eL.default)(JZ).withConfig({displayName:"IndentMenu__StyledToolbarBaseButton",componentId:"sc-c78b5aae-0"})` + margin-right: 5px; +`,JB=function(e){let{selectedIds:t}=e,a=null==t,n=(0,e$.useDispatch)(),l=(0,eK.Z)(),r=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),a||n(De(t))},[a,t,n]),o=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),a||n(Dt(t))},[a,t,n]);return ev.createElement(ev.Fragment,null,ev.createElement(JL,{onMouseDown:o,disabled:a,tooltipMessage:l.formatMessage({id:"general.unindent",defaultMessage:"Unindent"}),suffix:ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.Shift),ev.createElement(eI.Shortcut.Key,null,"Tab"))},ev.createElement(lT.sB,null)),ev.createElement(JL,{onMouseDown:r,disabled:a,tooltipMessage:l.formatMessage({id:"general.indent",defaultMessage:"Indent"}),suffix:ev.createElement(eI.Shortcut.Key,{alwaysDark:!0},"Tab")},ev.createElement(lT.KJ,null)))},Jz=eL.default.div.withConfig({displayName:"Toolbar__StyledContainer",componentId:"sc-24adb0f8-0"})` + display: none; + flex-direction: row; + align-items: center; + justify-content: center; + padding: 10px; + border-radius: 50px; + pointer-events: all; + + border: 4px solid ${e=>e.theme.appColors.hex(60)}; + background: ${e=>e.theme?.isNightMode?e.theme.appColors.hex(100):"#fff"}; + + @media (min-width: 768px) { + display: flex; + } + + body.taskade-embed && { + display: none; + } + + transform: ${e=>e.isDisabled?"translateY(80px)":"translateY(0)"}; + transition: transform 120ms ease-in-out; +`,JV=eL.default.div.withConfig({displayName:"Toolbar__StyledText",componentId:"sc-24adb0f8-1"})` + padding: 0 22px 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + font-weight: bold; +`,Jq=VX({toolbarMenuState:function(e,t){return e?.highlight===t?.highlight}}),JW=(0,e$.connect)(function(e,t){return{selectionCount:JP(e,t),toolbarMenuState:JF(e),isHideCompleted:dT(e)}},void 0,void 0,{areStatePropsEqual:Jq}),JH=(0,ek.qC)(Vm(),JW)(function(e){let{selectedItems:t,toolbarMenuState:a,selectionCount:n,clearSelection:l,isHideCompleted:r}=e,o=(0,ev.useMemo)(()=>t.isEmpty()?null:t.toArray(),[t]),i=null==o;return null==n||null==o?null:ev.createElement(Jz,{isDisabled:i},ev.createElement(JV,null,ev.createElement(eY.Z,{id:"general.selected_count",defaultMessage:"{selectionCount} items selected",values:{selectionCount:n}})),ev.createElement(JU,{selectedIds:o}),ev.createElement(JB,{selectedIds:o}),ev.createElement(J_,{selectedIds:o,isHideCompleted:r,clearSelection:l}),ev.createElement(J$,{selectedIds:o}),ev.createElement(Jb,{selectedIds:o}),ev.createElement(VT,{selectedIds:o,isHoverMenu:!1,selectedColor:a?.highlight??null}),ev.createElement("div",{className:"mx-2 flex h-6 w-px bg-appcolor-300"}),ev.createElement(Ji,{selectedIds:o,clearSelection:l}),ev.createElement(Q3,{selectedIds:o,clearSelection:l}))}),JG=(0,tB.P1)([function(e,t){return t.commandPrefix},function(e,t){return t.permitNonSpacePrefix??!1},i5,iR,i3],(e,t,a,n,l)=>{if(null==a||a===n||null==l||!l.isCollapsed)return null;let{endText:r,endKey:o,endOffset:i}=l;if(null==r||0===r.characters.size)return null;let s=r.text.slice(0,i),d=-1;e:for(let a=s.length-1;a>=0;a--)switch(s[a]){case"#":case" ":return null;case e:{let e=a-1,n=s[e];if(!t&&e>=0&&" "!==n)return null;d=a;break e}}return -1!==d?{commandPrefix:e,text:s.slice(d).slice(e.length),nodeID:a,selection:{anchorKey:o,anchorOffset:d,focusKey:o,focusOffset:i}}:null}),JK=eL.default.div.withConfig({displayName:"styled__PositionerElement",componentId:"sc-fa1491a8-0"})` + position: absolute; + top: 0; + left: 0; +`,JY=eL.default.div.withConfig({displayName:"styled__ReferenceElement",componentId:"sc-fa1491a8-1"})` + position: absolute; +`,JQ=(0,e$.connect)(function(e,t){return{commandMenuState:JG(e,t)}})(function(e){let{commandMenuState:t,children:a}=e,n=(0,e$.useDispatch)(),l=(0,ev.useRef)(null),[r,o]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),i=(0,ev.useRef)(null),s=(0,ev.useRef)(null),d=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:r,placement:"right-start"});(0,ev.useEffect)(()=>{o({type:null!=t?"Expand":"Collapse"})},[t,o]);let c=(0,ev.useMemo)(()=>{if(null==t)return;let e=window.getSelection();if(null==e||0===e.rangeCount)return;let a=e.getRangeAt(0);VQ&&(a=a.cloneRange()).setStart(a.startContainer,0);let n=a.getBoundingClientRect();if(null==n)return;let r=l.current,o=r?.getBoundingClientRect(),i=o?.top??0,s=o?.left??0;if("Range"===e.type){let e=Math.round(n.left+window.scrollX)-s,t=Math.round(n.bottom+window.scrollY)-i;return{top:`${t}px`,left:`${e}px`}}{let e=Math.round(n.left+n.width+window.scrollX)-s,t=Math.round(n.bottom+window.scrollY)-i;return{top:`${t}px`,left:`${e}px`}}},[t]),m=d.popper.instanceRef.current?.update;(0,ev.useEffect)(()=>{m?.()},[c,m]);let u=(0,ev.useMemo)(()=>null==t?null:{...t,replaceText:function(e){null!=t&&n(mU(t.nodeID,e,t.selection))}},[t,n]);return ev.createElement(ev.Fragment,null,ev.createElement(JK,{ref:l}),ev.createElement(JY,{ref:i,style:c}),r.expanded&&null!=u&&ev.createElement(eI.Popup,{...d.props,dispatch:o},a(u)))}),JJ=(0,la.ZP)` + query MeEmojiSkinPreferenceQuery { + me { + id + preferences { + emojiSkin + } + } + } +`,JX=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-3178f177-0"})` + width: 240px; + background-color: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + padding: 8px 0; + overflow: hidden; +`,J0=eL.default.div.withConfig({displayName:"styled__OptionWrapper",componentId:"sc-3178f177-1"})` + display: flex; + align-items: center; + padding: 4px 16px 4px 20px; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + + ${e=>e.$selected&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(70)}; + `} +`,J1=eL.default.span.withConfig({displayName:"styled__OptionLabel",componentId:"sc-3178f177-2"})` + margin-left: 12px; +`,J2=eL.default.span.withConfig({displayName:"styled__EmptyStateText",componentId:"sc-3178f177-3"})` + padding: 4px 16px 4px 20px; + color: ${e=>e.theme.textColors.hex(30)}; +`;function J5(e){return"native"in e}let J3=ev.forwardRef(function(e,t){let{text:a,replaceText:n}=e,l=(0,ev.useMemo)(()=>{if(a.length<2)return[];let e=go.bj.search(a);return null!=e?e.filter(J5).slice(0,20):[]},[a]),[r,o]=(0,ev.useState)(0),i=(0,ev.useCallback)(()=>{if(0===l.length)return;let e=l[r];n(`${e.native} `)},[r,l,n]),s=(0,ev.useCallback)(e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(e=>Math.max(e-1,0));break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(e=>Math.min(e+1,l.length-1));break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i()}},[i,l.length]);(0,ev.useImperativeHandle)(t,()=>({handleKeyDownCapture:s}));let{data:d}=(0,eB.a)(JJ),c=d?.me?.preferences?.emojiSkin??1,m=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i()},[i]);return(0,ev.useEffect)(()=>{o(0)},[a]),ev.createElement(JX,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},l.map((e,t)=>ev.createElement(J0,{key:e.id,$selected:t===r,onMouseEnter:()=>o(t),onClick:m},ev.createElement(go.dy,{emoji:e,size:18,skin:c}),ev.createElement(J1,null,":",e.id,":"))),0===l.length&&ev.createElement(J2,null,a.length-1>=2?ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}):ev.createElement(eY.Z,{id:"general.emoji_command_menu_text_empty",defaultMessage:"Search to insert an emoji",values:{count:2}})))}),J4=ev.forwardRef(function(e,t){return ev.createElement(JQ,{commandPrefix:":"},e=>ev.createElement(J3,{ref:t,...e}))});var J6=a(95659);let J8=function(){return ev.useEffect(()=>{let e=J6.Gd().getScope()?.getTransaction()?.startChild({op:"editor.ui.loader"});return()=>{e?.finish()}},[]),ev.createElement("div",{className:"absolute top-0 flex h-screen w-full justify-center"},ev.createElement(eI.Spinner,null))};class J7{clientPointAtom;draggingNodeIdsAtom;isNodeIdDraggingSelectorFamily;constructor(){let e=(0,zO.cn)({key:"clientPoint",default:{x:0,y:0}}),t=(0,zO.cn)({key:"draggingNodeIds",default:null}),a=(0,zO.CG)({key:"isNodeIdDragging",get:e=>a=>{let{get:n}=a,l=n(t);return l?.has(e)??!1}});this.clientPointAtom=e,this.draggingNodeIdsAtom=t,this.isNodeIdDraggingSelectorFamily=a}}let J9=ev.createContext(void 0),Xe=function(e){let[t]=ev.useState(()=>new J7);return ev.createElement(J9.Provider,{value:t},e.children)};function Xt(){let e=ev.useContext(J9);if(null==e)throw Error("Missing DropAreaContext Provider not available");return e}function Xa(){return(e,t)=>{let a=i3(t());return null==a||function(e){let{selection:t}=e;if(!t.isFocused)return!1;let a=e.change().selectAll();t.isBackward&&(a=a.flip());let{selection:n}=a.value;return tz.default.is(t,n)}(a)}}function Xn(e,t){return function(a,n){let{contents:l}=n();if(e.length>1){let a=l.sortNodeIds(e,t);if(null==a)return;e=a}let r=CP()(e);if(null==r)return;let o=l.findNextNodeId(r,{ancestors:t,skipDescendants:!0});if(null==o||o===l.rootID||e.includes(o)||(null==t&&(t=l.findAncestorsForNode(r)),null==CP()(t)))return;let i=l.findNodeByID(o);if(null==i)return;let s=l.findAncestorsForNode(o);if(null==CP()(s))return;let d="afterend";s.length>t.length||(s.length===t.length?!i.collapsed&&i.hasChild&&(d="afterbegin"):d="beforebegin",a(Di({ids:e,ancestors:t},{id:o,ancestors:s,position:d})))}}function Xl(e,t){return function(a,n){let{contents:l}=n();if(e.length>1){let a=l.sortNodeIds(e,t);if(null==a)return;e=a}let r=e[0];if(null==r)return;let o=l.findPreviousNodeID(r);if(null==o||o===l.rootID||e.includes(o))return;null==t&&(t=l.findAncestorsForNode(r));let i=CP()(t);if(null==i)return;let s=l.findAncestorsForNode(o),d=CP()(s);if(null==d)return;let c="beforebegin";i!==d&&i!==o&&(c="afterend"),a(Di({ids:e,ancestors:t},{id:o,ancestors:s,position:c}))}}function Xr(e){let{start:t,end:a}=e;return(e,n)=>{let{contents:l,documentPreferences:r}=n();if(null==a)return Jv(l,r,t.nodeID,!0);{if(t.nodeID===a.nodeID)return Jv(l,r,a.nodeID,!0);let{common:e,source:n,target:o}=z4(t.ancestryPath,a.ancestryPath);if(0===e.length)return null;if(0===n.length&&0===o.length)return Jv(l,r,a.nodeID,!0);if(0===n.length&&o.length>0)return Jv(l,r,t.nodeID,!0);if(n.length>0&&0===o.length)return Jv(l,r,a.nodeID,!1);let i=o[0];return null==i?null:Jv(l,r,i,!0)}}}function Xo(e){let{start:t,end:a}=e;return(e,n)=>{let{contents:l,documentPreferences:r}=n();if(null==a)return Jk(l,r,t.nodeID);{if(t.nodeID===a.nodeID)return Jk(l,r,a.nodeID);let{common:e,source:n,target:o}=z4(t.ancestryPath,a.ancestryPath);if(0===e.length)return null;if(0===n.length&&0===o.length)return Jk(l,r,a.nodeID);if(0===n.length&&o.length>0)return Jk(l,r,t.nodeID);if(n.length>0&&0===o.length)return Jk(l,r,a.nodeID);let i=o[0];return null==i?null:Jk(l,r,i)}}}let Xi=(0,e$.connect)(function(e){return{contents:iL(e)}})(function(e){let{children:t,contents:a}=e,n=(0,e$.useDispatch)(),l=ev.useCallback(()=>n(Xa()),[n]),r=ev.useCallback(()=>n(zY()),[n]),o=ev.useCallback(()=>{n((e,t)=>{e(mD(dP(t()),void 0))})},[n]),i=ev.useCallback(e=>{n(QF(e))},[n]),s=ev.useCallback(e=>{n(JE(e))},[n]),d=ev.useCallback((e,t)=>{n(Ds(e,t))},[n]),c=ev.useCallback(e=>{n(De(e))},[n]),m=ev.useCallback(e=>{n(Dt(e))},[n]),u=ev.useCallback(()=>{n(I7())},[n]),p=ev.useCallback(()=>{n(I9())},[n]),g=ev.useCallback(e=>{n(Xl(e))},[n]),f=ev.useCallback(e=>{n(Xn(e))},[n]),h=ev.useCallback(e=>{n(Dd(e))},[n]),y=ev.useCallback(e=>{n(Dc(e))},[n]),b=ev.useCallback(e=>{n(Dm(e))},[n]),v=ev.useCallback(e=>n(Xr(e)),[n]),k=ev.useCallback(e=>n(Xo(e)),[n]);return ev.createElement(Va,{contents:a,canSelectAllNodes:l,fetchFocusNodeId:r,toggleSelectionComplete:s,toggleSelectionMark:d,onClearFocus:o,onDeleteNodes:i,indentNodes:c,outdentNodes:m,undo:u,redo:p,moveNodesToPreviousLocation:g,moveNodesToNextLocation:f,multiselectEnter:h,multiselectDown:y,multiselectUp:b,findNextNodeIdForSelection:v,findPreviousNodeIdForSelection:k},t)}),Xs={assignees:"assignees",dueDate:"dueDate",comments:"comments",reactions:"reactions",timer:"timer",media:"media"},Xd={[Xs.assignees]:(0,te.Em)({id:"general.assignee",defaultMessage:"Assignee"}),[Xs.dueDate]:(0,te.Em)({id:"general.due_date",defaultMessage:"Due Date"}),[Xs.comments]:(0,te.Em)({id:"general.comments",defaultMessage:"Comments"}),[Xs.reactions]:(0,te.Em)({id:"general.reactions",defaultMessage:"Reactions"}),[Xs.timer]:(0,te.Em)({id:"general.timer",defaultMessage:"Timer"}),[Xs.media]:(0,te.Em)({id:"general.media",defaultMessage:"Media"})},Xc={[Xs.assignees]:"addon_assign",[Xs.dueDate]:"addon_date",[Xs.comments]:"addon_comment",[Xs.reactions]:"addon_reaction",[Xs.timer]:"addon_timer",[Xs.media]:"addon_upload"},Xm=lw().string().valid(...Object.keys(Xs)),Xu=lw().object({name:Xm.required(),width:lw().number().optional()});lw().object({editorColumnWidth:lw().number().required(),columns:lw().array().items(Xu).required()});let Xp={editorColumnWidth:500,columns:[{name:Xs.assignees},{name:Xs.dueDate},{name:Xs.comments},{name:Xs.reactions},{name:Xs.timer},{name:Xs.media}]},Xg=function(){return ev.createElement("div",{className:"node-add-block relative flex"},ev.createElement("div",{className:"guideline-block-to absolute hidden"}),ev.createElement("div",{className:"add-block-title flex w-full"},ev.createElement("div",{className:"guideline-block-from absolute hidden h-fit"}),ev.createElement(GC,{className:"node-styled-insert duration-250 flex w-full items-center text-sm opacity-0 transition ease-in-out hover:opacity-100"},ev.createElement("span",{className:"flex items-center whitespace-nowrap px-5 text-primary hover:text-primary/80"},ev.createElement(tn.Icon,{className:"mr-1 shrink-0",icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.add_block",defaultMessage:"Add Block"})))))},Xf=ev.createContext(Xp);function Xh(e,t,a){return(n,l)=>{if("application/vnd.taskade.taskast"===e.dropType){let a=t.getData("application/vnd.taskade.taskast");if(!a)return;let r=JSON.parse(a),o=l();if(!function(e){let t=e.meta.id;if(null==t)return!0;let a=e.entities.documents.entities[t];return null!=a&&lm({role:a.role,action:{project:"edit",workspace:"edit_project"}})}(o))return;let i=iL(o);if(function(e,t,a){if(null!=t&&null!=e.project&&t!==e.project.id)return!1;for(let t of e.children)if(null==t.id||!a.nodes.has(t.id))return!1;return!0}(r,dP(o),i)){let t=(0,eo.compactMap)(r.children,e=>e.id);if(0===t.length)return;let a=i.findAncestorsForNode(t[0]);n(Di({ids:t,ancestors:a},{id:e.nodeId,ancestors:i.findAncestorsForNode(e.nodeId),position:e.position}))}else n(Da({id:e.nodeId,position:e.position},r))}else if("Files"===e.dropType){let r=l(),o=dP(r);if(null==o)return;let i=new Set(cx.UPLOAD_VALID_EXTENSIONS),s=[],d=[];for(let e of Array.from(t.files)){let t=(0,sX.extractFileExtension)(e.name);i.has(t)?s.push(e):d.push(e)}if(d.length>0){let e=s.length+d.length,t=d.map(e=>e.name).join("\n");if(n((0,l3.error)({uid:"attachment-upload-error",message:a.formatMessage({id:"general.upload_attachment_error",defaultMessage:"There was an error uploading {invalidFileCount} of {totalFileCount} file(s): {fileNames}"},{invalidFileCount:d.length,totalFileCount:e,fileNames:t}),position:"tc",autoDismiss:8,dismissible:!1})),0===s.length)return}let c=iA(r,{nodeID:e.nodeId});if((c?.media?.total??0)+(c?.media?.uploadingAttachments?.length??0)+s.length>12){n((0,l3.error)({uid:"attachment-upload-error",message:m4,position:"tc",autoDismiss:8,dismissible:!1}));return}n(mG(o,e.nodeId,s))}}}var Xy=a(23493),Xb=a.n(Xy);!function(e){e[e.DragEnter=0]="DragEnter",e[e.DragOver=1]="DragOver",e[e.DragLeave=2]="DragLeave",e[e.Drop=3]="Drop"}(W||(W={}));let Xv=function(e,t){let a=e.counter-1;return{counter:a,dropType:a>0?t.dropType:null}},Xk={actions:{dragEnter:function(e,t){let a=t?.(e,W.DragEnter)??null;return{type:W.DragEnter,dropType:a}},dragLeave:function(e,t){let a=t?.(e,W.DragLeave)??null;return{type:W.DragLeave,dropType:a}},dragOver:function(e,t){let a=t?.(e,W.DragOver)??null;return{type:W.DragOver,dropType:a}},drop:function(e,t){let a=t?.(e,W.Drop)??null;return{type:W.Drop,dropType:a}}},initialState:{counter:0,dropType:null},reducer:function(e,t){switch(t.type){case W.DragEnter:return{counter:e.counter+1,dropType:t.dropType};case W.DragOver:return e.dropType===t.dropType?e:{counter:e.counter,dropType:t.dropType};case W.DragLeave:return Xv(e,t);case W.Drop:return{counter:e.counter-1,dropType:null};default:return e}}};function XE(e){let{nodeId:t,canDrop:a,onDrop:n}=e,l=Xt(),r=(0,zO.Zl)(l.clientPointAtom),o=ev.useMemo(()=>Xb()((e,t)=>{r(a=>a.x===e&&a.y===t?a:{...a,x:e,y:t})},1e3/30,{leading:!0,trailing:!1}),[r]),[i,s]=ev.useReducer(Xk.reducer,Xk.initialState),d=ev.useCallback(e=>{let t=Xk.actions.dragEnter(e,a);e.stopPropagation(),null!=t.dropType&&e.preventDefault(),o.cancel();let{clientX:n,clientY:l}=e;r(e=>e.x===n&&e.y===l?e:{...e,x:n,y:l}),s(t)},[a,r,o]),c=ev.useCallback(e=>{let t=Xk.actions.dragOver(e,a);e.stopPropagation(),e.preventDefault(),o(e.clientX,e.clientY),s(t)},[a,o]),m=ev.useCallback(e=>{let t=Xk.actions.dragLeave(e,a);e.stopPropagation(),e.preventDefault(),o.cancel();let{clientX:n,clientY:l}=e;r(e=>e.x===n&&e.y===l?e:{...e,x:n,y:l}),s(t)},[a,r,o]),u=ev.useCallback(e=>{let t=Xk.actions.drop(e,a);e.stopPropagation(),e.preventDefault(),o.cancel();let{clientX:l,clientY:i}=e;r({x:l,y:i}),s(t),n?.(e,t)},[a,n,r,o]),p=null!=t&&i.counter>0;return ev.useEffect(()=>{null!=t&&(p?r(e=>e.nodeId===t?e:{...e,nodeId:t}):r(e=>e.nodeId!==t?e:{x:e.x,y:e.y}))},[p,t,r]),{state:i,props:{onDragEnter:d,onDragOver:c,onDragLeave:m,onDrop:u}}}let Xx={initialState:null,reducer:function(e,t){if("OnDropLocation"===t.type)return null==t.payload?null==e?e:t.payload:bW()(e,t.payload)?e:t.payload;return e},actions:{onDropLocation:e=>({type:"OnDropLocation",payload:e})}},X_=eL.default.div.withConfig({displayName:"DropIndicator__Container",componentId:"sc-9f0a7a8e-0"})` + pointer-events: none; + height: 5px; + z-index: 2; + background-color: ${e=>e.theme.primaryColorScheme?.base}; +`,Xw=function(e){let{className:t,onDropLocation:a}=e,n=Xt(),l=(0,zO.sJ)(n.clientPointAtom),[r,o]=ev.useReducer(Xx.reducer,Xx.initialState);ev.useEffect(()=>{let e=a(l);o(Xx.actions.onDropLocation(e))},[l,a]);let{Component:i,style:s}=ev.useMemo(()=>null==r?{Component:"div",style:{display:"none"}}:{Component:X_,style:r.rect},[r]);return ev.createElement(i,{className:t,style:s})};function XN(e,t,a,n){if(null==a||"Files"===e)return null;let l=a.dataset.nodeId;return null==l?null:{dropType:e,nodeId:l,position:n,rect:{left:void 0,right:void 0,top:void 0,bottom:void 0}}}let XC=eL.default.tr.withConfig({displayName:"styled__Container",componentId:"sc-edbb2f26-0"})` + height: 20px; +`,XM=eL.default.td.withConfig({displayName:"styled__Column",componentId:"sc-edbb2f26-1"})` + position: relative; + padding: 0; +`,XS=eL.default.div.withConfig({displayName:"styled__DropIndicatorContainer",componentId:"sc-edbb2f26-2"})` + display: flex; + flex-direction: column; + justify-items: center; +`,XI=function(e){let{nodeId:t,position:a}=e,n=(0,e$.useDispatch)(),l=(0,eK.Z)(),r=ev.useContext(Xf),o=ev.useRef(null),i=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback((e,t)=>{if(null==t.dropType||null==o.current?.getBoundingClientRect())return;let r=XN(t.dropType,{x:e.clientX,y:e.clientY},o.current,a);null!=r&&n(Xh(r,e.dataTransfer,l))},[n,l,a])}),s=ev.useCallback(e=>null==i.state.dropType?null:XN(i.state.dropType,e,o.current,a),[i.state.dropType,a]),d=i.state.counter>0;return ev.createElement(XC,{ref:o,...i.props,"data-node-id":t},ev.createElement(XM,{colSpan:r.columns.length+1},d&&ev.createElement(XS,null,ev.createElement(Xw,{onDropLocation:s}))))};function XD(e){return function(t,a){let n=function(e,t){let{contents:a,documentPreferences:n}=e;if("board"!==dA(e))return null;let l=a.findNodeByID(t);if(null==l)return null;let r=l.children.findLast(e=>n.isNodeIDVisible(e));if(null==r)return null;let o=a.findNodeByID(r);return null==o?null:o.format?.node}(a(),e);t(Da({id:e,position:"beforeend"},{type:"fragment",children:[{type:"text",format:n?{node:n}:void 0,text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},children:[]}]}))}}function XT(e){let t=null!=e;return t||uT(new ei.TaskadeError({code:"STALE_PROPS_AND_ZOMBIE_STATES",message:"Stale Props and Zombie States Detected"}),_I),t}function X$(e){let t=e.getClientRects(),a=[];for(let e of t){let t=e.y,n=(0,eo.findInsertionIndex)(a,t,e=>e.y),l=a[n];null==l||t!==l.y?a.splice(n,0,{y:t,clientRects:[e]}):l.clientRects.push(e)}return a}function XP(e,t,a){return function(n,l){let r=iV(l(),{nodeID:e});if(null==r||r.selection.isExpanded)return!1;let o=(0,RV.zg)(r.selection);if(null==o)return!1;let i=X$(o),s=i[i.length-1];if(null==s)return!1;let d=(0,RV.zg)(r.change().selectAll().value.selection);if(null==d)return!1;let c=X$(d),m=c[c.length-1];return null!=m&&!(s.clientRects[0].bottom<(m.clientRects[0].top+m.clientRects[0].bottom)/2)&&(n(Dk(e,t,a)),!0)}}var XF=a(23277),XA=a(73435),XR=a(44783),Xj=a(22292),XO=a(6898),XU=a(77943),XZ=a.n(XU),XL=a(86146),XB=a(2903),Xz=a(91058),XV=a(32998);function Xq(e){let t=(0,XV.$getRoot)();t.clear();let a=(0,XV.$createParagraphNode)(),n=e.split("\n");for(let[e,t]of n.entries()){if(t.length>0){let e=(0,XV.$createTextNode)(t);a.append(e)}if(e!==n.length-1){let e=(0,XV.$createLineBreakNode)();a.append(e)}}t.append(a)}var XW=a(84260);let XH=function(e){let{onBlur:t,onFocus:a}=e,[n]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>{let e=n.registerCommand(XV.BLUR_COMMAND,()=>(t(),!0),XV.COMMAND_PRIORITY_EDITOR),l=n.registerCommand(XV.FOCUS_COMMAND,()=>(a(),!0),XV.COMMAND_PRIORITY_EDITOR);return()=>{e(),l()}},[n,t,a]),null};var XG=a(40676);let XK="@@taskade/editor-event-emitter/ADD_NOTE_VALUE_LISTENER",XY="@@taskade/editor-event-emitter/REMOVE_NOTE_VALUE_LISTENER",XQ=function(e){let{nodeId:t}=e,a=(0,e$.useDispatch)(),[n]=(0,XW.useLexicalComposerContext)(),l=ev.useCallback((e,t)=>{n.update(()=>{let a=(0,XV.$getSelection)();if((0,XV.$isRangeSelection)(a)){let l=(0,XG.$createOffsetView)(n),[r,o]=l.getOffsetsFromSelection(a);r=li.Text0Subtype.transformCursor(r,t.o),o=li.Text0Subtype.transformCursor(o,t.o),Xq(e);let i=(l=(0,XG.$createOffsetView)(n)).createSelectionFromOffsets(r,o);(0,XV.$setSelection)(i)}else Xq(e),(0,XV.$setSelection)(null)},{tag:"rtce"})},[n]);return ev.useLayoutEffect(()=>(a({type:XK,payload:{nodeId:t,listener:l}}),()=>{a({type:XY,payload:{nodeId:t,listener:l}})}),[a,l,t]),ev.useLayoutEffect(()=>n.registerUpdateListener(e=>{let{dirtyElements:n,dirtyLeaves:l,editorState:r,tags:o}=e;!o.has("rtce")&&(0!==n.size||0!==l.size)&&r.read(()=>{a({type:ma,payload:{nodeId:t,note:li.NoteAttributeValueZchema.parse({type:"text/markdown",value:(0,XV.$getRoot)().getTextContent()})}})})}),[a,n,t]),null},XJ=function(e){let{isOpenInRedux:t}=e,[a]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>{t&&a.focus()},[a,t]),null},XX=function(e){let{nodeId:t,onFirstLineArrowUpPressed:a,onLastLineArrowDownPressed:n}=e,l=(0,e$.useDispatch)(),[r]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>{let e=r.registerCommand(XV.KEY_ENTER_COMMAND,e=>(e?.shiftKey===!0?(e?.preventDefault(),l(mI(t,-1))):r.update(()=>{e?.preventDefault(),r.dispatchCommand(XV.INSERT_LINE_BREAK_COMMAND,!1)}),!0),XV.COMMAND_PRIORITY_CRITICAL),o=r.registerCommand(XV.FORMAT_ELEMENT_COMMAND,()=>!0,XV.COMMAND_PRIORITY_CRITICAL),i=r.registerCommand(XV.FORMAT_TEXT_COMMAND,()=>!0,XV.COMMAND_PRIORITY_CRITICAL),s=r.registerCommand(XV.KEY_BACKSPACE_COMMAND,e=>0===(0,XV.$getRoot)().getTextContentSize()&&(e.preventDefault(),l(mI(t,-1)),!0),XV.COMMAND_PRIORITY_CRITICAL),d=r.registerCommand(XV.UNDO_COMMAND,()=>(r.blur(),l(I7()),!0),XV.COMMAND_PRIORITY_EDITOR),c=r.registerCommand(XV.REDO_COMMAND,()=>(r.blur(),l(I9()),!0),XV.COMMAND_PRIORITY_EDITOR),m=r.registerCommand(XV.KEY_ARROW_UP_COMMAND,e=>{let t=(0,XV.$getRoot)();if(0===t.getTextContentSize())return e?.preventDefault(),a(-1),!0;let n=(0,XV.$getSelection)();if(!(0,XV.$isRangeSelection)(n))return!1;let[l]=n.getNodes(),r=l.getParent();return null!=r&&t.getFirstChild()===r&&r.getFirstChild()===l&&(e?.preventDefault(),a(n.getCharacterOffsets()[1]),!0)},XV.COMMAND_PRIORITY_EDITOR),u=r.registerCommand(XV.KEY_ARROW_DOWN_COMMAND,e=>{let t=(0,XV.$getRoot)();if(0===t.getTextContentSize())return e?.preventDefault(),n(-1),!0;let a=(0,XV.$getSelection)();if(!(0,XV.$isRangeSelection)(a))return!1;let l=CP()(a.getNodes());if(null==l)return!1;let r=l.getParent();return null!=r&&t.getLastChild()===r&&r.getLastChild()===l&&(e?.preventDefault(),n(a.getCharacterOffsets()[1]),!0)},XV.COMMAND_PRIORITY_EDITOR),p=r.registerCommand(XV.KEY_DOWN_COMMAND,e=>!!oc(e)&&(e.preventDefault(),l(uj()),!0),XV.COMMAND_PRIORITY_EDITOR);return()=>{o(),i(),s(),d(),c(),m(),u(),e(),p()}},[l,r,t,a,n]),null},X0=function(e){let{nodeId:t,externalValue:a,onBlur:n,onFocus:l,isOpenInRedux:r,onFirstLineArrowUpPressed:o,onLastLineArrowDownPressed:i,isReadOnly:s,isNodeCompleted:d}=e,[c]=ev.useState(a),m=ev.useMemo(()=>({editorState:()=>{Xq(c)},namespace:"Note",theme:{},onError:console.error,editable:!s,nodes:[XB.HeadingNode,XR.ListNode,XR.ListItemNode,XB.QuoteNode,XF.CodeNode,XF.CodeHighlightNode,Xz.TableNode,Xz.TableCellNode,Xz.TableRowNode,XA.AutoLinkNode,XA.LinkNode]}),[c,s]);return ev.createElement("div",{className:og()("grow",d?"text-textcolor-400 dark:text-textcolor-400":"text-textcolor-600 dark:text-textcolor-500"),onKeyDown:e=>{Y5(e)||(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())}},ev.createElement(Xj.LexicalComposer,{initialConfig:m},ev.createElement(XL.RichTextPlugin,{contentEditable:ev.createElement(XO.ContentEditable,null),placeholder:null,ErrorBoundary:XZ()}),ev.createElement(XQ,{nodeId:t}),ev.createElement(XX,{nodeId:t,onFirstLineArrowUpPressed:o,onLastLineArrowDownPressed:i}),ev.createElement(XH,{onFocus:l,onBlur:n}),ev.createElement(XJ,{isOpenInRedux:r})))},X1=(0,e$.connect)(function(e,t){return{node:iq()(e,{nodeID:t.nodeId}),isOpenInRedux:e.session.noteOpenNodeId===t.nodeId,isReadOnly:dq(e)}})(function(e){let{nodeId:t,ancestors:a,node:n,isOpenInRedux:l,isReadOnly:r}=e,o=(0,e$.useDispatch)(),i=n.attributes.note?.value??"",s=ev.useCallback(()=>{o(mJ(t))},[o,t]),d=ev.useCallback(()=>{o(mJ(null))},[o]),c=ev.useCallback(e=>{o(mI(t,e))},[o,t]),m=ev.useCallback(e=>{o(XP(t,a,e))},[a,o,t]);return 0!==i.length||l?ev.createElement(X0,{nodeId:t,externalValue:i,onFocus:s,onBlur:d,onFirstLineArrowUpPressed:c,onLastLineArrowDownPressed:m,isOpenInRedux:l,isReadOnly:r,isNodeCompleted:n.completed}):null});function X2(e){let{ancestors:t,nodeID:a,dispatch:n}=e,l=ev.useContext(z2),r=Xt(),o=(0,zO.sJ)(r.isNodeIdDraggingSelectorFamily(a)),i=(0,zO.Zl)(r.draggingNodeIdsAtom),s=ev.useRef(),d=ev.useCallback(e=>{if(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.target instanceof HTMLElement&&("true"!==e.target.dataset.dragHandle||e.target.dataset.nodeId!==a)){e.preventDefault();return}let r=l.getSelectedIdsAtNode(a,t);if(0===r.length){e.preventDefault();return}1===r.length&&r[0]===a&&e.dataTransfer.setDragImage(e.currentTarget,0,0);let o=n(Vj(r));e.dataTransfer.setData("application/vnd.taskade.taskast",JSON.stringify(o)),null!=o.project&&(e.dataTransfer.setData("application/x.taskade.app.document-id",o.project.id),e.dataTransfer.setData("application/x.taskade.app.revision",o.project.revision.toString())),i(new Set(r)),s.current=()=>{i(null),s.current=void 0}},[t,n,a,l,i]),c=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s.current?.()},[]);return ev.useEffect(()=>()=>{s.current?.()},[]),{isDragging:o,props:{onDragStart:d,onDragEnd:c}}}function X5(e,t,a){return function(n,l){let r=iV(l(),{nodeID:e});if(null==r||r.selection.isExpanded)return!1;let o=(0,RV.zg)(r.selection);if(null==o)return!1;let i=X$(o)[0];if(null==i)return!1;let s=(0,RV.zg)(r.change().selectAll().value.selection);if(null==s)return!1;let d=X$(s)[0];return null!=d&&!(i.clientRects[0].top>(d.clientRects[0].top+d.clientRects[0].bottom)/2)&&(n(Dv(e,t,a)),!0)}}function X3(e,t,a){return(n,l)=>{let r=l();if("type"in e){if("files"===e.type){let a=dV(r),l=a?.id;null!=l&&null!=e.files&&e.files.length>0&&n(mG(l,t,e.files))}else"application/vnd.taskade.taskast"===e.type&&n(Db(t,a,e.fragment))}else li.Contents.isContents(e)&&n(Dh(t,a,e))}}function X4(e){return(t,a)=>{let n=dV(a());return!!(null!=n&&lm({role:n.role,action:{project:"check"}}))&&(t(mA(e)),!0)}}let X6=(0,eL.css)` + border-style: solid; + border-color: ${e=>e.theme.appColors.hex(70)}; + border-width: 0; + + background-clip: padding-box; +`,X8=(0,eL.css)` + ${X6}; + + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(2.5)}; +`,X7=(0,eL.css)` + &:first-child { + td { + border-top-width: 0; + } + } +`,X9=eL.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-8512d339-0"})` + width: 100%; + background: ${e=>e.theme.appColors.hex(70)}; + height: 1px; + margin: var(--menu-item-divider-margin); +`,eee=eL.default.div.withConfig({displayName:"styled__TimestampContainer",componentId:"sc-8512d339-1"})` + display: flex; + flex-direction: column; + column-gap: var(--menu-item-gap); + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(4)}; + ${e1.UiTypography.xs}; + line-height: 18px; + color: ${e=>e.theme.textColors.hex(50)}; + gap: ${eI.UiSpacing.getPx(1.5)}; + align-items: flex-start; + text-align: left; +`,eet=eL.default.div.withConfig({displayName:"styled__TooltipReference",componentId:"sc-8512d339-2"})` + position: absolute; + left: 0; + right: -4px; + top: 50%; + transform: translateY(4px); +`,eea=eL.default.div.withConfig({displayName:"styled__FooterContainer",componentId:"sc-8512d339-3"})` + display: flex; + flex-direction: column; + position: relative; + cursor: pointer; +`,een=eL.default.div.withConfig({displayName:"styled__TooltipContainer",componentId:"sc-8512d339-4"})` + display: flex; + flex-direction: column; + ${e1.UiTypography.xs}; + line-height: 18px; + gap: ${eI.UiSpacing.getPx(1.5)}; +`,eel=(0,te.vU)({created:{id:"general.created_timestamp_attribute",defaultMessage:"Created by {handle} {br} {shortDate} {on} {at}"},updated:{id:"general.updated_timestamp_attribute",defaultMessage:"Last edited by {handle} {br} {shortDate} {on} {at}"},completed:{id:"general.completed_timestamp_attribute",defaultMessage:"Completed by {handle} {br} {shortDate} {on} {at}"}}),eer=function(e){let{type:t,timestamp:a}=e,n=(0,eK.Z)(),l=(0,ll.x)(),r=ev.useMemo(()=>{if(null==a.by||"user"!==a.by.type)return null;let e=a.by.id;try{let t=l.readFragment({id:`User:${e}`,fragment:up,fragmentName:"BasicUserFields"});return t?.handle}catch(t){return`user id: ${e}`}},[l,a.by]),o=ev.useMemo(()=>{let e=eG()(a.at);return e.isSame(eG()(),"day")?`${n.formatMessage({id:"general.today",defaultMessage:"Today"})},`:e.isSame(eG()().subtract(1,"day"),"day")?`${n.formatMessage({id:"general.yesterday",defaultMessage:"Yesterday"})},`:e.isSame(eG()().add(1,"day"),"day")?`${n.formatMessage({id:"general.date_tomorrow",defaultMessage:"Tomorrow"})}`:null},[n,a.at]);return ev.createElement("div",null,ev.createElement(eY.Z,{...eel[t],values:{shortDate:o,on:ev.createElement(te.Ji,{value:new Date(a.at),month:"short",day:"numeric"}),at:ev.createElement(te.qN,{value:new Date(a.at)}),handle:r??"Anonymous",br:ev.createElement("br",null)}}))},eeo=function(e){let{created:t,updated:a,completed:n}=e,{arrowProps:l,popperProps:r,referenceProps:o,setVisible:i,visible:s}=(0,eI.useTooltip)({placement:"right"});return ev.createElement(eea,{onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)}},ev.createElement(X9,null),ev.createElement(eet,o),ev.createElement(eee,null," ",null!=a?ev.createElement(eer,{type:"updated",timestamp:a}):null!=n?ev.createElement(eer,{type:"completed",timestamp:n}):null!=t?ev.createElement(eer,{type:"created",timestamp:t}):null),s&&ev.createElement(eI.Tooltip,{arrowProps:l,popperProps:r},ev.createElement(een,null,null!=a?ev.createElement(ev.Fragment,null,null!=n&&ev.createElement(eer,{type:"completed",timestamp:n}),null!=t&&ev.createElement(eer,{type:"created",timestamp:t})):null!=n?ev.createElement(ev.Fragment,null,null!=t&&ev.createElement(eer,{type:"created",timestamp:t})):ev.createElement(ev.Fragment,null,null!=n&&ev.createElement(eer,{type:"completed",timestamp:n})))))},eei=function(e){let{type:t,timestamp:a}=e;return ev.createElement(ev.Fragment,null,ev.createElement(X9,null),ev.createElement(eee,null,ev.createElement(eer,{type:t,timestamp:a})))},ees=function(e){let{attributes:t}=e,a=t?.created,n=t?.updated,l=t?.completed;return null==n&&null==a&&null==l?null:null!=n&&null==a&&null==l?ev.createElement(eei,{type:"updated",timestamp:n}):null==n&&null!=a&&null==l?ev.createElement(eei,{type:"created",timestamp:a}):null==n&&null==a&&null!=l?ev.createElement(eei,{type:"completed",timestamp:l}):ev.createElement(eeo,{created:a,updated:n,completed:l})},eed=(0,la.ZP)` + mutation ProjectNodesImportMutation($input: ProjectNodesImportInput!) { + projectNodesImport(input: $input) { + clientMutationId + nodeID + document { + id + info + } + } + } +`;function eec(){return[{name:"offset",options:{offset:[-7,5]}}]}let eem=(0,eL.default)(cF).withConfig({displayName:"MenuItem__StyledMenuButton",componentId:"sc-12388bee-0"})` + position: relative; + justify-content: space-between; + text-align: left; + word-break: break-word; +`,eeu=eL.default.div.withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-12388bee-1"})` + & svg { + margin-right: 0; + transform: none; + align-self: center; + } +`,eep=function(e){let{children:t,className:a,onClick:n,name:l,value:r,paywallEnabled:o}=e,i=ev.useRef(null),s=(0,eI.useMenuItem)({onClick:n,stopRef:i,name:l,value:r});return ev.createElement(eem,{...s.props,className:a},t,o&&ev.createElement(eeu,null,ev.createElement(e1.UpgradeBadge,null)))},eeg=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-73bd586e-0"})` + display: flex; + flex-direction: column; + width: ${e=>e.$width?e.$width+"px":"inherit"}; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + max-width: 240px; + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eef=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledSubMenu",componentId:"sc-73bd586e-1"})` + display: flex; + flex-direction: column; + width: ${e=>e.$width?e.$width+"px":"inherit"}; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + max-width: 240px; + max-height: 400px; + overflow-y: auto; + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${tM}; +`,eeh=eL.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-73bd586e-2"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eey=eL.default.div.withConfig({displayName:"styled__EmojiWrapper",componentId:"sc-73bd586e-3"})` + display: flex; + width: 20px; + height: 20px; + justify-content: center; + font-size: 18px; + line-height: 21px; + margin-right: var(--menu-item-gap); + align-self: flex-start; +`,eeb=(0,eL.default)(eI.Overline).withConfig({displayName:"styled__Heading",componentId:"sc-73bd586e-4"})` + display: flex; + padding: 0.5rem 1rem; + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.xs}; +`;eL.default.span.withConfig({displayName:"styled__HighlightCircleIcon",componentId:"sc-73bd586e-5"})` + background: ${e=>e.$color}; + border-radius: 50px; + width: 20px; + height: 20px; + align-self: center; + transition: all ease-in-out 0.2s; + margin-right: 12px; +`;let eev=(0,eL.default)(eep).withConfig({displayName:"styled__DeleteMenuItem",componentId:"sc-73bd586e-6"})` + position: relative; + justify-content: space-between; + padding-right: 15px; + & > div { + color: #eb6461; + & svg path { + stroke: #eb6461; + } + } +`,eek=eL.default.div.withConfig({displayName:"styled__HighlightSection",componentId:"sc-73bd586e-7"})` + display: flex; + flex-direction: row; + justify-content: center; + flex-wrap: wrap; +`;eL.default.div.withConfig({displayName:"styled__IconName",componentId:"sc-73bd586e-8"})` + display: flex; +`,eL.default.div.withConfig({displayName:"styled__HighlightIcon",componentId:"sc-73bd586e-9"})` + display: flex; + & svg { + margin-left: -8px; + } +`;let eeE=eL.default.div.withConfig({displayName:"styled__HighlightIconName",componentId:"sc-73bd586e-10"})` + display: flex; + align-items: center; + + & svg { + flex-shrink: 0; + box-shadow: 0 3px 0 0 #fff599; + path { + stroke: none; + fill: ${e=>e.theme.textColors.hex("10")}; + } + } +`,eex=(0,la.ZP)` + query MembershipsQuery { + me { + id + memberships { + id + order + role + space { + id + color + name + archived_at + parent_membership { + id + order + role + space { + id + color + name + archived_at + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + default { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + } + } + } + } + } + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + default { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + } + } + } + } + } + } + } +`,ee_=(0,la.ZP)` + query ProjectsQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + space { + id + documents_v2 { + edges { + node { + id + info + shared_preferences + archived_at + } + } + } + } + } + } +`,eew=(0,lb.C)({context:{memberships:[],workspaceTrees:[],selected:null,error:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"projectSelect",initial:"loading",states:{loading:{invoke:{id:"loadWorkspaceTrees",src:"loadWorkspaceTrees",onDone:[{actions:"handleWorkspaceTreesLoaded",target:"#projectSelect.selecting"}],onError:[{actions:"handleError",target:"#projectSelect.erred"}]}},selecting:{invoke:{id:"loadSelectedSpace",src:"loadSelectedSpace",onDone:[{actions:"handleSelectedSpaceLoaded",target:"#projectSelect.loaded"}],onError:[{actions:"handleError",target:"#projectSelect.erred"}]}},loaded:{on:{SPACE_SELECTED:{actions:"handleSpaceSelected",target:"#projectSelect.selecting"}}},erred:{}}},{actions:{handleError:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleSpaceSelected:(0,lv.assign)((e,t)=>(0,es.ZP)(e,a=>{let{spaceId:n}=t.payload,l=e.memberships.find(e=>e.space.id===n);return null!=l?a.selected={space:l.space,membership:null}:a.selected=null,a})),handleWorkspaceTreesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>{e.memberships=t.data.memberships,e.workspaceTrees=t.data.workspaceTrees;let a=t.data.workspaceTrees[0]?.space;return null!=a&&(e.selected={space:a,membership:null}),e})),handleSelectedSpaceLoaded:(0,lv.assign)((e,t)=>{let a=t.data.membership;return(0,es.ZP)(e,e=>{if(null!=e.selected){let{space:t}=e.selected;null!=a&&t.id===a.space.id?e.selected.membership=a:e.selected=null}return e})})}});eL.default.button.withConfig({displayName:"styled__ReferenceButton",componentId:"sc-186b2561-0"})` + position: absolute; + background: none; + border: none; + -webkit-appearance: none; + padding: 0; + margin: 0; + width: 0px; + height: 0px; + right: 0; +`,(0,eL.default)(eI.Overline).withConfig({displayName:"styled__StyledOverline",componentId:"sc-186b2561-1"})` + margin: 15px 20px 5px; +`,(0,eL.default)(eep).withConfig({displayName:"styled__StyledMenuItem",componentId:"sc-186b2561-2"})` + display: flex; + flex-direction: column; + padding: var(--menu-item-padding); + background: none; + border: none; + -webkit-appearance: none; + + &:hover, + &:focus { + outline: 0; + background: ${e=>e.theme.appColors.hex(80)}; + cursor: pointer; + } +`,eL.default.div.withConfig({displayName:"styled__ProjectList",componentId:"sc-186b2561-3"})` + display: flex; + flex-direction: column; + margin-bottom: 12px; +`;let eeN=(0,eL.default)(eep).withConfig({displayName:"styled__ProjectButton",componentId:"sc-186b2561-4"})` + display: flex; + background: none; + margin: 0; + padding: var(--menu-item-padding); + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + width: 100%; + font-weight: 400; + color: ${e=>e.theme.textColors.hex(10)}; + text-align: left; + justify-content: ${e=>e.$justifyLeft?"flex-start":"space-between"}; + + &:disabled { + opacity: 0.4; + pointer-events: none; + } + + &:hover, + &:focus { + outline: 0; + background: ${e=>e.theme.appColors.hex(80)}; + } +`;eL.default.div.withConfig({displayName:"styled__SpaceWrapper",componentId:"sc-186b2561-5"})` + display: flex; + align-items: center; + width: 100%; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.md}; +`;let eeC=eL.default.span.withConfig({displayName:"styled__SpaceName",componentId:"sc-186b2561-6"})` + flex-grow: 1; + text-align: left; + align-self: center; +`,eeM=(0,eL.default)(pJ).withConfig({displayName:"styled__SpaceAvatarStyled",componentId:"sc-186b2561-7"})` + position: relative; + margin-right: var(--menu-item-gap); + width: 20px; + height: 20px; + border-radius: 8px; + align-self: flex-start; +`;(0,eL.default)(tn.Icon).attrs({icon:"dd_caret"}).withConfig({displayName:"styled__StyledArrowIcon",componentId:"sc-186b2561-8"})``,eL.default.div.withConfig({displayName:"styled__EmojiWrapper",componentId:"sc-186b2561-9"})` + align-self: center; + margin-right: var(--menu-item-gap); +`;let eeS=(0,eL.default)(tn.Icon).attrs({icon:"dd_project"}).withConfig({displayName:"styled__StyledProjectIcon",componentId:"sc-186b2561-10"})` + align-self: center; + margin-right: 12px; + display: flex; + flex-shrink: 0; + align-self: flex-start; +`,eeI=eL.default.div.withConfig({displayName:"styled__EmptyMessage",componentId:"sc-186b2561-11"})` + padding: 2px 20px 0; + color: ${e=>e.theme.textColors.hex(40)}; + text-align: left; + ${e1.UiTypography.sm}; + margin-bottom: 4px; +`,eeD=(0,eL.default)(eep).withConfig({displayName:"styled__SubspaceMenuItem",componentId:"sc-186b2561-12"})` + padding-left: 40px; +`,eeT=function(e){let{state:t}=e,{selected:a}=t.context;if(t.matches("selecting"))return ev.createElement(eeI,null,ev.createElement(eI.Spinner,{size:22}));if(null==a)return ev.createElement(eeI,null,ev.createElement(eY.Z,{id:"general.no_space_selected",defaultMessage:"No space selected"}));if(null==a.membership)return ev.createElement(eeI,null,ev.createElement(eY.Z,{id:"general.no_membership_to_space",defaultMessage:"No membership to space"}));let n=a.membership.space.documents_v2;return null==n.edges||0===n.edges.length?ev.createElement(eeI,null,ev.createElement(eY.Z,{id:"general.no_projects",defaultMessage:"This space has no projects"})):ev.createElement("div",null,n.edges.map(e=>{let t=e.node;if(null==t||null!=t.archived_at)return null;let a=nQ(t);return ev.createElement(eeN,{key:t.id,name:"project",value:t.id,$justifyLeft:!0},null!=a?ev.createElement(eey,null,a):ev.createElement(eeS,null),ev.createElement("span",null,t.info.title||"Untitled"))}))},ee$=ev.forwardRef(function(e,t){let{onSelect:a,selectedSpace:n,workspaceTrees:l}=e,[r,o]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),i=ev.useRef(null),s=ev.useRef(null),d=ev.useRef(null),c=ev.useCallback(()=>{r.expanded?i.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):o({type:"Expand",payload:"first"})},[r.expanded]),m=ev.useCallback(()=>{r.expanded?s.current?.focus():o({type:"Expand"})},[r.expanded]),{navigated:u,props:p}=(0,eI.useMenuItem)({submenuPopupState:r,stopRef:s,onClick:c,onMouseEnter:m}),g=ev.useCallback(()=>{u&&s.current?.focus()},[u]);(0,eI.usePopupEvents)({state:r,onCollapse:g});let f=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:r,placement:"right-start",computeModifiersCallback:eec}),h=ev.useCallback(()=>{r.expanded&&i.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[r.expanded]);ev.useEffect(()=>{r.expanded&&!u&&o({type:"Collapse"})},[o,r.expanded,u]);let y=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:n}=e.payload;"space"===t&&null!=n&&a(n)}},[a]);return ev.useImperativeHandle(t,()=>({updateSubmenuIfNeeded:()=>{f.popper.instanceRef.current?.update()}}),[f.popper.instanceRef]),ev.createElement(ev.Fragment,null,ev.createElement(eem,{...p,onFocus:h},null!=n&&ev.createElement(Bu,null,ev.createElement(eeM,{space:n,size:"small"}),ev.createElement(eeC,null,n.name)),ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),r.expanded&&ev.createElement(eI.Popup,{...f.props,dispatch:o},ev.createElement(eI.MenuGroupContext.Provider,{value:y},ev.createElement(eef,{initialFocus:f.initialFocus,isSubmenu:!0,ref:i,$width:280},l.map(e=>ev.createElement(ev.Fragment,{key:e.id},ev.createElement(eep,{name:"space",value:e.space.id},ev.createElement(eeM,{space:e.space,size:"small"}),ev.createElement(eeC,null,e.space.name)),e.children.map(e=>ev.createElement(eeD,{key:e.id,name:"space",value:e.space.id},ev.createElement(eeM,{space:e.space,size:"small"}),ev.createElement(eeC,null,e.space.name)))))))))}),eeP=ev.forwardRef(function(e,t){let{initialFocus:a,popperInstanceRef:n,onSelect:l,projectOverlineText:r}=e,o=ev.useRef(null),[i,s]=function(){let e=(0,ll.x)();return(0,ls.e)(eew,{services:{loadWorkspaceTrees:async()=>{let t=await e.query({query:eex,fetchPolicy:"cache-first"}),a=t.errors?.[0];if(null!=a)throw a;let n=t.data?.me?.memberships??[];if(0===n.length)throw Error("error fetching memberships");let l=n.filter(e=>null==e.space.archived_at),r=pI(l);return{memberships:l,workspaceTrees:r}},loadSelectedSpace:async t=>{if(null==t.selected)return{membership:null};let a=t.selected.space.id,n=await e.query({fetchPolicy:"cache-first",query:ee_,variables:{spaceId:a}}),l=n.errors?.[0];if(null!=l)throw l;return n.data}}})}(),{context:d}=i,{selected:c,workspaceTrees:m}=d,u=ev.useCallback(e=>{s({type:"SPACE_SELECTED",payload:{spaceId:e}}),n.current?.update()},[n,s]),p=ev.useContext(eI.MenuGroupContext),g=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:a}=e.payload;"project"===t&&null!=a&&l(a)}p?.(e)},[l,p]);return ev.useEffect(()=>{i.value,o.current?.updateSubmenuIfNeeded()},[i.value]),ev.createElement(eI.MenuGroupContext.Provider,{value:g},ev.createElement(eef,{initialFocus:a,isSubmenu:!0,ref:t,$width:280},i.matches("loading")?ev.createElement(eI.Spinner,{size:22}):i.matches("loaded")||i.matches("selecting")?ev.createElement("div",null,ev.createElement(eeb,null,ev.createElement(eY.Z,{id:"general.space",defaultMessage:"Space"})),ev.createElement(ee$,{ref:o,selectedSpace:c?.space??null,workspaceTrees:m,onSelect:u}),ev.createElement(eeb,null,r??ev.createElement(eY.Z,{id:"general.project",defaultMessage:"Project"})),ev.createElement(eeT,{state:i})):i.matches("erred")?ev.createElement("span",null,"An error occurred"):ev.createElement("span",null,"Unknown state")))}),eeF=function(e){let{onSelect:t,children:a,projectOverlineText:n}=e,[l,r]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),d=ev.useCallback(()=>{l.expanded?o.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):r({type:"Expand",payload:"first"})},[l.expanded]),c=ev.useCallback(()=>{l.expanded?i.current?.focus():r({type:"Expand"})},[l.expanded]),{navigated:m,props:u}=(0,eI.useMenuItem)({submenuPopupState:l,stopRef:i,onClick:d,onMouseEnter:c}),p=ev.useCallback(()=>{m&&i.current?.focus()},[m]);(0,eI.usePopupEvents)({state:l,onCollapse:p});let g=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:l,placement:"right-start",computeModifiersCallback:eec}),f=ev.useCallback(()=>{l.expanded&&o.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[l.expanded]);return ev.useEffect(()=>{l.expanded&&!m&&r({type:"Collapse"})},[r,l.expanded,m]),ev.createElement(ev.Fragment,null,ev.createElement(eem,{...u,onFocus:f},a,ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),l.expanded&&ev.createElement(eI.Popup,{...g.props,dispatch:r},ev.createElement(eeP,{initialFocus:g.initialFocus,popperInstanceRef:g.popper.instanceRef,onSelect:t,projectOverlineText:n})))},eeA=(0,e$.connect)(function(e){return{attachments:iF(e),contents:iL(e)}})(function(e){let{attachments:t,contents:a,nodeID:n}=e,l=(0,eK.Z)(),r=(0,e$.useDispatch)(),[o]=(0,cs.D)(eed),i=(0,ev.useCallback)(async e=>{let i=a.extractFragment([n]);i=VR(i,t),i=(0,lr.replaceIDs)(i);let{data:s,errors:d}=await o({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:e,nodeID:null,placement:"beforeend",type:"application/vnd.taskade.taskast",content:i,action:"copy"}}}),c=(0,ld.Z)(),m=s?.projectNodesImport?.document??null;if(null!=m){let e=`nodeids-copied-${c}`,t=ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.copy_node_success_notification",defaultMessage:"Copied to {projectName}",values:{project:e=>ev.createElement(sC.rU,{to:`/d/${m.id}`},e),projectName:m.info.title||"Untitled"}}));r((0,l3.success)({position:"br",autoDismiss:5,dismissible:!1,uid:e,children:t}))}else if(null!=d){let e=`nodeids-copy-error-${c}`,t=l.formatMessage({id:"general.copy_error",defaultMessage:"An error occurred during copying."});r((0,l3.error)({position:"br",autoDismiss:5,dismissible:!1,uid:e,message:t}))}},[t,a,r,l,n,o]);return ev.createElement(eeF,{onSelect:i,projectOverlineText:l.formatMessage({id:"general.copy_to",defaultMessage:"Copy To"})},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_copy"}),ev.createElement(eY.Z,{id:"general.copy_to",defaultMessage:"Copy To"}),ev.createElement(SV,{date:"2021-06-29"})))}),eeR=(0,e$.connect)(function(e){return{attachments:iF(e),contents:iL(e)}})(function(e){let{attachments:t,contents:a,documentID:n,nodeID:l}=e,r=(0,eK.Z)(),o=(0,e$.useDispatch)(),[i]=(0,cs.D)(eed),s=(0,ev.useCallback)(async e=>{let s=a.extractFragment([l]);s=VR(s,t),s=(0,lr.replaceIDs)(s);let{data:d,errors:c}=await i({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:e,nodeID:null,placement:"beforeend",type:"application/vnd.taskade.taskast",content:s,action:"move"}}}),m=(0,ld.Z)(),u=d?.projectNodesImport?.document??null;if(null!=u){let e=`nodeids-moved-${m}`,t=ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.move_node_success_notification",defaultMessage:"Moved to {projectName}!",values:{project:e=>ev.createElement(sC.rU,{to:`/d/${u.id}`},e),projectName:u.info.title||"Untitled"}}));o(mS(n,[l])),o((0,l3.success)({position:"br",autoDismiss:5,dismissible:!1,uid:e,children:t}))}else if(null!=c){let e=`nodeids-move-error-${m}`,t=r.formatMessage({id:"general.move_error",defaultMessage:"An error occurred during moving."});o((0,l3.error)({position:"br",autoDismiss:5,dismissible:!1,uid:e,message:t}))}},[t,a,o,n,r,l,i]);return ev.createElement(eeF,{onSelect:s,projectOverlineText:r.formatMessage({id:"general.move_to",defaultMessage:"Move To"})},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_move"}),ev.createElement(eY.Z,{id:"general.move_to",defaultMessage:"Move To"})))}),eej=ev.forwardRef(function(e,t){let{initialFocus:a,nodeID:n,documentID:l,hasChild:r}=e,o=(0,e$.useDispatch)(),i=(0,eK.Z)(),s=gV(),d=s.id,c=d6()&&!hA(s.type),m=ev.useCallback(e=>{if(!r){let e=i.formatMessage({id:"general.sort_error",defaultMessage:"Unable to sort as the node has no children."}),t=(0,ld.Z)(),a=`nodeids-sort-error-${t}`;o((0,l3.error)({uid:a,message:e,position:"br",autoDismiss:5}));return}if((e===O.DueDate||e===O.Mention||e===O.Tag||e===O.DateCreated)&&c){null!=d&&o(d4(d));return}o(Du(n,e)),u$?.track("Node Sorted Children",{sortBy:e,version:2},{context:{nodeId:n,projectId:l,groupId:d}})},[o,l,c,n,d,r,i]),u=ev.useContext(eI.MenuGroupContext),p=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:a}=e.payload;"sort"===t&&function(e){if(null==e)return!1;switch(e){case O.CompleteAsc:case O.CompleteDesc:case O.DueDate:case O.AlphabeticalAsc:case O.AlphabeticalDesc:case O.Tag:case O.Mention:case O.DateCreated:return!0;default:return!1}}(a)&&m(a)}u?.(e)},[m,u]);return ev.createElement(eI.MenuGroupContext.Provider,{value:p},ev.createElement(eeg,{initialFocus:a,isSubmenu:!0,ref:t},c&&ev.createElement(eeO,{$type:"upgrade",onClick:()=>{null!=d&&o(d4(d)),u?.({type:"Dismiss"})}},"⚡️"," ",ev.createElement(eY.Z,{id:"general.sort_submenu_paywall",defaultMessage:"You can upgrade to unlock all sorting options.",values:{link:e=>ev.createElement(eeU,null,e)}})),ev.createElement(eep,{name:"sort",value:O.CompleteAsc},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"general.sort_completed",defaultMessage:"Completed"}))),ev.createElement(eep,{name:"sort",value:O.CompleteDesc},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_unchecked"}),ev.createElement(eY.Z,{id:"general.sort_uncompleted",defaultMessage:"Uncompleted"}))),ev.createElement(eep,{name:"sort",value:O.AlphabeticalAsc},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_asc"}),ev.createElement(eY.Z,{id:"general.sort_AZ",defaultMessage:"A to Z"}))),ev.createElement(eep,{name:"sort",value:O.AlphabeticalDesc},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_desc"}),ev.createElement(eY.Z,{id:"general.sort_ZA",defaultMessage:"Z to A"}))),ev.createElement(eep,{name:"sort",value:O.Tag,paywallEnabled:c},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_tag"}),ev.createElement(eY.Z,{id:"general.sort_tag",defaultMessage:"Tag"}))),ev.createElement(eep,{name:"sort",value:O.Mention,paywallEnabled:c},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_mention"}),ev.createElement(eY.Z,{id:"general.sort_mention",defaultMessage:"Mention"}))),ev.createElement(eeh,null),ev.createElement(eep,{name:"sort",value:O.DueDate,paywallEnabled:c},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_date"}),ev.createElement(eY.Z,{id:"general.sort_due_date",defaultMessage:"Due Date"}))),ev.createElement(eep,{name:"sort",value:O.DateCreated,paywallEnabled:c},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_edit"}),ev.createElement(eY.Z,{id:"general.date_created",defaultMessage:"Date Created"})))))}),eeO=(0,eL.default)(e1.Notice).withConfig({displayName:"SortSubmenu__StyledNotice",componentId:"sc-e8f3b888-0"})` + ${e1.UiTypography.sm}; + margin: 0 10px 10px; + cursor: pointer; +`,eeU=eL.default.span.withConfig({displayName:"SortSubmenu__StyledPaywallUpgradeLink",componentId:"sc-e8f3b888-1"})` + color: ${eI.ThemeColors.upgrade}; + &:hover { + text-decoration: underline; + } +`,eeZ=function(e){let{documentID:t,nodeID:a,hasChild:n}=e,[l,r]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),d=ev.useCallback(()=>{l.expanded?o.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):r({type:"Expand",payload:"first"})},[l.expanded]),c=ev.useCallback(()=>{l.expanded?i.current?.focus():r({type:"Expand"})},[l.expanded]),{navigated:m,props:u}=(0,eI.useMenuItem)({submenuPopupState:l,stopRef:i,onClick:d,onMouseEnter:c}),p=ev.useCallback(()=>{m&&i.current?.focus()},[m]);(0,eI.usePopupEvents)({state:l,onCollapse:p});let g=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:l,placement:"right-start",computeModifiersCallback:eec}),f=ev.useCallback(()=>{l.expanded&&o.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[l.expanded]);return ev.useEffect(()=>{l.expanded&&!m&&r({type:"Collapse"})},[r,l.expanded,m]),ev.createElement(ev.Fragment,null,ev.createElement(eem,{...u,onFocus:f},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_sort"}),ev.createElement(eY.Z,{id:"general.sort_by",defaultMessage:"Sort By"})),ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),l.expanded&&ev.createElement(eI.Popup,{...g.props,dispatch:r},ev.createElement(eej,{initialFocus:g.initialFocus,documentID:t,nodeID:a,hasChild:n})))},eeL=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-44b321f5-0"})` + display: flex; + flex-direction: column; +`,eeB=eL.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-44b321f5-1"})` + width: 100%; + background: ${e=>e.theme.appColors.hex(70)}; + height: 1px; + margin: var(--menu-item-divider-margin); +`,eez=eL.default.div.withConfig({displayName:"styled__ItemContainer",componentId:"sc-44b321f5-2"})` + display: flex; + align-items: center; + padding: var(--menu-item-padding); + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + cursor: pointer; + + & .highlight { + box-shadow: 0 3px 0 0 #fff599; + } + & svg { + margin-right: var(--menu-item-gap); + transform: var(--menu-item-icon-scale); + } + & .caret { + margin-right: inherit; + margin-left: auto; + } + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,eeV=eL.default.div.withConfig({displayName:"styled__InlineShortcut",componentId:"sc-44b321f5-3"})` + display: flex; + align-items: center; + padding-right: 4px; + margin-left: auto; + ${e1.UiTypography.xxs}; + + & > span { + display: flex; + margin-left: 4px; + color: ${e=>e.theme.appColors.hex(50)}; + } +`,eeq=function(e){let{isSubtreeCompleted:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,name:"check_all"});return ev.createElement(eez,n.props,t?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_checkall"}),ev.createElement(eY.Z,{id:"general.uncheck_all",defaultMessage:"Uncheck all"})):ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_checkall"}),ev.createElement(eY.Z,{id:"general.check_all",defaultMessage:"Check all"})),ev.createElement(eeV,null,ev.createElement("span",null,eI.ModifierKeys.ModSymbol),ev.createElement("span",null,"SHIFT"),ev.createElement("span",null,"↵")))},eeW=function(e){let{isChecked:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,name:"check"});return ev.createElement(eez,n.props,t?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"general.uncheck",defaultMessage:"Uncheck"})):ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"general.check",defaultMessage:"Check"})),ev.createElement(eeV,null,ev.createElement("span",null,eI.ModifierKeys.ModSymbol),ev.createElement("span",null,"↵")))},eeH=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({stopRef:e,name:"copy_link"});return ev.createElement(eez,t.props,ev.createElement(tn.Icon,{icon:"dd_copylink"}),ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"}))},eeG=(0,eL.default)(e1.Shortcut.Combo).withConfig({displayName:"DeleteItem__StyledShortcut",componentId:"sc-45aa19bd-0"})` + margin-left: auto; +`,eeK=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({stopRef:e,name:"delete"});return ev.createElement(eez,{...t.props,$color:eI.ThemeColors.danger},ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}),ev.createElement(eeG,null,ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.Shift),ev.createElement(e1.Shortcut.Key,null,"Del")))},eeY=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({stopRef:e,name:"duplicate"});return ev.createElement(eez,t.props,ev.createElement(tn.Icon,{icon:"dd_duplicate"}),ev.createElement(eY.Z,{id:"general.duplicate",defaultMessage:"Duplicate"}),ev.createElement(eeV,null,ev.createElement("span",null,eI.ModifierKeys.ModSymbol),ev.createElement("span",null,"D")))};function eeQ(e,t){let{contents:a}=e,{nodeID:n}=t,l=li.FORMAT_TYPE_NODE,r=function(e,t){let a=e.getIn(["nodes",t,"format",li.FORMAT_TYPE_NODE]);if(null!=a)return a;let n=e.findParentNodeByID(t);if(null==n)return li.FORMAT_CHECKBOX;let l=n.format?.children;return li.CHILDREN_FORMATS.includes(l)?l:li.FORMAT_CHECKBOX}(a,n);return{formatScope:l,formatNodeId:n,formatValue:r}}let eeJ=(0,eL.default)(eez).withConfig({displayName:"MenuItem__StyledItemContainer",componentId:"sc-24aeac0f-0"})` + user-select: none; +`,eeX=function(e){let{children:t,name:a,value:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,name:a,value:n});return ev.createElement(eeJ,r.props,t)},ee0=(0,eL.default)(eI.Menu).withConfig({displayName:"FormatItem__StyledMenu",componentId:"sc-59224026-0"})` + display: flex; + flex-direction: column; + width: inherit; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + max-width: 240px; + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,ee1=(0,eL.default)(tn.Icon).attrs({icon:"dd_caret"}).withConfig({displayName:"FormatItem__CaretIcon",componentId:"sc-59224026-1"})` + margin-left: auto !important; + margin-right: -4px !important; +`,ee2=(0,e$.connect)(function(e,t){return eeQ(e,{nodeID:t.nodeId,ancestors:t.ancestors})})(function(e){let{nodeId:t,formatValue:a,formatScope:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=ev.useRef(null),d=ev.useCallback(()=>{o.expanded?s.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):i({type:"Expand",payload:"first"})},[o.expanded]),c=ev.useCallback(()=>{o.expanded?l.current?.focus():i({type:"Expand"})},[o.expanded]),m=(0,eI.useMenuItem)({stopRef:l,name:"check",onClick:d,onMouseEnter:c,submenuPopupState:o}),u=ev.useCallback(()=>{o.expanded&&s.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[o.expanded]),p=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"right-start",computeModifiersCallback:tr}),g=ev.useCallback(()=>{m.navigated&&l.current?.focus()},[m.navigated]);(0,eI.usePopupEvents)({state:o,onCollapse:g}),ev.useEffect(()=>{o.expanded&&!m.navigated&&i({type:"Collapse"})},[i,o.expanded,m.navigated]);let f=(0,e$.useDispatch)(),h=ev.useContext(eI.MenuGroupContext),y=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:a,value:l}=e.payload;"format"===a&&null!=l&&f(mZ(t,n,l)),h?.(e);break}case"Dismiss":h?.(e)}},[f,h,n,t]);return ev.createElement(ev.Fragment,null,ev.createElement(eez,{...m.props,onFocus:u},ev.createElement(tn.Icon,{icon:q7[a]}),ev.createElement(eY.Z,q8[a]),ev.createElement(ee1,null)),o.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:i},ev.createElement(eI.MenuGroupContext.Provider,{value:y},ev.createElement(ee0,{ref:s,initialFocus:p.initialFocus,isSubmenu:!0},"node"===n&&li.NODE_FORMATS.map(e=>ev.createElement(eeX,{key:e,name:"format",value:e},ev.createElement(tn.Icon,{icon:q7[e]}),ev.createElement(eY.Z,q8[e]))),"children"===n&&li.CHILDREN_FORMATS.map(e=>ev.createElement(eeX,{key:e,name:"format",value:e},ev.createElement(tn.Icon,{icon:q7[e]}),ev.createElement(eY.Z,q8[e])))))))}),ee5=(0,eL.default)(eI.Menu).withConfig({displayName:"HighlightItem__StyledMenu",componentId:"sc-665f1434-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,ee3=(0,eL.default)(tn.Icon).attrs({icon:"dd_caret"}).withConfig({displayName:"HighlightItem__CaretIcon",componentId:"sc-665f1434-1"})` + margin-left: auto !important; + margin-right: -4px !important; +`,ee4=function(e){let{nodeId:t,exit:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1}),i=ev.useRef(null),s=ev.useCallback(()=>{r.expanded?i.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):o({type:"Expand",payload:"first"})},[r.expanded]),d=ev.useCallback(()=>{r.expanded?n.current?.focus():o({type:"Expand"})},[r.expanded]),c=(0,eI.useMenuItem)({stopRef:n,name:"check",onClick:s,onMouseEnter:d,submenuPopupState:r}),m=ev.useCallback(()=>{r.expanded&&i.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[r.expanded]),u=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"right-start",computeModifiersCallback:tr}),p=ev.useCallback(()=>{c.navigated&&n.current?.focus()},[c.navigated]);return(0,eI.usePopupEvents)({state:r,onCollapse:p}),ev.useEffect(()=>{r.expanded&&!c.navigated&&o({type:"Collapse"})},[o,r.expanded,c.navigated]),ev.createElement(ev.Fragment,null,ev.createElement(eez,{...c.props,onFocus:m},ev.createElement(tn.Icon,{className:"highlight",icon:"dd_highlight"}),ev.createElement(eY.Z,{id:"general.highlight",defaultMessage:"Highlight"}),ev.createElement(ee3,null)),r.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:o},ev.createElement(ee5,{ref:i,isSubmenu:!0},ev.createElement(VM,{selectedIds:t,selectedColor:null,onSelect:a}))))},ee6=(0,e$.connect)(function(e){return{projectId:dP(e),isLoggedIn:null!=t7(e)}})(function(e){let{nodeId:t,ancestors:a,projectId:n,isLoggedIn:l,exit:r,nodeHasChildren:o,areDescendantsCompleted:i,isChecked:s}=e,d=(0,e$.useDispatch)(),c=s&&i,m=ev.useCallback(e=>{if("Activate"===e.type){let{name:l}=e.payload;switch(l){case"check":d(P0(t));break;case"check_all":d(X4(t));break;case"duplicate":d(mT(t,a));break;case"copy_link":{let e=new URL("https://www.taskade.com");e.pathname=`/d/${n}`,e.hash=`#node-${t}`,R4()(e.href)}break;case"delete":d(mM(t,a))}}r()},[a,d,r,t,n]);return ev.createElement(eI.MenuGroupContext.Provider,{value:m},ev.createElement(eeL,{onKeyDown:e=>{e.key===eI.KeyboardKeys.Escape&&r()}},ev.createElement(ee2,{nodeId:t,ancestors:a}),ev.createElement(eeB,null),ev.createElement(eeW,{isChecked:s}),o&&ev.createElement(eeq,{isSubtreeCompleted:c}),ev.createElement(eeY,null),ev.createElement(eeB,null),ev.createElement(ee4,{nodeId:t,exit:r}),ev.createElement(eeB,null),null!=n&&ev.createElement(eeZ,{documentID:n,nodeID:t,hasChild:o}),l&&ev.createElement(ev.Fragment,null,ev.createElement(eeA,{nodeID:t}),ev.createElement(eeR,{nodeID:t,documentID:n})),ev.createElement(eeH,null),ev.createElement(eeB,null),ev.createElement(eeK,null)))}),ee8=eL.default.input.withConfig({displayName:"Input__Wrapper",componentId:"sc-1f17ecc5-0"})` + border: none; + background: none; + color: ${e=>e.theme.appColors.hex(10)}; + + ${e1.UiTypography.sm}; +`,ee7=ev.forwardRef(function(e,t){let{onKeyDown:a}=e,n=ev.useRef(null);ev.useImperativeHandle(t,()=>({focus(){n.current?.focus()}}));let l=(0,eI.useMenuItem)({stopRef:n});return ev.createElement(ee8,{...e,...l.props,onKeyDown:e=>{if(0===e.currentTarget.value.length){l.props.onKeyDown(e);return}a?.(e)}})}),ee9="date",ete="assign",ett="addons",eta="upload",etn="format",etl="reaction",etr="timer",eto="action";function eti(e){return"native"in e}let ets=eL.default.div.withConfig({displayName:"GenericItem__Wrapper",componentId:"sc-e27fd5f7-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + color: ${e=>e.$color??e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,etd=function(e){let{morseChildProps:t,icon:a,color:n}=e,l=ev.useRef(null);return ev.useEffect(()=>{t.focused&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(ets,{ref:l,$active:t.focused,onClick:t.activate,$color:n},ev.createElement(tn.Icon,{icon:a}),t.label)},etc={add_task_above:"dd_add_above",add_task_below:"dd_add_below",check:"dd_check",check_all:"dd_checkall",copy_link:"dd_copylink",delete:"dd_delete",duplicate:"dd_duplicate",add_note:"dd_note"},etm=function(e){let{morseChildProps:t}=e,a=etc[t.data]??"dd_duplicate",n="delete"===t.data?eI.ThemeColors.danger:void 0;return ev.createElement(etd,{icon:a,morseChildProps:t,color:n})},etu=eL.default.div.withConfig({displayName:"AssigneeItem__Wrapper",componentId:"sc-593d05bd-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,etp=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"AssigneeItem__CheckIcon",componentId:"sc-593d05bd-1"})` + margin-left: auto; +`,etg=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]);let{user:n,isAssigned:l}=t.data;return null!=n&&"object"==typeof n&&"__typename"in n&&"User"===n.__typename?ev.createElement(etu,{ref:a,$active:t.focused,onClick:t.activate},ev.createElement(ao,{avatars_v2:n.avatars_v2,handle:n.handle,userID:n.id,size:16}),n.handle,l&&ev.createElement(etp,null)):null},etf=function(e){let{morseChildProps:t}=e,a=q7[t.data]??"dd_format_heading1";return ev.createElement(etd,{icon:a,morseChildProps:t})},eth=eL.default.div.withConfig({displayName:"ReactionItem__Wrapper",componentId:"sc-8a4af03e-0"})` + display: flex; + align-items: center; + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + line-height: 1; + + color: ${e=>e.theme.textColors.hex(10)}; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,ety=eL.default.div.withConfig({displayName:"ReactionItem__EmojiWrapper",componentId:"sc-8a4af03e-1"})` + display: flex; + width: 20px; + height: 20px; + transform: var(--menu-item-icon-scale); +`,etb=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]);let{data:n}=(0,eB.a)(TM),l=n?.me??null,r=l?.preferences?.emojiSkin??1;return ev.createElement(eth,{ref:a,$active:t.focused,onClick:t.activate},ev.createElement(ety,null,ev.createElement(go.dy,{size:18,emoji:t.data,skin:r})),t.data.name)},etv=function(e){let{morseChildProps:t}=e;return ev.createElement(etd,{icon:"dd_timer",morseChildProps:t})},etk={computer:"dd_upload",google_drive:"dd_upload_google_drive",dropbox:"dd_upload_dropbox",instagram:"dd_upload_instagram",box:"dd_upload_box"},etE=function(e){let{morseChildProps:t}=e,a=etk[t.data]??"dd_upload";return ev.createElement(etd,{icon:a,morseChildProps:t})},etx="ActionItem",et_="AssigneeItem",etw="DateItem",etN="CommentItem",etC="EmbedItem",etM="UploadItem",etS="FormatItem",etI="ReactionItem",etD="TimerItem",etT={[etx]:e=>ev.createElement(etm,{morseChildProps:e}),[et_]:e=>ev.createElement(etg,{morseChildProps:e}),[etw]:e=>ev.createElement(etd,{icon:"dd_date",morseChildProps:e}),[etN]:e=>ev.createElement(etd,{icon:"dd_comment",morseChildProps:e}),[etC]:e=>ev.createElement(etd,{icon:"dd_embed",morseChildProps:e}),[etM]:e=>ev.createElement(etE,{morseChildProps:e}),[etS]:e=>ev.createElement(etf,{morseChildProps:e}),[etI]:e=>ev.createElement(etb,{morseChildProps:e}),[etD]:e=>ev.createElement(etv,{morseChildProps:e})},et$=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__Container",componentId:"sc-e3438126-0"})` + width: 240px; + background-color: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: var(--menu-border-radius); + padding: var(--menu-padding); + overflow: clip; + + display: flex; + flex-direction: column; +`,etP=eL.default.div.withConfig({displayName:"styled__InputWrapper",componentId:"sc-e3438126-1"})` + display: flex; + align-items: center; + margin: 0.2rem 0.8rem 0.5rem; + + border-radius: 0.5rem; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: 0.25rem 0.5rem; + + transition: border-color ease-in-out 150ms; + + &:focus-within { + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,etF=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),etA=(0,e$.connect)(function(e,t){let a=iq(),n=iK(),l=a(e,{nodeID:t.nodeId}),r=l?.children.size??0,o=n(e,{nodeID:t.nodeId});return{isChecked:l?.completed??!1,attachments:iA(e,{nodeID:t.nodeId}),attributes:l?.attributes,nodeHasChildren:r>0,areDescendantsCompleted:o}}),etR=(0,ek.qC)(Vm(),etA)(function(e){let{nodeId:t,ancestors:a,reposition:n,close:l,isChecked:r,attachments:o,clearSelection:i,nodeHasChildren:s,areDescendantsCompleted:d}=e,[c,m]=ev.useState(""),u=ev.useRef(null),p=ev.useRef(null),g=(0,e$.useDispatch)(),f=ev.useCallback(function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];e&&g(mI(t,-1)),l()},[l,g,t]);ev.useLayoutEffect(()=>{i();let e=requestAnimationFrame(()=>{p?.current?.focus()});return()=>{cancelAnimationFrame(e)}},[i,p]);let h=function(e){let{isChecked:t,attachments:a,nodeHasChildren:n,areDescendantsCompleted:l}=e,r=(0,eK.Z)(),o=(0,eF.$B)("/d/:documentID"),i=o?.params.documentID,{data:s,loading:d}=(0,eB.a)(bA,null!=i?{variables:{document_id:i,projectMembersLimit:30}}:{skip:!0}),c=ev.useMemo(()=>{if(d)return[];let e=s?.document;if(null==e)return[];let t=new Map;if(null!=e.members.edges)for(let a of e.members.edges){if(null==a.node)continue;let{user:e}=a.node;t.set(e.id,e)}if(null!=e.space)for(let a of e.space.memberships){let{user:e}=a;t.set(e.id,e)}return[...t.values()]},[s?.document,d]),m=ev.useMemo(()=>{let e=r.formatMessage({id:"general.due_date",defaultMessage:"Due Date"});return{type:"section",label:e,items:[{itemType:ee9,label:r.formatMessage({id:"general.today",defaultMessage:"Today"}),values:[e,"today"],data:{start:ez.MomentHelpers.toDateTimeDesc(eG()().startOf("day"))},render:etw},{itemType:ee9,label:r.formatMessage({id:"general.date_tomorrow",defaultMessage:"Tomorrow"}),values:[e,"tomorrow"],data:{start:ez.MomentHelpers.toDateTimeDesc(eG()().startOf("day").add(1,"day"))},render:etw},{itemType:ee9,label:r.formatMessage({id:"general.date_next_week",defaultMessage:"Next week"}),values:[e,"next week"],data:{start:ez.MomentHelpers.toDateTimeDesc(eG()().startOf("day").add(1,"week"))},render:etw}]}},[r]),u=ev.useMemo(()=>{let e=a?.assignees?.attachments??[];return aR()(e,"data.assignee.id")},[a]),p=ev.useMemo(()=>{let e=r.formatMessage({id:"general.assign",defaultMessage:"Assign"});return{type:"section",label:e,items:c.map(t=>{let a=null!=u[t.id];return{itemType:ete,label:t.handle,values:[e,t.handle,t.default_name],data:{user:t,isAssigned:a},render:et_}})}},[u,r,c]),g=ev.useMemo(()=>{let e=r.formatMessage({id:"general.addons",defaultMessage:"Addons"});return{type:"section",label:e,items:[{itemType:ett,label:"Comment",values:[e,"comment"],data:"comment",render:etN},{itemType:ett,label:"Embed",values:[e,"embed"],data:"embed",render:etC}]}},[r]),f=ev.useMemo(()=>{let e=r.formatMessage({id:"general.upload",defaultMessage:"Upload"});return{type:"section",label:e,items:[{itemType:eta,label:"Computer",values:[e,"computer"],data:"computer",render:etM},{itemType:eta,label:"Google Drive",values:[e,"google drive"],data:"google_drive",render:etM},{itemType:eta,label:"Dropbox",values:[e,"dropbox"],data:"dropbox",render:etM},{itemType:eta,label:"Instagram",values:[e,"instagram"],data:"instagram",render:etM},{itemType:eta,label:"Box",values:[e,"box"],data:"box",render:etM}]}},[r]),h=ev.useMemo(()=>{let e=r.formatMessage({id:"general.turn_to",defaultMessage:"Turn To"});return{type:"section",label:e,items:li.NODE_FORMATS.map(t=>({itemType:etn,label:r.formatMessage(q8[t]),values:[e,r.formatMessage(q8[t])],data:t,render:etS}))}},[r]),y=ev.useMemo(()=>{let e=r.formatMessage({id:"general.actions",defaultMessage:"Actions"}),a=[{itemType:eto,label:r.formatMessage({id:"general.add_task_above",defaultMessage:"Add task above"}),values:[e,r.formatMessage({id:"general.add_task_above",defaultMessage:"Add task above"})],data:"add_task_above",render:etx},{itemType:eto,label:r.formatMessage({id:"general.add_task_below",defaultMessage:"Add task below"}),values:[e,r.formatMessage({id:"general.add_task_below",defaultMessage:"Add task below"})],data:"add_task_below",render:etx},{itemType:eto,label:r.formatMessage({id:"general.copylink",defaultMessage:"Copy link"}),values:[e,r.formatMessage({id:"general.copylink",defaultMessage:"Copy link"})],data:"copy_link",render:etx},{itemType:eto,label:t?r.formatMessage({id:"general.uncheck",defaultMessage:"Uncheck"}):r.formatMessage({id:"general.check",defaultMessage:"Check"}),values:[e,t?r.formatMessage({id:"general.uncheck",defaultMessage:"Uncheck"}):r.formatMessage({id:"general.check",defaultMessage:"Check"})],data:"check",render:etx},{itemType:eto,label:r.formatMessage({id:"general.add_note",defaultMessage:"Add note"}),values:[e,r.formatMessage({id:"general.add_note",defaultMessage:"Add note"})],data:"add_note",render:etx},{itemType:eto,label:r.formatMessage({id:"general.delete",defaultMessage:"Delete"}),values:[e,r.formatMessage({id:"general.delete",defaultMessage:"Delete"})],data:"delete",render:etx}];if(n){let n=t&&l;a.push({itemType:eto,label:n?r.formatMessage({id:"general.uncheck_all",defaultMessage:"Uncheck all"}):r.formatMessage({id:"general.check_all",defaultMessage:"Check all"}),values:[e,n?r.formatMessage({id:"general.uncheck_all",defaultMessage:"Uncheck all"}):r.formatMessage({id:"general.check_all",defaultMessage:"Check all"})],data:"check_all",render:etx})}return{type:"section",label:e,items:a}},[l,r,t,n]),b=ev.useMemo(()=>{let e=r.formatMessage({id:"general.timer",defaultMessage:"Timer"});return{type:"section",label:e,items:[{itemType:etr,label:r.formatMessage({id:"general.timer_15_minutes",defaultMessage:"15 minutes"}),data:"PT15M",values:[e,r.formatMessage({id:"general.timer_15_minutes",defaultMessage:"15 minutes"})],render:etD},{itemType:etr,label:r.formatMessage({id:"general.timer_25_minutes",defaultMessage:"25 minutes"}),values:[e,r.formatMessage({id:"general.timer_25_minutes",defaultMessage:"25 minutes"})],data:"PT25M",render:etD},{itemType:etr,label:r.formatMessage({id:"general.timer_30_minutes",defaultMessage:"30 minutes"}),values:[e,r.formatMessage({id:"general.timer_30_minutes",defaultMessage:"30 minutes"})],data:"PT30M",render:etD},{itemType:etr,label:r.formatMessage({id:"general.timer_1_hour",defaultMessage:"1 hour"}),values:[e,r.formatMessage({id:"general.timer_1_hour",defaultMessage:"1 hour"})],data:"PT1H",render:etD},{itemType:etr,label:r.formatMessage({id:"general.timer_2_hours",defaultMessage:"2 hours"}),values:[e,r.formatMessage({id:"general.timer_2_hours",defaultMessage:"2 hours"})],data:"PT2H",render:etD}]}},[r]);return ev.useMemo(()=>[m,p,g,f,h,b,y],[y,g,p,m,h,b,f])}({isChecked:r,attachments:o,nodeHasChildren:s,areDescendantsCompleted:d}),y=function(e,t){let a=(0,eF.$B)("/d/:documentID"),n=a?.params.documentID,{data:l}=(0,eB.a)(TM),r=l?.me??null,o=(0,e$.useDispatch)(),i=gV(),[s]=(0,cs.D)(qO),[d]=(0,cs.D)(qU),c=ev.useCallback(()=>{o(rh({isOpen:!0,activeView:rI,enableCopyList:void 0}))},[o]),m=Fp(n),{setDueDate:u}=FS(n??null);return ev.useCallback(a=>{if(null==n){o(Fd()),t();return}switch(a.itemType){case ee9:if(null==r){c();return}u([e],a.data);break;case ete:if(null==r){c();return}m([e],a.data.user.id);break;case ett:if(null==r){c();return}switch(a.data){case"comment":o(qx(e));break;case"embed":o(q_(e))}break;case etl:{if(null==r){c();return}let t=a.data.id,l=a.data.skin;d({variables:{input:{projectId:n,nodeIds:[e],clientMutationId:(0,ld.Z)(),emojiName:t,emojiSkin:l}}});break}case etn:{let t=a.data;o(mZ(e,li.FORMAT_TYPE_NODE,t));break}case eta:o(qE(e,i));break;case eto:switch(a.data){case"duplicate":o(mT(e));break;case"add_task_above":o(qk(e,void 0,!0));break;case"add_task_below":o(qk(e));break;case"copy_link":{let t=new URL("https://www.taskade.com");t.pathname=`/d/${n}`,t.hash=`#node-${e}`,R4()(t.href)}break;case"check":o(P0(e));break;case"check_all":o(mA(e));break;case"add_note":o(mJ(e)),t(!1);return;case"delete":o(mM(e))}break;case etr:if(null==r){c();return}s({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:n,nodeIds:[e],operation:"quick_start",duration:a.data}}})}t()},[n,t,o,r,u,e,c,m,d,i,s])}(t,f),b=function(){let e=(0,eK.Z)();return ev.useCallback(async t=>{let a=[],n=(0,qZ.extractFromText)(t,eG()());if(null!=n){let t=ez.DateDuration.fromDateRangeDesc({start:n.start}).toReadableFormat();a.push({type:"section",label:e.formatMessage({id:"general.date_suggestion",defaultMessage:"Date Suggestion"}),items:[{itemType:ee9,label:t,data:n,render:etw,values:[t]}]})}let l=go.bj.search(t);return null!=l&&l.length>0&&a.push({type:"section",label:e.formatMessage({id:"general.reaction",defaultMessage:"Reaction"}),items:l.filter(eti).slice(0,3).map(e=>({itemType:etl,label:e.native,data:e,render:etI,values:[e.name]}))}),a},[e])}();return ev.createElement(et$,null,ev.createElement(etP,{onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u.current?.focusPrevItem?.();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u.current?.focusNextItem?.();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:f();break;case"a":e.metaKey&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())}}},ev.createElement(ee7,{ref:p,type:"text",placeholder:"Search",value:c,onChange:e=>{m(e.target.value),n()}})),0===c.length?ev.createElement(ee6,{nodeId:t,ancestors:a,exit:f,isChecked:r,nodeHasChildren:s,areDescendantsCompleted:d}):ev.createElement(tT,{ref:u,term:c,data:h,renderMap:etT,search:etF,onActivate:y,generate:b}),ev.createElement(ees,{attributes:e.attributes}))}),etj="application/vnd.taskade.actionsheet-column",etO=eL.default.span.withConfig({displayName:"NodeDragHandle__Container",componentId:"sc-eab8cbef-0"})` + height: ${24}px; + display: flex; + align-items: center; + ${e=>e.$nodeFormat!==li.FORMAT_HEADING1&&e.$nodeFormat!==li.FORMAT_HEADING2||e.$hasChild?e.$hasChild?void 0:(0,eL.css)` + margin-left: 19.5px; + margin-right: 9px; + `:(0,eL.css)` + margin-left: 19.5px; + margin-right: 12px; + `}} + ${e=>(e.$nodeFormat===li.FORMAT_HEADING1||e.$nodeFormat===li.FORMAT_HEADING2)&&(0,eL.css)` + margin-top: 3px; + `} + &:hover { + cursor: pointer; + } +`,etU=eL.default.span.withConfig({displayName:"NodeDragHandle__TooltipText",componentId:"sc-eab8cbef-1"})` + color: #cccccc; +`,etZ=eL.default.span.withConfig({displayName:"NodeDragHandle__Highlight",componentId:"sc-eab8cbef-2"})` + font-weight: 700; + color: #ffffff; +`,etL=(0,eL.default)(tn.Icon).attrs({icon:"default_grip"}).withConfig({displayName:"NodeDragHandle__IconDrag",componentId:"sc-eab8cbef-3"})` + fill: ${e=>e.theme.textColors.hex(70)}; + + &:hover { + fill: ${e=>e.theme.textColors.hex(10)}; + } +`,etB=(0,eL.default)(function(e){let{className:t,nodeId:a,ancestors:n,readOnly:l,nodeFormat:r,hasChild:o}=e,[i,s]=ev.useState(!1),d=ev.useRef(null),c=ev.useRef(null),m=ev.useRef(null),{referenceProps:u,arrowProps:p,popperProps:g}=(0,eI.useControlledTooltip)({referenceElementRef:d,popperElementRef:m,arrowElementRef:c,visible:i,placement:"top"}),f=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s(!1)},[]),h=ev.useCallback(()=>{s(!0)},[]),y=ev.useCallback(()=>{s(!1)},[]),[b,v]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),k=(0,eI.useMenuButton)({ref:d,state:b,dispatch:v,onClick:e=>{l&&e.preventDefault()}}),E=ev.useRef(null),x=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:E,state:b,placement:"right"}),_=ev.useCallback(()=>{x.popper.instanceRef.current?.update()},[x.popper.instanceRef]),w=ev.useCallback(()=>{v({type:"Collapse"})},[]);return ev.createElement(ev.Fragment,null,ev.createElement(etO,{...u,...k.props,draggable:!0,"data-node-id":a,"data-drag-handle":!0,className:og()(t,"node-drag-handle"),onMouseDown:f,onMouseEnter:h,onMouseLeave:y,$nodeFormat:r,$hasChild:o},ev.createElement(etL,null)),i&&ev.createElement(eI.Tooltip,{arrowProps:p,popperProps:g},l?ev.createElement(eY.Z,{id:"general.drag_hint",defaultMessage:"Drag to move"}):ev.createElement(etU,null,ev.createElement(eY.Z,{id:"general.drag_menu_hint",defaultMessage:"Drag to move {br} Click to open",values:{highlight:e=>ev.createElement(etZ,null,e),br:ev.createElement("br",null)}}))),b.expanded&&ev.createElement(eI.Popup,{dispatch:v,...x.props,modal:!0},ev.createElement(etR,{initialFocus:x.initialFocus,nodeId:a,ancestors:n,reposition:_,close:w})))}).withConfig({displayName:"styled__StyledNodeDragHandle",componentId:"sc-a4b4e289-0"})` + opacity: 0; + pointer-events: none; +`,etz=eL.default.th.withConfig({displayName:"styled__TableRowHeader",componentId:"sc-a4b4e289-1"})` + ${X8}; + border-right-width: 1px; + border-top-width: 1px; + border-left-width: 1px; + border-bottom-width: ${e=>e.$showBottomBorder?"1px":"0"}; + padding-left: 0; + font-weight: normal; + + position: sticky; + left: 0; + background: ${e=>e.theme.appColors.hex(80)}; + + z-index: 1; +`,etV=eL.default.td.withConfig({displayName:"styled__DropIndicatorTableData",componentId:"sc-a4b4e289-2"})` + position: relative; + padding: 0; +`,etq=eL.default.tr.withConfig({displayName:"styled__Container",componentId:"sc-a4b4e289-3"})` + min-height: ${24}px; + position: relative; + ${X7}; + + ${e=>e.$isDragging&&"pointer-events: none;"} + + &:first-child { + ${etz} { + border-top-width: 0; + } + } + + &:hover { + ${etB} { + opacity: 1; + pointer-events: all; + } + } + + ${e=>e.$shouldResetNodeCounter&&(0,eL.css)` + counter-reset: ${e.$nodeCounterName}; + `} + + &:focus-within { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + ${e=>e.$isHashHighlighted&&(0,eL.css)` + &:after { + display: flex; + content: ' '; + width: calc(100% - 22px); + height: 100%; + position: absolute; + z-index: 2; + left: 0; + top: 0; + pointer-events: none; + background-color: ${e.theme.primaryColorScheme?.alpha5}; + outline: 2px solid ${e.theme.primaryColorScheme?.alpha50}; + } + `} +`,etW=(0,eL.default)(RV.ML).withConfig({displayName:"styled__StyledEditor",componentId:"sc-a4b4e289-4"})` + flex-grow: 1; + text-align: left; + + ${RK}; + + ${e=>e.$isCompleted&&(0,eL.css)` + text-decoration: line-through; + color: ${e.theme.isNightMode?"#666":"#bfbfbf"}; + + .mention, + .hashtag { + color: ${e.theme.isNightMode?"#666":"#bfbfbf"}; + + &:hover { + color: ${e.theme.primaryColorScheme?.base}; + } + } + + .anchor { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + + &:hover { + color: ${e.theme.primaryColorScheme?.base}; + } + } + `} +`,etH=eL.default.div.withConfig({displayName:"styled__NodeContainer",componentId:"sc-a4b4e289-5"})` + display: flex; + padding-left: ${e=>30*e.$indentationCount}px; +`,etG=eL.default.div.withConfig({displayName:"styled__EditorWrapper",componentId:"sc-a4b4e289-6"})` + display: flex; + width: 100%; + word-wrap: break-word; + word-break: break-word; + + ${e=>e.$showSelectBackground&&(0,eL.css)` + background: ${e.theme.primaryColorScheme?.alpha5}; + `}; +`;eL.default.div.withConfig({displayName:"styled__NoteAddonWrapper",componentId:"sc-a4b4e289-7"})` + ${RY}; +`;let etK=eL.default.div.withConfig({displayName:"styled__NodeFolderContainer",componentId:"sc-a4b4e289-8"})` + display: flex; + align-items: center; + + width: 23px; + height: ${24}px; + margin-right: 8px; + color: ${e=>e.theme.appColors.hex(50)}; + + ${e=>(e.$nodeFormat===li.FORMAT_HEADING1||e.$nodeFormat===li.FORMAT_HEADING2)&&(0,eL.css)` + margin-top: 3px; + margin-right: 11px; + `} + + &:hover { + cursor: pointer; + } +`,etY=eL.default.td.withConfig({displayName:"styled__Column",componentId:"sc-a4b4e289-9"})` + ${X8}; + + height: 100%; + + vertical-align: top; + + border-right-width: 1px; + border-top-width: 1px; + border-bottom-width: ${e=>e.$showBottomBorder?"1px":"0"}; + + &:last-child { + border-right-width: 1px; + } +`,etQ=(0,eL.css)` + ${e=>e.$isAddonEmpty&&(0,eL.css)` + opacity: 0; + + &:hover { + opacity: 1; + } + `} +`,etJ=(0,eL.css)` + ${e=>e.$readOnly&&e.$isAddonEmpty&&(0,eL.css)` + &:hover { + opacity: 0; + } + + & > * { + pointer-events: none; + } + `} +`,etX=eL.default.div.withConfig({displayName:"AssigneeAddon__Wrapper",componentId:"sc-5a373ca0-0"})` + display: flex; + + height: 100%; + + & > div > button { + margin: 0; + } + + ${etQ}; + ${etJ}; +`,et0=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.nodeId});return{assignmentsState:a?.assignees,projectId:dP(e)??null}})(function(e){let{assignmentsState:t,projectId:a,nodeId:n,node:l,readOnly:r}=e,[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=null==t||0===t.total;return ev.createElement(etX,{$isAddonEmpty:s,$readOnly:r},ev.createElement(FM,{assignees:t,documentID:a,nodeID:n,popupState:o,popupDispatch:i,nodeCompleted:l.completed,readOnly:r}))}),et1=eL.default.button.withConfig({displayName:"NodeCommentButton__AddonButton",componentId:"sc-a5e4d919-0"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + &:hover { + color: ${e.theme.appColors.hex(10)}; + border-color: ${e.theme.appColors.hex(60)}; + } + `} +`,et2=(0,eL.default)(tn.Icon).attrs({icon:"addon_comment"}).withConfig({displayName:"NodeCommentButton__CommentIcon",componentId:"sc-a5e4d919-1"})` + ${e=>e.$nodeCompleted&&(0,eL.css)``} +`,et5=eL.default.span.withConfig({displayName:"NodeCommentButton__CommentCount",componentId:"sc-a5e4d919-2"})` + ${e=>e.$nodeCompleted&&(0,eL.css)``} + + margin-left: 5px; + ${e1.UiTypography.xs}; +`,et3=function(e){let{className:t,documentID:a,nodeID:n,numberOfComments:l,nodeCompleted:r}=e,o=e.readOnly??!1,i=(0,e$.useDispatch)(),s=ev.useContext(jz).commentsMode===j.DISABLED,d=ev.useRef(null),c=ev.useRef(null),m=ev.useRef(null),[u,p]=ev.useState(!1),{arrowProps:g,popperProps:f,referenceProps:h}=(0,eI.useControlledTooltip)({referenceElementRef:d,arrowElementRef:c,popperElementRef:m,placement:"top",visible:u}),y=ev.useMemo(()=>{if(!o)return()=>{p(!0)}},[o]),b=ev.useMemo(()=>{if(!o)return()=>{p(!1)}},[o]),v=ev.useCallback(()=>{s||(null==a?i(Fd()):i($L({documentID:a,nodeID:n})))},[i,a,s,n]);return ev.createElement(et1,{...h,type:"button",className:t,onClick:v,onMouseEnter:y,onMouseLeave:b,$nodeCompleted:r},u&&ev.createElement(eI.Tooltip,{arrowProps:g,popperProps:f},s?ev.createElement(eY.Z,{id:"general.comment_disabled",defaultMessage:"Comment (Disabled)"}):ev.createElement(eY.Z,{id:"general.add_comments",defaultMessage:"Add Comments"})),ev.createElement(et2,{$nodeCompleted:r}),l>0&&ev.createElement(et5,{$nodeCompleted:r},l))},et4=eL.default.div.withConfig({displayName:"CommentAddon__Wrapper",componentId:"sc-2757c727-0"})` + display: flex; + + & > button { + margin: 0; + } + + ${etQ}; +`,et6=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.nodeId});return{commentCount:a?.comments?.total??0,projectId:dP(e)??null}})(function(e){let{projectId:t,nodeId:a,commentCount:n,node:l}=e;return ev.createElement(et4,{$isAddonEmpty:0===n},ev.createElement(et3,{documentID:t,nodeID:a,numberOfComments:n,nodeCompleted:l.completed}))}),et8=eL.default.div.withConfig({displayName:"DueDateAddon__Wrapper",componentId:"sc-5fcc06e8-0"})` + display: flex; + + & > div > button { + margin: 0; + } + + ${etQ}; + ${etJ}; +`,et7=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.nodeId});return{dateAttachmentsState:a?.dates,projectId:dP(e)??null}})(function(e){let{dateAttachmentsState:t,projectId:a,nodeId:n,node:l,readOnly:r}=e,[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=null==t||0===t.total;return ev.createElement(et8,{$isAddonEmpty:s,$readOnly:r},ev.createElement(RM,{projectId:a,nodeId:n,popupState:o,popupDispatch:i,dateAttachment:t?.attachments?.[0],nodeCompleted:l.completed,readOnly:r}))});var et9=a(39138),eae=a.n(et9);let eat=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-7b472f8-0"})` + height: 20px; + width: 20px; + padding-right: 5px; +`,eaa=function(e){let{embedType:t}=e;switch(t){case"figma":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.nq,null));case"invision":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.Sn,null));case"loom":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.jA,null));case"soundcloud":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.cL,null));case"typeform":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.e6,null));case"vimeo":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.aO,null));case"whimsical":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.HS,null));case"wistia":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.ix,null));case"youtube":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.Hj,null));case"other":return ev.createElement("span",{className:"embed-badge"},ev.createElement(lT.Pb,null));default:return null}},ean=eL.default.div.withConfig({displayName:"EmbedImage__CenterCropWrapper",componentId:"sc-4678f924-0"})` + align-items: center; + display: flex; + justify-content: center; + height: 160px; +`,eal=eL.default.div.withConfig({displayName:"EmbedImage__TypeFormWrapper",componentId:"sc-4678f924-1"})` + height: 160px; +`,ear=eL.default.img.withConfig({displayName:"EmbedImage__StyledImage",componentId:"sc-4678f924-2"})` + max-height: 160px; + width: auto; +`,eao=new Set(["figma","invision","loom","typeform","whimsical","other"]),eai=function(e){let{embedType:t,onClick:a,title:n,url:l}=e,r=e.imageUrl;null==r&&(r="/images/no-embed.png");let o=e.embedType;switch(eao.has(t)||Zo.Z.canPlay(l??"")||(o="cantplay"),o){case"typeform":return ev.createElement(eal,null,ev.createElement(ear,{alt:n,onClick:a,title:n,src:r}));case"cantplay":case"other":return ev.createElement("a",{href:l,target:"_blank",rel:"noopener noreferrer"},ev.createElement(ean,null,ev.createElement(ear,{alt:n,title:n,src:r})));default:return ev.createElement(ean,null,ev.createElement(ear,{alt:n,onClick:a,title:n,src:r}))}},eas=function(e){let t=(0,eK.Z)(),{attachment:a,index:n,onDelete:l,onSelect:r,readOnly:o,currentUserId:i}=e,[s,d]=ev.useState(!1),c=ev.useRef(null),m=ev.useRef(null),u=ev.useRef(null),{arrowProps:p,popperProps:g,referenceProps:f}=(0,eI.useControlledTooltip)({referenceElementRef:c,arrowElementRef:m,popperElementRef:u,placement:"bottom",visible:s}),h=a.data.embed.data.url,y=(0,wo.a)(["embed",h],async()=>{let e=encodeURIComponent(h),t=await fetch(`/web-api/embed?url=${e}`,{credentials:"same-origin",method:"GET",headers:{"X-Anonymous-ID":u$?.getAnonymousId()??void 0,"X-Requested-With":"XMLHttpRequest"}});if(!t.ok)throw Error("Network response was not ok");return await t.json()},{enabled:!1,retry:!1,cacheTime:864e5,staleTime:864e5});ev.useEffect(()=>{y.refetch()},[]);let b=ev.useCallback(e=>{e.preventDefault(),confirm("Are you sure you want to delete this attachment?")&&l(a)},[a,l]),v=ev.useCallback(e=>{e.preventDefault(),r({...a,other:y.data},n)},[a,n,r,y.data]),k=ev.useCallback(()=>{d(!0)},[d]),E=ev.useCallback(()=>{d(!1)},[d]),x=a.data.embed.type;if(y.isLoading)return ev.createElement("div",{className:"attachment-upload"},!o&&null!=i&&ev.createElement("div",{className:"file-actions absolute right-2 top-2 flex gap-1"},ev.createElement("button",{className:"flex items-center justify-center rounded-full bg-appcolor-0 p-2 text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-0/80 hover:text-danger",onClick:b},ev.createElement(tn.Icon,{icon:"dd_delete",className:"scale-90"}))),ev.createElement(eI.Spinner,{delay:0,height:160,width:160,marginBottom:0}));if(y.isError)return ev.createElement("div",{className:"attachment-item",...f,onMouseEnter:k,onMouseLeave:E},ev.createElement("div",{className:"file-actions absolute right-2 top-2 flex gap-1"},ev.createElement("button",{className:"flex items-center justify-center rounded-full bg-appcolor-0 p-2 text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-0/80",title:t.formatMessage({id:"general.error_loading_image_please_tap_retry",defaultMessage:"Error loading image, please tap retry"}),onClick:()=>{y.refetch()}},ev.createElement(tn.Icon,{icon:"dd_sync",className:"scale-90"})),!o&&null!=i&&ev.createElement("button",{className:"flex items-center justify-center rounded-full bg-appcolor-0 p-2 text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-0/80 hover:text-danger",onClick:b},ev.createElement(tn.Icon,{icon:"dd_delete",className:"scale-90"}))),ev.createElement(eai,{embedType:x,title:"",imageUrl:"/images/no-embed.png",onClick:v,url:h}),s&&ev.createElement(eI.Tooltip,{arrowProps:p,popperProps:g},ev.createElement(eat,{icon:"link"}),eae()(h,{length:50})));let _=y.data?.ogTags?.ogTitle,w=y.data?.ogTags?.ogImage?.url,N=null==_||0===_.length,C=N?h:_,M=eae()(C,{length:50});return ev.createElement("div",{className:"attachment-item",...f,onMouseEnter:k,onMouseLeave:E},!o&&null!=i&&ev.createElement("div",{className:"file-actions absolute right-2 top-2 flex gap-1"},ev.createElement("button",{className:"flex items-center justify-center rounded-full bg-appcolor-0 p-2 text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-0/80 hover:text-danger",onClick:b},ev.createElement(tn.Icon,{icon:"dd_delete",className:"scale-90"}))),ev.createElement(eai,{embedType:x,imageUrl:w,onClick:v,url:h}),ev.createElement("div",{className:"details"},ev.createElement(eaa,{embedType:x}),null!=_&&ev.createElement("span",{className:"filename"},ev.createElement("span",null,_))),s&&ev.createElement(eI.Tooltip,{arrowProps:p,popperProps:g},N&&ev.createElement(eat,{icon:"link"}),M))},ead=function(e){let{attachment:t,onClick:a}=e,n=t.data.url.download,l=t.data.url.preview,r=t.data.file.filename,o=(0,sX.extractFileExtension)(n),i=Zi.has(o),s=Zd.has(o),d=i?a:void 0;if(s&&null!=n){let e=Zd.get(o)??void 0;return ev.createElement("video",{preload:"metadata",onClick:d,width:160,height:160},ev.createElement("source",{src:n,type:e}),ev.createElement("img",{src:l}))}return null!=n?ev.createElement("a",{href:n,rel:"noopener noreferrer",target:"_blank",style:{color:"#FFF"}},ev.createElement("img",{alt:r,title:r,src:l,onClick:d,width:160,height:160})):ev.createElement("img",{alt:r,title:r,src:l,onClick:a,width:160,height:160})},eac=function(e){let{documentId:t,attachment:a,hasDeletePermission:n,index:l,currentUserId:r,onDelete:o,onSelect:i}=e,s=a.data.file.filename??$k(a.data.file),d=a.data.file.extension,c=null!=t&&Zc.has(d),m=n&&null!=r,u=ev.useMemo(()=>{if(m)return e=>{e.preventDefault(),confirm("Are you sure you want to delete this attachment?")&&o?.(a)}},[a,m,o]),p=ev.useCallback(e=>{e.preventDefault(),i?.(a,l)},[a,l,i]),g=(0,e$.useDispatch)(),f=ev.useCallback(e=>{if(null!=t){if(null==r){g(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!1}));return}g(Pw.actions.toggleEditorMediaAiDialog({documentId:t,attachment:a})),e.stopPropagation()}},[a,g,t,r]);return ev.createElement("div",{className:"attachment-item"},ev.createElement("div",{className:"file-actions absolute right-2 top-2 flex gap-1"},c&&ev.createElement("button",{className:"whitespace-nowrap rounded-full border border-solid border-appcolor-300 bg-appcolor-0 px-3 py-2 text-sm font-medium transition duration-150 ease-in-out hover:bg-appcolor-0/80",onClick:f},ev.createElement(tn.Icon,{className:"-mt-1 mr-2 scale-90 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ask_ai",defaultMessage:"Ask AI"}))),null!=u&&ev.createElement("button",{className:"flex items-center justify-center rounded-full bg-appcolor-0 p-2 text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-0/80 hover:text-danger",onClick:u},ev.createElement(tn.Icon,{icon:"dd_delete",className:"scale-90"}))),ev.createElement(ead,{attachment:a,onClick:p}),ev.createElement("div",{className:"details"},ev.createElement("span",{className:"extension-badge"},d),ev.createElement("span",{className:"filename"},ev.createElement("span",null,s))))},eam=function(){return ev.createElement("div",{className:"attachment-upload"},ev.createElement(eI.Spinner,{delay:0,height:160,width:160,marginBottom:0}))},eau=function(e){let{hasFileDeletePermission:t,currentUserId:a,media:n,onDelete:l,onSelect:r,readOnly:o}=e;return ev.createElement("div",{className:"attachment-items-wrapper"},ev.createElement("div",null,n.map((n,i)=>"uploadID"in n?ev.createElement(eam,{key:`media-preview-${n.uploadID}`,attachment:n}):"data"in n&&"file"===n.data.type?ev.createElement(eac,{key:`media-preview-${n.id}`,documentId:e.documentId,hasDeletePermission:t,index:i,attachment:n,currentUserId:a,onDelete:l,onSelect:r}):"data"in n&&"embed"===n.data.type?ev.createElement(eas,{key:`media-preview-${n.id}`,attachment:n,currentUserId:a,index:i,onSelect:r,onDelete:l,readOnly:o}):null)))};function eap(e,t){return(a,n)=>{let l=n(),r=t7(l),o=dV(l);null!=r&&null!=o&&!("uploadID"in t)&&a(mB(o.id,{id:t.id,type:t.data.type,nodeID:e}))}}let eag=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-f13107d2-0"})` + width: 100%; + + position: relative; + + flex: 1 1 auto; + + display: flex; + flex-direction: column; + + ${e=>"banner"===e.$coverImage&&(0,eL.css)` + overflow-y: scroll; + `} + + ${e=>"background"===e.$coverImage&&(0,eL.css)` + overflow-y: scroll; + + .cover-image { + position: fixed; + height: 100%; + } + `} + + & > .nodes-wrapper { + display: flex; + flex-direction: column; + } +`,eaf=eL.default.div.withConfig({displayName:"styled__ProjectContainer",componentId:"sc-f13107d2-1"})` + display: flex; + flex-direction: column; + position: relative; + row-gap: 20px; + + padding: 30px 96px 60px; + + ${e=>"banner"===e.$coverImage&&(0,eL.css)` + height: 100%; + `} + + ${e=>"background"===e.$coverImage&&(0,eL.css)` + background: ${e.theme.isNightMode?"rgba(23,25,28, 0.98)":"rgba(255,255,255,0.98)"}; + margin: 30px 20px; + border-radius: 20px; + `} +`,eah=eL.default.div.withConfig({displayName:"styled__ToolbarContainer",componentId:"sc-f13107d2-2"})` + position: fixed; + left: 0; + bottom: 0; + width: 100%; + justify-content: center; + pointer-events: none; + z-index: 10; + margin-bottom: 40px; + + display: flex; + align-items: center; + + @media print { + display: none; + } +`,eay=eL.default.div.withConfig({displayName:"styled__PopupBody",componentId:"sc-f13107d2-3"})` + position: relative; + + ${e1.UiBorderRadius.lg}; + + min-width: var(--menu-min-width); + + max-width: ${eI.UiSpacing.getPx(96)}; + + display: flex; + flex-direction: column; + row-gap: ${eI.UiSpacing.getPx(3)}; + + background: ${e=>e.theme.appColors.hex(100)}; + padding: ${eI.UiSpacing.getPx(3.5)} 0; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eab=e=>{for(let t of e.dataTransfer.types)if("Files"===t)return t;return null},eav=eL.default.span.withConfig({displayName:"styled__EmptyState",componentId:"sc-b34f0213-0"})` + ${e1.UiTypography.xs}; + + min-height: ${24}px; + line-height: ${24}px; + + color: ${e=>e.theme.textColors.hex(40)}; + user-select: none; + text-overflow: ellipsis; + white-space: nowrap; +`,eak=eL.default.div.withConfig({displayName:"styled__Counter",componentId:"sc-b34f0213-1"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(1)}; + height: ${24}px; + overflow: hidden; + + ${e1.UiTypography.xs}; + + user-select: none; + color: ${e=>e.theme.textColors.hex(40)}; +`,eaE=(0,eL.css)` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(40)}; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + + &:hover, + &[aria-expanded='true'] { + border-color: ${e=>e.theme.primaryColorScheme?.base}; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + } +`,eax=eL.default.div.withConfig({displayName:"styled__AddButtonContainer",componentId:"sc-b34f0213-2"})` + width: ${24}px; + height: ${24}px; + + flex-shrink: 0; + margin-left: auto; + + display: flex; + align-items: center; + justify-items: center; +`,ea_=eL.default.button.attrs({type:"button"}).withConfig({displayName:"styled__AddButton",componentId:"sc-b34f0213-3"})` + ${eaE}; + border-radius: 100%; + + display: flex; + align-items: center; + justify-content: center; + + width: 20px; + height: 20px; + + padding: ${eI.UiSpacing.getPx(1)} 0; +`,eaw=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-b34f0213-4"})` + height: 100%; + + position: relative; + display: flex; + align-items: start; + column-gap: ${eI.UiSpacing.getPx(2)}; + + ${eav}, ${ea_}:not([aria-expanded='true']) { + visibility: collapse; + } + + &:hover { + ${eav}, ${ea_} { + visibility: visible; + } + } +`,eaN=eL.default.div.withConfig({displayName:"styled__PopupHeader",componentId:"sc-b34f0213-5"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(2)}; + + margin: 0 ${eI.UiSpacing.getPx(3.5)}; +`,eaC=eL.default.button.attrs({type:"button"}).withConfig({displayName:"styled__PopupAddButton",componentId:"sc-b34f0213-6"})` + ${eaE}; + ${e1.UiBorderRadius.md}; + ${e1.UiTypography.sm}; + + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(1)}; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(2)}; +`,eaM=(0,eL.default)(G1).withConfig({displayName:"styled__PopupAddonWrapper",componentId:"sc-b34f0213-7"})` + margin: 0 ${eI.UiSpacing.getPx(3.5)}; + max-height: ${eI.UiSpacing.getPx(96)}; + width: unset; + + overflow-y: scroll; + ${tM}; +`,eaS=eL.default.div.withConfig({displayName:"styled__Dropzone",componentId:"sc-b34f0213-8"})` + position: absolute; + pointer-events: none; + top: 0; + left: 0; + right: 0; + bottom: 0; + + ${e1.UiBorderRadius.md}; + + display: flex; + align-items: center; + justify-content: center; + + &:after { + ${e1.UiTypography.xs}; + ${e1.UiBorderRadius.md}; + + display: flex; + align-items: center; + justify-content: center; + content: 'Drop files here'; + color: ${e=>e.theme.textColors.hex(10)}; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: ${e=>e.theme.isNightMode?"rgba(29, 31, 34, 0.9)":"rgba(247, 247, 247, 0.9)"}; + color: ${e=>e.theme.appColors.hex(10)}; + ${O$}; + } +`,eaI=(0,e$.connect)(function(e){let t=t7(e)??null;return{isFileDeleteAllowed:function(e){let t=e.meta.id;if(null==t)return!1;let a=e.entities.documents.entities[t];return null!=a&&lm({role:a.role,action:{project:"delete_file"}})}(e),currentUserId:t?.id??null}})(function(e){let{mediaAttachmentsState:t,nodeId:a,readOnly:n,isFileDeleteAllowed:l,currentUserId:r,reposition:o,projectId:i}=e,s=(0,e$.useDispatch)(),d=gV(),c=(0,eK.Z)(),m=ev.useMemo(()=>{let e=t?.attachments??[],a=t?.uploadingAttachments??[],n=uz()(a,12),l=uz()(e,12-n.length);return[...n,...l]},[t]),u=ev.useCallback(e=>{s(eap(a,e))},[s,a]),p=ev.useCallback((e,t)=>{s(Z$.actions.toggleMediaDialog({media:m,index:t}))},[s,m]),g=XE({canDrop:eab,onDrop:ev.useCallback((e,t)=>{null!=t.dropType&&(s(Xh({dropType:t.dropType,nodeId:a,position:"afterbegin",rect:{left:0,right:0,top:0,bottom:0}},e.dataTransfer,c)),o())},[s,c,a,o])}),f=g.state.counter>0;return ev.createElement(eay,g.props,ev.createElement(eaN,null,!n&&ev.createElement(ev.Fragment,null,ev.createElement(eaC,{onClick:()=>{s(qE(a,d))}},ev.createElement(tn.Icon,{icon:"addon_upload",width:16,height:16}),ev.createElement(eY.Z,{id:"general.upload_file",defaultMessage:"Upload File"})),ev.createElement(eaC,{onClick:()=>{s(q_(a))}},ev.createElement(tn.Icon,{icon:"dd_embed",width:16,height:16}),ev.createElement(eY.Z,{id:"general.embed_link",defaultMessage:"Embed Link"})))),m.length>0&&ev.createElement(eaM,null,ev.createElement(eau,{currentUserId:r,media:m,hasFileDeletePermission:l,onDelete:u,onSelect:p,readOnly:n,documentId:i})),f&&ev.createElement(eaS,null))}),eaD=function(e){let{mediaAttachmentsState:t}=e,a=ev.useMemo(()=>{let e=t?.attachments??[],a=t?.uploadingAttachments?.length??0,n=0,l=0;for(let t of e)"file"===t.data.type?n++:"embed"===t.data.type&&l++;return{file:n,embed:l,uploadingCount:a}},[t]);return ev.createElement(ev.Fragment,null,a.uploadingCount>0&&ev.createElement(eak,null,ev.createElement(eI.Spinner,{size:16,width:16}),a.uploadingCount),a.file>0&&ev.createElement(eak,null,ev.createElement(tn.Icon,{icon:"addon_upload",width:16,height:16}),a.file),a.embed>0&&ev.createElement(eak,null,ev.createElement(tn.Icon,{icon:"dd_embed",width:16,height:16}),a.embed))},eaT=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.nodeId});return{projectId:dP(e)??null,mediaAttachmentsState:a?.media}})(function(e){let{projectId:t,nodeId:a,mediaAttachmentsState:n,readOnly:l}=e,r=(0,e$.useDispatch)(),o=(0,eK.Z)(),i=ev.useMemo(()=>{let e=n?.attachments??[],t=n?.uploadingAttachments??[];return e.length+t.length},[n]),s=XE({canDrop:eab,onDrop:ev.useCallback((e,t)=>{null!=t.dropType&&r(Xh({dropType:t.dropType,nodeId:a,position:"afterbegin",rect:{left:0,right:0,top:0,bottom:0}},e.dataTransfer,o))},[r,o,a])}),d=s.state.counter>0,c=ev.useRef(null),m=ev.useRef(null),[u,p]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),g=(0,eI.usePopup)({referenceElementRef:c,popupElementRef:m,state:u,placement:"bottom-end"}),f=ev.useCallback(()=>{g.popper.instanceRef.current?.update()},[g.popper.instanceRef]),h=(0,eI.useMenuButton)({ref:c,state:u,dispatch:p});return null==t?null:ev.createElement(eaw,s.props,ev.createElement(eaD,{mediaAttachmentsState:n}),!l&&0===i&&ev.createElement(eav,null,ev.createElement(eY.Z,{id:"general.drop_files_here",defaultMessage:"Drop files here"})),(!l||i>0)&&ev.createElement(ev.Fragment,null,u.expanded&&ev.createElement(eI.Popup,{dispatch:p,...g.props,modal:!0},ev.createElement(eaI,{nodeId:a,mediaAttachmentsState:n,readOnly:l,reposition:f,projectId:t})),ev.createElement(eax,null,ev.createElement(ea_,h.props,ev.createElement(tn.Icon,{icon:"dd_new",width:16,height:16})))),!l&&d&&ev.createElement(eaS,null))}),ea$=eL.default.button.withConfig({displayName:"styled__PillButton",componentId:"sc-e39ea03e-0"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 3.4px 6px; + max-height: 24px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + &:disabled { + cursor: auto; + } + + ${e=>e.$active&&!e.$nodeCompleted&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha10}; + border-color: ${e.theme.primaryColorScheme?.alpha50}; + + &:hover { + border-color: ${e.theme.primaryColorScheme?.base}; + } + `} + + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + &:hover { + color: ${e.theme.appColors.hex(10)}; + border-color: ${e.theme.appColors.hex(60)}; + } + `} +`,eaP=eL.default.button.withConfig({displayName:"styled__AddButton",componentId:"sc-e39ea03e-1"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + position: relative; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + &:hover { + color: ${e.theme.appColors.hex(10)}; + border-color: ${e.theme.appColors.hex(60)}; + } + `} + + ${e=>e.$active&&(0,eL.css)` + border-color: ${e.theme.appColors.hex(60)}; + `} +`,eaF=eL.default.span.withConfig({displayName:"styled__TooltipUser",componentId:"sc-e39ea03e-2"})` + display: block; + + ${e=>e.$self&&(0,eL.css)` + font-weight: 900; + `} +`,eaA=eL.default.span.withConfig({displayName:"styled__Emoji",componentId:"sc-e39ea03e-3"})` + ${e=>e.$nodeCompleted&&(0,eL.css)` + filter: grayscale(1); + `} +`,eaR=eL.default.span.withConfig({displayName:"styled__UserCounter",componentId:"sc-e39ea03e-4"})` + margin-left: 0.4rem; + + ${e=>e.$active&&(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + font-weight: bolder; + `} +`,eaj=ev.forwardRef(function(e,t){let{nodeCompleted:a}=e,n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),[o,i]=(0,ev.useState)(!1);ev.useImperativeHandle(t,()=>n.current,[]);let{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"top",visible:o});return ev.createElement("div",null,ev.createElement(eaP,{$active:e["aria-expanded"],$nodeCompleted:a,...e,...c,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)}},ev.createElement(tn.Icon,{icon:"addon_reaction"})),o&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"general.add_reaction",defaultMessage:"Add reaction"})))}),eaO=function(e){let{emoji:t,onEmojiClick:a,currentUserId:n,emojiSkinPreference:l,nodeCompleted:r}=e,o=(0,ev.useMemo)(()=>{let e=new Map,a=go.bj.emojis[t.name];if("native"in a)e.set(null,a);else if("imageUrl"in a);else{for(let t=1;t<=6;t++)e.set(t,a[t]);e.set(null,a[1])}return e},[t.name]),i=(0,ev.useMemo)(()=>{let e=[],a=new Set;for(let e of t.users)a.add(e.skin);for(let t of a){let a=o.get(t);null!=a&&e.push(a)}return e},[t.users,o]),s=(0,ev.useMemo)(()=>{for(let e of t.users)if(e.user?.id===n)return!0;return!1},[t,n]),[d,c]=(0,ev.useState)(!1),m=ev.useRef(null),u=ev.useRef(null),p=ev.useRef(null),{arrowProps:g,popperProps:f,referenceProps:h}=(0,eI.useControlledTooltip)({referenceElementRef:m,arrowElementRef:u,popperElementRef:p,placement:"top",visible:d});return 0===o.size?null:ev.createElement(ev.Fragment,null,ev.createElement(ea$,{...h,$active:s,$nodeCompleted:r,onClick:()=>{let e=o.get(l)??o.get(null);null!=e&&a(e)},onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},i.map(e=>ev.createElement(eaA,{$nodeCompleted:r,key:e.id},"native"in e?e.native:null)),ev.createElement(eaR,{$active:s,$nodeCompleted:r},t.users.length.toString())),d&&ev.createElement(eI.Tooltip,{arrowProps:g,popperProps:f},t.users.map((e,t)=>ev.createElement(eaF,{key:t,$self:e.user?.id===n},e.user?.handle??"deleted"))))},eaU=(0,la.ZP)` + query MeIdQuery { + me { + id + preferences { + emojiSkin + } + } + } +`,eaZ=(0,la.ZP)` + mutation ($input: ProjectNodesReactionUpdateInput!) { + projectNodesReactionUpdate(input: $input) { + clientMutationId + errors + reactionCollections { + id + emojis { + created_at + name + users { + skin + user { + ...BasicUserFields + } + } + } + } + } + } + ${up} +`,eaL=function(e){let{projectId:t,nodeId:a,popupState:n,popupDispatch:l,reactionCollections:r,showAlways:o,nodeCompleted:i}=e,s=(0,e$.useDispatch)(),d=e.isReadOnly??!1,c=ev.useRef(null),m=ev.useRef(null),u=(0,eI.usePopup)({referenceElementRef:c,popupElementRef:m,state:n,placement:"bottom",computeModifiersCallback:tr}),p=(0,ev.useCallback)(()=>{s(mI(a,null))},[s,a]);(0,eI.usePopupEvents)({state:n,onCollapse:p});let g=(0,eI.useMenuButton)({state:n,dispatch:l,ref:c}),{data:f}=(0,eB.a)(eaU,{fetchPolicy:"cache-first"}),h=f?.me?.id,y=f?.me?.preferences?.emojiSkin??null,[b]=(0,cs.D)(eaZ),v=(0,ev.useMemo)(()=>r?.attachments?.[0]??null,[r]),k=(0,ev.useCallback)(e=>{if(null==h){s(rh({isOpen:!0,activeView:rI}));return}if(d||!("native"in e))return;let n=e.id??e.name,r=e.skin??null;b({variables:{input:{projectId:t,nodeIds:[a],clientMutationId:(0,ld.Z)(),emojiName:n,emojiSkin:r}}}),l({type:"Collapse"})},[h,d,b,t,a,l,s]),E=(0,ev.useMemo)(()=>null==v?[]:pS()(v.emojis,"created_at"),[v]);return 0!==E.length||n.expanded||o?ev.createElement(ev.Fragment,null,ev.createElement(ev.Fragment,null,E.map(e=>ev.createElement(eaO,{key:e.name,emoji:e,onEmojiClick:k,currentUserId:h,emojiSkinPreference:y,nodeCompleted:i})),null!=h&&!d&&ev.createElement(eaj,{...g.props,nodeCompleted:i})),n.expanded&&null!=t&&ev.createElement(gp,{dispatch:l,onEmojiPick:k,popupProps:u.props})):null},eaB=eL.default.div.withConfig({displayName:"ReactionsAddon__Wrapper",componentId:"sc-b00bf5d0-0"})` + display: flex; + + & > button { + margin-bottom: 0; + } + + & > div > button { + margin: 0; + } + + ${etQ}; +`,eaz=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.nodeId});return{reactionCollections:a?.reactionCollections,projectId:dP(e)??null}})(function(e){let{projectId:t,nodeId:a,reactionCollections:n,node:l}=e,[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1});if(null==t)return null;let i=null==n||0===n.total;return ev.createElement(eaB,{$isAddonEmpty:i},ev.createElement(eaL,{projectId:t,nodeId:a,popupState:r,popupDispatch:o,nodeCompleted:l.completed,reactionCollections:n,showAlways:!0}))});function eaV(){return(e,t)=>null!=t7(t())||(e(rh({isOpen:!0,activeView:rI})),!1)}let eaq=(0,la.ZP)` + query ProjectAddonsCountdownQuery($id: ID!, $shareToken: ShareTokenInput) { + document(id: $id, shareToken: $shareToken) { + id + addons { + countdowns { + id + last_used_duration + creator { + ...BasicUserFields + } + states { + created_at + end + actor { + ...BasicUserFields + } + type + } + node_id + removed + } + } + } + } + ${up} +`,eaW=(0,la.ZP)` + mutation ProjectNodesCountdownUpdateMutation($input: ProjectNodesCountdownUpdateInput!) { + projectNodesCountdownUpdate(input: $input) { + clientMutationId + ok + countdowns { + id + last_used_duration + creator { + ...BasicUserFields + } + states { + created_at + end + actor { + ...BasicUserFields + } + type + } + node_id + removed + } + errors + } + } + ${up} +`;function eaH(e){let t=(0,ev.useMemo)(()=>null==e?null:CP()(e.states)??null,[e]),[a,n]=(0,ev.useState)(()=>{switch(t?.type){case"paused":return t.end.period;case"ongoing":break;case"reset":return null;case"terminated":{let a=e?.states?.length??0,n=e?.states?.[a-2];switch(n?.type){case"paused":return n.end.period;case"ongoing":{let e=ez.DateTimeDescHelpers.toMoment(t.created_at),a=ez.DateTimeDescHelpers.toMoment(n.created_at),l=eG().duration(n.end.period),r=a.add(l).diff(e,"seconds");return r<0&&(r=0),eG().duration(r,"seconds").toISOString()}}}}return e?.last_used_duration??null}),l=(0,ev.useMemo)(()=>{if(null==e)return null;switch(t?.type){case"ongoing":case"paused":case"terminated":return e.states[0].end.period;default:return null}},[t,e]),r=(0,ev.useMemo)(()=>{if(null==t)return null;switch(t?.type){case"ongoing":case"paused":{let e=ez.DateTimeDescHelpers.toMoment(t.created_at),a=eG().duration(t.end.period);return e.add(a)}default:return null}},[t]);(0,ev.useEffect)(()=>{switch(t?.type){case"paused":eG().duration(t.end.period).asSeconds()>0?n(t.end.period):n("P0D");break;case"ongoing":{if(t?.type!=="ongoing")return;let e=null;function a(){if(null==r)return;let e=r.diff(eG()(),"seconds"),t=eG().duration(e,"seconds");if(e<0){n("P0D");return}requestAnimationFrame(()=>{n(t.toISOString())})}return a(),e=setInterval(a,1e3),()=>{null!=e&&clearInterval(e)}}case"terminated":{let a=e?.states?.length??0,l=e?.states?.[a-2];switch(l?.type){case"paused":eG().duration(l.end.period).asSeconds()>0?n(l.end.period):n("P0D");break;case"ongoing":{let e=ez.DateTimeDescHelpers.toMoment(t.created_at),a=ez.DateTimeDescHelpers.toMoment(l.created_at),r=eG().duration(l.end.period),o=a.add(r).diff(e,"seconds");n(eG().duration(Math.max(0,o),"seconds").toISOString())}}break}case"reset":n(null)}},[e,t,r]);let o=(0,ev.useMemo)(()=>{if(null==a||null==l)return 0;if(t?.type==="reset")return 1;let e=eG().duration(a),n=eG().duration(l);return t?.type==="terminated"&&0===e.asSeconds()?1:e.asSeconds()/n.asSeconds()},[t,a,l]),i=(0,ev.useMemo)(()=>{if(null==t)return eI.ThemeColors.success;switch(t.type){case"paused":return eI.ThemeColors.warning;case"terminated":return eI.ThemeColors.danger;default:return eI.ThemeColors.success}},[t]);return(0,ev.useMemo)(()=>({timeRemaining:a,timeTotal:l,lastState:t,endAt:r,percentRemaining:o,accentColor:i}),[a,l,t,r,o,i])}let eaG=eL.default.button.withConfig({displayName:"styled__AddonButton",componentId:"sc-661847af-0"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + & * { + color: ${e.theme.appColors.hex(50)} !important; + } + + &:hover { + border-color: ${e.theme.appColors.hex(60)}; + & * { + color: ${e.theme.appColors.hex(10)} !important; + } + } + `} + + &:disabled { + cursor: auto; + } +`,eaK=(0,eL.default)(tn.Icon).attrs({icon:"addon_timer"}).withConfig({displayName:"styled__CountdownIcon",componentId:"sc-661847af-1"})` + color: ${e=>e.$accentColor??e.theme.textColors.hex(20)}; +`,eaY=eL.default.span.withConfig({displayName:"styled__AddonButtonText",componentId:"sc-661847af-2"})` + display: ${e=>e.$show?"flex":"none"}; + color: ${e=>e.$accentColor??e.theme.textColors.hex(20)}; + margin-left: 4px; + ${e1.UiTypography.xs}; +`,eaQ=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-661847af-3"})` + width: ${eI.UiSpacing.getPx(52)}; + background: none; + background-color: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + & .arrow { + display: none; + } + padding: ${eI.UiSpacing.getPx(3.5)} 0; +`,eaJ=eL.default.div.withConfig({displayName:"styled__BodyWrapper",componentId:"sc-661847af-4"})` + display: flex; + flex-direction: column; +`,eaX=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__StyledOverline",componentId:"sc-661847af-5"})` + ${e1.UiTypography.xxs}; + padding: 0 ${eI.UiSpacing.getPx(3.5)}; + margin-bottom: 4px; +`;function ea0(e){let t=[];for(let a of(0,eo.makeReverseIterable)(e.states)){if("reset"===a.type&&0!==t.length)break;t.unshift(a)}return{...e,states:t}}var ea1=a(32475),ea2=a.n(ea1);let ea5=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-32563115-0"})` + display: flex; + align-items: center; + padding: 0 ${eI.UiSpacing.getPx(3.5)}; + margin-bottom: ${eI.UiSpacing.getPx(1.5)}; + + label { + flex-shrink: 1; + margin: 0; + } +`,ea3=(0,eL.default)(tn.Icon).attrs({icon:"dd_timer"}).withConfig({displayName:"styled__StopwatchIcon",componentId:"sc-32563115-1"})` + transform: var(--global-icon-scale); + flex-shrink: 0; + margin-right: var(--menu-item-gap); + color: ${e=>e.theme.textColors.hex(10)}; +`,ea4=eL.default.input.attrs({size:3}).withConfig({displayName:"styled__Input",componentId:"sc-32563115-2"})` + ${e1.UiTypography.sm}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: none; + color: ${e=>e.theme.textColors.hex(10)}; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + border-radius: 10px; + + width: 60px; + flex-grow: 1; + + text-align: right; + + -moz-appearance: textfield; + + &::-webkit-inner-spin-button { + cursor: pointer; + margin-left: 8px; + } + + &:invalid { + border: 1px solid ${eI.ThemeColors.danger}; + } +`;function ea6(e){let t=eG().duration(e),a=t.seconds();t.subtract(a,"seconds");let n=t.minutes();t.subtract(n,"minutes");let l=t.hours();t.subtract(l,"hours");let r=t.asDays(),o=[];if(r>0&&o.push(r.toString()),r>0||l>0){let e=ea2()(l.toString(),r>0?2:1,"0");o.push(e)}let i=ea2()(n.toString(),l>0?2:1,"0");o.push(i);let s=ea2()(a.toString(),2,"0");return o.push(s),o.join(":")}let ea8=function(e){let{duration:t,onDurationChange:a,onEnterPress:n}=e,l=(0,eK.Z)(),[r,o]=(0,ev.useState)(()=>null==t?"":ea6(t)),i=(0,ev.useRef)(null),{props:s}=(0,eI.useMenuItem)({stopRef:i}),d=(0,ev.useCallback)(e=>{let t=r.trim(),n=eG().duration(),s=t.match(/^(\d{1,3}):(\d{1,3}):(\d{1,2}):(\d{1,3})$/i),d=t.match(/^(\d{1,3}):(\d{1,2}):(\d{1,3})$/i),c=t.match(/^(\d{1,3}):(\d{1,3})$/i),m=t.match(/^(\d{1,3})$/i);if(i.current?.setCustomValidity?.(""),i.current?.reportValidity?.(),0===t.length)return a(null),!1;if(null!=s)n.add(s[1],"days"),n.add(s[2],"hours"),n.add(s[3],"minutes"),n.add(s[4],"seconds");else if(null!=d)n.add(d[1],"hours"),n.add(d[2],"minutes"),n.add(d[3],"seconds");else if(null!=c)n.add(c[1],"minutes"),n.add(c[2],"seconds");else{if(null==m)return i.current?.setCustomValidity?.(l.formatMessage({id:"general.invalid_duration",defaultMessage:"Invalid duration"})),i.current?.reportValidity?.(),a(null),!1;n.add(m[1],"seconds")}return 0===n.asSeconds()?(i.current?.setCustomValidity?.(l.formatMessage({id:"general.duration_cannot_be_zero",defaultMessage:"Duration must be more than zero"})),i.current?.reportValidity?.(),a(null),!1):("replace"===e&&o(ea6(n.toISOString())),a(n.toISOString()),!0)},[r,a,l]);return(0,ev.useEffect)(()=>{d("error")},[r,d]),ev.createElement(ea5,null,ev.createElement(ea3,null),ev.createElement(ea4,{...s,value:r,onChange:e=>{o(e.target.value)},onKeyDown:e=>{if(e.key!==eI.KeyboardKeys.Escape)switch(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.key){case eI.KeyboardKeys.Enter:e.preventDefault(),d("error")&&n?.();break;case eI.KeyboardKeys.ArrowUp:case eI.KeyboardKeys.ArrowDown:s.onKeyDown(e)}},onBlur:()=>{d("replace")},placeholder:"h:mm:ss",onClick:void 0,min:0,type:"text"}))},ea7=eL.default.button.withConfig({displayName:"styled__Wrapper",componentId:"sc-7d096c49-0"})` + display: flex; + align-items: center; + background: none; + border: none; + padding: var(--menu-item-padding); + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + cursor: pointer; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(70)}; + outline: 0; + } +`,ea9=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__TintedIcon",componentId:"sc-7d096c49-1"})` + transform: var(--global-icon-scale); + color: ${e=>e.$tint??e.theme.textColors.hex(10)}; + margin-right: var(--menu-item-gap); +`,ene=(0,eL.default)(e1.MenuItem).withConfig({displayName:"styled__TintedMenuItem",componentId:"sc-7d096c49-2"})` + color: ${e=>e.$tint??e.theme.textColors.hex(10)}}; + ${e1.UiTypography.sm}; +`,ent=function(e){let{onClick:t,icon:a,tint:n,text:l,onMouseEnter:r}=e,o=(0,ev.useRef)(null),i=(0,eI.useMenuItem)({stopRef:o,onClick:t,onMouseEnter:r});return ev.createElement(ea7,i.props,ev.createElement(ea9,{icon:a,$tint:n}),ev.createElement(ene,{$tint:n},l))},ena=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-958b0574-0"})` + align-self: center; + position: relative; + + width: 140px; + height: 140px; + + margin: 0 ${eI.UiSpacing.getPx(5)} ${eI.UiSpacing.getPx(5)}; + + border: 3px solid ${e=>e.theme.appColors.hex(60)}; + border-radius: 100%; + + box-sizing: content-box; +`,enn=eL.default.svg.withConfig({displayName:"styled__RingSvg",componentId:"sc-958b0574-1"})` + position: relative; + + width: 160px; + height: 160px; + + top: -10px; + left: -10px; +`,enl=eL.default.circle.withConfig({displayName:"styled__RingCircle",componentId:"sc-958b0574-2"})` + stroke-width: 4px; + stroke-linecap: round; + transform: rotate(-90deg) scaleX(1); + transform-origin: center; + transition: 1s linear stroke-dasharray; + fill-rule: nonzero; + stroke: ${e=>e.$color}; + stroke-dasharray: 283; + stroke-dashoffset: ${e=>283-283*e.$percentRemaining}; + fill: none; +`,enr=eL.default.div.withConfig({displayName:"styled__RingMetadata",componentId:"sc-958b0574-3"})` + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +`,eno=eL.default.span.withConfig({displayName:"styled__TimeRemaining",componentId:"sc-958b0574-4"})` + font-size: 22.78px; + font-weight: 500; + line-height: 1.2; + color: ${e=>e.$color}; +`,eni=eL.default.span.withConfig({displayName:"styled__TimeTotal",componentId:"sc-958b0574-5"})` + ${e1.UiTypography.sm}; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(50)}; +`,ens=function(e){let{remaining:t,total:a,accentColor:n,percentRemaining:l}=e;return ev.createElement(ena,null,ev.createElement(enn,{viewBox:"0 0 100 100"},ev.createElement(enl,{$color:n,cx:"50",cy:"50",r:"45",$percentRemaining:l})),ev.createElement(enr,null,ev.createElement(eno,{$color:n},t),ev.createElement(eni,null,"of ",a)))},end=function(e){let{projectId:t,nodeId:a,nodeCountdown:n,exit:l}=e,r=(0,eK.Z)(),{search:o}=(0,eF.TH)(),i=ev.useMemo(()=>s4(o),[o]),[s]=(0,cs.D)(eaW),d=(0,ev.useMemo)(()=>null==n?null:ea0(n),[n]),c=(0,ev.useCallback)(e=>{s({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:t,nodeIds:[a],...e}},update:(e,a)=>{let{data:n}=a;if(null==n)return;let l=e.readQuery({query:eaq,variables:{id:t,shareToken:i}});if(null==l||null==l.document)return;let r=aR()(l.document.addons.countdowns,"node_id");for(let e of n.projectNodesCountdownUpdate.countdowns)r[e.node_id]=e;let o={document:{...l.document,addons:{...l.document.addons,countdowns:Object.values(r)}}};e.writeQuery({query:eaq,data:o,variables:{id:t,shareToken:i}})}})},[a,t,s,i]);(0,ev.useEffect)(()=>{(null==d||d.removed)&&c({operation:"create",duration:null})},[d,t,a,c]);let m=eaH(d),u=m.lastState,[p,g]=(0,ev.useState)(null),f=(0,aK.useRovingTabindexState)(),h=(0,aK.useRovingTabindexDispatch)();(0,ev.useEffect)(()=>{0!==f.stops.length&&requestAnimationFrame(()=>{h({type:aK.ActionTypes.First})})},[f.stops.length,h,u]);let y=(0,ev.useCallback)(e=>{e.preventDefault(),c({operation:"start",duration:p}),l()},[c,p,l]),b=(0,ev.useCallback)(e=>{e.preventDefault(),c({operation:"pause",duration:null})},[c]),v=(0,ev.useCallback)(e=>{e.preventDefault(),c({operation:"resume",duration:null})},[c]),k=(0,ev.useCallback)(e=>{e.preventDefault(),c({operation:"reset",duration:null})},[c]),E=(0,ev.useCallback)(e=>{e.preventDefault(),c({operation:"cancel",duration:null})},[c]),x=(0,ev.useCallback)(e=>{e.preventDefault(),c({operation:"remove",duration:null}),l()},[c,l]),_=(0,ev.useCallback)(e=>{g(e)},[]),w=(0,ev.useCallback)(()=>{c({operation:"start",duration:p}),l()},[c,l,p]),N=(0,ev.useCallback)(()=>{u?.type==="reset"&&h({type:aK.ActionTypes.First})},[u,h]),C=(0,ev.useMemo)(()=>u?.type==="reset"?p??"PT0M":m.timeRemaining,[p,u,m.timeRemaining]),M=(0,ev.useMemo)(()=>u?.type==="reset"?p??"PT0M":m.timeTotal,[p,u,m.timeTotal]),S=(0,ev.useMemo)(()=>null!=p?ez.IsoDurationHelpers.unstable_formatToShortDuration(p)??"":null!=C?ez.IsoDurationHelpers.unstable_formatToShortDuration(C)??"":"",[C,p]),I=(0,ev.useMemo)(()=>null!=p?ez.IsoDurationHelpers.unstable_formatToShortDuration(p)??"":null!=M?ez.IsoDurationHelpers.unstable_formatToShortDuration(M)??"":"",[M,p]);return null==d?ev.createElement(eI.Spinner,null):ev.createElement(eaJ,null,ev.createElement(ens,{accentColor:m.accentColor,remaining:S,total:I,percentRemaining:m.percentRemaining}),u?.type==="reset"&&ev.createElement(ev.Fragment,null,ev.createElement(eaX,null,ev.createElement(eY.Z,{id:"general.duration",defaultMessage:"Duration"})),ev.createElement(ea8,{duration:p,onDurationChange:_,onEnterPress:w}),null!=p&&ev.createElement(ent,{icon:"dd_resume",text:r.formatMessage({id:"general.start",defaultMessage:"Start"}),tint:eI.ThemeColors.success,onClick:y,onMouseEnter:N})),u?.type==="ongoing"&&ev.createElement(ent,{icon:"dd_pause",text:r.formatMessage({id:"general.pause",defaultMessage:"Pause"}),onClick:b}),u?.type==="paused"&&ev.createElement(ent,{icon:"dd_resume",text:r.formatMessage({id:"general.resume",defaultMessage:"Resume"}),tint:eI.ThemeColors.success,onClick:v}),(u?.type==="ongoing"||u?.type==="paused")&&ev.createElement(ent,{icon:"dd_stop",text:r.formatMessage({id:"general.stop",defaultMessage:"Stop"}),onClick:E}),u?.type==="terminated"&&ev.createElement(ent,{icon:"dd_restore",text:r.formatMessage({id:"general.reset",defaultMessage:"Reset"}),onClick:k}),null!=d&&ev.createElement(ent,{icon:"dd_delete",tint:eI.ThemeColors.danger,text:r.formatMessage({id:"general.remove",defaultMessage:"Remove"}),onClick:x,onMouseEnter:N}))},enc=ev.forwardRef(function(e,t){let{nodeCountdown:a,active:n,disabled:l,nodeCompleted:r,...o}=e,i=eaH((0,ev.useMemo)(()=>null==a?null:ea0(a),[a]));return ev.createElement(eaG,{...o,ref:t,$active:n,disabled:l,$nodeCompleted:r},ev.createElement(eaK,{$accentColor:i.accentColor,$nodeCompleted:r}),i.timeRemaining&&ev.createElement(eaY,{$accentColor:i.accentColor,$show:null!=a,$nodeCompleted:r},ez.IsoDurationHelpers.unstable_formatToShortDuration(i.timeRemaining)))}),enm=function(e){let{countdownAttachments:t,projectId:a,nodeId:n,popupState:l,popupDispatch:r,showAlways:o,readOnly:i,nodeCompleted:s}=e,d=ev.useRef(null),c=ev.useRef(null),m=(0,e$.useDispatch)(),u=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:l,placement:"bottom",computeModifiersCallback:tr}),p=(0,eI.useMenuButton)({dispatch:r,ref:d,state:l}),g=(0,ev.useCallback)(e=>{if(!i){if(!m(eaV())){m(rh({isOpen:!0,activeView:rI}));return}if(null==a){e.preventDefault(),m(Fd());return}p.props.onClick(e)}},[m,p.props,a,i]),f=ev.useCallback(()=>{m(mI(n,null))},[m,n]),h=ev.useCallback(e=>{switch(e.type){case"Activate":case"Dismiss":r({type:"Collapse"})}},[r]);(0,eI.usePopupEvents)({state:l,onCollapse:f});let y=(0,ev.useCallback)(()=>{r({type:"Collapse"})},[r]),b=t?.attachments[0];return!o&&!1===l.expanded&&(null==b||b.removed)?null:ev.createElement("div",null,ev.createElement(enc,{...p.props,disabled:i,onClick:g,nodeCountdown:b,active:l.expanded,nodeCompleted:s}),l.expanded&&null!=a&&ev.createElement(eI.Popup,{...u.props,dispatch:r,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:h},ev.createElement(eaQ,{initialFocus:u.initialFocus,loop:!0},ev.createElement(end,{projectId:a,nodeId:n,nodeCountdown:b,exit:y})))))},enu=eL.default.div.withConfig({displayName:"TimerAddon__Wrapper",componentId:"sc-80305826-0"})` + display: flex; + align-items: center; + + & > div > button { + margin: 0; + } + + ${etQ}; + ${etJ}; +`,enp=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.nodeId});return{countdownAttachments:a?.countdowns,projectId:dP(e)??null}})(function(e){let{projectId:t,nodeId:a,countdownAttachments:n,node:l,readOnly:r}=e,[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=ev.useMemo(()=>null==n||n.attachments[0].removed,[n]);return null==t?null:ev.createElement(enu,{$isAddonEmpty:s,$readOnly:r},ev.createElement(enm,{projectId:t,nodeId:a,popupState:o,popupDispatch:i,countdownAttachments:n,readOnly:r,nodeCompleted:l.completed,showAlways:!0}))}),eng={[Xs.assignees]:et0,[Xs.dueDate]:et7,[Xs.comments]:et6,[Xs.reactions]:eaz,[Xs.timer]:enp,[Xs.media]:eaT},enf=eL.default.div.withConfig({displayName:"DropIndicator__Container",componentId:"sc-219a120-0"})` + position: absolute; + pointer-events: none; + height: 5px; + z-index: 2; + background-color: ${e=>e.theme.primaryColorScheme?.base}; +`,enh=function(e){let{className:t,onDropLocation:a}=e,n=Xt(),l=(0,zO.sJ)(n.clientPointAtom),[r,o]=ev.useReducer(Xx.reducer,Xx.initialState);ev.useEffect(()=>{let e=a(l);o(Xx.actions.onDropLocation(e))},[l,a]);let{Component:i,style:s}=ev.useMemo(()=>null==r?{Component:"div",style:{display:"none"}}:{Component:enf,style:r.rect},[r]);return ev.createElement(i,{className:t,style:s})},eny=(0,eL.css)` + &:after { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + white-space: nowrap; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } +`,enb=(0,eL.css)` + ${eny} + + &:after { + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,env=(0,eL.css)` + ${eny}; + + &:after { + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,enk=(0,eL.css)` + ${eny} + + &:after { + margin-top: 2px; + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + border-radius: 6px; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected3.svg":"/../images/check_hover3.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected3.svg'); + } + } +`,enE=(0,eL.css)` + ${enk} + + &:after { + border-radius: 25px; + } +`,enx=(0,eL.css)` + ${eny} + + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_heart2.svg'); + margin-top: 5px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_heart2.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_heart_selected2.svg'); + opacity: 1; + transform: scale(1); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_heart_selected2.svg'); + } +`,en_=(0,eL.css)` + ${eny} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border-radius: 25px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,enw=(0,eL.css)` + ${eny} + + &:after { + border-radius: 25px; + content: ''; + } + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_triangle.svg'); + margin-left: -2px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_triangle.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_triangle.svg'); + opacity: 1; + transform: scale(1.4); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_triangle_selected.svg'); + } +`,enN=(0,eL.css)` + ${eny} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + border-radius: 1px; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,enC=eL.default.div.withConfig({displayName:"NodeBullet__Wrapper",componentId:"sc-a7770e5f-0"})` + display: flex; + margin-right: 8px; + margin-left: 2px; + + ${e=>{switch(e.$format){case li.FORMAT_HEADING1:case li.FORMAT_HEADING2:case li.FORMAT_TEXT:return(0,eL.css)` + display: none; + `}}} +`,enM=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"NodeBullet__Checkbox",componentId:"sc-a7770e5f-1"})` + width: 1.125rem; + height: 1.125rem; + -webkit-appearance: none; + + ${e=>e.$format===li.FORMAT_ALPHA&&env} + ${e=>e.$format===li.FORMAT_NUMBER&&enb} + ${e=>e.$format===li.FORMAT_CHECKBOX&&enk} + ${e=>e.$format===li.FORMAT_CIRCLE_CHECK&&enE} + ${e=>e.$format===li.FORMAT_HEART&&enx} + ${e=>e.$format===li.FORMAT_BULLET&&en_} + ${e=>e.$format===li.FORMAT_TRIANGLE&&enw} + ${e=>e.$format===li.FORMAT_SQUARE&&enN} + + ${e=>e.$format===li.FORMAT_ALPHA&&(0,eL.css)` + &:after { + counter-increment: ${e.$nodeCounterName}; + content: counter(${e.$nodeCounterName}, lower-alpha) '.'; + } + `} + + ${e=>e.$format===li.FORMAT_NUMBER&&(0,eL.css)` + &:after { + counter-increment: ${e.$nodeCounterName}; + content: counter(${e.$nodeCounterName}, decimal) '.'; + } + `} +`,enS=function(e){let{nodeID:t,nodeFormat:a,completed:n,nodeCounterName:l}=e,r=(0,e$.useDispatch)(),o=ev.useCallback(()=>{r(P0(t))},[r,t]);return a===li.FORMAT_TEXT?null:ev.createElement(enC,{$format:a},ev.createElement(enM,{$format:a,$nodeCounterName:l,id:`checkbox-${t}`,className:"left",checked:n,onClick:o}))},enI=eL.default.div.withConfig({displayName:"NodeFolder__TooltipWithShortcutContainer",componentId:"sc-de3414c4-0"})` + display: flex; + flex-direction: column; + align-items: center; + + row-gap: 4px; +`,enD=function(e){let{nodeId:t,nodeCollapsed:a,nodeFormat:n}=e,l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),i=(0,e$.useDispatch)(),[s,d]=ev.useState(!1),{referenceProps:c,arrowProps:m,popperProps:u}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,visible:s,placement:"top"});return ev.createElement(ev.Fragment,null,ev.createElement(etK,{...c,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},onClick:e=>{e.preventDefault(),e.stopPropagation(),i(DE(t)),d(!1)},$nodeFormat:n},ev.createElement(tn.Icon,{icon:a?"default_caret_right":"default_caret_down"})),s&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(enI,null,a?ev.createElement(eY.Z,{id:"general.unfold",defaultMessage:"Unfold"}):ev.createElement(eY.Z,{id:"general.fold",defaultMessage:"Fold"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,a?"↓":"↑")))))};function enT(e,t,a,n){if(null==a||null==n)return null;let l=a.dataset.nodeId;if(null==l)return null;let r=a.getBoundingClientRect(),o=n.getBoundingClientRect();return t.y=30?{dropType:e,nodeId:l,position:"beforeend",rect:{left:r.left-o.left+30,right:o.right-r.right,top:r.height,bottom:o.bottom-r.bottom}}:{dropType:e,nodeId:l,position:"afterend",rect:{left:r.left-o.left,right:o.right-r.right,top:r.height,bottom:o.bottom-r.bottom}}}let en$=(0,e$.connect)(function(e,t){let a=iq();return{value:iV(e,{nodeID:t.nodeId}),readOnly:dq(e),node:a(e,{nodeID:t.nodeId}),previousNodeFormat:iJ(e,t),nodeFormat:function(e,t){let{ancestors:a,nodeId:n}=t,l=iL(e),r=l.findNodeByID(n),o=r?.format?.node;if(null!=o)return o;let i=a[a.length-1],s=l.findNodeByID(i);return s?.format?.children!=null?s.format.children:li.FORMAT_CHECKBOX}(e,t)}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{nodeId:a,ancestors:n,value:l,readOnly:r,node:o,isSectionNode:i,shouldShowSelectBackground:s,nodeFormat:d,previousNodeFormat:c,indexOfNode:m,hasVisibleChild:u}=e,p=(0,e$.useDispatch)(),g=(0,eK.Z)(),f=(0,eF.TH)(),h=ev.useRef(null),y=ev.useRef(null),b=ev.useContext(Xf),v=ev.useMemo(()=>f.hash===`#node-${a}`,[f.hash,a]),k=ev.useCallback(()=>{h.current?.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})},[]),E=ev.useCallback(e=>{p(mN(a,e))},[p,a]),x=function(e){let{nodeId:t,ancestors:a}=e,n=(0,e$.useDispatch)();return ev.useMemo(()=>{let e=e=>n(X5(t,a,e)),l=e=>n(XP(t,a,e)),r=()=>{n(mM(t,a))};return[RH.MarkHotKey({key:"b",type:"bold"}),RH.MarkHotKey({key:"u",type:"underline"}),RH.MarkHotKey({key:"i",type:"italic"}),RH.MarkHotKey({key:"e",type:"highlight"}),RH.OnPreviousNode({up:e,left:e,move:()=>(n(Xl([t],a)),!0)}),RH.OnNextNode({down:l,right:l,move:()=>{n(Xn([t],a))}}),RH.OnEscape(),RH.OnEnter({onEnter:()=>(n(Dr(t,a)),!0),onModShiftEnter:()=>n(X4(t)),onComplete:()=>(n(P0(t)),!0),onShiftEnter:()=>{n(mJ(t))}}),RH.OnBackspace({onBackspace:()=>(n(Dl(t,a)),!0),onForceBackspace:r}),RH.OnTab({indent:()=>(n(m$(t,a)),!0),outdent:()=>(n(mC(t,a)),!0)}),RH.OnDelete({onDelete:()=>(n(Do(t,a)),!0),onForceDelete:r}),RH.OnHistory(),RH.OnPaste({onPaste:e=>{n(X3(e,t,a))}}),RH.OnDuplicate({onDuplicate:()=>{n(mT(t,a))}}),RH.OnCollapseExpandNode({onCollapse:()=>{n(DE(t,!0))},onExpand:()=>{n(DE(t,!1))}})]},[a,n,t])}({nodeId:a,ancestors:n}),_=X2({ancestors:n,nodeID:a,dispatch:p}),w=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback((e,t)=>{if(i||null==t.dropType||null==h.current?.getBoundingClientRect())return;let a=enT(t.dropType,{x:e.clientX,y:e.clientY},h.current,y.current);null!=a&&p(Xh(a,e.dataTransfer,g))},[p,g,i])}),N=w.state.counter>0,C=ev.useCallback(e=>i||null==w.state.dropType?null:enT(w.state.dropType,e,h.current,y.current),[w.state.dropType,i]),M=ev.useMemo(()=>0===m||(d===li.FORMAT_NUMBER||d===li.FORMAT_ALPHA)&&(c===li.FORMAT_NUMBER||c===li.FORMAT_ALPHA)&&d!==c,[m,d,c]);if(null==o||null==l)return null;let S=n[n.length-1],I=i?"nodeCounter":`node-counter-${S}`,D=o.completed??!1,T=o.collapsed??!1;return ev.createElement(ev.Fragment,null,N&&ev.createElement("tr",null,ev.createElement(etV,{colSpan:1+b.columns.length},ev.createElement(enh,{onDropLocation:C}))),ev.createElement(etq,{ref:h,..._.props,...w.props,"data-node-id":a,$isDragging:_.isDragging,$shouldResetNodeCounter:M,$nodeCounterName:I,$isHashHighlighted:v,onFocus:k},ev.createElement(etz,{$isSectionNode:i,$isHashHighlighted:v,$showBottomBorder:!o.hasChild&&n.length<2},ev.createElement(etH,{id:`node-${a}`,ref:y,$indentationCount:n.length-1},ev.createElement(etB,{nodeId:a,ancestors:n,readOnly:r,nodeFormat:d,hasChild:u}),u&&ev.createElement(enD,{nodeId:a,nodeCollapsed:T,nodeFormat:d}),ev.createElement(etG,{$showSelectBackground:s,ref:t},ev.createElement(enS,{nodeID:a,nodeFormat:d,completed:D,nodeCounterName:I}),ev.createElement("div",{className:"flex w-full flex-col"},ev.createElement(etW,{className:`node-format-${d} node-editor`,value:l,onChange:E,readOnly:r,decorateNode:PC,renderMark:PX,plugins:x,$isCompleted:D}),ev.createElement("div",{className:"mb-2 text-start text-sm text-textcolor-500"},ev.createElement(X1,{nodeId:a,ancestors:n})))))),b.columns.map(e=>{let t=eng[e.name];return ev.createElement(etY,{key:e.name,$showBottomBorder:!o.hasChild&&n.length<2},ev.createElement(t,{nodeId:a,node:o,readOnly:r}))})))})),enP=(0,e$.connect)(function(e,t){return{node:iq()(e,{nodeID:t.nodeID}),documentPreferences:iG(e),documentSearch:iz(e)}})(Vr(function(e){let{nodeID:t,ancestors:a,node:n,documentPreferences:l,documentSearch:r,isParentMultiselect:o,indexOfNode:i}=e,s=XT(n),d=ev.useMemo(()=>[...a,t],[a,t]),c=ev.useMemo(()=>s?(n?.children??tz.List()).filter(e=>l.isNodeIDVisible(e)&&r.isNodeIDVisible(e)):tz.List(),[l,r,n?.children,s]),m=ev.useMemo(()=>!!o||e.selected||e.selecting,[o,e.selected,e.selecting]);return s?ev.createElement(ev.Fragment,null,ev.createElement(en$,{nodeId:t,ancestors:a,shouldShowSelectBackground:m,ref:e.selectableRef,indexOfNode:i,hasVisibleChild:c.size>0}),n.hasChild&&!n.collapsed&&c.map((e,t)=>ev.createElement(enP,{key:e,nodeID:e,ancestors:d,isParentMultiselect:m,indexOfNode:t}))):null}));eL.default.tr.withConfig({displayName:"styled__Container",componentId:"sc-944669b7-0"})``;let enF=eL.default.tr.withConfig({displayName:"styled__AddTaskRow",componentId:"sc-944669b7-1"})` + color: ${e=>e.theme.textColors.hex(60)}; + + &:hover { + cursor: pointer; + background-color: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.textColors.hex(30)}; + } +`,enA=eL.default.td.withConfig({displayName:"styled__AddTaskColumn",componentId:"sc-944669b7-2"})` + ${X6}; + border-top-width: 1px; + + position: sticky; + left: 0; +`,enR=eL.default.td.withConfig({displayName:"styled__AddTaskEmptyColumn",componentId:"sc-944669b7-3"})` + ${X6}; + border-top-width: 1px; +`,enj=eL.default.div.withConfig({displayName:"styled__AddTask",componentId:"sc-944669b7-4"})` + display: flex; + align-items: center; + padding-top: 5px; + padding-bottom: 5px; + padding-left: ${e=>30*e.$indentationCount}px; + + ${e1.UiTypography.xs}; + font-weight: 500; +`,enO=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-944669b7-5"})` + margin-right: 7px; + margin-left: 20px; + transform: scale(0.8); +`,enU=(0,e$.connect)(function(e,t){return{node:iq()(e,{nodeID:t.nodeID}),documentPreferences:iG(e),documentSearch:iz(e),readOnly:dq(e)}})(Vr(function(e){let{nodeID:t,ancestors:a,node:n,documentPreferences:l,documentSearch:r,readOnly:o,indexOfNode:i}=e,s=XT(n),d=ev.useContext(Xf),c=(0,e$.useDispatch)(),m=ev.useMemo(()=>[...a,t],[a,t]),u=ev.useMemo(()=>s?(n?.children??tz.List()).filter(e=>l.isNodeIDVisible(e)&&r.isNodeIDVisible(e)):tz.List(),[l,r,n?.children,s]),p=e.selected||e.selecting;return s?ev.createElement(ev.Fragment,null,ev.createElement(en$,{nodeId:t,ancestors:a,isSectionNode:!0,shouldShowSelectBackground:p,ref:e.selectableRef,indexOfNode:i,hasVisibleChild:u.size>0}),n.hasChild&&!n.collapsed&&u.map((e,t)=>ev.createElement(enP,{key:e,nodeID:e,ancestors:m,isParentMultiselect:p,indexOfNode:t})),!o&&u.size>0&&!n.collapsed&&ev.createElement(enF,{onClick:()=>{c(XD(t))}},ev.createElement(enA,null,ev.createElement(enj,{$indentationCount:a.length+1},ev.createElement(enO,{icon:"dd_new"}),ev.createElement(eY.Z,{id:"general.add_task",defaultMessage:"Add Task"}))),ev.createElement(enR,{colSpan:d.columns.length}))):null})),enZ=(0,la.ZP)` + mutation DocumentUserPreferencesUpdateMutation($input: DocumentUserPreferencesUpdateInput!) { + documentUserPreferencesUpdate(input: $input) { + clientMutationId + preferences { + viewPreferences { + actionsheet { + editorColumnWidth + columns { + name + width + } + } + } + } + } + } +`,enL=(0,la.ZP)` + query MeIdQuery { + me { + id + } + } +`;function enB(e){return{name:e.name,width:e.width??void 0}}function enz(e){let t=ev.useContext(Xf),a=(0,ll.x)(),[n]=(0,cs.D)(enZ),{data:l}=(0,eB.a)(enL),r=l?.me?.id!=null,o=ev.useCallback(t=>{if(null==e)return;let l={editorColumnWidth:t.editorColumnWidth,columns:t.columns.map(e=>({name:e.name,width:e.width??null}))};if(!r){a.cache.writeFragment({id:a.cache.identify({__typename:"Document",id:e}),fragment:(0,la.ZP)` + fragment documentFragment on Document { + preferences { + viewPreferences { + actionsheet { + editorColumnWidth + columns { + name + width + } + } + } + } + } + `,data:{preferences:{viewPreferences:{actionsheet:l}}}});return}let o=(0,ld.Z)();n({variables:{input:{clientMutationId:o,documentId:e,preferences:{viewPreferences:{actionsheet:{...t,columns:t.columns.map(enB)}}}}},optimisticResponse:{documentUserPreferencesUpdate:{clientMutationId:o,preferences:{viewPreferences:{actionsheet:l}}}},update:(t,a)=>{let{data:n}=a,l=n?.documentUserPreferencesUpdate?.preferences?.viewPreferences?.actionsheet;null!=l&&t.writeFragment({id:t.identify({__typename:"Document",id:e}),fragment:(0,la.ZP)` + fragment documentFragment on Document { + preferences { + viewPreferences { + actionsheet { + editorColumnWidth + columns { + name + width + } + } + } + } + } + `,data:{preferences:{viewPreferences:{actionsheet:l}}}})}})},[a.cache,n,r,e]),i=ev.useCallback(a=>{null!=e&&o({editorColumnWidth:a,columns:t.columns})},[t.columns,e,o]),s=ev.useCallback(a=>{null!=e&&o({editorColumnWidth:t.editorColumnWidth,columns:t.columns.map(e=>e.name===a.name?a:e)})},[t,e,o]),d=ev.useCallback(a=>{null==e||t.columns.some(e=>e.name===a)||o({editorColumnWidth:t.editorColumnWidth,columns:[...t.columns,{name:a}]})},[t,e,o]),c=ev.useCallback(a=>{null!=e&&o({editorColumnWidth:t.editorColumnWidth,columns:t.columns.filter(e=>e.name!==a.name)})},[t,e,o]),m=ev.useCallback((a,n,l)=>{if(null==e)return;let r=new Map;for(let[e,a]of t.columns.entries())r.set(a.name,e);let i=r.get(n.name);if(null==i)return;let s=r.get(a.name);if(null==s)return;let d=[...t.columns];d.splice(s,1);let c=-1;switch(l){case"before":c=i;break;case"after":c=i+1}c>s&&c--,d.splice(c,0,a),o({editorColumnWidth:t.editorColumnWidth,columns:d})},[t.columns,t.editorColumnWidth,e,o]);return{actionsheetViewPreferences:t,updateEditorColumnWidth:i,updateColumn:s,removeColumn:c,addColumn:d,reorderColumn:m}}let enV=eL.default.div.withConfig({displayName:"ColumnHeaderMenuItem__Container",componentId:"sc-6e7e29b0-0"})` + display: flex; + padding: var(--menu-item-padding); + align-items: center; + + column-gap: var(--menu-item-gap); + + color: ${e=>e.$color??e.theme.appColors.hex(10)}; + + &:hover { + cursor: pointer; + } + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,enq=(0,eL.default)(tn.Icon).withConfig({displayName:"ColumnHeaderMenuItem__StyledIcon",componentId:"sc-6e7e29b0-1"})` + transform: var(--menu-item-icon-scale); +`,enW=eL.default.span.withConfig({displayName:"ColumnHeaderMenuItem__Label",componentId:"sc-6e7e29b0-2"})` + ${e1.UiTypography.sm}; +`,enH=function(e){let{name:t,value:a,icon:n,messageDescriptor:l,color:r}=e,o=ev.useRef(null),i=(0,eI.useMenuItem)({name:t,value:a,stopRef:o});return ev.createElement(enV,{...i.props,$color:r},ev.createElement(enq,{icon:n,width:16}),ev.createElement(enW,null,ev.createElement(eY.Z,l)))},enG=function(e){let{initialFocus:t,projectId:a,column:n}=e,{removeColumn:l}=enz(a),r=ev.useCallback(e=>{"Activate"===e.type&&"hide_column"===e.payload.name&&l(n)},[n,l]);return ev.createElement(eay,null,ev.createElement(eI.MenuGroupContext.Provider,{value:r},ev.createElement(eI.Menu,{initialFocus:t,loop:!0},ev.createElement(enH,{messageDescriptor:{id:"general.hide_column",defaultMessage:"Hide column"},icon:"dd_hide_completed",name:"hide_column"}))))},enK=eL.default.table.withConfig({displayName:"styled__Table",componentId:"sc-4ba1812d-0"})` + border-collapse: separate; + border-spacing: 0; + + width: max-content; + min-width: 100%; + + height: 1px; + + ${tM}; + counter-reset: nodeCounter; +`,enY=eL.default.button.withConfig({displayName:"styled__MoreButton",componentId:"sc-4ba1812d-1"})` + margin-left: auto; +`,enQ=(0,eL.default)(tn.Icon).attrs({icon:"header_more"}).withConfig({displayName:"styled__MoreIcon",componentId:"sc-4ba1812d-2"})` + transform: var(--global-icon-scale); + color: ${e=>e.theme.appColors.hex(40)}; +`,enJ=(0,eL.default)(function(e){let{className:t,projectId:a,column:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),s=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"bottom"}),d=(0,eI.useMenuButton)({ref:l,state:o,dispatch:i});return ev.createElement(ev.Fragment,null,ev.createElement(enY,{className:t,...d.props},ev.createElement(enQ,null)),o.expanded&&ev.createElement(eI.Popup,{dispatch:i,...s.props,modal:!0},ev.createElement(enG,{projectId:a,column:n})))}).withConfig({displayName:"styled__StyledColumnHeaderMenu",componentId:"sc-4ba1812d-3"})` + visibility: collapse; + + &[aria-expanded='true'] { + visibility: visible; + } +`,enX=eL.default.th.withConfig({displayName:"styled__ColumnHeaderContainer",componentId:"sc-4ba1812d-4"})` + ${e1.UiTypography.sm}; + ${X8}; + + border-width: 1px; + border-left-width: 0; + + &:first-child { + border-left-width: 1px; + } + + background-color: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(30)}; + + position: sticky; + top: 0; + z-index: 2; + + &:first-child { + z-index: 3; + left: 0; + } + + &:hover { + ${enJ} { + visibility: visible; + } + } + + &[draggable] { + &:hover { + cursor: grab; + } + + &:active { + cursor: grabbing; + } + } +`,en0=eL.default.div.withConfig({displayName:"styled__ColumnHeaderInnerContainer",componentId:"sc-4ba1812d-5"})` + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getPx(3)}; +`,en1=eL.default.div.withConfig({displayName:"ColumnHeaderResizer__Container",componentId:"sc-7d3ec3b7-0"})` + position: absolute; + right: 0; + top: 0; + bottom: 0; + width: 10px; + background: ${e=>e.theme.primaryColorScheme?.base}; + + cursor: col-resize; + + opacity: 0; + + &:hover { + opacity: 1; + } + + &.active { + opacity: 1; + } +`,en2=function(e){let{onResizeStart:t,onResizeEnd:a,onResize:n}=e,l=ev.useRef(null),r=ev.useRef(null),o=e=>{null!=r.current&&n(e.clientX-r.current)},i=()=>{r.current=null,a(),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i),l.current?.classList?.remove("active")};return ev.createElement(en1,{ref:l,onMouseDown:e=>{r.current=e.clientX,t(),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i),l.current?.classList?.add("active")}})},en5=eL.default.div.withConfig({displayName:"ColumnHeaderDraggableDropPoint__LineIndicator",componentId:"sc-99a9b566-0"})` + width: ${eI.UiSpacing.getPx(1)}; + + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + + visibility: collapse; +`,en3=eL.default.div.withConfig({displayName:"ColumnHeaderDraggableDropPoint__Container",componentId:"sc-99a9b566-1"})` + position: absolute; + top: 0; + bottom: 0; + + display: flex; + + ${e=>e.$isDraggingOver&&(0,eL.css)` + ${en5} { + visibility: visible; + } + `} + + ${e=>"before"===e.$targetLocation&&(0,eL.css)` + left: 0; + right: 50%; + `} + + ${e=>"after"===e.$targetLocation&&(0,eL.css)` + left: 50%; + right: 0; + flex-direction: row-reverse; + `} +`,en4=function(e){let{targetLocation:t,projectId:a,column:n}=e,{reorderColumn:l}=enz(a),r=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if(t===etj)return t;return null},[]),onDrop:ev.useCallback((e,a)=>{if(null==a.dropType)return;let r=JSON.parse(e.dataTransfer.getData(etj));if(n.name===r.name){console.warn("Column dropped on itself, ignoring.");return}l(r,n,t)},[n,l,t])}),o=r.state.counter>0;return ev.createElement(en3,{...r.props,$isDraggingOver:o,$targetLocation:t},ev.createElement(en5,null))},en6=eL.default.span.withConfig({displayName:"ColumnHeader__Label",componentId:"sc-ffc07f3a-0"})` + user-select: none; + white-space: nowrap; +`,en8=function(e){let{projectId:t,column:a}=e,n=ev.useRef(null),l=ev.useRef(0),{updateColumn:r}=enz(t),[o,i]=ev.useState(!1),s=ev.useCallback(()=>{let e=n.current;null!=e&&(i(!0),l.current=e.getBoundingClientRect().width)},[]),d=ev.useCallback(e=>{let t=n.current;if(null==t)return;let a=l.current+e;requestAnimationFrame(()=>{t.style.width=`${a}px`})},[]),c=ev.useCallback(()=>{if(null==t)return;let e=n.current;if(null==e)return;i(!1);let l=Math.round(e.getBoundingClientRect().width);r({...a,width:l})},[a,t,r]),m=function(e,t,a){let[n,l]=ev.useState(!1),r=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.dataTransfer.setData(etj,JSON.stringify(t)),l(!0)},[t]),o=ev.useCallback(()=>{l(!1)},[]);return null==e?{props:{}}:{isDragging:n,props:{draggable:!a,onDragStart:r,onDragEnd:o}}}(t,a,o);return ev.useLayoutEffect(()=>{let e=n.current;if(null!=e){if(null==a.width){e.style.width="120px";return}e.style.width=`${a.width}px`}},[a]),ev.createElement(enX,{ref:n,...m.props},ev.createElement(en0,null,ev.createElement(en4,{column:a,targetLocation:"before",projectId:t}),ev.createElement(en6,null,ev.createElement(eY.Z,Xd[a.name])),ev.createElement(en4,{column:a,targetLocation:"after",projectId:t}),null!=t&&ev.createElement(ev.Fragment,null,ev.createElement(en2,{onResizeStart:s,onResizeEnd:c,onResize:d}),ev.createElement(enJ,{column:e.column,projectId:t}))))},en7=function(e){let{initialFocus:t,projectId:a,close:n,hiddenColumnNames:l}=e,{addColumn:r}=enz(a),o=ev.useCallback(e=>{"Activate"===e.type&&"add_column"===e.payload.name&&(r(e.payload.value),n())},[r,n]);return ev.createElement(eay,null,ev.createElement(eI.MenuGroupContext.Provider,{value:o},ev.createElement(eI.Menu,{initialFocus:t,loop:!0},l.map(e=>ev.createElement(enH,{key:e,messageDescriptor:Xd[e],icon:Xc[e],name:"add_column",value:e})))))},en9=(0,eL.default)(tn.Icon).attrs({icon:"dd_new"}).withConfig({displayName:"styled__AddIcon",componentId:"sc-5114e7a-0"})` + transform: var(--global-icon-scale); + color: ${e=>e.theme.appColors.hex(40)}; +`,ele=function(e){let{className:t,projectId:a,hiddenColumnNames:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),s=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"bottom"}),d=(0,eI.useMenuButton)({ref:l,state:o,dispatch:i}),c=ev.useCallback(()=>{i({type:"Collapse"})},[i]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:t,...d.props},ev.createElement(en9,null)),o.expanded&&ev.createElement(eI.Popup,{dispatch:i,...s.props,modal:!0},ev.createElement(en7,{projectId:a,close:c,hiddenColumnNames:n})))},elt=function(e){let{projectId:t}=e,{actionsheetViewPreferences:a}=enz(t),n=ev.useMemo(()=>{let e=new Set;for(let t of a.columns)e.add(t.name);return Object.values(Xs).filter(t=>!e.has(t))},[a.columns]);return 0===n.length||null==t?ev.createElement(enX,null):ev.createElement(enX,null,ev.createElement(en0,null,ev.createElement(ele,{projectId:t,hiddenColumnNames:n})))},ela=function(e){let{projectId:t}=e,a=ev.useRef(null),n=ev.useRef(0),{updateEditorColumnWidth:l}=enz(t),r=ev.useContext(Xf),o=ev.useCallback(()=>{let e=a.current;null!=e&&(n.current=e.getBoundingClientRect().width)},[]),i=ev.useCallback(e=>{let t=a.current;if(null==t)return;let l=Math.max(n.current+e,250);requestAnimationFrame(()=>{t.style.width=`${l}px`})},[]),s=ev.useCallback(()=>{if(null==t)return;let e=a.current;null!=e&&l(Math.round(e.getBoundingClientRect().width))},[t,l]);return ev.useLayoutEffect(()=>{let e=a.current;null!=e&&(e.style.width=`${r.editorColumnWidth}px`)},[r.editorColumnWidth]),ev.createElement(enX,{ref:a},ev.createElement(en0,null,null!=t&&ev.createElement(en2,{onResizeStart:o,onResizeEnd:s,onResize:i})))},eln=eL.default.div.withConfig({displayName:"ContainerWrapper__HorizontalScroll",componentId:"sc-87f53bbd-0"})` + ${tM}; + overflow-x: scroll; +`,ell=eL.default.div.withConfig({displayName:"ContainerWrapper__Container",componentId:"sc-87f53bbd-1"})` + overflow: visible; +`,elr=function(e){let{children:t}=e;return ev.createElement(ell,null,ev.createElement(eln,null,t))},elo=(0,la.ZP)` + query DocumentViewPreferencesQuery($id: ID!) { + document(id: $id) { + id + preferences { + viewPreferences { + actionsheet { + editorColumnWidth + columns { + name + width + } + } + } + } + } + } +`,eli=(0,e$.connect)(function(e){return{projectId:dP(e),rootNodeAncestors:iZ(e),rootNodeId:iR(e),rootNode:ij(e),documentPreferences:iG(e),documentSearch:iz(e),isReadOnly:dq(e)}})(function(e){let{coverImageType:t,rootNodeId:a,rootNode:n,rootNodeAncestors:l,documentPreferences:r,documentSearch:o,projectId:i,isReadOnly:s}=e,d=ev.useMemo(()=>[...l,a],[l,a]),c=ev.useMemo(()=>n.children.filter(e=>r.isNodeIDVisible(e)&&o.isNodeIDVisible(e)),[r,o,n.children]),{data:m}=(0,eB.a)(elo,{variables:{id:i},skip:null==i}),u=ev.useMemo(()=>m?.document?.preferences?.viewPreferences?.actionsheet??Xp,[m]);return ev.createElement(Xf.Provider,{value:u},ev.createElement(elr,null,ev.createElement(enK,null,ev.createElement("thead",null,ev.createElement("tr",null,ev.createElement(ela,{projectId:i}),u.columns.map(e=>ev.createElement(en8,{projectId:i,key:e.name,column:e})),ev.createElement(elt,{projectId:i}))),ev.createElement("tbody",null,ev.createElement(XI,{nodeId:a,position:"afterbegin"}),c.map((e,t)=>ev.createElement(ev.Fragment,{key:e},ev.createElement(enU,{nodeID:e,ancestors:d,indexOfNode:t}),ev.createElement(XI,{nodeId:e,position:"afterend"}))))),!s&&ev.createElement(Xg,null)))}),els=eL.default.div.withConfig({displayName:"ProjectStatus__Container",componentId:"sc-ab11f509-0"})` + ${e1.UiTypography.xs}; + + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + margin-top: 16px; + + @media print { + display: none !important; + } +`,eld=(0,e$.connect)(function(e){return{editorStatus:dL(e)}})(function(e){let{editorStatus:t}=e;if(null==t)return null;let{createdBy:a,updatedBy:n,updatedAt:l}=t;return ev.createElement(els,null,"Created by ",a," · Updated by ",n," ",cc()(l).fromNow())}),elc=[(0,te.Em)({id:"general.give_me_a_template_name",defaultMessage:"Give me a template name"}),(0,te.Em)({id:"general.add_a_template_title",defaultMessage:"Add a template title"}),(0,te.Em)({id:"general.untitled_template",defaultMessage:"Untitled Template"})],elm=[(0,te.Em)({id:"general.give_me_a_project_name",defaultMessage:"Give me a project name"}),(0,te.Em)({id:"general.add_a_project_title",defaultMessage:"Add a project title"}),(0,te.Em)({id:"general.untitled_project",defaultMessage:"Untitled Project"})],elu=(0,e$.connect)(function(e){return{doc:dV(e),isMember:iU(e)}})(function(e){let t;let{documentId:a,doc:n,isMember:l}=e,{data:r}=(0,$y.J)({from:{__typename:"Document",id:a},fragment:Yb}),o=r?.role?.project??r?.role?.workspace??null;"participant"===o&&(t="check_only"),"viewer"===o&&(t="view_only"),l||"collaborator"!==o||(t="view_and_edit");let i=og()("mr-2 py-px my-0.5 inline-flex h-6 items-center gap-x-1 rounded-2xl border border-solid border-appcolor-300 bg-appcolor-100 px-2 text-xs hover:border-appcolor-400");return ev.createElement(ev.Fragment,null,"check_only"===t&&ev.createElement("div",{className:i},ev.createElement("span",null,"✅"),ev.createElement(eY.Z,{id:"general.check_only",defaultMessage:"Check Only"})),"view_only"===t&&ev.createElement("div",{className:i},ev.createElement("span",null,"\uD83E\uDD13"),ev.createElement(eY.Z,{id:"general.view_only",defaultMessage:"View Only"})),"view_and_edit"===t&&ev.createElement("div",{className:i},ev.createElement("span",null,"✍️"),ev.createElement(eY.Z,{id:"general.view_and_edit",defaultMessage:"View & Edit"})),l&&r?.pinned_at!=null&&ev.createElement("div",{className:i},ev.createElement(tn.Icon,{icon:"dd_pin",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.pinned",defaultMessage:"Pinned"})),n?.isArchived&&ev.createElement("div",{className:i},ev.createElement(eY.Z,{id:"general.archived",defaultMessage:"Archived"})))}),elp=(0,la.ZP)` + query DocumentAttachmentsQuery($documentId: ID!) { + document(id: $documentId) { + id + templated_at + space { + id + name + color + taskadePlanType + } + assignments(first: null) { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + role { + project + workspace + } + shared_preferences + tags(first: null) { + edges { + node { + id + key + raw_key + preferences { + color + } + } + } + } + } + } + ${up} +`;var elg=a(76566),elf=a.n(elg);function elh(e,t,a){return(0,es.ZP)(e,e=>(e[t]=(0,es.cA)(a),e))}function ely(e,t,a){let n=function(e,t){let a=e[t];return"string"==typeof a?[a]:Array.isArray(a)?a:[]}(e,t);if("string"==typeof a){let l=elf()(n,[a]);return ts()(l)?(0,es.ZP)(e,e=>(delete e[t],e)):elh(e,t,l)}if(!Array.isArray(a))return(0,es.ZP)(e,e=>(t in e?delete e[t]:e[t]=null,e));{let l=elf()(n,a);return ts()(l)?(0,es.ZP)(e,e=>(delete e[t],e)):elh(e,t,l)}}!function(e){e.Unscheduled="unscheduled",e.Every="every"}(H||(H={}));let elb={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MeTimezoneQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"timezone"}}]}}]}}]},elv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TemplateCreationScheduleDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TemplateCreationScheduleDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"templateCreationScheduleDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]}}]},elk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TemplateCreationScheduleUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TemplateCreationScheduleUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"templateCreationScheduleUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]}}]};var elE=a(17126);function elx(e,t){if(null==e)return null;let a=elE.ou.fromISO(e,{zone:t});return{byhour:[a.hour],byminute:[a.minute],bysecond:[a.second]}}function el_(e){return null==e?null:Array.isArray(e)?e[0]:e}function elw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eG().tz.guess(),a=elE.ou.local({zone:t}).startOf("hour").plus({hour:1}).toISOTime({suppressMilliseconds:!0,includeOffset:!1});(0,ei.assert)(null!=a,"time is null");let n=elx(a,t);switch(e){case H.Unscheduled:return{mode:H.Unscheduled,timezone:t};case H.Every:{let e={...n,freq:mX.Frequency.DAILY,interval:1,tzid:t};return{mode:H.Every,rruleOptions:e,time:a,timezone:t}}}}function elN(e){return[mX.RRule.MO,mX.RRule.TU,mX.RRule.WE,mX.RRule.TH,mX.RRule.FR,mX.RRule.SA,mX.RRule.SU][e-1]}let elC=(e,t)=>{switch(t.type){case"set_mode":return elw(t.mode,e.timezone);case"toggle_switch":if(e.mode===H.Unscheduled)return elw(H.Every,e.timezone);return elw(H.Unscheduled,e.timezone);case"time_update":return(0,ei.assert)(e.mode!==H.Unscheduled,"Cannot update time in RecurringMode.Unscheduled"),(0,es.ZP)(e,a=>{let n=elx(t.time,e.timezone);null!=n&&(a.rruleOptions.byhour=n.byhour,a.rruleOptions.byminute=n.byminute,a.rruleOptions.bysecond=n.bysecond,a.rruleOptions.tzid=e.timezone,a.time=t.time)});case"freq_update":return(0,ei.assert)(e.mode===H.Every,"Cannot update freq outside of RecurringMode.Every"),(0,es.ZP)(e,e=>{e.rruleOptions.freq=t.freq,t.freq===mX.Frequency.WEEKLY?e.rruleOptions.byweekday=[elN(eG()().isoWeekday())]:e.rruleOptions.byweekday=void 0});case"interval_update":return(0,ei.assert)(e.mode===H.Every,"Cannot update interval outside of RecurringMode.Every"),(0,es.ZP)(e,e=>{e.rruleOptions.interval=Math.max(t.interval,1)});case"weekday_toggle":return(0,ei.assert)(e.mode===H.Every,"Cannot toggle weekday outside of RecurringMode.Every"),(0,ei.assert)(e.rruleOptions.freq===mX.Frequency.WEEKLY,"Cannot toggle weekday outside of Frequency.WEEKLY"),(0,es.ZP)(e,e=>{let{byweekday:a}=e.rruleOptions,n=new Set;if("number"==typeof a)n.add(a);else if("string"==typeof a)n.add(a);else if(Array.isArray(a))for(let e of a)n.add(e);n.has(t.weekday)?n.delete(t.weekday):n.add(t.weekday),n.size<1||(e.rruleOptions.byweekday=[...n])});case"timezone_configurator_update":return(0,ei.assert)(e.mode!==H.Unscheduled,"Cannot update time in RecurringMode.Unscheduled"),(0,es.ZP)(e,e=>{e.timezone=t.timezone,e.rruleOptions.tzid=t.timezone})}};function elM(e){switch(e){case mX.Frequency.DAILY:return"daily";case mX.Frequency.WEEKLY:return"week";default:throw new ei.TaskadeError({code:"UNSUPPORTED_RRULE_FREQ",message:`${e} is not supported`})}}let elS=function(e){let{freq:t,onFreqPicked:a,disabled:n}=e,l=(0,eK.Z)(),r=ev.useMemo(()=>[{label:l.formatMessage({id:"general.schedule_day",defaultMessage:"day"}),value:elM(mX.Frequency.DAILY)},{label:l.formatMessage({id:"general.schedule_week",defaultMessage:"week"}),value:elM(mX.Frequency.WEEKLY)}],[l]),o=ev.useMemo(()=>r.find(e=>e.value===elM(t))??null,[t,r]),i=ev.useCallback(e=>{if(null==e)return;let t=function(e){switch(e){case"daily":return mX.Frequency.DAILY;case"week":return mX.Frequency.WEEKLY}return null}(e.value);null!=t&&a(t)},[a]);return ev.createElement("div",{className:og()("w-20 shrink",{"pointer-events-none":n})},ev.createElement(FL,{selected:o,options:r,onChange:i}))},elI=function(e){let{isoTime:t,active:a,selected:n,onClick:l,onMouseEnter:r}=e,o=ev.useRef(null),i=ev.useMemo(()=>eG()(t,na).format("LT"),[t]);return ev.useEffect(()=>{a&&o.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[a]),ev.createElement("div",{ref:o,className:og()("flex items-center gap-x-1.5 py-1.5 pl-2 pr-3 text-xs hover:cursor-pointer hover:bg-appcolor-300",{"bg-appcolor-300":a}),onClick:l,onMouseEnter:r},n?ev.createElement(tn.Icon,{icon:"dd_check",className:"h-4 w-4"}):ev.createElement("div",{className:"w-4"}),ev.createElement("span",{className:"select-none"},i))},elD=(e,t)=>{switch(t.type){case"prev":{let t=e.activeIndex-1;return t<0&&(t=e.timeOptions.length-1),{...e,activeIndex:t}}case"next":{let t=e.activeIndex+1;return t>e.timeOptions.length-1&&(t=0),{...e,activeIndex:t}}case"set_active_index":return{...e,activeIndex:t.activeIndex}}},elT=function(e){let{time:t,onTimePicked:a}=e,[n,l]=ev.useReducer(elD,function(e){let t=elE.ou.now().startOf("day"),a=0,n=[];for(let l=0;l<24;l++)for(let r=0;r<4;r++){let o=t.plus({hour:l,minute:15*r});e===o.toISOTime({includeOffset:!1,suppressMilliseconds:!0})&&(a=4*l+r),n.push(o.toISOTime({includeOffset:!1,suppressMilliseconds:!0}))}return{activeIndex:a,timeOptions:n}}(t)),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1}),i=ev.useRef(null),s=ev.useRef(null),d=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:r,placement:"bottom",computeModifiersCallback:tr});return ev.createElement(ev.Fragment,null,ev.createElement("input",{ref:i,className:"w-full rounded-lg border-[1px] border-appcolor-300 bg-appcolor-100 py-1 px-2 text-sm text-textcolor-1000 focus-within:bg-appcolor-200",type:"text",value:eG()(t,na).format("LT"),onChange:e=>{},onFocus:e=>{o({type:"Expand"})},onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),l({type:"prev"});break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),l({type:"next"});break;case eI.KeyboardKeys.Enter:case eI.KeyboardKeys.Escape:a(n.timeOptions[n.activeIndex]),i.current?.blur(),o({type:"Collapse"})}}}),r.expanded&&ev.createElement(eI.Popup,{dispatch:o,...d.props,modal:!0},ev.createElement("div",{className:"flex max-h-40 w-32 flex-col overflow-y-scroll rounded-lg border-[1px] border-solid border-appcolor-300 bg-appcolor-100 py-3"},n.timeOptions.map((e,r)=>ev.createElement(elI,{key:e,isoTime:e,active:r===n.activeIndex,selected:t===e,onMouseEnter:()=>{l({type:"set_active_index",activeIndex:r})},onClick:()=>{a(e),o({type:"Collapse"})}})))))},el$=function(e){let{value:t,onWeekDayPicked:a}=e,n=ev.useMemo(()=>null==t?new Set:Array.isArray(t)?new Set(t):new Set([t]),[t]),l=ev.useMemo(()=>{let e=[];for(let t=0;t<7;t++){let a=eG().weekdaysMin(!0,t)[0],n=eG()().weekday(t);e.push({rruleValue:elN(n.isoWeekday()),momentLocaleAwareWeekday:t,momentDisplayText:a})}return e},[]);return ev.createElement("div",{className:"flex items-center justify-between gap-x-1 overflow-hidden rounded-lg"},l.map(e=>ev.createElement("div",{className:og()("flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-appcolor-0 hover:cursor-pointer",{"bg-primary text-white":n.has(e.rruleValue),"border border-appcolor-300 hover:bg-primary/10":!n.has(e.rruleValue)}),key:e.rruleValue.weekday,onClick:()=>{a(e.rruleValue)}},ev.createElement("span",{className:"select-none text-sm"},e.momentDisplayText))))},elP=function(e){let{projectId:t,templateCreationSchedule:a,close:n,popperUpdate:l,spacePlanType:r}=e,o=fR.Vl.getFeature("template.schedule").plans[r],i=(0,eL.useTheme)(),s=ev.useMemo(()=>gW()(i.primaryColor??eI.Colors.BRAND).rgb().join(" "),[i.primaryColor]),[d]=(0,cs.D)(elk),[c]=(0,cs.D)(elv),m=(0,eB.a)(elb,{fetchPolicy:"cache-first"}),u=ev.useMemo(()=>m.data?.me?.timezone??eG().tz.guess(),[m]),p=ev.useMemo(()=>null==a?elw(H.Unscheduled,u):function(e){let{rruleSet:t,timezone:a}=e,n=(0,mX.rrulestr)(t.join("\n")),{freq:l}=n.origOptions;switch(l){case mX.Frequency.DAILY:case mX.Frequency.WEEKLY:case mX.Frequency.MONTHLY:case mX.Frequency.YEARLY:break;default:throw new ei.TaskadeError({code:"UNSUPPORTED_RRULE_FREQUENCY",message:`${l} is not supported`})}let r=function(e){let{byhour:t,byminute:a,bysecond:n}=e,l=el_(t),r=el_(a),o=el_(n);return elE.ou.fromObject({hour:l??void 0,minute:r??void 0,second:o??void 0}).toISOTime({includeOffset:!1,suppressMilliseconds:!0})}(n.origOptions);return(0,ei.assert)(null!=r,"rrule has no byhour/byminute/bysecond"),{mode:H.Every,rruleOptions:{...n.origOptions,freq:n.origOptions.freq??mX.Frequency.DAILY,interval:n.origOptions.interval??1},timezone:a,time:r}}(a),[u,a]),[g,f]=ev.useReducer(elC,p);ev.useEffect(()=>{l()},[l,g]);let h=ev.useCallback(e=>{null!=e&&f({type:"time_update",time:e})},[]),y=async()=>{let e=g.mode===H.Unscheduled?null:new mX.RRule(g.rruleOptions).toString().split("\n");if(g.mode===H.Unscheduled||null==e)return;let a=g.timezone;try{await d({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:t,schedule:{rruleSet:e,timezone:a}}}})}catch(e){uT(e,uI)}n()},b=ev.useCallback(e=>{f({type:"toggle_switch"}),e||c({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:t}}})},[t,c]),v=ev.useCallback(e=>{f({type:"freq_update",freq:e})},[]),k=ev.useCallback(e=>{f({type:"weekday_toggle",weekday:e})},[]);return!o&&d6()?ev.createElement("div",{className:"flex w-64 flex-col overflow-hidden rounded-lg border border-solid border-appcolor-300 bg-appcolor-0 shadow-lg",style:{"--color-primary":s}},ev.createElement("div",null,ev.createElement("img",{src:"/images/tooltips/schedule-template.gif"})),ev.createElement("div",{className:"flex flex-col p-6"},ev.createElement("div",{className:"mb-3 flex items-center justify-start"},ev.createElement("p",{className:"mr-2 text-sm font-medium"},ev.createElement(eY.Z,{id:"general.schedule_templates",defaultMessage:"Schedule Templates"})),ev.createElement(e1.UpgradeBadge,null)),ev.createElement("div",{className:"mb-6 text-sm font-normal"},ev.createElement(eY.Z,{id:"general.upgrade_to_schedule_templates",defaultMessage:" Automatically generate projects from scheduled templates, complete with pre-assigned tasks for faster workflows."})),ev.createElement("div",null,ev.createElement(EI,{className:"w-28"})))):ev.createElement("div",{className:"flex w-72 flex-col rounded-lg border border-solid border-appcolor-300 bg-appcolor-0 px-4 py-5 shadow-lg",style:{"--color-primary":s}},ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"flex items-center justify-between gap-x-2 px-3"},ev.createElement("span",{className:"text-md font-medium"},ev.createElement(eY.Z,{id:"general.schedule_title",defaultMessage:"Schedule Template"})),ev.createElement("div",{className:"flex shrink-0 items-center hover:cursor-pointer"},ev.createElement(e1.Switch,{checked:g.mode!==H.Unscheduled,onChange:b}))),g.mode!==H.Unscheduled&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"mt-4 flex flex-col gap-y-2 px-3"},ev.createElement("div",{className:"flex items-center gap-x-2.5"},ev.createElement("label",{htmlFor:H.Every,className:"flex items-center gap-x-2 text-sm"},ev.createElement(eY.Z,{id:"general.schedule_every",defaultMessage:"Every"}),ev.createElement("div",{className:og()("flex items-center gap-x-2",{"opacity-60":g.mode!==H.Every})},ev.createElement("input",{type:"number",min:1,className:"w-14 rounded-lg border border-appcolor-300 bg-appcolor-100 px-2 py-1 text-sm text-textcolor-1000 focus-within:bg-appcolor-200",value:g.rruleOptions.interval,onChange:e=>{let t=e.target.valueAsNumber;isNaN(t)&&(t=1),f({type:"interval_update",interval:t})},disabled:g.mode!==H.Every}),ev.createElement(elS,{freq:g.rruleOptions.freq,onFreqPicked:v,disabled:g.mode!==H.Every}))))),g.mode===H.Every&&ev.createElement(ev.Fragment,null,g.rruleOptions.freq===mX.Frequency.WEEKLY&&ev.createElement("div",{className:"mt-4 flex flex-col px-3"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.schedule_on",defaultMessage:"On"})),ev.createElement("div",{className:"mt-2"},ev.createElement(el$,{value:g.rruleOptions.byweekday,onWeekDayPicked:k}))),ev.createElement("div",{className:"mt-4 flex flex-col px-3"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.schedule_at",defaultMessage:"At"})),ev.createElement("div",{className:"mt-2 flex items-center gap-x-2.5"},ev.createElement(elT,{time:g.time,onTimePicked:h})))),ev.createElement("div",{className:"mt-5 flex items-center justify-evenly gap-x-2 px-3"},ev.createElement("button",{className:"w-28 rounded-lg bg-appcolor-300 px-5 py-3 text-sm font-medium text-appcolor-500 hover:cursor-pointer hover:bg-appcolor-400",onClick:n},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})),ev.createElement("button",{className:"w-28 rounded-lg bg-primary px-5 py-3 text-sm font-medium text-white hover:cursor-pointer hover:brightness-110",onClick:y},ev.createElement(eY.Z,{id:"general.schedule",defaultMessage:"Schedule"}))))))},elF={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DocumentSharedPreferencesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]},elA={[mX.Frequency.DAILY]:(0,te.Em)({id:"general.recurrence_day",defaultMessage:"day"}),[mX.Frequency.WEEKLY]:(0,te.Em)({id:"general.recurrence_week",defaultMessage:"week"}),[mX.Frequency.MONTHLY]:(0,te.Em)({id:"general.recurrence_month",defaultMessage:"month"}),[mX.Frequency.YEARLY]:(0,te.Em)({id:"general.recurrence_year",defaultMessage:"year"}),[mX.Frequency.HOURLY]:(0,te.Em)({id:"general.recurrence_hour",defaultMessage:"hour"}),[mX.Frequency.MINUTELY]:(0,te.Em)({id:"general.recurrence_minute",defaultMessage:"minute"}),[mX.Frequency.SECONDLY]:(0,te.Em)({id:"general.recurrence_second",defaultMessage:"second"})},elR=function(e){let{projectId:t,role:a,spacePlanType:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"bottom-start",computeModifiersCallback:tr}),d=(0,eI.useMenuButton)({ref:l,state:o,dispatch:i}),c=ev.useCallback(()=>{i({type:"Collapse"})},[]),{data:m,loading:u,error:p}=(0,eB.a)(elF,{variables:{projectId:t}}),g=ev.useMemo(()=>u||null==m?null:m.document?.shared_preferences?.templateCreationSchedule??null,[m,u]),f=function(e){let t=(0,eK.Z)();return ev.useMemo(()=>{if(null==e)return t.formatMessage({id:"general.schedule",defaultMessage:"Schedule"});let a=function(e,t){let a=eG().tz(t),n=ez.MomentHelpers.toDateTimeDesc(a),l=ez.RecurringDateRangeDescHelpers.nextRecurringDateRangeDesc({start:n,recurrence:{rruleSet:e}},new Date);return null==l?null:ez.DateTimeDescHelpers.toMoment(l.start)}(e.rruleSet,e.timezone);if(null==a)return t.formatMessage({id:"general.schedule_finished",defaultMessage:"Schedule Finished"});let{freq:n,interval:l}=(0,mX.rrulestr)(e.rruleSet.join("\n")).options;return t.formatMessage({id:"general.schedule_recurring_summary",defaultMessage:"Every {interval, plural, one {{freq}} other {# {freq}s}} at {nextCreationDateTime}"},{interval:l,freq:t.formatMessage(elA[n]),nextCreationDateTime:a.format("LT")})},[t,e])}(g),h=ev.useMemo(()=>lm({role:a,action:{workspace:"schedule_template"}}),[a]),y=ev.useCallback(()=>{s.popper.instanceRef?.current?.update()},[s.popper.instanceRef]);return h?ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"mr-2 inline-flex items-center rounded-2xl border border-solid border-appcolor-300 bg-appcolor-100 px-2 py-px text-xs hover:border-appcolor-400",...d.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i({type:"Expand",payload:"first"})}},ev.createElement(tn.Icon,{icon:"dd_date",className:"h-5 w-3 scale-125"}),ev.createElement("div",{className:"ml-[5px] text-xs"},f)),o.expanded&&ev.createElement(eI.Popup,{dispatch:i,...s.props,modal:!0},null!=m&&!u&&ev.createElement(elP,{projectId:t,close:c,templateCreationSchedule:g,popperUpdate:y,spacePlanType:n}),null!=p&&ev.createElement("span",{className:"text-danger"},"An error occurred: ",p.message),u&&ev.createElement(eI.Spinner,null))):null},elj=(0,la.ZP)` + query SpaceAssignmentsQuery($spaceId: ID!) { + me { + id + } + membership(space_id: $spaceId) { + id + space { + id + memberships { + id + role + user { + ...BasicUserFields + } + } + } + } + } + ${up} +`,elO=function(e){let{assignments:t,spaceId:a,onSelect:n,...l}=e,{data:r,error:o,loading:i}=(0,eB.a)(elj,{variables:{spaceId:a}}),s=(0,ev.useMemo)(()=>t.edges.map(e=>e.node.user),[t]),d=(0,ev.useMemo)(()=>r?.membership?.space.memberships.map(e=>e.user)??[],[r]),c=r?.me?.id??null;return i?ev.createElement(av,null,ev.createElement(eI.Spinner,{size:36})):null!=o?ev.createElement(av,null,ev.createElement(Ff,null,ev.createElement(eY.Z,{id:"general.generic_error_occurred",defaultMessage:"An error occurred."})),";"):ev.createElement(a_,{assignees:s,members:d,currentUserId:c,onUserSelect:n,hideUserPresence:!0,...l})},elU=eL.default.img.withConfig({displayName:"AssignmentsButton__AvatarCircle",componentId:"sc-12366cb2-0"})` + height: 20px; + width: 20px; + border-radius: 50%; + background-color: white; + margin-right: ${e=>e.$isSingleAvatar?"0px":"-5px"}; +`,elZ=eL.default.div.withConfig({displayName:"AssignmentsButton__AvatarCircleWrapper",componentId:"sc-12366cb2-1"})` + display: inline-flex; + margin-right: ${e=>e.$isSingleAvatar?"0px":"5px"}; +`,elL=eL.default.div.withConfig({displayName:"AssignmentsButton__UserSpan",componentId:"sc-12366cb2-2"})` + display: inline-block; + max-width: 100px; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: nowrap; +`,elB=ev.forwardRef(function(e,t){let{assignments:a,onClick:n,...l}=e,r=a.edges.length>0,o=1===a.edges.length;return r?ev.createElement(tP,{...l,$assigned:r,type:"button",onClick:n,ref:t},ev.createElement(elZ,{$isSingleAvatar:o},a.edges.map(e=>{let t=e.node;return ev.createElement(elU,{key:t.id,className:"meta-avatar",src:t.user.avatars_v2?.small?.mdpi.url,$isSingleAvatar:o})})),ev.createElement(tF,null,ev.createElement(elL,null,a.edges.map(e=>e.node.user.handle).join(", ")))):null!=n?ev.createElement(tP,{...l,$assigned:r,type:"button",onClick:n,ref:t},ev.createElement(lT.NL,{className:"meta-icon"}),ev.createElement(tF,null,ev.createElement(eY.Z,{id:"general.assign",defaultMessage:"Assign"}))):null}),elz=(0,la.ZP)` + mutation AssignToDocumentMutation($input: AssignToDocumentInput!) { + assignToDocument(input: $input) { + clientMutationId + ok + assignment { + id + user { + ...BasicUserFields + } + } + } + } + ${up} +`,elV=(0,la.ZP)` + fragment DocumentAssignmentsFragment on Document { + id + assignments(first: null) { + edges { + node { + id + user { + ...BasicUserFields + } + } + } + } + } + ${up} +`,elq=function(e){let{assignments:t,documentId:a,role:n,spaceId:l}=e,r=(0,ev.useRef)(null),o=(0,ev.useRef)(null),[i,s]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),d=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:i,placement:"bottom",computeModifiersCallback:tr}),c=(0,eI.useMenuButton)({ref:r,state:i,dispatch:s}),[m]=(0,cs.D)(elz),u=Eu({role:n?.workspace,action:"assign_project"}),p=(0,ev.useCallback)(e=>{s({type:"Collapse"})},[]),g=(0,ev.useCallback)(e=>{e.relatedTarget===o.current&&e.target instanceof HTMLElement&&e.target.focus()},[]),f=(0,ev.useMemo)(()=>{if(u)return e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s({type:"Expand"})}},[u,s]),h=(0,ev.useCallback)(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),y=e=>null!=e&&"object"==typeof e&&"__typename"in e&&"User"===e.__typename,b=(0,ev.useCallback)(async e=>{if(!y(e))return;let n=e.id,l=t.edges.findIndex(t=>t.node.user.id===e.id),r=(0,ld.Z)(),o=-1===l;await m({variables:{input:{clientMutationId:r,documentID:a,userID:n,assigned:o}},optimisticResponse:{__typename:"Mutation",assignToDocument:{__typename:"AssignToDocumentPayload",clientMutationId:r,ok:!0,assignment:o?{__typename:"Assignment",id:`${a}:${n}`,user:e}:null}},update:(t,l)=>{if(null==l.data)return;let r=t.readFragment({id:`Document:${a}`,fragment:elV,fragmentName:"DocumentAssignmentsFragment"});if(null!=r){if(null==l.data.assignToDocument.assignment){let e=(0,es.ZP)(r,e=>{let t=e.assignments.edges.findIndex(e=>`${a}:${n}`===e.node.id);return -1!==t&&e.assignments.edges.splice(t,1),e});t.writeFragment({id:`Document:${a}`,fragment:elV,fragmentName:"DocumentAssignmentsFragment",data:e})}else{let l=(0,es.ZP)(r,t=>{if(-1===t.assignments.edges.findIndex(e=>`${a}:${n}`===e.node.id)){let l=t.assignments.edges.length;t.assignments.edges.push({__typename:"AssignmentEdge",cursor:`${l}`,node:{__typename:"Assignment",id:`${a}:${n}`,user:e}})}return t});t.writeFragment({id:`Document:${a}`,fragment:elV,fragmentName:"DocumentAssignmentsFragment",data:l})}}}})},[m,t,a]);return ev.createElement(ev.Fragment,null,ev.createElement(elB,{assignments:t,...c.props,onClick:f}),i.expanded&&ev.createElement(eI.Popup,{...d.props,modal:!0,dispatch:s,onClick:h,tabIndex:-1},ev.createElement(elO,{assignments:t,spaceId:l,onSelect:b,onPopupClose:p,onPopupBlur:g})))},elW=eL.default.button.withConfig({displayName:"styled__Container",componentId:"sc-3f05e3ed-0"})` + display: grid; + grid-template-areas: + 'icon title' + 'icon text'; + grid-template-columns: auto 1fr; + grid-template-rows: auto 1fr; + row-gap: ${eI.UiSpacing.getPx(1.5)}; + + padding: 6px 12px 6px 14px; + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,elH=eL.default.div.withConfig({displayName:"styled__IconContainer",componentId:"sc-3f05e3ed-1"})` + grid-area: icon; + + display: flex; + align-items: center; + justify-content: center; +`,elG=eL.default.span.withConfig({displayName:"styled__Title",componentId:"sc-3f05e3ed-2"})` + grid-area: title; + + color: ${e=>e.theme.textColors.hex(e.$isUntitled?60:10)}; + ${e1.UiTypography.sm}; + text-align: start; +`,elK=eL.default.span.withConfig({displayName:"styled__Text",componentId:"sc-3f05e3ed-3"})` + grid-area: text; + + white-space: break-spaces; + + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.xs}; + text-align: start; + + border-left: ${eI.UiSpacing.getPx(1)} solid ${e=>e.theme.appColors.hex(60)}; + padding-left: ${eI.UiSpacing.getPx(1.5)}; +`,elY=function(e){let{task:t}=e,a=t.document,n=ev.useRef(null),l=(0,eI.useMenuItem)({stopRef:n,name:"redirect",value:JSON.stringify({pathname:`/d/${t.document_id}`,hash:`#node-${t.node_id}`})});if(null==a)return ev.createElement(elW,l.props,ev.createElement(V6,null),ev.createElement(elG,{$isUntitled:!1},ev.createElement(eY.Z,{id:"general.project",defaultMessage:"Project"})));let r=null==a.info.title||0===a.info.title.length;return ev.createElement(elW,l.props,ev.createElement(elH,null,ev.createElement(V7,{project:a})),ev.createElement(elG,{$isUntitled:r},a.info.title||"Untitled"),ev.createElement(elK,null,t.text_string))},elQ=(0,eL.default)(tA).withConfig({displayName:"styled__StyledMenuContainer",componentId:"sc-70d2564d-0"})` + ${tM}; + + max-height: 300px; + overflow-y: scroll; +`,elJ=eL.default.span.withConfig({displayName:"styled__Header",componentId:"sc-70d2564d-1"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(40)}; + padding: var(--menu-item-padding); + padding-bottom: ${eI.UiSpacing.getPx(3)}; + display: flex; + justify-content: space-between; + user-select: none; + position: relative; +`,elX=eL.default.div.withConfig({displayName:"styled__SpinnerContainer",componentId:"sc-70d2564d-2"})` + display: flex; + align-items: center; + justify-content: center; + position: absolute; + right: 12px; + top: 0; +`,el0=function(e){let{backlinkConnection:t,loading:a}=e,[n,l]=ev.useState(null),r=ev.useContext(eI.MenuGroupContext);return ev.useEffect(()=>{if(null==n)return;let e=tN()(function(){if(null==n)return;let e=n.scrollHeight-n.clientHeight;(!(e>0)||n.scrollTop===e)&&t.pageInfo.hasNextPage&&r?.({type:"Activate",payload:{name:"load_more"}})},350);return e(),n.addEventListener("scroll",e),()=>{n.removeEventListener("scroll",e)}},[t.pageInfo.hasNextPage,n,r]),ev.createElement(elQ,{ref:l},ev.createElement(elJ,null,ev.createElement(eY.Z,{id:"general.backlinks.linked_to_this_project",defaultMessage:"Linked to this project"}),a&&ev.createElement(elX,null,ev.createElement(eI.Spinner,{width:10,height:10}))),t.edges.map(e=>ev.createElement(ev.Fragment,null,"Task"===e.node.__typename&&ev.createElement(elY,{key:e.node.id,task:e.node}))))},el1={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DocumentBacklinksQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"backlinks"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Task"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"document_id"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"text_string"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}}]}}]}}]}}]},el2=function(e){let{projectId:t}=e,a=(0,eF.k6)(),[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:n,placement:"bottom",computeModifiersCallback:tr}),d=(0,eI.useMenuButton)({dispatch:l,ref:o,state:n}),{data:c,loading:m,fetchMore:u,refetch:p}=(0,eB.a)(el1,{variables:{projectId:t,first:10},fetchPolicy:"cache-first",nextFetchPolicy:"cache-and-network"}),g=ev.useMemo(()=>null==c||null==c.document?0:c.document.backlinks.totalCount,[c]),f=ev.useMemo(()=>c?.document?.backlinks?.pageInfo?.endCursor,[c]),h=ev.useCallback(e=>{switch(e.type){case"Activate":switch(e.payload.name){case"redirect":{let{pathname:t,hash:n}=JSON.parse(e.payload.value??"{}");a.push({pathname:t,hash:n});break}case"load_more":if(null==f)return;u({variables:{projectId:t,after:f}})}break;case"Dismiss":l({type:"Collapse"})}},[a,f,u,t]),y=ev.useCallback(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),0!==g&&(n.expanded?r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):l({type:"Expand",payload:"first"}))},[g,n.expanded]);return(ev.useEffect(()=>{n.expanded&&p()},[n.expanded,p]),0===g)?null:ev.createElement(ev.Fragment,null,ev.createElement(tP,{...d.props,onClick:y},ev.createElement(tn.Icon,{icon:"addon_backlink"}),ev.createElement(tF,null,ev.createElement(eY.Z,{id:"general.backlinks_counter",defaultMessage:` + {backlinkCount} {backlinkCount, plural, + one {Backlink} + other {Backlinks} + }`,values:{backlinkCount:g}}))),n.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:l,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:h},ev.createElement(t$,{initialFocus:s.initialFocus,ref:r,width:"400px"},c?.document!=null&&ev.createElement(el0,{backlinkConnection:c.document.backlinks,loading:m})))))},el5={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PiecesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NamedType",name:{kind:"Name",value:"PieceFiltering"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieces"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"logoUrl"}},{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"authDesc"}},{kind:"Field",name:{kind:"Name",value:"triggers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},el3={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"flow"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]},el4=function(e){let{trigger:t,onSelect:a}=e,n=ev.useRef(null),l=ev.useCallback(()=>{a(t)},[a,t]),r=(0,eI.useMenuItem)({onClick:l,stopRef:n}),o=(0,eq.omit)(r.props,"onMouseEnter");return ev.createElement("button",{className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",key:t.name,...o},ev.createElement("img",{src:t.icon,className:"size-5"}),t.displayName)},el6=function(e){let{triggers:t,spaceId:a,projectId:n,projectName:l}=e,[r]=(0,cs.D)(el3),o=(0,eF.k6)(),i=async e=>{let t=(0,ld.Z)(),i=await r({variables:{input:{clientMutationId:t,name:`${l} (${e.displayName})`,spaceId:a,trigger:{type:"PIECE_TRIGGER",valid:!0,displayName:e.displayName,name:"trigger",settings:{pieceName:e.pieceName,pieceVersion:"BLANK",input:{projectId:n},inputUiInfo:{},triggerName:e.name}},projectId:n}}}),s=i.data?.flowCreate.flow.id;null!=s&&o.push(`/f/${s}`)};return ev.createElement(ev.Fragment,null,ev.createElement("span",{className:"mb-1 flex items-center gap-px px-3 text-xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.trigger",defaultMessage:"Trigger"})),t.map(e=>ev.createElement(el4,{key:e.name,trigger:e,onSelect:i})),ev.createElement(sC.rU,{to:`/spaces/${a}/flows`,className:"flex items-center gap-x-2 px-3 py-1 text-sm text-appcolor-500 hover:bg-appcolor-300 hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"automate_add"}),ev.createElement(eY.Z,{id:"automation.add_automation",defaultMessage:"Add automation"})))},el8=function(e){let{spaceId:t,projectId:a,projectName:n}=e,l=ev.useCallback(e=>{e.stopPropagation()},[]),r=(0,aK.useRovingTabindexState)(),o=(0,aK.useRovingTabindexDispatch)();ev.useEffect(()=>{0!==r.stops.length&&o({type:aK.ActionTypes.First})},[r.stops.length,o]);let{data:i,error:s,loading:d}=(0,eB.a)(el5,{variables:{filterby:{pieceIdList:["@taskade/automade-internalpiece-taskade"]}}}),c=ev.useMemo(()=>{let e=[];return i?.pieces.forEach(t=>t.triggers?.forEach(a=>{e.push({name:a.name,displayName:a.displayName,pieceName:t.name,icon:t.logoUrl})})),e},[i?.pieces]);return d?ev.createElement("div",{className:"flex flex-col py-3.5",onClick:l},ev.createElement(eI.Spinner,{size:30})):null!=s?ev.createElement("div",{className:"flex flex-col py-3.5",onClick:l},s.message):ev.createElement("div",{className:"flex flex-col py-3.5",onClick:l},ev.createElement(el6,{triggers:c,projectId:a,spaceId:t,projectName:n}))},el7=function(e){let{spaceId:t,projectId:a,projectName:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),d=ev.useCallback(e=>{switch(e.type){case"Activate":case"Dismiss":r({type:"Collapse"})}},[r]),c=ev.useCallback(()=>{i.current?.focus()},[]);(0,eI.usePopupEvents)({state:l,onCollapse:c});let m=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:l,placement:"bottom"}),u=(0,eI.useMenuButton)({dispatch:r,ref:i,state:l}),p=ev.useMemo(()=>e=>{l.expanded?o.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):r({type:"Expand",payload:"first"}),e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[l.expanded]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...u.props,className:"inline-flex h-6 items-center gap-x-1 rounded-2xl border-[1px] border-solid border-appcolor-300 bg-appcolor-100 px-2 text-xs hover:border-appcolor-400",onClick:p},ev.createElement(tn.Icon,{icon:"automate_flow",className:"h-5 w-4"}),ev.createElement(eY.Z,{id:"flow.automation",defaultMessage:"Automation"})),l.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:r,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(eI.Menu,{className:"flex w-60 flex-col rounded-xl border border-appcolor-300 bg-appcolor-0",initialFocus:m.initialFocus,ref:o},ev.createElement(el8,{spaceId:t,projectId:a,projectName:n})))))},el9=(0,la.ZP)` + fragment DocumentSharedPreferencesFragment on Document { + id + shared_preferences + } +`,ere=(0,la.ZP)` + mutation ProjectDueDateAddMutation($input: ProjectDueDateAddInput!) { + projectDueDateAdd(input: $input) { + clientMutationId + ok + documentID + start + end + } + } +`,ert=(0,la.ZP)` + mutation ProjectDueDateRemoveMutation($input: ProjectDueDateRemoveInput!) { + projectDueDateRemove(input: $input) { + clientMutationId + ok + } + } +`,era=eL.default.div.withConfig({displayName:"styled__CalendarPickerWrapper",componentId:"sc-a7d072e6-0"})` + margin: 0 ${eI.UiSpacing.getPx(3.5)} ${eI.UiSpacing.getPx(3)}; +`,ern=eL.default.div.withConfig({displayName:"styled__Footer",componentId:"sc-a7d072e6-1"})` + display: flex; + padding: 10px ${eI.UiSpacing.getPx(3)} 0; + column-gap: ${eI.UiSpacing.getPx(2)}; +`,erl=eL.default.button.withConfig({displayName:"styled__ButtonBase",componentId:"sc-a7d072e6-2"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(3)}; + + display: flex; + background: none; + width: 49%; + border: 0; + font-weight: 500; + margin: 0; + outline: 0; + cursor: pointer; + justify-content: center; + + &:focus { + outline: 0; + } +`,err=(0,eL.default)(erl).withConfig({displayName:"styled__DeleteButton",componentId:"sc-a7d072e6-3"})` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(30)}; + + &:hover { + color: ${e=>e.theme.textColors.hex(40)}; + } +`,ero=(0,eL.default)(erl).withConfig({displayName:"styled__CancelButton",componentId:"sc-a7d072e6-4"})` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(50)}; + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,eri=(0,eL.default)(erl).withConfig({displayName:"styled__SetButton",componentId:"sc-a7d072e6-5"})` + color: ${e=>e.disabled?e.theme.textColors.hex(60):"#FFF"}; + + background: ${e=>e.disabled?e.theme.primaryColorScheme?.alpha50:e.theme?.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.disabled?e.theme.primaryColorScheme?.alpha50:e.theme?.primaryColorScheme?.alpha80}; + } +`,ers=function(e){let{documentId:t,userTimezone:a,onButtonClick:n,dateRange:l}=e,o=(0,ev.useMemo)(()=>a??cw,[a]),d=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),[c]=(0,cs.D)(ere),[m]=(0,cs.D)(ert),[u,p]=(0,ev.useState)(()=>null==l?null:ez.DateDuration.fromDateRangeDesc(l).toDisplayState().startTimezone),[g,f]=(0,ev.useState)(()=>null==l?null:ez.DateDuration.fromDateRangeDesc(l).toDisplayState().endTimezone),h=null!=l?ez.DateDuration.fromDateRangeDesc(l):null,{pickerProps:y,dispatch:b,output:v}=nx({pickerMode:r.End,startDate:h?.startMoment??null,startTime:h?.toDisplayState().startTime??null,endDate:h?.endMoment??null,endTime:h?.toDisplayState().endTime??null,quirks:{dateDependencyMode:i.MustHaveEnd,disableTime:!1,sameDateNoTimeResolutionStrategy:s.EndDate,autoSwitchMode:!0}});(0,ev.useEffect)(()=>{if(null==l){b({type:"update_state",startDate:null,startTime:null,endDate:null,endTime:null});return}let{startDate:e,startTime:t,endDate:a,endTime:n}=ez.DateDuration.fromDateRangeDesc(l).toDisplayState();b({type:"update_state",startDate:e,startTime:t,endDate:a,endTime:n})},[b,l]),(0,ev.useEffect)(()=>{let{startDate:e,endDate:t}=v;null!=e&&p(e=>e??o),null!=t&&f(e=>e??o)},[v,o]);let k=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();let{startDate:a,startTime:l,endDate:r,endTime:o}=v,i=ez.DateDuration.fromDisplayState({startDate:a,startTime:l,endDate:r,endTime:o,startTimezone:u,endTimezone:g});if(null==i)return;let s=i.toCanonicalDateTimeDesc(),d=(0,ld.Z)();c({variables:{input:{clientMutationId:d,documentID:t,start:s.start,end:s.end}},optimisticResponse:{__typename:"Mutation",projectDueDateAdd:{__typename:"ProjectDueDateAddPayload",clientMutationId:d,ok:!0,documentID:t,start:s.start,end:s.end}},update:(e,a)=>{let n=a.data,l=e.readFragment({id:`Document:${t}`,fragment:el9,fragmentName:"DocumentSharedPreferencesFragment"});null!=l&&e.writeFragment({id:`Document:${t}`,fragment:el9,data:(0,es.ZP)(l,e=>(e.shared_preferences.start=s.start,e.shared_preferences.end=s.end,null!=n&&(e.shared_preferences.start=n.projectDueDateAdd.start,e.shared_preferences.end=n.projectDueDateAdd.end),e))})}}),n(e)},[t,c,v,n,u,g]),E=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();let a=(0,ld.Z)();m({variables:{input:{clientMutationId:a,documentID:t}},optimisticResponse:{__typename:"Mutation",projectDueDateRemove:{__typename:"ProjectDueDateRemovePayload",clientMutationId:a,ok:!0}},update:e=>{let a=e.readFragment({id:`Document:${t}`,fragment:el9,fragmentName:"DocumentSharedPreferencesFragment"});null!=a&&e.writeFragment({id:`Document:${t}`,fragment:el9,data:(0,es.ZP)(a,e=>(e.shared_preferences.start=null,e.shared_preferences.end=null,e))})}}),n(e)},[t,m,n]),x=(0,ev.useCallback)(e=>{n(e)},[n]),_=(0,ev.useMemo)(()=>{let{endDate:e}=v;return null==e},[v]),w=(0,ev.useCallback)(e=>{e.key!==eI.KeyboardKeys.Escape&&e.nativeEvent.stopImmediatePropagation()},[]),N=eG().localeData().longDateFormat("L"),C=`e.g. ${eG()("2:30 AM","hh:mm A").format("LT")}`;return ev.createElement(tA,{onClick:d,onMouseDown:e=>{e.stopPropagation()},onKeyDown:w},ev.createElement(era,null,ev.createElement(ny,{pickerProps:y,focusPlaceholderDateStart:N,focusPlaceholderDateEnd:N,focusPlaceholderTimeStart:C,focusPlaceholderTimeEnd:C,formatDate:N,formatTime:"LT"})),(null!=u||null!=g)&&ev.createElement(Rl,{startTimezone:u,endTimezone:g,onStartTimezoneChange:p,onEndTimezoneChange:f}),ev.createElement(ern,null,null!=l?ev.createElement(err,{type:"button",onClick:E},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})):ev.createElement(ero,{type:"button",onClick:x},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(eri,{type:"button",onClick:k,disabled:_},null!=l?ev.createElement(eY.Z,{id:"general.change",defaultMessage:"Change"}):ev.createElement(eY.Z,{id:"general.set",defaultMessage:"Set"}))))},erd=function(e){let{userTimezone:t,onClick:a,menuButtonProps:n,dateRange:l}=e,r=(0,ev.useMemo)(()=>t||eG().tz.guess()||"Etc/UTC",[t]),o=null!=l,i=(0,ev.useMemo)(()=>null==l?"":ez.DateDuration.fromDateRangeDesc(l).toReadableFormat({timezone:r}),[l,r]);return null==a&&null==l?null:ev.createElement(tP,{...n,onClick:a},ev.createElement(lT.pV,{className:"meta-icon"}),ev.createElement(tF,null,o?i:ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})))},erc=function(e){let{documentId:t,role:a,sharedPreferences:n}=e,l=(0,ev.useRef)(null),r=(0,ev.useRef)(null),[o,i]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),s=Eu({role:a?.workspace,action:"schedule_project"}),d=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"bottom",computeModifiersCallback:tr}),c=(0,eI.useMenuButton)({ref:l,state:o,dispatch:i}),m=(0,ev.useMemo)(()=>{if(s)return e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o.expanded?i({type:"Collapse"}):i({type:"Expand",payload:"first"})}},[s,o.expanded]),u=(0,ev.useCallback)(()=>{o.expanded&&i({type:"Collapse"})},[o.expanded]),p=n?.start,g=n?.end,f=null!=p?{start:p,end:g}:null,{data:h,loading:y}=(0,eB.a)(sN);return y||h?.me?.timezone==null?null:ev.createElement(ev.Fragment,null,ev.createElement(erd,{menuButtonProps:c.props,onClick:m,dateRange:f,userTimezone:h.me?.timezone}),o.expanded&&ev.createElement(eI.Popup,{...d.props,modal:!0,dispatch:i},ev.createElement(t$,{initialFocus:d.initialFocus,loop:!0,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},ev.createElement(ers,{documentId:t,dateRange:f,userTimezone:h.me?.timezone,onButtonClick:u}))))},erm="#f15575",eru={"color-1":"#f15575","color-2":"#F83853","color-3":"#565CD2","color-4":"#3B3AC9","color-5":"#42CDFC","color-6":"#00BBFC","color-7":"#20E6E5","color-8":"#00D7D7","color-9":"#00EA7D","color-10":"#00C567","color-11":"#FFC138","color-12":"#FFA900","color-13":"#FFDD4B","color-14":"#FFD300","color-15":"#D2DAE1","color-16":"#808E9C"};function erp(e){return null==e?erm:eru[e]??erm}function erg(){let e=[];return Object.entries(eru).forEach(t=>{let[a,n]=t;e.push({name:a,hex:n})}),e}let erf=(0,eL.default)(lT.k1).withConfig({displayName:"TagPill__StyledIconTag",componentId:"sc-96d2f779-0"})` + margin-right: 3px; + ${function(e){let t=erp(e.$color);return(0,eL.css)` + & path:first-child { + fill: ${t}; + } + & path:last-child { + stroke: ${t}; + } + `}} +`,erh=function(e){let{onSelect:t,tag:a}=e,n=(0,ev.useMemo)(()=>{if(null!=t)return e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t(a)}},[t,a]);return ev.createElement(tP,{$assigned:!0,type:"button",onClick:n},ev.createElement(erf,{$color:a.preferences?.color}),ev.createElement(tF,null,a.raw_key))},ery=function(e){let{onSelect:t,tags:a}=e,{edges:n}=a;return ev.createElement(ev.Fragment,null,n.map(e=>{let a=e.node;return ev.createElement(erh,{key:a.id,onSelect:t,tag:a})}))},erb={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"DocumentTagsParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Document"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"color"}}]}},{kind:"Field",name:{kind:"Name",value:"raw_key"}}]}}]}}]}}]}}]};function erv(e,t,a,n){let l=`Document:${e}`,r=n.readFragment({id:l,fragment:erb});if(null==r||null==r.tags.edges)return;let o=r.tags.edges,i=o.findIndex(e=>null!=e&&null!=e.node&&e.node.id===t.id.toString());if(a){if(-1!==i)return;o=[...o,{node:t}]}else{if(-1===i)return;(o=[...o]).splice(i,1)}r={...r,tags:{...r.tags,edges:o}},n.writeFragment({id:l,fragment:erb,data:r})}let erk=function(e){let{onClick:t,menuButtonProps:a}=e;return null==t?null:ev.createElement(tP,{$assigned:!1,...a,onClick:t},ev.createElement(lT.TU,{className:"meta-icon"}),ev.createElement(tF,null,ev.createElement(eY.Z,{id:"general.tag",defaultMessage:"Tag"})))},erE=(0,la.ZP)` + query SpaceTagsQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + space { + id + tags(first: null) { + edges { + node { + id + key + preferences { + color + } + raw_key + } + } + } + } + } + } +`,erx=(0,la.ZP)` + query document($documentID: ID!) { + document(id: $documentID) { + id + tags(first: null) { + edges { + node { + id + key + raw_key + preferences { + color + } + } + } + } + } + } +`;(0,la.ZP)` + query document($documentID: ID!) { + document(id: $documentID) { + id + edit_path + view_path + is_owner + info + shared_preferences + user { + ...BasicUserFields + } + space { + id + } + collaborators { + id + initials + default_name + handle + avatars { + hdpi { + url + } + } + } + } + } + ${up} +`;let er_=(0,la.ZP)` + query { + me { + id + handle + tags(first: null) { + edges { + node { + id + key + preferences { + color + } + raw_key + } + } + } + } + } +`,erw=(0,la.ZP)` + query membership($spaceID: ID!) { + membership(space_id: $spaceID) { + id + space { + id + tags(first: null) { + edges { + node { + id + key + preferences { + color + } + raw_key + } + } + } + } + } + } +`;(0,la.ZP)` + query spaceAssignedUsers($spaceID: ID!, $archived: Boolean!) { + membership(space_id: $spaceID) { + id + space { + id + assignees(archived: $archived, first: null) { + edges { + node { + ...BasicUserFields + } + } + } + } + } + } + ${up} +`,(0,la.ZP)` + query($space_id: ID) { + membership(space_id: $space_id) { + id + role + space { + id + name + color + invite_link + memberships { + id + role + user { + ...BasicUserFields + } + } + } + } + } + ${up} +`;let erN="SWITCH_TO_TAGS_MENU_SCREEN",erC="SWITCH_TO_TAG_FORM_SCREEN";function erM(e){return{type:erC,payload:{tag:e}}}let erS=eL.default.div.withConfig({displayName:"TagTextField__StyledInputWrapper",componentId:"sc-3b91e2f1-0"})` + top: 0; + background: ${e=>e.theme.appColors.hex(100)}; + padding: 0 12px ${eI.UiSpacing.getPx(2)}; +`,erI=eL.default.input.withConfig({displayName:"TagTextField__StyledInput",componentId:"sc-3b91e2f1-1"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + + width: 100%; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; +`,erD=eL.default.span.withConfig({displayName:"TagTextField__StyledErrorLabel",componentId:"sc-3b91e2f1-2"})` + color: ${eI.ThemeColors.danger}; + ${e1.UiTypography.xs} +`,erT=function(e){let{errorMessage:t,onChange:a,placeholder:n,value:l}=e,r=(0,ev.useCallback)(e=>{r7(e.nativeEvent)&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())},[]),o=(0,ev.useRef)(null),i=(0,aK.useRovingTabindexDispatch)(),s=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i({type:aK.ActionTypes.First})},[i]),d=(0,eI.useMenuItem)({onClick:s,stopRef:o,name:"input"}),c=(0,eq.omit)(d.props,"onMouseEnter");return ev.createElement(erS,null,ev.createElement(erI,{...c,type:"text",placeholder:n,value:l,ref:o,onKeyDown:r,onChange:a}),null!=t&&ev.createElement(erD,null,"string"==typeof t?t:ev.createElement(eY.Z,t)))},er$=eL.default.div.withConfig({displayName:"ColorField__ColorCircleGrid",componentId:"sc-665c0711-0"})` + display: grid; + width: 100%; + padding: 0 ${eI.UiSpacing.getPx(3.5)}; + grid-template-columns: repeat(6, ${eI.UiSpacing.getPx(8)}); + grid-template-rows: repeat(3, 1fr); + column-gap: ${eI.UiSpacing.getPx(2.5)}; + row-gap: ${eI.UiSpacing.getPx(1.5)}; + align-items: center; + justify-content: start; + margin-top: ${eI.UiSpacing.getPx(2.5)}; +`,erP=eL.default.div.withConfig({displayName:"ColorField__ColorCircle",componentId:"sc-665c0711-1"})` + height: ${eI.UiSpacing.getPx(7)}; + width: ${eI.UiSpacing.getPx(7)}; + border-radius: 50%; + background-color: ${e=>e.$color}; + border: 2px solid ${e=>e.theme.isNightMode?"#222":"#f2f2f2"}; + + cursor: pointer; + + &:focus { + border: 2px solid ${e=>e.theme.isNightMode?"#222":"#f2f2f2"}; + box-shadow: 0 0 0 2px ${e=>e.$color}; + outline: 0; + } + + ${e=>e.$checked?(0,eL.css)` + border: 2px solid ${e.theme.isNightMode?"#222":"#f2f2f2"}; + box-shadow: 0 0 0 2px ${e.$color}; + `:void 0} +`,erF=function(e){let{checked:t,color:a,value:n,onSelect:l}=e,r=(0,ev.useMemo)(()=>{if(null!=l)return()=>{l(n)}},[l,n]);return ev.createElement(erP,{$color:a,$checked:t,onClick:r})},erA=function(e){let{onSelect:t,value:a}=e,n=(0,ev.useMemo)(()=>erg(),[]);return ev.createElement(er$,null,n.map(e=>ev.createElement(erF,{key:e.name,checked:e.name===a,color:e.hex,value:e.name,onSelect:t})))},erR=(0,la.ZP)` + mutation CreateTagMutation($input: CreateTagInput!) { + createTag(input: $input) { + clientMutationId + tag { + id + key + raw_key + preferences { + color + } + } + } + } +`,erj=(0,la.ZP)` + mutation DeleteTagMutation($input: DeleteTagInput!) { + deleteTag(input: $input) { + clientMutationId + ok + } + } +`,erO=(0,la.ZP)` + mutation EditTagMutation($input: EditTagInput!) { + editTag(input: $input) { + clientMutationId + tag { + id + key + raw_key + preferences { + color + } + } + } + } +`,erU=eL.default.div.withConfig({displayName:"TagForm__Body",componentId:"sc-f133b58f-0"})` + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +`,erZ=eL.default.div.withConfig({displayName:"TagForm__ButtonBar",componentId:"sc-f133b58f-1"})` + display: grid; + grid-template-columns: 1fr 1fr; + column-gap: ${eI.UiSpacing.getPx(2)}; + + width: 100%; + flex-direction: row; + align-items: center; + justify-content: center; + margin: ${eI.UiSpacing.getPx(3.5)} 0 0; + padding: 0 ${eI.UiSpacing.getPx(3.5)}; +`,erL=eL.default.button.withConfig({displayName:"TagForm__SecondaryButton",componentId:"sc-f133b58f-2"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(3)}; + + border: 0; + background-color: ${e=>e.theme.appColors.hex(80)}; + color: #999; + cursor: pointer; + font-weight: 500; + + &:hover, + &:focus { + outline: none; + background-color: ${e=>e.theme.appColors.hex(70)}; + } +`,erB=(0,eL.default)(erL).withConfig({displayName:"TagForm__PrimaryButton",componentId:"sc-f133b58f-3"})` + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + + &:hover, + &:focus { + outline: none; + background-color: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } +`,erz=function(e){let{tag:t,spaceId:a,documentId:n,dispatch:l}=e,r=erg(),[o,i]=(0,ev.useState)(()=>t?.preferences?.color??r[0].name),[s,d]=(0,ev.useState)(()=>t?.raw_key??""),c=(0,eF.TH)(),m=(0,eF.k6)(),[u,p]=(0,cs.D)(erR),[g,f]=(0,cs.D)(erj),[h,y]=(0,cs.D)(erO),b=p.error?.graphQLErrors[0]?.message??f.error?.graphQLErrors[0]?.message??y.error?.graphQLErrors[0]?.message,v=[{query:erx,variables:{documentID:n}},{query:erw,variables:{spaceID:a}},{query:er_}],k=(0,ev.useCallback)(e=>{d(e.target.value)},[]),E=(0,ev.useCallback)(e=>{i(e)},[]),x=(0,ev.useCallback)(()=>{l({type:erN})},[l]),_=async()=>{await u({variables:{input:{color:o,rawKey:s,spaceID:a,clientMutationId:(0,ld.Z)()}},refetchQueries:v,awaitRefetchQueries:!0}),x()},w=()=>{let e=window.location.search,t=new URLSearchParams(e).getAll("label").filter(e=>e!==s),a=new URLSearchParams;t.forEach(e=>{a.append("label",e)}),m.push((c?.pathname??"")+"?"+a.toString())},N=async()=>{await h({variables:{input:{id:t.id,color:o,rawKey:s,clientMutationId:(0,ld.Z)()},refetchQueries:v,awaitRefetchQueries:!0}}),w(),x()};return ev.createElement(ev.Fragment,null,ev.createElement(erT,{errorMessage:b,onChange:k,value:s,placeholder:"Name"}),ev.createElement(tO,null,ev.createElement(eY.Z,{id:"general.colors",defaultMessage:"Colors"})),ev.createElement(erU,null,ev.createElement(erA,{onSelect:E,value:o}),ev.createElement(erZ,null,null!=t?ev.createElement(ev.Fragment,null,ev.createElement(erL,{onClick:()=>{g({variables:{input:{id:t.id,clientMutationId:(0,ld.Z)()}},refetchQueries:v,awaitRefetchQueries:!0}),w(),x()}},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})),ev.createElement(erB,{onClick:N},ev.createElement(eY.Z,{id:"general.update",defaultMessage:"Update"}))):ev.createElement(ev.Fragment,null,ev.createElement(erL,{onClick:x},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(erB,{onClick:_},ev.createElement(eY.Z,{id:"general.create",defaultMessage:"Create"}))))))},erV=eL.default.button.withConfig({displayName:"MenuItem__StyledMenuButton",componentId:"sc-17efefab-0"})` + width: 100%; + padding: 0 ${eI.UiSpacing.getPx(3.5)}; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + border: 0; + background: ${e=>e.theme.appColors.hex(100)}; + cursor: pointer; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + outline: none; + } + + font-weight: ${e=>e.selected?"500":"inherit"}; +`,erq=eL.default.div.withConfig({displayName:"NewTagMenuItem__Container",componentId:"sc-380e1e94-0"})` + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + width: 100%; + overflow-wrap: break-word; + overflow: hidden; +`,erW=eL.default.span.withConfig({displayName:"NewTagMenuItem__Label",componentId:"sc-380e1e94-1"})` + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + padding: 6.529px 0; +`,erH=(0,eL.default)(lT.TU).withConfig({displayName:"NewTagMenuItem__StyledIconTagAdd",componentId:"sc-380e1e94-2"})` + margin-right: var(--menu-item-gap); + + > path { + stroke: ${e=>e.$assigned?e.theme.appColors.hex(10):e.theme.appColors.hex(50)}; + } +`,erG=function(e){let{onClick:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({onClick:t,stopRef:a}),l=(0,eq.omit)(n.props,"onMouseEnter");return ev.createElement(erV,{...l,onClick:t},ev.createElement(erq,null,ev.createElement(erH,null),ev.createElement(erW,null,ev.createElement(eY.Z,{id:"general.new_tag",defaultMessage:"New tag"}))))},erK=(0,eL.default)(lT.k1).withConfig({displayName:"TagMenuItem__StyledIconTag",componentId:"sc-36aef5d3-0"})` + margin-right: var(--menu-item-gap); + ${function(e){let t=erp(e.$color);return(0,eL.css)` + & path:first-child { + fill: ${t}; + stroke: ${t}; + } + & path:last-child { + stroke: ${t}; + } + `}}; + flex-shrink: 0; +`,erY=eL.default.button.withConfig({displayName:"TagMenuItem__StyledEditButton",componentId:"sc-36aef5d3-1"})` + visibility: hidden; + flex-direction: row; + padding: 0; + background-color: transparent; + border: 0; + cursor: pointer; + + display: flex; + align-items: center; + + :focus { + outline: none; + } + + ${tR}:hover & { + visibility: visible; + } +`,erQ=(0,eL.default)(lT._r).withConfig({displayName:"TagMenuItem__StyledIconTagEdit",componentId:"sc-36aef5d3-2"})` + width: 20px; + height: 20px; + & path { + fill: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + } + ${erY}:hover & { + & path { + fill: ${e=>e.theme.isNightMode?"#ccc":"#999"}; + } + } +`,erJ=(0,eL.default)(lT.MM).withConfig({displayName:"TagMenuItem__IconFilterSelected",componentId:"sc-36aef5d3-3"})` + display: flex; + height: 30px; + margin-left: auto; + flex: 1 0 auto; + justify-self: flex-end; + + path { + fill: ${e=>e.selected?e.theme?.primaryColorScheme?.base:"transparent"}; + } +`,erX=function(e){let{onSelect:t,tag:a,onEdit:n,selected:l}=e,r=(0,aK.useRovingTabindexDispatch)(),o=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),n(a)},[n,a]),i=a.preferences?.color,s=a.raw_key,d=ev.useRef(null),c=(0,ev.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t(a),r({type:aK.ActionTypes.Navigate,payload:d})},[t,r,a]),m=(0,eI.useMenuItem)({onClick:c,stopRef:d}),u=(0,eq.omit)(m.props,"onMouseEnter");return ev.createElement(erV,{...u,selected:l},ev.createElement(tR,null,ev.createElement(erK,{$color:i}),ev.createElement(tj,{style:{textAlign:"left"}},s),ev.createElement(erY,{onClick:o},ev.createElement(erQ,{$color:i}))),ev.createElement(erJ,{selected:l}))},er0=eL.default.div.withConfig({displayName:"TagsMenu__ScrollbarWrapper",componentId:"sc-ce0b6417-0"})` + max-height: 360px; + overflow-x: hidden; + overflow-y: scroll; + ${tS} +`,er1=function(e){let{documentTags:t,spaceTags:a,onSelectTag:n,dispatch:l}=e,r=(0,ev.useMemo)(()=>new Set(t.edges.map(e=>e.node.key)),[t]),o=(0,ev.useMemo)(()=>new to.Z(Array.from(a.edges.map(e=>e.node)),{keys:["key","raw_key"]}),[a]),[i,s]=(0,ev.useState)(""),d=(0,ev.useCallback)(e=>{s(e.target.value)},[]),c=(0,ev.useMemo)(()=>ts()(i)?Array.from(a.edges,(e,t)=>({item:e.node,refIndex:t})):o.search(i),[i,o,a]),m=(0,ev.useCallback)(e=>{l(erM(e))},[l]),u=(0,ev.useCallback)(()=>{l(erM())},[l]);return ev.createElement(ev.Fragment,null,ev.createElement(erT,{placeholder:"Filter",value:i,onChange:d}),ev.createElement(er0,null,ev.createElement(tO,null,ev.createElement(eY.Z,{id:"general.tags",defaultMessage:"Tags"})),c.map(e=>{let t=e.item;return ev.createElement(erX,{key:t.key,tag:t,selected:r.has(t.key),onSelect:n,onEdit:m})}),ev.createElement(erG,{onClick:u})))};function er2(e,t){switch(t.type){case erN:return(0,es.ZP)(e,e=>(e.screen=G.TagsMenu,delete e.tag,e));case erC:return(0,es.ZP)(e,e=>(e.screen=G.TagForm,e.tag=t.payload.tag,e));default:return e}}!function(e){e[e.TagsMenu=0]="TagsMenu",e[e.TagForm=1]="TagForm"}(G||(G={}));let er5=function(e){let{spaceId:t,documentId:a,documentTags:n,onSelectTag:l}=e,[r,o]=(0,ev.useReducer)(er2,{screen:G.TagsMenu}),i=(0,ev.useCallback)(e=>{e.stopPropagation()},[]),{data:s,error:d,loading:c}=(0,eB.a)(erE,{variables:{spaceId:t}}),m=(0,aK.useRovingTabindexState)(),u=(0,aK.useRovingTabindexDispatch)();if((0,ev.useEffect)(()=>{0!==m.stops.length&&u({type:aK.ActionTypes.First})},[m.stops.length,u]),c)return ev.createElement(tA,{onClick:i},ev.createElement(eI.Spinner,{size:30}));if(null!=d)return ev.createElement(tA,{onClick:i},d.message);let p=s?.membership?.space?.tags;if(null==p)return ev.createElement(tA,{onClick:i},"Unexpected Error");switch(r.screen){case G.TagsMenu:return ev.createElement(tA,{onClick:i},ev.createElement(er1,{documentTags:n,spaceTags:p,onSelectTag:l,dispatch:o}));case G.TagForm:return ev.createElement(tA,{onClick:i},ev.createElement(erz,{tag:r.tag,documentId:a,spaceId:t,dispatch:o}))}},er3={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TagDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TagDocumentInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tagDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},er4=function(e){let{spaceId:t,documentId:a,documentTags:n,role:l}=e,r=Ck({role:l,action:{workspace:"create_tag"}}),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=ev.useRef(null),d=ev.useRef(null),c=ev.useRef(null),m=ev.useCallback(e=>{switch(e.type){case"Activate":case"Dismiss":i({type:"Collapse"})}},[i]),u=ev.useCallback(()=>{d.current?.focus()},[]);(0,eI.usePopupEvents)({state:o,onCollapse:u});let p=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:o,placement:"bottom",computeModifiersCallback:tr}),g=(0,eI.useMenuButton)({dispatch:i,ref:d,state:o}),f=(0,ll.x)(),h=ev.useMemo(()=>{if(r)return e=>{o.expanded?s.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):i({type:"Expand",payload:"first"}),e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},[r,o.expanded]),y=(0,ev.useCallback)(e=>{let t=(0,ld.Z)(),l=-1===n.edges.findIndex(t=>t.node.id===e.id);f.mutate({mutation:er3,variables:{input:{clientMutationId:t,documentID:a,tagID:e.id,tagged:l}},optimisticResponse:{__typename:"Mutation",tagDocument:{__typename:"TagDocumentPayload",clientMutationId:t,ok:!0}},update:t=>{erv(a,e,l,t)}})},[f,a,n]);return ev.createElement(ev.Fragment,null,ev.createElement(erk,{menuButtonProps:g.props,onClick:h}),o.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:i,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:m},ev.createElement(t$,{initialFocus:p.initialFocus,ref:s,width:"280px"},ev.createElement(er5,{documentTags:n,documentId:a,spaceId:t,onSelectTag:y})))))},er6=eL.default.div.withConfig({displayName:"ProjectAttachmentsBody__ProjectAddons",componentId:"sc-a83d39d3-0"})` + display: contents; + + & > * { + margin: 2px 4px 2px 0; + } + & > button:last-child { + margin-right: 0.25rem; + } +`,er8=function(e){let{documentId:t,assignments:a,isTemplate:n,space:l,tags:r,tagPathname:o,sharedPreferences:i,role:s,disableBacklinks:d,projectName:c}=e,m=(0,eF.TH)(),u=(0,eF.k6)(),p=Eu({role:s?.workspace,action:"create_space_flow"}),g=(0,ev.useCallback)(e=>{let t=tL.parse(m.search);t=ely(t,"label",e.key),t=ely(t,"page",null);let a=tL.stringify(t),n={search:ts()(a)?void 0:`?${a}`};null!=o&&(n.pathname=o),u.push(n)},[u,m.search,o]);return ev.createElement(er6,{className:"project-addons"},!n&&ev.createElement(erc,{documentId:t,role:s,sharedPreferences:i}),!n&&ev.createElement(elq,{assignments:a,documentId:t,role:s,spaceId:l.id}),n&&ev.createElement(elR,{projectId:t,role:s,spacePlanType:l.taskadePlanType}),ev.createElement(ery,{onSelect:g,tags:r}),ev.createElement(er4,{documentTags:r,documentId:t,role:s,spaceId:l.id}),!n&&!d&&ev.createElement(el2,{projectId:t}),p&&!n&&ev.createElement(el7,{projectId:t,spaceId:l.id,projectName:c}))},er7=function(e){let{documentId:t}=e,{data:a,error:n,loading:l}=(0,eB.a)(elp,{variables:{documentId:t}});if(null!=n)return console.log(n),ev.createElement(ev.Fragment,null,"Error loading project attachment");let r=a?.document;if(null==r)return null;let o=r.space;if(null==o)return null;let{id:i,assignments:s,role:d,tags:c,shared_preferences:m,templated_at:u}=r,p=null!=r.templated_at?`/spaces/${o.id}/templates`:`/spaces/${o.id}`;return ev.createElement(er8,{documentId:i,isTemplate:null!=u,assignments:s,role:d,space:o,tags:c,tagPathname:p,sharedPreferences:m,projectName:r.info?.title??""})},er9=eL.default.span.withConfig({displayName:"MoreButton__MenuButton",componentId:"sc-180ca304-0"})` + display: flex; + justify-content: center; + align-items: center; + width: 30px; + height: 28px; + cursor: pointer; + border-radius: 10px; + flex-shrink: 0; + position: relative; + + &[aria-expanded='true'] { + opacity: 1; + } + + & > svg { + margin-top: 6px; + & path { + fill: ${e=>e.theme.appColors.hex(60)}; + } + } + + &:hover svg { + & path { + fill: ${e=>e.theme.appColors.hex(10)}; + } + } +`,eoe=eL.default.div.withConfig({displayName:"MoreButton__TooltipReference",componentId:"sc-180ca304-1"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,eot=ev.forwardRef(function(e,t){let[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement(er9,{...e,ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},ev.createElement(tn.Icon,{icon:"header_more"}),ev.createElement(eoe,d)),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.more",defaultMessage:"More"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"’")))))}),eoa=(0,e$.connect)(function(){let e=iq();return function(t,a){return{documentID:dP(t),isViewOnly:dq(t),allowCheck:dW(t),node:e(t,a),isHideCompleted:dT(t),isAllCompleted:sr(t),isAllCollapsed:sn(t),isCollapsible:sl(t),isLoggedIn:t9(t)}}})(function(e){let{nodeID:t,documentID:a,isViewOnly:n,node:l,initialFocus:r,isHideCompleted:o,isAllCompleted:i,isAllCollapsed:s,isCollapsible:d,allowCheck:c,isLoggedIn:m}=e,u=l.hasChild,p=(0,e$.useDispatch)(),g=ev.useContext(eI.PopupDispatchContext),f=ev.useCallback(e=>{switch(e.type){case"Activate":case"Dismiss":g?.({type:"Collapse"})}},[g]);return ev.createElement(eI.MenuGroupContext.Provider,{value:f},ev.createElement(eon,{initialFocus:r,loop:!0},ev.createElement(eep,{onClick:e=>{if(e.stopPropagation(),!m){p(rh({isOpen:!0,activeView:rI,enableCopyList:void 0}));return}null!=a&&p(xE(a))}},o?ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_show_completed"}),ev.createElement(eY.Z,{id:"general.show_completed",defaultMessage:"Show completed"})):ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_hide_completed"}),ev.createElement(eY.Z,{id:"general.hide_completed",defaultMessage:"Hide completed"}))),c&&ev.createElement(ev.Fragment,null,ev.createElement(eeh,null),ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(mF())}},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_checkall"}),i?ev.createElement(eY.Z,{id:"general.uncomplete_all",defaultMessage:"Uncomplete all"}):ev.createElement(eY.Z,{id:"general.complete_all",defaultMessage:"Complete all"}))),!n&&ev.createElement(ev.Fragment,null,ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(mR())}},d&&s?ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_unfoldall"}),ev.createElement(eY.Z,{id:"general.unfold_all",defaultMessage:"Unfold all"})):ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_foldall"}),ev.createElement(eY.Z,{id:"general.fold_all",defaultMessage:"Fold all"}))),null!=a&&ev.createElement(eeZ,{documentID:a,nodeID:t,hasChild:u})))))}),eon=(0,eL.default)(eI.Menu).withConfig({displayName:"MoreMenu__StyledMenu",componentId:"sc-e6ff16cd-0"})` + display: flex; + flex-direction: column; + width: ${e=>e.$width?e.$width+"px":"inherit"}; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + max-width: 280px; + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eol=ev.forwardRef(function(e,t){let{nodeId:a,documentId:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,e$.useDispatch)(),d=l.finalFocus,c=ev.useCallback(()=>{"none"!==d&&s(mI(a,null))},[s,d,a]);(0,eI.usePopupEvents)({state:l,onCollapse:c}),ev.useImperativeHandle(t,()=>({showMenu:()=>{r({type:"Expand",payload:"first"})}}),[r]);let m=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"bottom"}),u=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l,onClick:e=>{null==n&&(e.preventDefault(),s(Fd()))}});return ev.createElement(ev.Fragment,null,ev.createElement(eot,u.props),l.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:r,modal:!0},ev.createElement(eoa,{nodeID:a,initialFocus:m.initialFocus})))}),eor={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DocumentStarredAtQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"starred_at"}}]}}]}}]},eoo=eL.default.button.withConfig({displayName:"StarButton__StarBadge",componentId:"sc-975ba99b-0"})` + display: flex; + align-items: center; + justify-content: center; + height: 30px; + width: 30px; + margin: 2px 2px 0 20px; + padding: 0; + background: none; + border: 0; + cursor: pointer; + color: ${e=>e.$isStarred?"#ffdf00":e.theme.textColors.hex("90")}; + + &:focus { + outline: 0; + } + + &:hover { + color: ${e=>e.$isStarred?"#ffdf00":e.theme.textColors.hex("70")}; + } + + @media print { + display: none !important; + } + + body.taskade-embed && { + display: none; + } +`,eoi=(0,eL.default)(tn.Icon).withConfig({displayName:"StarButton__StyledIcon",componentId:"sc-975ba99b-1"})` + flex-shrink: 0; + height: 24px; + width: 24px; +`,eos=function(e){let{documentId:t}=e,a=(0,ll.x)(),n=(0,eB.a)(eor,{variables:{documentId:t}}),l=n.data?.document;if(null==l)return null;let r=null!=l.starred_at;return ev.createElement(eoo,{onClick:()=>{if(null==l)return;let e=null!=l.starred_at;a.mutate({mutation:Mx,variables:{id:l.id,starred:!e},optimisticResponse:{__typename:"Mutation",starDocument:{__typename:"Document",id:l.id,starred_at:e?null:new Date().toString()}}})},$isStarred:r},ev.createElement(eoi,{icon:"dd_default_view"}))},eod=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-8ff43c1f-0"})` + position: relative; + display: flex; + z-index: 1; + + ${e=>"banner"===e.$coverImageType&&(0,eL.css)` + flex-direction: column; + margin-top: -70px; + row-gap: 16px; + `} +`,eoc=eL.default.div.withConfig({displayName:"styled__ProjectTitle",componentId:"sc-8ff43c1f-1"})` + display: flex; + align-items: center; +`,eom=(0,eL.default)(RV.ML).withConfig({displayName:"styled__StyledEditor",componentId:"sc-8ff43c1f-2"})` + flex-grow: 1; + font-size: 1.375rem; + width: 100%; + line-height: 28px; + font-weight: 400; + color: ${e=>e.theme.textColors.hex("10")}; +`,eou=eL.default.div.withConfig({displayName:"styled__RightSide",componentId:"sc-8ff43c1f-3"})` + flex-grow: 1; + display: flex; + flex-direction: column; +`,eop=eL.default.div.withConfig({displayName:"styled__Meta",componentId:"sc-8ff43c1f-4"})` + display: inline-flex; + align-items: center; + flex-wrap: wrap; + min-height: 30px; + margin-top: 6px; +`,eog=(0,e$.connect)(function(e){return{rootNodeID:iR(e),ancestors:iZ(e),readOnly:dq(e),value:iO(e),projectId:dP(e),percentCompleted:dY(e)}},void 0,void 0,{})(function(e){let{ancestors:t,rootNodeID:a,readOnly:n,value:l,isNewTemplate:r,projectId:o,coverImageType:i,percentCompleted:s}=e,d=(0,e$.useDispatch)(),c=(0,eK.Z)(),m=ev.useRef(null),u=ev.useMemo(()=>{let e=r?(0,eq.sample)(elc):(0,eq.sample)(elm);return null==e?r?c.formatMessage({id:"general.untitled_project",defaultMessage:"Untitled Project"}):c.formatMessage({id:"general.untitled_template",defaultMessage:"Untitled Template"}):c.formatMessage(e)},[r,c]),p=ev.useCallback(e=>{d(mN(a,e))},[d,a]),g=function(e){let{nodeID:t,ancestors:a,onMoreMenu:n}=e,l=(0,e$.useDispatch)();return ev.useMemo(()=>{let e=()=>(l(Dk(t,a,0)),!0);return[RH.OnEscape(),RH.OnEnter({onEnter:()=>(l(Dr(t,a)),!0)}),RH.OnHistory(),RH.OnNextNode({down:e,right:e}),RH.OnPaste({onPaste:e=>{if(li.Contents.isContents(e))l(Dh(t,a,e));else if("application/vnd.taskade.taskast"===e.type)l(Db(t,a,e.fragment));else{let t=Error("Unsupported paste contents");er.$e(a=>{a.setExtra("pasteContents",e),er.Tb(t)})}}}),RH.OnMoreMenu({onMoreMenu:n})]},[a,l,t,n])}({ancestors:t,nodeID:a,onMoreMenu:ev.useCallback(()=>{m?.current?.showMenu()},[])});return null==l?null:ev.createElement(eod,{$coverImageType:i},ev.createElement(Kd,{readOnly:n}),ev.createElement(eou,null,ev.createElement(eoc,null,ev.createElement(eom,{className:"mousetrap notranslate",value:l,placeholder:u,plugins:g,readOnly:n,onChange:p}),null!=o&&ev.createElement(eos,{documentId:o}),ev.createElement(eol,{nodeId:a,documentId:o,ref:m})),ev.createElement(eop,null,null!=o&&ev.createElement(ev.Fragment,null,ev.createElement(er7,{documentId:o}),ev.createElement(elu,{documentId:o})),ev.createElement(pl,{percentCompleted:s,showTooltip:!0}))))}),eof=(0,e$.connect)(function(e){return{readOnly:dq(e),user:t7(e),doc:dV(e)}})(function(e){let{documentView:t,coverImageType:a,match:n,doc:l,documentID:r,fetchStatus:o,readOnly:i,user:s,spaceId:d}=e,c=n?.params?.isNewDocument!=null,m=l?.isTemplate||n?.params?.isTemplate!=null,u=c&&m,p=ev.useRef(null),g=ev.useRef(null),f=ev.useRef(null);return o===uE?ev.createElement(J8,null):ev.createElement(eag,{$coverImage:a,onKeyDownCapture:e=>{p.current?.handleKeyDownCapture(e),g.current?.handleKeyDownCapture(e)}},null!=s&&m&&ev.createElement(zz,{isNewTemplate:u,documentID:r,documentView:t,spaceID:d}),ev.createElement(Uv,null),ev.createElement(QD,null),ev.createElement(Qc,null),ev.createElement(Xi,null,ev.createElement(zO.Wh,null,ev.createElement(eaf,{$coverImage:a},ev.createElement(eog,{isNewTemplate:u,coverImageType:a}),ev.createElement(Xe,null,ev.createElement(eli,{coverImageType:a})),ev.createElement("div",null,ev.createElement(z0,{documentID:r}),ev.createElement(eld,null))),null!=r&&ev.createElement(ev.Fragment,null,ev.createElement(Q_,{ref:f,documentID:r}),ev.createElement(zQ,{projectID:r})),ev.createElement(V2,{documentId:r}),ev.createElement(J4,{ref:p}),ev.createElement(W9,{ref:g,documentId:r}),!i&&ev.createElement(eah,null,ev.createElement(JH,null)))),ev.createElement(zZ,{location:e.location,isLoggedIn:null!=s}),ev.createElement(Q$,{fetchStatus:o}),ev.createElement(YA,null),ev.createElement(H5,null),ev.createElement(KA,null),ev.createElement(Y0,null))}),eoh=eL.default.div.withConfig({displayName:"Status__Container",componentId:"sc-e5e426d9-0"})` + cursor: pointer; + pointer-events: auto; + position: absolute; + transform: translate(${e=>e.point.x+0}px, ${e=>e.point.y}px); + justify-content: center; + flex-direction: row-reverse; + left: 4px; + + ${e=>e.$isRunning&&(0,eL.css)` + animation: blinker 1s linear infinite; + `} + + & > svg:first-child { + transform: translateX(0) scale(0.8) !important; + z-index: 1; + position: relative; + } + & > img:first-child { + transform: translateX(0) !important; + z-index: 1; + position: relative; + } + & > svg:only-child { + flex: inherit !important; + transform: translateX(0) scale(0.8) !important; + } + & > img:only-child { + flex: inherit !important; + transform: translateX(0) !important; + } + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 100%; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } + @keyframes blinker { + 50% { + opacity: 0; + } + } +`,eoy=(0,e$.connect)(function(e,t){return{isLoggedIn:t9(e),isViewOnly:dq(e),documentView:dA(e)}})(function(e){let{point:t,spaceAgentRun:a,isLoggedIn:n,isViewOnly:l,documentView:r}=e,o=(0,e$.useDispatch)();return"mindmap"===r||"orgchart"===r||!n||l?null:(a.isCompleted,ev.createElement(eoh,{className:"flex rounded-full bg-appcolor-0 p-1 text-sm",point:t,onClick:()=>{o(DT.actions.toggleAiAssistantDialog({nodeId:a.node_id,nodeText:a.goal,command:{type:"custom_background"},projectId:a.document_id,spaceAgentRunId:a.id}))},$isRunning:!a.isCompleted},ev.createElement(Tc,{agent:a.spaceAgent,size:"xs"})))}),eob=function(e){let{nodeId:t,ancestorRef:a,spaceAgentRun:n,counter:l}=e,[r,o]=(0,Qm.x)(null);return(ev.useEffect(()=>{let e=a.current;if(null==e){o(()=>null);return}let n=document.getElementById(`node-${t}`);if(null==n){o(()=>null);return}let l=n.querySelector(":scope .right-side");if(null==l){o(()=>null);return}let r=l.getBoundingClientRect(),i=e.getBoundingClientRect(),s=r.right-i.left,d=r.top-i.top;o(e=>null==e?{x:s,y:d}:(e.x=s,e.y=d,e))},[a,t,o,l]),null==r)?null:ev.createElement(eoy,{point:r,spaceAgentRun:n})},eov=eL.default.div.withConfig({displayName:"Overlay__Container",componentId:"sc-43599638-0"})` + pointer-events: none; + position: absolute; + top: 0; + left: 0; + + @media print { + opacity: 0; + } +`,eok=ev.forwardRef(function(e,t){let{projectId:a}=e,[n,l]=ev.useState(0),r=ev.useRef(null);ev.useImperativeHandle(t,()=>({forceUpdate:()=>{l(e=>e+1)}}),[]);let o=(0,eB.a)(Ts,{variables:{filterby:{projectId:a}},pollInterval:5e3});ev.useEffect(()=>{if(o.loading)return;let e=!0;for(let t of o.data?.spaceAgentRuns.edges.map(e=>e.node)??[])if(!1===t.isCompleted){e=!1;break}e&&o.stopPolling()},[o]);let i=o.data?.spaceAgentRuns.edges.map(e=>e.node)??[];return ev.createElement(eov,{ref:r},i.map(e=>ev.createElement(eob,{key:e.node_id,ancestorRef:r,spaceAgentRun:e,nodeId:e.node_id,counter:n})))});function eoE(e,t){let a={x:null,y:null};return t.width>0&&(a.x=(e.x-t.left)/t.width),t.height>0&&(a.y=(e.y-t.top)/t.height),a}let eox=()=>{let e=ev.useRef(),t=ev.useRef(),a=ev.useRef([0,0]),n=ev.useRef(!1),l=ev.useRef(-1);ev.useEffect(()=>{e.current=document.getElementById("project-canvas")},[]);let r=ev.useCallback(()=>{if(a.current.some(e=>0!==e)){let n=Date.now(),o=-1===l.current?0:(n-l.current)/1e3,i=a.current.map(e=>Math.round(e*o));l.current=n,t.current=requestAnimationFrame(()=>{e.current?.scrollBy(...i),r()})}},[]),o=ev.useCallback(()=>{n.current||(r(),n.current=!0)},[r]),i=ev.useCallback(()=>{n.current&&(a.current=[0,0],n.current=!1,l.current=-1,null!=t.current&&(cancelAnimationFrame(t.current),t.current=null))},[]),s=Xt(),d=!!(0,zO.sJ)(s.draggingNodeIdsAtom),c=(0,zO.sJ)(s.clientPointAtom);if(d){if(null==e.current)return;let t=function(e,t,a){let n=eoE({x:e,y:t},a.getBoundingClientRect()),l=n.x??.5,r=n.y??.5,o=0,i=0;return l<.1?o=-Math.round(1e3*Math.pow(Math.max(Math.min((.1-l)/.1,1),0),2)):l>.9&&(o=Math.round(1e3*Math.pow(Math.max(Math.min((l-.9)/.1,1),0),2))),r<.1?i=-Math.round(1e3*Math.pow(Math.max(Math.min((.1-r)/.1,1),0),2)):r>.9&&(i=Math.round(1e3*Math.pow(Math.max(Math.min((r-.9)/.1,1),0),2))),[o,i]}(c.x,c.y,e.current);a.current=t,t.some(e=>0!==e)?o():i()}else{i();return}},eo_=eL.default.header.withConfig({displayName:"RootNode__Header",componentId:"sc-e53f2861-0"})` + cursor: auto; + display: block; + + position: sticky; + left: 0; + + /* (dionis@taskade) this is needed to stretch the board header 100% while preserving position sticky */ + &:after { + content: ''; + display: flex; + height: 100%; + width: 100vw; + position: absolute; + top: 0; + z-index: -1; + pointer-events: none; + + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.9)":"rgba(255,255,255,0.9)"}; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + } +`,eow=eL.default.div.withConfig({displayName:"RootNode__Wrapper",componentId:"sc-e53f2861-1"})` + display: flex; + position: relative; +`,eoN=eL.default.div.withConfig({displayName:"RootNode__RightSide",componentId:"sc-e53f2861-2"})` + display: flex; + flex-direction: column; +`,eoC=eL.default.div.withConfig({displayName:"RootNode__ProjectTitle",componentId:"sc-e53f2861-3"})` + display: flex; + align-items: center; +`,eoM=(0,eL.default)(RV.ML).withConfig({displayName:"RootNode__StyledEditor",componentId:"sc-e53f2861-4"})` + flex-grow: 1; + font-size: 22px; + min-width: 268px; + line-height: 28px; + font-weight: 400; + color: ${e=>e.theme.textColors.hex("10")}; + margin-bottom: 4px; +`,eoS=(0,e$.connect)(function(e){return{rootNodeID:iR(e),ancestors:iZ(e),readOnly:dq(e),value:iO(e),documentId:dP(e),percentCompleted:dY(e)}},void 0,void 0,{})(function(e){let{rootNodeID:t,ancestors:a,readOnly:n,value:l,documentId:r,percentCompleted:o,isNewTemplate:i}=e,s=ev.useRef(null),d=(0,e$.useDispatch)(),c=(0,eK.Z)(),m=ev.useMemo(()=>{let e=i?(0,eq.sample)(elc):(0,eq.sample)(elm);return null==e?i?c.formatMessage({id:"general.untitled_project",defaultMessage:"Untitled Project"}):c.formatMessage({id:"general.untitled_template",defaultMessage:"Untitled Template"}):c.formatMessage(e)},[i,c]),u=ev.useCallback(e=>{d(mN(t,e))},[d,t]),p=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),g=function(e){let{nodeID:t,ancestors:a,onMoreMenu:n}=e,l=(0,e$.useDispatch)();return ev.useMemo(()=>{let e=()=>(l(Dk(t,a,0)),!0);return[RH.OnEscape(),RH.OnEnter({onEnter:()=>(l(Dr(t,a)),!0)}),RH.OnHistory(),RH.OnNextNode({down:e,right:e}),RH.OnPaste({onPaste:e=>{if(li.Contents.isContents(e))l(Dh(t,a,e));else if("application/vnd.taskade.taskast"===e.type)l(Db(t,a,e.fragment));else{let t=Error("Unsupported paste contents");er.$e(a=>{a.setExtra("pasteContents",e),er.Tb(t)})}}}),RH.OnMoreMenu({onMoreMenu:n})]},[a,l,t,n])}({ancestors:a,nodeID:t,onMoreMenu:ev.useCallback(()=>{s?.current?.showMenu()},[])});return null==l?null:ev.createElement(eo_,{onMouseDown:p},ev.createElement(eow,{className:"project-title-wrapper project-title"},ev.createElement(Kd,{readOnly:n}),ev.createElement(eoN,null,ev.createElement(eoC,{className:"project-title"},ev.createElement(eoM,{className:"mousetrap notranslate",value:l,placeholder:m,plugins:g,autoCorrect:!0,spellCheck:!0,onChange:u,readOnly:n}),null!=r&&ev.createElement(eos,{documentId:r}),ev.createElement(eol,{nodeId:t,documentId:r,ref:s})),ev.createElement("div",{className:"mt-1.5 inline-flex min-h-7 flex-wrap items-center"},null!=r&&ev.createElement(ev.Fragment,null,ev.createElement(er7,{documentId:r}),ev.createElement(elu,{documentId:r})),ev.createElement(pl,{percentCompleted:o,showTooltip:!0})))))});function eoI(e,t){let a=e.children[t];if(a instanceof HTMLElement)return a}function eoD(e,t,a,n){if(null==a)return null;let l=a.dataset.nodeId;if(null==l||null==n)return null;let r=n.children.length,o=(0,eo.findInsertionIndex)(n.children,t.x,e=>{let t=e.getBoundingClientRect();return t.x+t.width/2});if(0===o)return{dropType:e,nodeId:l,position:"afterbegin",rect:{top:0,bottom:0,left:0,right:void 0}};if(o===r)return{dropType:e,nodeId:l,position:"beforeend",rect:{top:0,bottom:0,left:void 0,right:0}};let i=eoI(n,o-1);if(null==i)return null;let s=i.dataset.nodeId;if(null==s)return null;let d=eoI(n,o);if(null==d)return null;let c=i.getBoundingClientRect(),m=d.getBoundingClientRect(),u=a.getBoundingClientRect();return{dropType:e,nodeId:s,position:"afterend",rect:{top:0,bottom:0,left:(c.right+m.left)/2-u.x,right:void 0}}}function eoT(e,t){return!(t.xe.right)&&!(t.ye.bottom)}function eo$(e,t,a,n,l){if(null==a)return null;let r=a.dataset.nodeId;if(null==r)return null;if("Files"===e){if(null==n)return null;let l=n.getBoundingClientRect();if(!eoT(l,t))return null;let o=a.getBoundingClientRect();return{dropType:e,nodeId:r,position:"afterbegin",rect:{left:l.left-o.left,right:o.right-l.right,top:l.top-o.top,bottom:o.bottom-l.bottom}}}if(null==l){if(null!=n){let l=n.getBoundingClientRect(),o=a.getBoundingClientRect();return eoT(l,t)?(t.x-l.left)/(l.right-l.left)<=.25?{dropType:e,nodeId:r,position:"afterend",rect:{left:l.left-o.left,right:o.right-l.right,top:l.bottom-o.top,bottom:void 0}}:{dropType:e,nodeId:r,position:"afterbegin",rect:{left:l.left-o.left+(l.right-l.left)*.1,right:o.right-l.right,top:l.bottom-o.top,bottom:void 0}}:{dropType:e,nodeId:r,position:"afterend",rect:{left:l.left-o.left,right:o.right-l.right,top:l.bottom-o.top,bottom:void 0}}}}else{let n=(0,eo.findInsertionIndex)(l.children,t.y,e=>{let t=e.getBoundingClientRect();return t.y+t.height/2});if(0===n){let t=l.getBoundingClientRect(),n=a.getBoundingClientRect();return{dropType:e,nodeId:r,position:"afterbegin",rect:{left:t.left-n.left,right:n.right-t.right,top:t.top-n.top,bottom:void 0}}}if(n===length){let t=l.getBoundingClientRect(),n=a.getBoundingClientRect();return{dropType:e,nodeId:r,position:"beforeend",rect:{left:t.left-n.left,right:n.right-t.right,top:void 0,bottom:t.bottom-n.bottom}}}let o=eoI(l,n-1);if(null==o)return null;let i=o.dataset.nodeId;if(null==i)return null;let s=eoI(l,n);if(null==s)return null;let d=o.getBoundingClientRect(),c=s.getBoundingClientRect(),m=l.getBoundingClientRect(),u=a.getBoundingClientRect();return{dropType:e,nodeId:i,position:"afterend",rect:{left:m.left-u.left,right:u.right-m.right,top:(d.bottom+c.top)/2-u.top,bottom:void 0}}}let o=a.getBoundingClientRect();return t.ye.theme.primaryColorScheme?.base}; +`,eoF=function(e){let{className:t,onDropLocation:a}=e,n=Xt(),l=(0,zO.sJ)(n.clientPointAtom),[r,o]=ev.useReducer(Xx.reducer,Xx.initialState);ev.useEffect(()=>{let e=a(l);o(Xx.actions.onDropLocation(e))},[l,a]);let{Component:i,style:s}=ev.useMemo(()=>{if(null==r)return{Component:"div",style:{display:"none"}};if("Files"===r.dropType)return{Component:Kb,style:r.rect};let e={...r.rect};return null==e.top||null==e.bottom?(e.marginTop=-2,e.height=4):(null==e.left||null==e.right)&&(e.marginLeft=-2,e.width=4),{Component:eoP,style:e}},[r]);return ev.createElement(i,{className:t,style:s})},eoA=eL.default.button.withConfig({displayName:"AddonButton__StyledBadge",componentId:"sc-36534b1f-0"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + position: relative; + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + &[aria-expanded='true'] { + opacity: 1 !important; + } + + @media print { + opacity: 0; + } +`,eoR=eL.default.button.withConfig({displayName:"AddonButton__StyledButton",componentId:"sc-36534b1f-1"})` + display: flex; + width: 24px; + height: 24px; + align-items: center; + justify-content: center; + margin: 3px 5px 3px 3px; + border-radius: 30px; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + border: 0; + ${e1.UiTypography.xs}; + position: relative; + transition: transform 0.2s ease-in-out; + + &:hover { + cursor: pointer; + transform: scale(1.3); + } + + &[aria-expanded='true'] { + opacity: 1 !important; + } + + @media print { + opacity: 0; + } +`,eoj=eL.default.div.withConfig({displayName:"AddonButton__TooltipReference",componentId:"sc-36534b1f-2"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,eoO=ev.forwardRef(function(e,t){let{isBadge:a,onClick:n,...l}=e,{arrowProps:r,popperProps:o,referenceProps:i,setVisible:s,visible:d}=(0,eI.useTooltip)({placement:"top"}),c=ev.useCallback(e=>{s(!1),n?.(e)},[n,s]),m=ev.useCallback(()=>{s(!0)},[s]),u=ev.useCallback(()=>{s(!1)},[s]);return ev.createElement(ev.Fragment,null,a?ev.createElement(eoA,{...l,ref:t,onClick:c,onMouseEnter:m,onMouseLeave:u},ev.createElement(tn.Icon,{icon:"plus_invite"}),ev.createElement(eoj,i)):ev.createElement(eoR,{...l,ref:t,onClick:c,onMouseEnter:m,onMouseLeave:u},ev.createElement(tn.Icon,{icon:"plus_invite"}),ev.createElement(eoj,i)),d&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.addons",defaultMessage:"Addons"}),ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"/")))))}),eoU=(0,e$.connect)(function(e,t){return{attachments:iA(e,t),documentID:dP(e),user:t7(e),isViewOnly:dq(e)}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{documentID:a,nodeID:n,user:l,attachments:r,isViewOnly:o,onClose:i}=e,s=(0,e$.useDispatch)();return ev.createElement("input",{ref:t,accept:cN,id:`add-on-file-upload-${n}`,multiple:!0,onClick:e=>{if((r?.media?.uploadingAttachments??[]).length>0){s((0,l3.error)({uid:"attachment-upload-error",message:"There are currently files being uploaded, please wait for them to be done before uploading.",position:"tc",autoDismiss:8,dismissible:!1})),i(),e.preventDefault();return}if(o){s((0,l3.error)({uid:"attachment-upload-error",message:"Sorry, you do not have the permissions to upload a file.",position:"tc",autoDismiss:8,dismissible:!1})),i(),e.preventDefault();return}if(null==l){s(rh({isOpen:!0,activeView:rI,enableCopyList:!1})),i(),e.preventDefault();return}(r?.media?.total??0)>=12&&(s((0,l3.error)({uid:"attachment-upload-error",message:m4,position:"tc",autoDismiss:8,dismissible:!1})),i(),e.preventDefault())},onChange:e=>{null!=a&&null!=n&&null!=e.currentTarget.files&&s(mG(a,n,Array.from(e.currentTarget.files))),e.currentTarget.value="",i()},type:"file",style:{display:"none"}})}));function eoZ(){return[{name:"offset",options:{offset:[0,-2]}}]}let eoL=(0,eL.default)(cF).withConfig({displayName:"FileUploadMenuItem__MenuButton",componentId:"sc-b50784b1-0"})` + position: relative; + justify-content: space-between; + + ${e=>e.$navigated&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,eoB=ev.forwardRef(function(e,t){let{onFileClick:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{n.expanded?r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):l({type:"Expand",payload:"first"})},[n.expanded]),d=ev.useCallback(()=>{n.expanded?o.current?.focus():l({type:"Expand"})},[n.expanded,l]),c=(0,eI.useMenuItem)({submenuPopupState:n,stopRef:o,onClick:s,onMouseEnter:d}),m=ev.useCallback(()=>{c.navigated&&o.current?.focus()},[c.navigated]);(0,eI.usePopupEvents)({state:n,onCollapse:m});let u=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:n,placement:"right-start",computeModifiersCallback:eoZ}),p=ev.useCallback(()=>{n.expanded&&r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[n.expanded]);ev.useEffect(()=>{n.expanded&&!c.navigated&&l({type:"Collapse"})},[l,n.expanded,c.navigated]);let g=c.dispatch,f=ev.useCallback(()=>{c.navigated||g({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:o}),o.current?.click()},[c.navigated,g]);return ev.useImperativeHandle(t,()=>({showMenu:f}),[f]),ev.createElement(ev.Fragment,null,ev.createElement(eoL,{...c.props,onFocus:p,$navigated:c.navigated},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_upload"}),ev.createElement(eY.Z,{id:"general.upload_file",defaultMessage:"Upload File"})),ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),n.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:l},ev.createElement(Bv,{ref:r,initialFocus:u.initialFocus,isSubmenu:!0,onFileClick:a})))}),eoz=(0,eL.default)(eI.Menu).withConfig({displayName:"AddonMenu__StyledMenu",componentId:"sc-6c59daff-0"})` + padding: var(--menu-padding); + min-width: 220px; + border-radius: 10px; + overflow-y: ${e=>e.$selected?"scroll":"inherit"}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,eoV=eL.default.div.withConfig({displayName:"AddonMenu__CommentItemWrapper",componentId:"sc-6c59daff-1"})` + color: ${e=>e.$isDisabled&&e.theme.textColors.hex(50)}; +`,eoq=(0,e$.connect)(function(e){return{readOnly:dq(e)}})(function(e){let{nodeID:t,initialFocus:a,menuGroupDispatch:n,readOnly:l}=e,r=(0,e$.useDispatch)(),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{n({type:"Dismiss"})},[n]),d=ev.useCallback(()=>{r((e,t)=>{let a=t(),n=dV(a);return null==t7(a)?(e(rh({isOpen:!0,activeView:rI})),!1):null!=n||(e(Fd()),!1)})?o.current?.click():s()},[r,s]),c=ev.useCallback(e=>{e.stopPropagation(),e.preventDefault(),d()},[d]),m=(0,ev.useContext)(jz),u=ev.useCallback(e=>{"c"===e.key&&(e.stopPropagation(),e.preventDefault(),n({type:"Activate",payload:{name:"comment"}})),l||("a"===e.key?(e.stopPropagation(),e.preventDefault(),n({type:"Activate",payload:{name:"assign"}})):"d"===e.key?(e.stopPropagation(),e.preventDefault(),n({type:"Activate",payload:{name:"date"}})):"f"===e.key?(e.stopPropagation(),e.preventDefault(),d()):"e"===e.key?(e.stopPropagation(),e.preventDefault(),n({type:"Activate",payload:{name:"embed"}})):"t"===e.key?(e.stopPropagation(),e.preventDefault(),n({type:"Activate",payload:{name:"countdown"}})):"r"===e.key&&n({type:"Activate",payload:{name:"reaction"}}))},[d,n,l]);return ev.createElement(eI.MenuGroupContext.Provider,{value:n},ev.createElement(eoz,{initialFocus:a,loop:!0,onKeyDown:u},ev.createElement("div",{className:"flex flex-col"},ev.createElement(By,{name:"agent"},ev.createElement(Bu,null,ev.createElement("div",{className:"animate-color-rainbow"},ev.createElement(tn.Icon,{icon:"dd_ai"})),ev.createElement("div",{className:"text-moving-rainbow flex items-center"},ev.createElement(eY.Z,{id:"agent.ai_agent",defaultMessage:"AI Agent"}))),ev.createElement(Bp,null,ev.createElement(Bg,null,"/"))),ev.createElement(By,{name:"assistant"},ev.createElement(Bu,null,ev.createElement("div",{className:"animate-color-rainbow"},ev.createElement(tn.Icon,{icon:"dd_ai_spark"})),ev.createElement("div",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ai_assistant",defaultMessage:"AI Assistant"}))),ev.createElement(Bp,null,ev.createElement(Bg,null,"/"))),!l&&ev.createElement(ev.Fragment,null,ev.createElement(By,{name:"date"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_date"}),ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"D"))),ev.createElement(By,{name:"assign"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_assign"}),ev.createElement(eY.Z,{id:"general.assign",defaultMessage:"Assign"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"A")))),ev.createElement(By,{name:"comment"},ev.createElement(Bu,null,ev.createElement(eoV,{$isDisabled:m.commentsMode===j.DISABLED},ev.createElement(tn.Icon,{icon:"dd_comment"}),m.commentsMode===j.DISABLED?ev.createElement(eY.Z,{id:"general.comment_disabled",defaultMessage:"Comment (Disabled)"}):ev.createElement(eY.Z,{id:"general.comment",defaultMessage:"Comment"}))),ev.createElement(Bp,null,ev.createElement(Bg,null,"C"))),!l&&ev.createElement(ev.Fragment,null,ev.createElement(eoB,{ref:i,onFileClick:c}),ev.createElement(By,{name:"embed"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_embed"}),ev.createElement(eY.Z,{id:"general.embed",defaultMessage:"Embed"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"E")))),!l&&ev.createElement(By,{name:"countdown"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"addon_timer"}),ev.createElement(eY.Z,{id:"general.timer",defaultMessage:"Timer"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"T"))),ev.createElement(By,{name:"reaction"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_reaction"}),ev.createElement(eY.Z,{id:"general.reaction",defaultMessage:"Reaction"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"R"))))),!l&&ev.createElement(eoU,{ref:o,nodeID:t,onClose:s}))}),eoW=ev.memo(ev.forwardRef(function(e,t){let{nodeID:a,onAssign:n,onCountdown:l,onDueDate:r,onReaction:o,isBadge:i,documentId:s}=e,[d,c]=ev.useReducer(eI.popupReducer,{expanded:!1}),m=ev.useContext(jz),u=(0,eB.a)(sW),p=u.data?.me,g=(0,e$.useDispatch)(),f=ev.useRef(null),h=ev.useRef(null),y=d.finalFocus,b=ev.useCallback(()=>{"none"!==y&&g(mI(a,null))},[g,y,a]);(0,eI.usePopupEvents)({state:d,onCollapse:b});let v=(0,eI.usePopup)({referenceElementRef:f,popupElementRef:h,state:d,placement:"bottom"}),k=(0,eI.useMenuButton)({dispatch:c,ref:f,state:d}),E=ev.useCallback(()=>{if(m.commentsMode===j.ENABLED){g(qx(a));return}null!=s&&g(M1.actions.toggleProjectSettingsDialog({projectId:s,page:"admin"}))},[g,s,a,m.commentsMode]),x=ev.useCallback(()=>{g(q_(a))},[g,a]),_=gV(),w=ev.useCallback(()=>{g(qE(a,_))},[g,a,_]),N=ev.useCallback(()=>{if(null==s)return;let e=g(Vj([a]));if(0===e.children.length)return;let t=e.children[0],n=(0,lD.textDeltaToString)(t.text);g(DT.actions.toggleAiAssistantDialog({nodeId:a,nodeText:n,projectId:s}))},[g,s,a]),C=ev.useCallback(()=>{if(null==s)return;let e=g(Vj([a]));if(0===e.children.length)return;let t=e.children[0],n=(0,lD.textDeltaToString)(t.text);g(DT.actions.toggleAiAssistantDialog({nodeId:a,nodeText:n,projectId:s,shouldShowCustomAgentOptions:!0}))},[g,s,a]),M=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t}=e.payload;switch(t){case"agent":if(null==p){g(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!1}));return}C();break;case"assistant":if(null==p){g(rh({isOpen:!0,activeView:rI,enableCopyList:!0,copyAsTemplate:!1}));return}N();break;case"assign":n();break;case"comment":E();break;case"date":r();break;case"embed":x();break;case $.Cloud:w();break;case"countdown":l();break;case"reaction":o()}c({type:"Collapse",payload:"none"});break}case"Dismiss":c({type:"Collapse"})}},[p,g,C,N,w,E,x,n,l,r,o]);return ev.useImperativeHandle(t,()=>({expand:()=>{c({type:"Expand",payload:"first"})}}),[]),ev.createElement(ev.Fragment,null,ev.createElement(eoO,{...k.props,isBadge:i}),d.expanded&&ev.createElement(eI.Popup,{...v.props,dispatch:c,modal:!0},ev.createElement(eoq,{nodeID:a,initialFocus:v.initialFocus,menuGroupDispatch:M})))})),eoH=function(e){let{nodeId:t,onAssign:a,onCountdown:n,onDueDate:l,onReaction:r,documentId:o}=e,[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1});return ev.createElement(eoW,{isBadge:!0,nodeID:t,documentId:o,onAssign:a,onCountdown:n,onDueDate:l,onReaction:r,popupState:i,popupDispatch:s})},eoG=ev.forwardRef(function(e,t){let a=ev.useRef(null),{showFile:n,...l}=e;return ev.createElement(Bb,{...l,ref:t},n&&ev.createElement(eoB,{ref:a}),ev.createElement(By,{name:"embed"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_embed"}),ev.createElement(eY.Z,{id:"general.embed",defaultMessage:"Embed"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"E"))))}),eoK=eL.default.button.withConfig({displayName:"NodeUploadButton__AddonButton",componentId:"sc-37e8696e-0"})` + display: flex; + align-items: center; + margin: 0 5px 5px 0; + padding: 1px 6px; + border-radius: 30px; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.xs}; + + & label { + display: flex; + align-items: center; + margin: 0; + cursor: pointer; + } + + &:hover { + cursor: pointer; + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + &:hover { + color: ${e.theme.appColors.hex(10)}; + border-color: ${e.theme.appColors.hex(60)}; + } + `} +`,eoY=(0,eL.default)(tn.Icon).attrs({icon:"addon_upload"}).withConfig({displayName:"NodeUploadButton__UploadIcon",componentId:"sc-37e8696e-1"})` + flex-shrink: 0; +`,eoQ=eL.default.span.withConfig({displayName:"NodeUploadButton__Counter",componentId:"sc-37e8696e-2"})` + ${e=>e.$nodeCompleted&&(0,eL.css)``} + + margin-left: 5px; +`,eoJ=function(e){let{attachments:t,documentID:a,nodeID:n,readOnly:l,nodeCompleted:r}=e,o=t?.media?.total??0,i=0===o?null:o,s=!ts()(t?.media?.uploadingAttachments),[d,c]=ev.useReducer(eI.popupReducer,{expanded:!1}),m=(0,e$.useDispatch)(),u=d.finalFocus,p=(0,ev.useRef)(null),g=ev.useRef(null),f=ev.useRef(null),h=ev.useRef(null),y=ev.useCallback(()=>{"none"!==u&&m(mI(n,null))},[m,u,n]);(0,eI.usePopupEvents)({state:d,onCollapse:y});let b=(0,eI.usePopup)({referenceElementRef:f,popupElementRef:h,state:d,placement:"bottom"}),v=(0,eI.useMenuButton)({dispatch:c,ref:f,state:d,onClick:e=>{null==a&&(e.preventDefault(),m(Fd()))}}),k=gV(),E=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t}=e.payload;"embed"===t?m(q_(n)):t===$.Computer?p.current?.click():t===$.Cloud&&m(qE(n,k)),c({type:"Collapse",payload:"none"});break}case"Dismiss":c({type:"Collapse"})}},[m,n,k]),x=ev.useCallback(()=>{E({type:"Dismiss"})},[E]),_=ev.useCallback(e=>{"f"===e.key?(e.stopPropagation(),e.preventDefault(),E({type:"Activate",payload:{name:"file"}})):"e"===e.key&&(e.stopPropagation(),e.preventDefault(),E({type:"Activate",payload:{name:"embed"}}))},[E]),w=og()("file-attachment",{"file-attachment-disabled":s||l||!a});return l?ev.createElement(eoK,{className:w,$nodeCompleted:r},ev.createElement("label",null,ev.createElement(eoY,{$nodeCompleted:r}),null!=i&&ev.createElement(eoQ,{$nodeCompleted:r},i))):ev.createElement(ev.Fragment,null,ev.createElement(eoK,{...v.props,className:w,$nodeCompleted:r},ev.createElement("label",null,ev.createElement(eoY,{$nodeCompleted:r}),null!=i&&ev.createElement(eoQ,{$nodeCompleted:r},i))),d.expanded&&ev.createElement(eI.Popup,{...b.props,dispatch:c,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:E},ev.createElement(eoG,{ref:g,initialFocus:b.initialFocus,isSubmenu:!1,onKeyDown:_,showFile:!0}))),ev.createElement(eoU,{ref:p,nodeID:n,onClose:x}))};function eoX(e){return null!=e&&!!(null!=e.media&&(e.media.total>0||(0,eo.isNonEmptyArray)(e.media.uploadingAttachments)))}function eo0(e,t){return null!=e&&null!=e.comments&&t.commentsMode!==j.DISABLED&&e.comments.total>0}let eo1=(0,e$.connect)(function(e){return{user:t7(e)}})(function(e){let{user:t,hasFileDeletePermission:a,nodeID:n,mediaAttachmentPreviews:l,readOnly:r,projectId:o}=e,i=(0,e$.useDispatch)(),s=(0,ev.useCallback)(e=>{i(eap(n,e))},[i,n]),d=(0,ev.useCallback)((e,t)=>{i(Z$.actions.toggleMediaDialog({media:l,index:t}))},[i,l]);return ev.createElement(eau,{currentUserId:t?.id,media:l,hasFileDeletePermission:a,readOnly:r,onDelete:s,onSelect:d,documentId:o})}),eo2=(0,e$.connect)(function(e,t){let a=e.contents.findNodeByID(t.nodeID);return{nodeCompleted:a?.completed??!1,nodeFormat:a?.format?.node}})(function(e){let{nodeID:t,doc:a,nodeCompleted:n,nodeFormat:l,attachments:r,assignmentPopupState:o,assignmentPopupDispatch:i,countdownPopupState:s,countdownPopupDispatch:d,dueDatePopupState:c,dueDatePopupDispatch:m,reactionPopupState:u,reactionPopupDispatch:p,onAssign:g,onCountdown:f,onDueDate:h,onReaction:y}=e,b=ev.useMemo(()=>{let e=r?.media?.attachments??[],t=r?.media?.uploadingAttachments??[],a=uz()(t,12),n=uz()(e,12-a.length);return[...a,...n]},[r]),v=QP(a),k=lm({role:a.role,action:{project:"delete_file"}}),E=r?.dates?.total??0,x=r?.assignees?.total??0,_=E>0||c.expanded,w=o.expanded||x>0,N=(0,ev.useContext)(jz);return ev.createElement(eo5,{$nodeFormat:l},ev.createElement(G1,{className:"attachment-wrapper",$isHeadingOrText:!1},b.length>0&&ev.createElement(eo1,{nodeID:t,hasFileDeletePermission:k,mediaAttachmentPreviews:b,readOnly:v,projectId:a.id}),ev.createElement("div",{className:"addon-badges"},_&&ev.createElement(RM,{popupState:c,popupDispatch:m,projectId:a.id,nodeId:t,dateAttachment:r?.dates?.attachments?.[0],readOnly:v,nodeCompleted:n}),w&&ev.createElement(G4,null,ev.createElement(FM,{assignees:r?.assignees,documentID:a.id,nodeID:t,popupState:o,popupDispatch:i,nodeCompleted:n})),eo0(r,N)&&ev.createElement(G2,null,ev.createElement(et3,{documentID:a.id,nodeID:t,numberOfComments:r.comments.total,nodeCompleted:n})),eoX(r)&&ev.createElement(G3,null,ev.createElement(eoJ,{attachments:r,documentID:a.id,nodeID:t,readOnly:v,nodeCompleted:n})),ev.createElement(enm,{projectId:a.id,nodeId:t,popupState:s,popupDispatch:d,countdownAttachments:r?.countdowns,nodeCompleted:n,readOnly:v}),ev.createElement(eaL,{projectId:a.id,nodeId:t,popupState:u,popupDispatch:p,reactionCollections:r?.reactionCollections,nodeCompleted:n}),ev.createElement(eoH,{nodeId:t,documentId:a.id,onAssign:g,onDueDate:h,onCountdown:f,onReaction:y}))))}),eo5=eL.default.div.withConfig({displayName:"NodeAddonsBody__Wrapper",componentId:"sc-62d01775-0"})` + margin-left: ${e=>{let{$nodeFormat:t}=e;switch(t){case li.FORMAT_HEADING1:case li.FORMAT_HEADING2:case li.FORMAT_TEXT:return"0px";default:return"25px"}}}; +`,eo3=(0,e$.connect)(function(e,t){return{doc:dV(e),attachments:iA(e,t)}})(function(e){let{attachments:t,assignmentPopupState:a,assignmentPopupDispatch:n,doc:l,nodeID:r,countdownPopupState:o,countdownPopupDispatch:i,dueDatePopupState:s,dueDatePopupDispatch:d,reactionPopupState:c,reactionPopupDispatch:m,onAssign:u,onCountdown:p,onDueDate:g,onReaction:f}=e,h=(0,ev.useContext)(jz);return null==l?null:null!=t&&(null!=t.dates&&t.dates.total>0||null!=t.assignees&&t.assignees.total>0||eo0(t,h)||eoX(t)||null!=t.countdowns&&t.countdowns.total>0||null!=t.reactionCollections&&t.reactionCollections.total>0)||a.expanded||o.expanded||c.expanded||s.expanded?ev.createElement(eo2,{nodeID:r,doc:l,attachments:t,assignmentPopupState:a,assignmentPopupDispatch:n,countdownPopupState:o,countdownPopupDispatch:i,dueDatePopupState:s,dueDatePopupDispatch:d,reactionPopupState:c,reactionPopupDispatch:m,onAssign:u,onCountdown:p,onDueDate:g,onReaction:f}):null}),eo4=eL.default.span.withConfig({displayName:"NodeDragHandle__TooltipText",componentId:"sc-557ce3fa-0"})` + color: #cccccc; +`,eo6=eL.default.span.withConfig({displayName:"NodeDragHandle__Highlight",componentId:"sc-557ce3fa-1"})` + font-weight: 700; + color: #ffffff; +`,eo8=eL.default.span.withConfig({displayName:"NodeDragHandle__DragHandle",componentId:"sc-557ce3fa-2"})` + display: flex; + align-items: center; + justify-content: center; + position: absolute; + z-index: 2; + top: -4px; + left: -12px; + opacity: 0; + width: 12px; + height: 30px; + cursor: grab; + + &:active { + pointer-events: auto; + cursor: grabbing; + } + + & svg path { + fill: ${e=>e.theme.textColors.hex("70")}; + } + + &:hover { + & svg path { + fill: ${e=>e.theme.textColors.hex("10")}; + } + } +`,eo7=function(e){let{nodeId:t,readOnly:a,ancestors:n}=e,[l,r]=ev.useState(!1),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),{referenceProps:d,arrowProps:c,popperProps:m}=(0,eI.useControlledTooltip)({referenceElementRef:o,arrowElementRef:i,popperElementRef:s,visible:l,placement:"top"}),[u,p]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),g=ev.useRef(null),f=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:g,state:u,placement:"left"}),h=ev.useCallback(()=>{f.popper.instanceRef.current?.update()},[f.popper.instanceRef]),y=ev.useCallback(()=>{p({type:"Collapse"})},[]),b=(0,eI.useMenuButton)({ref:o,state:u,dispatch:p,onClick:e=>{a&&e.preventDefault()}}),v=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!1)},[]),k=ev.useCallback(()=>{r(!0)},[]),E=ev.useCallback(()=>{r(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement(eo8,{...d,...b.props,onMouseDown:v,onMouseEnter:k,onMouseLeave:E,draggable:!0,"data-node-id":t,"data-drag-handle":!0,className:"node-drag-handle"},ev.createElement(lT.VW,null)),l&&ev.createElement(eI.Tooltip,{arrowProps:c,popperProps:m},a?ev.createElement(eY.Z,{id:"general.drag_hint",defaultMessage:"Drag to move"}):ev.createElement(eo4,null,ev.createElement(eY.Z,{id:"general.drag_menu_hint",defaultMessage:"Drag to move {br} Click to open",values:{highlight:e=>ev.createElement(eo6,null,e),br:ev.createElement("br",null)}}))),u.expanded&&ev.createElement(eI.Popup,{dispatch:p,...f.props,modal:!0},ev.createElement(etR,{initialFocus:f.initialFocus,nodeId:t,ancestors:n,reposition:h,close:y})))},eo9=(0,te.Em)({id:"general.placeholder_editor_command_ai",defaultMessage:"Press 'space' for AI or '/' for commands"}),eie=(0,e$.connect)(function(e,t){return{value:iV(e,t)}})(function(e){let{ancestors:t,className:a,nodeID:n,onAddOnMenu:l,onMoreMenu:r,readOnly:o,value:i,hasPlaceholder:s}=e,d=(0,e$.useDispatch)(),c=(0,eK.Z)(),m=function(e){let{ancestors:t,nodeID:a,onAddOnMenu:n,onMoreMenu:l}=e,r=(0,e$.useDispatch)();return ev.useMemo(()=>{let e=e=>r(X5(a,t,e)),o=e=>r(XP(a,t,e)),i=()=>{r(mM(a,t))};return[RH.MarkHotKey({key:"b",type:"bold"}),RH.MarkHotKey({key:"u",type:"underline"}),RH.MarkHotKey({key:"i",type:"italic"}),RH.MarkHotKey({key:"e",type:"highlight"}),RH.OnPreviousNode({up:e,left:e,move:()=>(r(Xl([a],t)),!0)}),RH.OnNextNode({down:o,right:o,move:()=>{r(Xn([a],t))}}),RH.OnEscape(),RH.OnEnter({onEnter:()=>(r(Dr(a,t)),!0),onModShiftEnter:()=>r(X4(a)),onComplete:()=>(r(P0(a)),!0),onShiftEnter:()=>{r(mJ(a))}}),RH.OnBackspace({onBackspace:()=>(r(Dl(a,t)),!0),onForceBackspace:i}),RH.OnTab({indent:()=>(r(m$(a,t)),!0),outdent:()=>(r(mC(a,t)),!0)}),RH.OnDelete({onDelete:()=>(r(Do(a,t)),!0),onForceDelete:i}),RH.OnHistory(),RH.OnPaste({onPaste:e=>{r(X3(e,a,t))}}),RH.OnDuplicate({onDuplicate:()=>{r(mT(a,t))}}),RH.OnCollapseExpandNode({onCollapse:()=>{r(DE(a,!0))},onExpand:()=>{r(DE(a,!1))}}),RH.OnAddOnMenu({onAddOnMenu:n}),RH.OnMoreMenu({onMoreMenu:l})]},[t,r,a,n,l])}({ancestors:t,nodeID:n,onAddOnMenu:l,onMoreMenu:r}),u=ev.useCallback(e=>{d(mN(n,e))},[d,n]);return null==i?null:ev.createElement(RV.ML,{className:og()("mousetrap notranslate",a),plugins:m,value:i,autoCorrect:!0,spellCheck:!0,onChange:u,readOnly:o,decorateNode:PC,renderMark:PX,placeholder:s?c.formatMessage(eo9):void 0})}),eit=eL.default.span.withConfig({displayName:"MoreButton__MenuButton",componentId:"sc-ba087044-0"})` + position: relative; + display: flex; + width: 30px; + height: 28px; + cursor: pointer; + border-radius: 10px; + + &[aria-expanded='true'] { + opacity: 1 !important; + } + + & > svg { + margin-top: -1px; + & path { + fill: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + } + } + + &:hover svg { + & path { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } +`,eia=eL.default.div.withConfig({displayName:"MoreButton__TooltipReference",componentId:"sc-ba087044-1"})` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +`,ein=ev.forwardRef(function(e,t){let[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement(eit,{...e,ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},ev.createElement(lT.vY,null),ev.createElement(eia,d)),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.more",defaultMessage:"More"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"’")))))});function eil(e,t,a,n){u$?.track("Node Added Task",{position:e,version:2},{context:{nodeId:t,projectId:a,groupId:n}})}function eir(e,t){return function(a,n){let l=n(),r=i5(l);null==r?a(mI(e,-1)):r!==e&&a(mI(e,-1,r));let{slate:o}=l=n(),i=o.getIn([e,"text"]);null!=i&&a(mN(e,i.change().insertText(t)))}}let eio=function(e){let{nodeValue:t,documentID:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{n.expanded?r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):l({type:"Expand",payload:"first"})},[n.expanded]),d=ev.useCallback(()=>{n.expanded?o.current?.focus():l({type:"Expand"})},[n.expanded]),{navigated:c,props:m}=(0,eI.useMenuItem)({submenuPopupState:n,stopRef:o,onClick:s,onMouseEnter:d}),u=ev.useCallback(()=>{c&&o.current?.focus()},[c]);(0,eI.usePopupEvents)({state:n,onCollapse:u});let p=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:n,placement:"right-start",computeModifiersCallback:eec}),g=ev.useCallback(()=>{n.expanded&&r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[n.expanded]);ev.useEffect(()=>{n.expanded&&!c&&l({type:"Collapse"})},[l,n.expanded,c]);let f=(0,eF.k6)();return ev.createElement(ev.Fragment,null,ev.createElement(eem,{...m,onFocus:g},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_addtocalendar"}),ev.createElement(eY.Z,{id:"general.calendar",defaultMessage:"Calendar"})),ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),n.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:l},ev.createElement(eeg,{initialFocus:p.initialFocus,isSubmenu:!0,ref:r},ev.createElement(eeb,null,ev.createElement(eY.Z,{id:"general.add_to",defaultMessage:"Add to"})),ev.createElement(eep,{onClick:()=>{let e=new URL("https://www.taskade.com");e.pathname=`/d/${a}`;let n=e.href,l=t(),r=`Open Project: ${n}

Powered by Taskade`,o=`https://www.google.com/calendar/render?action=TEMPLATE&text=${l}+on+Taskade&details=${r}&sf=true&output=xml&location=${n}&crm=BUSY`;null!=window.open(o,"_blank","noopener,noreferrer")&&(window.opener=null)},name:"add_to_calendar",value:"google"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_calendar_google"}),ev.createElement(eY.Z,{id:"general.google_calendar",defaultMessage:"Google Calendar"}))),ev.createElement(eep,{onClick:()=>{let e=new URL("https://www.taskade.com");e.pathname=`/d/${a}`;let n=e.href,l=t(),r=`Open Project: ${n}

Powered by Taskade`,o=new Date().toISOString().replace(/[^0-9a-zA-Z]/g,""),i=`https://calendar.yahoo.com/?v=60&view=d&type=20&title=${l}&st=${o}&dur=1:30&desc=${r}`;null!=window.open(i,"_blank","noopener,noreferrer")&&(window.opener=null)},name:"add_to_calendar",value:"yahoo"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_calendar_yahoo"}),ev.createElement(eY.Z,{id:"general.yahoo_calendar",defaultMessage:"Yahoo Calendar"}))),ev.createElement(eeh,null),ev.createElement(eep,{onClick:()=>{f.push("/settings/integrations")},name:"calendar_sync"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_calendar_sync"}),ev.createElement(eY.Z,{id:"general.sync_with_calendar",defaultMessage:"Sync with Calendar"}))))))},eii=(0,e$.connect)(function(e,t){return eeQ(e,t)})(function(e){let{formatScope:t,formatValue:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{n.expanded?r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):l({type:"Expand",payload:"first"})},[n.expanded]),d=ev.useCallback(()=>{n.expanded?o.current?.focus():l({type:"Expand"})},[n.expanded]),{navigated:c,props:m}=(0,eI.useMenuItem)({submenuPopupState:n,stopRef:o,onClick:s,onMouseEnter:d}),u=ev.useCallback(()=>{c&&o.current?.focus()},[c]);(0,eI.usePopupEvents)({state:n,onCollapse:u});let p=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:n,placement:"right-start",computeModifiersCallback:eec}),g=ev.useCallback(()=>{n.expanded&&r.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[n.expanded]),f=ev.useContext(eI.MenuGroupContext),h=(0,e$.useDispatch)(),y=ev.useCallback(t=>{switch(t.type){case"Activate":{let{name:a,value:n}=t.payload;"format"===a&&null!=n&&h(mZ(e.nodeID,e.formatScope,n)),f?.(t);break}case"Dismiss":f?.(t)}},[h,f,e.formatScope,e.nodeID]);return ev.useEffect(()=>{n.expanded&&!c&&l({type:"Collapse"})},[l,n.expanded,c]),ev.createElement(ev.Fragment,null,ev.createElement(eem,{...m,onFocus:g},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:q7[a]}),ev.createElement(eY.Z,q8[a])),ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),n.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:l},ev.createElement(eI.MenuGroupContext.Provider,{value:y},ev.createElement(eeg,{initialFocus:p.initialFocus,isSubmenu:!0,ref:r},"node"===t&&li.NODE_FORMATS.map(e=>ev.createElement(eep,{key:e,name:"format",value:e},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:q7[e]}),ev.createElement(eY.Z,q8[e])))),"children"===t&&li.CHILDREN_FORMATS.map(e=>ev.createElement(eep,{key:e,name:"format",value:e},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:q7[e]}),ev.createElement(eY.Z,q8[e]))))))))}),eis=function(e){let{nodeID:t}=e,[a,n]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1}),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),i=ev.useCallback(()=>{a.expanded?l.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):n({type:"Expand",payload:"first"})},[a.expanded]),s=ev.useCallback(()=>{a.expanded?r.current?.focus():n({type:"Expand"})},[a.expanded]),{navigated:d,props:c}=(0,eI.useMenuItem)({submenuPopupState:a,stopRef:r,onClick:i,onMouseEnter:s}),m=ev.useCallback(()=>{d&&r.current?.focus()},[d]);(0,eI.usePopupEvents)({state:a,onCollapse:m});let u=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:a,placement:"right-start",computeModifiersCallback:eec}),p=ev.useCallback(()=>{a.expanded&&l.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[a.expanded]);return ev.useEffect(()=>{a.expanded&&!d&&n({type:"Collapse"})},[n,a.expanded,d]),ev.createElement(ev.Fragment,null,ev.createElement(eem,{...c,onFocus:p},ev.createElement(eeE,null,ev.createElement(tn.Icon,{className:"highlight",icon:"dd_highlight"}),ev.createElement(eY.Z,{id:"general.highlight_text",defaultMessage:"Highlight"})),ev.createElement(tn.Icon,{className:"caret",icon:"dd_caret"})),a.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:n},ev.createElement(eeg,{isSubmenu:!0},ev.createElement(eek,null,ev.createElement(VM,{selectedIds:t,selectedColor:null})))))},eid=ev.forwardRef(function(e,t){let{initialFocus:a,onClickToggleTag:n}=e,l=(0,e$.useSelector)(dO),[r,o]=ev.useState([]),i=ev.useCallback(()=>o(function(){let e=document.getElementsByClassName("hashtag"),t=new Set;for(let a of e){if(!(a instanceof HTMLElement))continue;let e=a.dataset.hashtagText;null!=e&&0!==e.length&&t.add(e.replace(/#/,""))}return t.size>0?[...t].sort():[]}()),[]);return ev.useEffect(()=>{i()},[i,l]),ev.createElement(eef,{initialFocus:a,ref:t},ev.createElement(eep,{key:"project-tag-create",onClick:()=>n(""),name:"create-tag",value:"#tag"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_new"}),ev.createElement(eY.Z,{id:"general.new_tag",defaultMessage:"New tag"}))),r.map(e=>ev.createElement(eep,{key:`project-tag-${e}`,onClick:()=>n(`${e} `),name:"tag",value:e},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_tag"}),e))))}),eic=function(e){let{onClickToggleTag:t}=e,[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1}),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),i=ev.useCallback(()=>{a.expanded?l.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.First}):n({type:"Expand",payload:"first"})},[a.expanded]),s=ev.useCallback(()=>{a.expanded?r.current?.focus():n({type:"Expand"})},[a.expanded]),{navigated:d,props:c}=(0,eI.useMenuItem)({submenuPopupState:a,stopRef:r,onClick:i,onMouseEnter:s}),m=ev.useCallback(()=>{d&&r.current?.focus()},[d]);(0,eI.usePopupEvents)({state:a,onCollapse:m});let u=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:a,placement:"right-start",computeModifiersCallback:eec}),p=ev.useCallback(()=>{a.expanded&&l.current?.dispatch({type:eI.RovingTabindexPattern.ActionTypes.Navigate,payload:void 0})},[a.expanded]);return ev.useEffect(()=>{a.expanded&&!d&&n({type:"Collapse"})},[n,a.expanded,d]),ev.createElement(ev.Fragment,null,ev.createElement(eem,{...c,onFocus:p},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_tag"}),ev.createElement(eY.Z,{id:"general.tag",defaultMessage:"Tag"})),ev.createElement(Bp,null,"#")),a.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:n},ev.createElement(eid,{initialFocus:u.initialFocus,ref:l,onClickToggleTag:t})))},eim=(0,e$.connect)(function(){let e=iq(),t=iK();return function(a,n){return{allowCheck:dW(a),documentID:dP(a),isViewOnly:dq(a),node:e(a,n),user:t7(a),areDescendantsCompleted:t(a,n),spaceID:dU(a)}}})(function(e){let{allowCheck:t,nodeID:a,ancestors:n,documentID:l,spaceID:r,isViewOnly:o,node:i,user:s,areDescendantsCompleted:d,initialFocus:c}=e,m=i.children.size>0,u=i.completed,p=(0,e$.useDispatch)(),g=ev.useContext(eI.PopupDispatchContext),f=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t}=e.payload;switch(t){case"delete":p(mM(a,n)),g?.({type:"Collapse",payload:"none"});break;case"duplicate":case"complete_all":case"mention":g?.({type:"Collapse",payload:"none"});break;case"add_note":p(mJ(a)),u$?.track("Node Added Note",{version:2},{context:{nodeId:a,projectId:l,groupId:r}}),g?.({type:"Collapse",payload:"none"});break;default:g?.({type:"Collapse"})}break}case"Dismiss":g?.({type:"Collapse"})}},[n,p,l,a,g,r]),h=ev.useCallback(e=>{o||p(eir(a,`${i.textString.length>0?" ":""}#${e}`))},[p,o,i.textString,a]),y=ev.useCallback(e=>{e.stopPropagation(),null==s?p(rh({isOpen:!0,activeView:rI,enableCopyList:void 0})):p(eir(a,`${i.textString.length>0?" ":""}@`))},[p,i.textString.length,a,s]);return ev.createElement(eI.MenuGroupContext.Provider,{value:f},ev.createElement(eeg,{initialFocus:c,loop:!0},!o&&ev.createElement(ev.Fragment,null,ev.createElement(eii,{nodeID:a,ancestors:n}),ev.createElement(eeh,null)),!o&&ev.createElement(ev.Fragment,null,ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(qk(a,n[n.length-1],!0)),eil("above",a,l,r)},name:"add_task_above"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_add_above"}),ev.createElement(eY.Z,{id:"general.add_task_above",defaultMessage:"Add task above"}))),ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(qk(a,n[n.length-1])),eil("below",a,l,r)},name:"add_task_below"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_add_below"}),ev.createElement(eY.Z,{id:"general.add_task_below",defaultMessage:"Add task below"})))),!o&&ev.createElement(eep,{name:"add_note"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_note"}),ev.createElement(eY.Z,{id:"general.add_note",defaultMessage:"Add note"}),ev.createElement(SV,{date:"2021-07-16"})),ev.createElement(Bp,null,ev.createElement(Bg,null,eI.ModifierKeys.Shift),ev.createElement(Bg,null,"↵"))),!o&&ev.createElement(ev.Fragment,null,ev.createElement(eeh,null),ev.createElement(eek,null,ev.createElement(eis,{nodeID:a}))),t&&ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(P0(a))},name:"complete"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_check"}),u?ev.createElement(eY.Z,{id:"general.uncheck",defaultMessage:"Uncheck"}):ev.createElement(eY.Z,{id:"general.check",defaultMessage:"Check"})),!o&&ev.createElement(Bp,null,ev.createElement(Bg,null,eI.ModifierKeys.ModSymbol),ev.createElement(Bg,null,"↵"))),t&&m&&ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(mA(a)),u$?.track("Node Completed All",{version:2},{context:{nodeId:a,projectId:l,groupId:r}})},name:"complete_all"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_checkall"}),u&&d?ev.createElement(eY.Z,{id:"general.uncheck_all",defaultMessage:"Uncheck all"}):ev.createElement(eY.Z,{id:"general.check_all",defaultMessage:"Check all"})),!o&&ev.createElement(Bp,null,ev.createElement(Bg,null,eI.ModifierKeys.ModSymbol),ev.createElement(Bg,null,eI.ModifierKeys.Shift),ev.createElement(Bg,null,"↵"))),!o&&ev.createElement(eep,{onClick:e=>{e.stopPropagation(),p(mT(a,n))},name:"duplicate"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_duplicate"}),ev.createElement(eY.Z,{id:"general.duplicate",defaultMessage:"Duplicate"})),ev.createElement(Bp,null,ev.createElement(Bg,null,eI.ModifierKeys.ModSymbol),ev.createElement(Bg,null,"D"))),ev.createElement(eep,{onClick:e=>{e.stopPropagation();{let e=new URL("https://www.taskade.com");e.pathname=`/d/${l}`,e.hash=`#node-${a}`,R4()(e.href)}},name:"copy_link"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_copylink"}),ev.createElement(eY.Z,{id:"general.copylink",defaultMessage:"Copy link"}))),ev.createElement(eeh,null),null!=s&&ev.createElement(eeA,{nodeID:a}),null!=s&&!o&&ev.createElement(eeR,{documentID:l,nodeID:a}),!o&&null!=l&&ev.createElement(eeZ,{documentID:l,nodeID:a,hasChild:m}),!o&&l&&ev.createElement(ev.Fragment,null,ev.createElement(eio,{nodeValue:()=>i.textString,documentID:l}),ev.createElement(eeh,null)),!o&&ev.createElement(ev.Fragment,null,ev.createElement(eep,{onClick:y,name:"mention"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_mention"}),ev.createElement(eY.Z,{id:"general.mention",defaultMessage:"Mention"})),ev.createElement(Bp,null,ev.createElement(Bg,null,"@"))),ev.createElement(eic,{onClickToggleTag:h})),!o&&ev.createElement(ev.Fragment,null,ev.createElement(eeh,null),ev.createElement(eev,{name:"delete"},ev.createElement(Bu,null,ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})),ev.createElement(Bp,null,ev.createElement(Bg,null,eI.ModifierKeys.ModSymbol),ev.createElement(Bg,null,eI.ModifierKeys.Shift),ev.createElement(Bg,null,"Del")))),ev.createElement(ees,{attributes:i.attributes})))});function eiu(){return[{name:"offset",options:{offset:[0,8]}},{name:"flip",options:{fallbackPlacements:["top","right-start","left-start","right","left","right-end","left-end"]}}]}let eip=ev.memo(ev.forwardRef(function(e,t){let{nodeID:a,ancestors:n}=e,l=ev.useRef(null),r=ev.useRef(null),o=(0,e$.useDispatch)(),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=i.finalFocus,c=ev.useCallback(()=>{"none"!==d&&o(mI(a,null))},[o,d,a]);(0,eI.usePopupEvents)({state:i,onCollapse:c});let m=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:i,placement:"bottom",computeModifiersCallback:eiu}),u=(0,eI.useMenuButton)({dispatch:s,ref:l,state:i});return ev.useImperativeHandle(t,()=>({expand:()=>{s({type:"Expand",payload:"first"})}}),[]),ev.createElement(ev.Fragment,null,ev.createElement(ein,u.props),i.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:s,modal:!0},ev.createElement(eim,{nodeID:a,ancestors:n,initialFocus:m.initialFocus})))})),eig=eL.default.button.withConfig({displayName:"NodeFolder__FolderButton",componentId:"sc-c0d94ebf-0"})` + height: fit-content; + border: 0; + background: none; + margin-left: 3px; + padding: 0; + color: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + cursor: pointer; + + &:focus { + outline: 0; + } + + &:hover { + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + + ${e=>e.$collapsed&&(0,eL.css)` + opacity: 1 !important; + `}; +`,eif=(0,eL.default)(tn.Icon).withConfig({displayName:"NodeFolder__StyledIcon",componentId:"sc-c0d94ebf-1"})` + ${e=>e.$collapsed&&(0,eL.css)` + transform: rotate(90deg); + `}; +`,eih=function(e){let{nodeId:t,collapsed:a}=e,n=(0,e$.useDispatch)(),[l,r]=ev.useState(!1),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),{referenceProps:d,arrowProps:c,popperProps:m}=(0,eI.useControlledTooltip)({placement:"top",referenceElementRef:o,arrowElementRef:i,popperElementRef:s,visible:l});return ev.createElement(ev.Fragment,null,ev.createElement(eig,{...d,onClick:e=>{e.preventDefault(),e.stopPropagation(),n(DE(t)),r(!1)},onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},$collapsed:a},ev.createElement(eif,{icon:"caret_down",$collapsed:a})),l&&ev.createElement(eI.Tooltip,{arrowProps:c,popperProps:m},ev.createElement(IN,null,a?ev.createElement(ev.Fragment,null,ev.createElement(eY.Z,{id:"general.unfold",defaultMessage:"Unfold"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"↓"))):ev.createElement(ev.Fragment,null,ev.createElement(eY.Z,{id:"general.fold",defaultMessage:"Fold"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"↑"))))))},eiy=eL.default.div.withConfig({displayName:"styled__RightSide",componentId:"sc-2ea17b3e-0"})` + display: flex; + padding-left: 5px; +`,eib=eL.default.div.withConfig({displayName:"NodeRightSide__Wrapper",componentId:"sc-6d31966b-0"})` + display: flex; +`,eiv=ev.forwardRef(function(e,t){let{className:a,moreMenuHidden:n,node:l,ancestors:r,nodeID:o,documentID:i,onAssign:s,onCountdown:d,onDueDate:c,onReaction:m,addonPopupState:u,addonPopupDispatch:p}=e,g=ev.useRef(null),f=ev.useRef(null);return ev.useImperativeHandle(t,()=>({expandMoreMenu:()=>{g.current?.expand()},expandAddonMenu:()=>{f.current?.expand()}}),[]),ev.createElement(eiy,{className:a},ev.createElement(eib,null,ev.createElement(eoW,{ref:f,nodeID:o,onAssign:s,onCountdown:d,onDueDate:c,onReaction:m,popupState:u,popupDispatch:p,documentId:i}),!n&&ev.createElement(eip,{ref:g,nodeID:o,ancestors:r})),l.hasChild&&ev.createElement(eib,null,ev.createElement(eih,{nodeId:o,collapsed:l.collapsed})))}),eik=eL.default.span.withConfig({displayName:"NodeContent__DragHandle",componentId:"sc-56652002-0"})` + display: flex; + align-items: center; + justify-content: center; + position: absolute; + z-index: 2; + top: -2px; + left: -12px; + opacity: 0; + width: 12px; + height: 30px; + cursor: grab; + + &:active { + cursor: grabbing; + } + + & svg path { + fill: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + } + + &:hover { + & svg path { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } +`,eiE=eL.default.div.withConfig({displayName:"NodeContent__Content",componentId:"sc-56652002-1"})` + position: relative; + padding: 1px 4px; + border-radius: 10px; + + ${e=>e.$isFocused&&(0,eL.css)` + background: ${e.theme.primaryColorScheme?.alpha5}; + `}; + + ${eiy} { + & > div > * { + opacity: 0; + } + } + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha5}; + + ${eiy} { + & > div > * { + opacity: 1; + } + } + + ${eik} { + opacity: 1; + } + } + + ${e=>e.$isCompleted&&(0,eL.css)` + /* Completed Addons */ + .attachment-wrapper .attachment-item { + filter: grayscale(1); + + &:hover { + filter: grayscale(0); + } + } + .addon-badges { + .emoji-value { + filter: grayscale(1); + } + button, + label { + color: ${e.theme.textColors.hex(60)}; + border-color: ${e.theme.appColors.hex(80)}; + background: none; + + & img { + filter: grayscale(1); + } + & svg { + color: ${e.theme.textColors.hex(60)}; + } + & .value { + color: ${e.theme.textColors.hex(60)}; + } + + &:hover { + color: ${e.theme.textColors.hex(10)}; + border-color: ${e.theme.appColors.hex(60)}; + + img { + filter: grayscale(0); + } + svg { + color: ${e.theme.textColors.hex(10)}; + } + .value { + color: ${e.theme.textColors.hex(10)}; + } + } + } + } + .addon-badges { + &:hover .icon { + border-color: ${e.theme.appColors.hex(60)}; + } + } + `}; + } +`,eix=eL.default.div.withConfig({displayName:"NodeContent__EditorWrapper",componentId:"sc-56652002-2"})` + display: flex; + width: 100%; + word-wrap: break-word; + word-break: break-word; +`,ei_=(0,eL.default)(eie).withConfig({displayName:"NodeContent__StyledNodeEditor",componentId:"sc-56652002-3"})` + width: 100%; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + white-space: pre-wrap; + overflow-wrap: break-word; + + ${RQ} + + ${e=>e.$isCompleted&&(0,eL.css)` + text-decoration: line-through; + color: ${e.theme.isNightMode?"#666":"#bfbfbf"}; + + .mention, + .hashtag { + color: ${e.theme.isNightMode?"#666":"#bfbfbf"}; + + &:hover { + color: ${e.theme.primaryColorScheme?.base}; + } + } + + .anchor { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + + &:hover { + color: ${e.theme.primaryColorScheme?.base}; + } + } + + .highlight { + border-color: ${e.theme.isNightMode?"#666":"#eee"} !important; + } + + &:hover { + text-decoration: initial; + } + `}; +`,eiw=eL.default.div.withConfig({displayName:"NodeContent__NoteAddonWrapper",componentId:"sc-56652002-4"})` + ${RY}; +`,eiN=(0,e$.connect)(function(e,t){return{readOnly:dq(e),user:t7(e),isFocused:i6(e,t),hasPlaceholder:iQ(e,t),documentId:dP(e)}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{isColumnNode:a,nodeFormat:n,nodeID:l,node:r,ancestors:o,readOnly:i,user:s,isFocused:d,hasPlaceholder:c,documentId:m,...u}=e,p=(0,e$.useDispatch)(),[g,f]=ev.useReducer(eI.popupReducer,{expanded:!1}),[h,y]=ev.useReducer(eI.popupReducer,{expanded:!1}),[b,v]=ev.useReducer(eI.popupReducer,{expanded:!1}),[k,E]=ev.useReducer(eI.popupReducer,{expanded:!1}),[x,_]=ev.useReducer(eI.popupReducer,{expanded:!1}),w=ev.useCallback(()=>{p(mI(l,null))},[l,p]);(0,eI.usePopupEvents)({state:h,onCollapse:w}),(0,eI.usePopupEvents)({state:k,onCollapse:w});let N=ev.useCallback(()=>{p((e,t)=>null!=t7(t())||(e(rh({isOpen:!0,activeView:rI})),!1))&&(h.expanded?y({type:"Collapse"}):y({type:"Expand",payload:"first"}))},[h.expanded,p]),C=ev.useRef(null),M=ev.useCallback(()=>{C.current?.expandMoreMenu()},[]),S=ev.useCallback(()=>{C.current?.expandAddonMenu()},[]),I=ev.useCallback(()=>{p((e,t)=>{let a=t(),n=dV(a),l=dq(a);return null==t7(a)?(e(rh({isOpen:!0,activeView:rI})),!1):!l&&(null!=n||(e(Fd()),!1))})&&(k.expanded?E({type:"Collapse"}):E({type:"Expand",payload:"first"}))},[p,k.expanded]),D=ev.useCallback(()=>{p(eaV())&&(b.expanded?v({type:"Collapse"}):v({type:"Expand",payload:"first"}))},[p,v,b.expanded]),T=ev.useCallback(()=>{p((e,t)=>null!=t7(t())||(e(rh({isOpen:!0,activeView:rI})),!1))&&(x.expanded?_({type:"Collapse"}):_({type:"Expand",payload:"first"}))},[p,_,x.expanded]),$=null==s&&i;return ev.createElement(eiE,{ref:t,className:"title",$isCompleted:r.completed,$isFocused:d,...u},ev.createElement(eix,{onDragStart:e=>{e.preventDefault(),e.stopPropagation()}},ev.createElement(Fa,{nodeID:l,nodeFormat:n,completed:r.completed}),ev.createElement("div",{className:"flex w-full flex-col"},ev.createElement(ei_,{className:`node-format-${n} node-editor`,$isCompleted:r.completed,ancestors:o,nodeID:l,onAddOnMenu:S,onMoreMenu:M,readOnly:i,hasPlaceholder:c}),ev.createElement(eiw,{className:`node-format-${n} text-sm text-textcolor-500`},ev.createElement(X1,{nodeId:l,ancestors:o}))),ev.createElement(eiv,{ref:C,className:"right-side",isColumnNode:a,node:r,nodeID:l,documentID:m,ancestors:o,onAssign:N,onCountdown:D,onDueDate:I,onReaction:T,addonPopupState:g,addonPopupDispatch:f,moreMenuHidden:$})),ev.createElement(eo3,{nodeID:l,assignmentPopupState:h,assignmentPopupDispatch:y,countdownPopupState:b,countdownPopupDispatch:v,dueDatePopupState:k,dueDatePopupDispatch:E,reactionPopupState:x,reactionPopupDispatch:_,onAssign:N,onCountdown:D,onDueDate:I,onReaction:T}),ev.createElement(eo7,{nodeId:l,readOnly:i,ancestors:o}))})),eiC=eL.default.div.withConfig({displayName:"RowNodeChildren__ChildrenWrapper",componentId:"sc-b037406-0"})` + margin-left: 14px; + padding-left: 12px; + border-left: 1px solid ${e=>e.theme.isNightMode?"#333":"#eaeaea"}; + counter-reset: nodeCounter nodeCounterNumber nodeCounterAlpha; +`,eiM=(0,e$.connect)(function(e){return{documentPreferences:iG(e),documentSearch:iz(e)}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{ancestors:a,nodeID:n,node:l,documentPreferences:r,documentSearch:o}=e,i=ev.useMemo(()=>[...a,n],[a,n]),s=ev.useMemo(()=>l.children.filter(e=>r.isNodeIDVisible(e)&&o.isNodeIDVisible(e)),[r,o,l.children]),d=l.format?.children??li.FORMAT_CHECKBOX;return ev.createElement(eiC,{ref:t},s.map(e=>ev.createElement(eiD,{key:e,ancestors:i,nodeID:e,nodeFormat:d})))})),eiS=eL.default.div.withConfig({displayName:"RowNode__Wrapper",componentId:"sc-49b9fa48-0"})` + position: relative; + display: flex; + justify-content: center; + flex-direction: column; + border-radius: 10px; + + ${e=>e.$showSelectBackground&&(0,eL.css)` + background: ${e.theme.primaryColorScheme?.alpha5}; + `}; + ${e=>e.$isDragging&&"pointer-events: none;"} + + & > div > div:hover > .node-drag-handle { + opacity: 1; + } +`,eiI=VX({ancestors:bW()}),eiD=(0,e$.connect)(function(e,t){return{node:iq()(e,t)}},void 0,void 0,{areOwnPropsEqual:eiI})(Vr(function(e){let{ancestors:t,nodeID:a,nodeFormat:n,node:l}=e,r=XT(l),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),d=(0,e$.useDispatch)(),c=ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t||"Files"===t)return t;return null},[]),m=(0,eK.Z)(),u=XE({canDrop:c,onDrop:ev.useCallback((e,t)=>{if(null==t.dropType)return;let a=eo$(t.dropType,{x:e.clientX,y:e.clientY},o.current,i.current,s.current);null!=a&&d(Xh(a,e.dataTransfer,m))},[d,m])}),p=X2({ancestors:t,nodeID:a,dispatch:d}),g=ev.useCallback(e=>null==u.state.dropType?null:eo$(u.state.dropType,e,o.current,i.current,s.current),[u.state.dropType]),f=u.state.counter>0,h=e.selected||e.selecting;return r?ev.createElement(eiS,{...u.props,...p.props,ref:o,"data-node-id":a,$showSelectBackground:h,$isDragging:p.isDragging,className:`node-format-${l.format?.node??n}`},ev.createElement("div",{id:`node-${a}`,ref:e.selectableRef},ev.createElement(eiN,{ref:i,id:`node-${a}`,ancestors:t,nodeID:a,node:l,nodeFormat:l.format?.node??n})),l.hasChild&&!l.collapsed&&ev.createElement(eiM,{ref:s,ancestors:t,nodeID:a,node:l}),f&&ev.createElement(eoF,{onDropLocation:g})):null})),eiT=eL.default.div.withConfig({displayName:"ColumnNodeChildren__ChildrenWrapper",componentId:"sc-70f67bac-0"})` + display: flex; + flex-direction: column; + + & > div:first-child { + counter-reset: nodeCounter; + } + + ${e=>e.$shouldIndent&&(0,eL.css)` + margin-left: 14px; + padding-left: 12px; + border-left: 1px solid ${e.theme.isNightMode?"#333":"#eaeaea"}; + `}; +`,ei$=(0,e$.connect)(function(e){return{documentPreferences:iG(e),documentSearch:iz(e)}},void 0,void 0,{forwardRef:!0})(ev.forwardRef(function(e,t){let{ancestors:a,nodeID:n,node:l,nodeFormat:r,documentPreferences:o,documentSearch:i}=e,s=ev.useMemo(()=>[...a,n],[a,n]),d=ev.useMemo(()=>l.children.filter(e=>o.isNodeIDVisible(e)&&i.isNodeIDVisible(e)),[o,i,l.children]),c=l.format?.children??li.FORMAT_CHECKBOX;return ev.createElement(eiT,{ref:t,$shouldIndent:!(null!=r&&(r===li.FORMAT_HEADING1||r===li.FORMAT_HEADING2||r===li.FORMAT_TEXT))},d.map(e=>ev.createElement(eiD,{key:e,ancestors:s,nodeID:e,nodeFormat:c})))})),eiP=eL.default.div.withConfig({displayName:"ColumnNode__StyledDraggable",componentId:"sc-a10ba92c-0"})` + cursor: auto; + position: relative; + display: flex; + flex-shrink: 0; + flex-direction: column; + margin-right: 1rem; + padding: 1rem; + width: 456px; + max-height: 100%; + border-radius: 10px; + border-right: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(90):e.theme.appColors.hex(100)}; + box-shadow: ${e=>e.theme.isNightMode?`0.5px 0px 0px 0px ${e.theme.appColors.hex(70)}`:"0 1px 2px 0 rgba(0, 0, 0, 0.18)"}; + ${e=>e.$isDragging&&"pointer-events: none;"} +`,eiF=eL.default.div.withConfig({displayName:"ColumnNode__Wrapper",componentId:"sc-a10ba92c-1"})` + position: relative; + margin-bottom: 16px; + border-radius: 10px; + + ${e=>e.$showSelectBackground&&(0,eL.css)` + background: ${e.theme.primaryColorScheme?.alpha5}; + `}; + + & > div > div:hover > .node-drag-handle { + opacity: 1; + } + + & div:not(.node-format-alpha) + div:is(.node-format-alpha) { + counter-reset: nodeCounter; + } + & div:not(.node-format-number) + div:is(.node-format-number) { + counter-reset: nodeCounter; + } + + &.node-format-h1 > div > .title .node-drag-handle { + top: 0; + } + &.node-format-h2 > div > .title .node-drag-handle { + top: -0.125rem; + } +`,eiA=eL.default.button.withConfig({displayName:"ColumnNode__AddChildButton",componentId:"sc-a10ba92c-2"})` + display: flex; + align-items: center; + justify-content: center; + border: 0; + background: none; + margin: 0; + padding: 0; + cursor: pointer; + color: ${e=>e.theme.appColors.hex(50)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } + + &:focus { + outline: 0; + } +`,eiR=(0,eL.default)(tn.Icon).withConfig({displayName:"ColumnNode__StyledIcon",componentId:"sc-a10ba92c-3"})` + margin-right: 5px; +`,eij=VX({ancestors:bW()}),eiO=(0,e$.connect)(function(e,t){let a=iq();return{isReadOnly:dq(e),documentSearch:iz(e),node:a(e,t)}},void 0,void 0,{areOwnPropsEqual:eij})(Vr(function(e){let{nodeID:t,node:a,ancestors:n,documentSearch:l,isReadOnly:r}=e,o=XT(a),i=(0,e$.useDispatch)(),s=ev.useMemo(()=>!!(o&&a?.hasChild)&&(!a?.collapsed||!!l.isActive&&a?.children.some(e=>l.isNodeIDVisible(e))),[l,a?.children,a?.collapsed,a?.hasChild,o]),d=(0,ev.useCallback)(()=>{i(XD(t))},[i,t]),c=ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t||"Files"===t)return t;return null},[]),m=ev.useRef(null),u=ev.useRef(null),p=ev.useRef(null),g=(0,eK.Z)(),f=XE({canDrop:c,onDrop:ev.useCallback((e,t)=>{if(null==t.dropType)return;let a=eo$(t.dropType,{x:e.clientX,y:e.clientY},m.current,u.current,p.current);null!=a&&i(Xh(a,e.dataTransfer,g))},[i,g])}),h=f.state.counter>0,y=X2({ancestors:n,nodeID:t,dispatch:i}),b=ev.useCallback(e=>null==f.state.dropType?null:eo$(f.state.dropType,e,m.current,u.current,p.current),[f.state.dropType]);if(!o)return null;let v=a.format?.node??li.FORMAT_CHECKBOX,k=e.selected||e.selecting;return ev.createElement(eiP,{...y.props,"data-node-id":t,$isDragging:y.isDragging},ev.createElement(eiF,{...f.props,ref:m,"data-node-id":t,$showSelectBackground:k,className:`node-format-${v}`},ev.createElement("div",{id:`node-${t}`,ref:e.selectableRef},ev.createElement(eiN,{ref:u,ancestors:n,nodeID:t,node:a,nodeFormat:v,isColumnNode:!0})),s&&ev.createElement(ei$,{ref:p,ancestors:n,nodeID:t,node:a,nodeFormat:v}),h&&ev.createElement(eoF,{onDropLocation:b})),!a.collapsed&&!r&&ev.createElement(eiA,{onClick:d},ev.createElement(eiR,{icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.add_task",defaultMessage:"Add Task"})))})),eiU=eL.default.div.withConfig({displayName:"RootNodeChildren__Wrapper",componentId:"sc-ee2b3d67-0"})` + position: relative; + padding: 20px; +`,eiZ=eL.default.div.withConfig({displayName:"RootNodeChildren__Children",componentId:"sc-ee2b3d67-1"})` + display: flex; + align-items: flex-start; + height: 100%; +`,eiL=(0,e$.connect)(function(e){return{documentPreferences:iG(e),documentSearch:iz(e)}})(function(e){let{ancestors:t,nodeID:a,node:n,documentPreferences:l,documentSearch:r}=e,o=ev.useMemo(()=>[...t,a],[t,a]),i=ev.useMemo(()=>n.children.filter(e=>l.isNodeIDVisible(e)&&r.isNodeIDVisible(e)),[l,r,n.children]),s=(0,e$.useDispatch)(),d=ev.useRef(null),c=ev.useRef(null),m=ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),u=(0,eK.Z)(),p=XE({canDrop:m,onDrop:ev.useCallback((e,t)=>{if(null==t.dropType)return;let a=eoD(t.dropType,{x:e.clientX,y:e.clientY},d.current,c.current);null!=a&&s(Xh(a,e.dataTransfer,u))},[s,u])}),g=ev.useCallback(e=>null==p.state.dropType?null:eoD(p.state.dropType,e,d.current,c.current),[p.state.dropType]),f=p.state.counter>0;return ev.createElement(eiU,{...p.props,ref:d,"data-node-id":a},ev.createElement(eiZ,{ref:c},i.map(e=>ev.createElement(eiO,{key:e,nodeID:e,ancestors:o}))),f&&ev.createElement(eoF,{onDropLocation:g}))}),eiB=(0,eL.default)(GC).withConfig({displayName:"DocumentContent__StyledInsertBlock",componentId:"sc-3334c067-0"})` + & .divider { + display: none; + } +`,eiz=(0,e$.connect)(function(e){return{rootNodeAncestors:iZ(e),rootNodeID:iR(e),rootNode:ij(e)}})(function(e){let{isNewTemplate:t,readOnly:a,rootNodeAncestors:n,rootNodeID:l,rootNode:r}=e,o=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback(()=>{},[])});return eox(),ev.createElement("div",{className:"w-inherit flex min-w-fit flex-auto flex-col items-start justify-start p-0",...o.props},ev.createElement(eoS,{isNewTemplate:t}),ev.createElement("div",{className:"completed relative flex items-start"},ev.createElement(eiL,{ancestors:n,nodeID:l,node:r}),!a&&ev.createElement(eiB,{className:"node-styled-insert hover:text-primar/80 duration-250 group -ml-5 mr-10 mt-5 flex w-96 items-center justify-center truncate whitespace-nowrap rounded-lg bg-appcolor-100 p-4 text-primary transition ease-in-out hover:text-primary/80"},ev.createElement(tn.Icon,{className:"mr-1 shrink-0",icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.add_block",defaultMessage:"Add Block"}))))}),eiV=(0,eL.default)(RG).withConfig({displayName:"BoardView__StyledProjectCanvas",componentId:"sc-9a0712b4-0"})` + cursor: grab; + .nodes-wrapper { + cursor: grab; + } + &.dragging { + cursor: grabbing; + .nodes-wrapper { + cursor: grabbing; + } + } + .nodes-wrapper { + padding-top: 0; + } +`,eiq=eL.default.div.withConfig({displayName:"BoardView__ToolbarContainer",componentId:"sc-9a0712b4-1"})` + position: fixed; + left: 0; + bottom: 0; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + pointer-events: none; + margin-bottom: 40px; + z-index: 10; + + @media print { + display: none; + } +`,eiW=(0,e$.connect)(function(e){return{readOnly:dq(e),user:t7(e),doc:dV(e)}})(function(e){let{documentID:t,fetchStatus:a,readOnly:n,coverImageType:l,user:r,match:o,doc:i,spaceId:s,documentView:d}=e,c=o?.params?.isNewDocument!=null,m=i?.isTemplate||o?.params?.isTemplate!=null,u=c&&m,p=ev.useRef(null),g=ev.useRef(null),f=ev.useRef(null),h=ev.useRef(null),y=ev.useRef(null),b=(0,e$.useDispatch)();ev.useEffect(()=>(Mousetrap.bind("mod+\\",()=>{b(xk(t))}),()=>{Mousetrap.unbind("mod+\\")}),[b,t]),ev.useEffect(()=>{if(a===uE)return;if(null==f.current)throw Error("Wrapper is not set up");let e=Xb()(()=>{h.current?.forceUpdate()},100),t=Xb()(()=>{y.current?.forceUpdate()},100),n=ZZ(()=>{e(),t()}),l=new MutationObserver(()=>{e(),t()});return n.observe(f.current),l.observe(f.current,{childList:!0,subtree:!0}),()=>{n.disconnect(),l.disconnect()}},[a]);let v=function(e){let{canvasRef:t}=e,a=ev.useRef(null);return ev.useCallback(e=>{if(!PO(e))return;let n=t.current;if(null==n)return;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),a.current={left:n.scrollLeft,top:n.scrollTop,x:e.clientX,y:e.clientY};let l=e=>{if(null==a.current)return;let t=a.current,l=e.clientX-t.x,r=e.clientY-t.y;n.scrollLeft=t.left-l,n.scrollTop=t.top-r},r=()=>{a.current=null,n.classList.remove("dragging"),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",r)};n.classList.add("dragging"),document.addEventListener("mousemove",l),document.addEventListener("mouseup",r)},[t])}({canvasRef:f});return a===uE?ev.createElement(J8,null):ev.createElement(eiV,{ref:f,onKeyDownCapture:e=>{p.current?.handleKeyDownCapture(e),g.current?.handleKeyDownCapture(e)},onMouseDown:v,$documentView:"board",$coverImage:l,id:"project-canvas"},null!=r&&m&&ev.createElement(zz,{isNewTemplate:u,documentID:t,documentView:d,spaceID:s}),ev.createElement(Uv,null),ev.createElement(QD,null),ev.createElement(Qc,null),ev.createElement(Xi,null,ev.createElement(zO.Wh,null,ev.createElement(Xe,null,ev.createElement(eiz,{isNewTemplate:u,readOnly:n})),null!=t&&ev.createElement(ev.Fragment,null,ev.createElement(Q_,{ref:h,documentID:t}),ev.createElement(zQ,{projectID:t}),ev.createElement(eok,{ref:y,projectId:t})),ev.createElement(V2,{documentId:t}),ev.createElement(J4,{ref:p}),ev.createElement(W9,{ref:g,documentId:t}),!n&&ev.createElement(eiq,null,ev.createElement(JH,null)))),ev.createElement(zZ,{location:e.location,isLoggedIn:null!=r}),ev.createElement(Q$,{fetchStatus:a}),ev.createElement(YA,null),ev.createElement(H5,null),ev.createElement(KA,null),ev.createElement(Y0,null))}),eiH=(0,la.ZP)` + mutation ProjectNodesImportMutation($input: ProjectNodesImportInput!) { + projectNodesImport(input: $input) { + clientMutationId + nodeID + document { + id + info + } + } + } +`,eiG=(0,eL.default)(RV.ML).withConfig({displayName:"SlateEditor__StyledEditor",componentId:"sc-f50b3685-0"})` + ${RQ} + word-break: break-word; +`,eiK=ev.forwardRef(function(e,t){let{className:a,delta:n,onChange:l,...r}=e,[o,i]=(0,ev.useState)(n),[s,d]=(0,ev.useState)((0,Df.MS)(n));(0,ev.useEffect)(()=>{let e=o.diff(n);if(0===e.ops.length)return;let t=(0,Df.Rx)(s,e),a=s.change();a.applyOperations(t,{save:!1}),i(n),d(a.value)},[n,o,s]);let c=(0,ev.useCallback)(e=>{if(s.document===e.value.document){d(e.value);return}let t=(0,Df.xc)(e.value.document);l?.(t)},[l,s.document]);return ev.createElement(eiG,{ref:t,className:a,value:s,onChange:c,decorateNode:PC,renderMark:PX,...r})}),eiY=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-3761c4d-0"})` + padding: 20px 0; + + display: flex; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(90)}; + border-radius: 10px; + + max-width: 500px; +`,eiQ=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"styled__Bullet",componentId:"sc-3761c4d-1"})` + ${P3} + + -webkit-appearance: none; + flex-shrink: 0; + + width: 20px; + height: 20px; + + margin-right: 10px; +`,eiJ=eL.default.div.withConfig({displayName:"styled__NodeWrapper",componentId:"sc-3761c4d-2"})` + display: flex; + align-items: flex-start; + + padding: 0 20px; +`,eiX=(0,eL.default)(eiK).withConfig({displayName:"styled__StyledSlateEditor",componentId:"sc-3761c4d-3"})` + width: 100%; +`,ei0=eL.default.div.withConfig({displayName:"styled__ActionBar",componentId:"sc-3761c4d-4"})` + display: flex; + align-items: center; + justify-content: flex-end; + + column-gap: 10px; + + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + + margin-top: 20px; + padding: 20px 20px 0; +`,ei1=eL.default.button.withConfig({displayName:"styled__CTAButton",componentId:"sc-3761c4d-5"})` + ${e1.UiTypography.sm}; + + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + font-weight: 500; + + padding: 8px 20px; + border-radius: 10px; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &:disabled { + background: ${e=>e.theme.primaryColorScheme?.alpha30}; + } +`,ei2=eL.default.button.withConfig({displayName:"styled__CancelButton",componentId:"sc-3761c4d-6"})` + ${e1.UiTypography.sm}; + + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + color: ${e=>e.theme.textColors.hex(40)}; + + padding: 8px 20px; + border-radius: 10px; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,ei5=eL.default.div.withConfig({displayName:"styled__Addons",componentId:"sc-3761c4d-7"})` + display: flex; + align-items: center; + + padding: 0 20px; + + margin-top: 10px; + margin-left: 25px; +`,ei3=eL.default.div.withConfig({displayName:"styled__AddonPill",componentId:"sc-3761c4d-8"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + column-gap: 4px; + + padding: 1px 6px 1px 8px; + + border-radius: 20px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(20)}; +`,ei4=function(e){let{selectedAssignees:t,projectId:a,handleUserSelect:n}=e,{users:l,loading:r}=aN({projectId:a}),o=(0,eB.a)(sW),i=o.data?.me,s=e=>null!=e&&"object"==typeof e&&"__typename"in e&&"User"===e.__typename;return r||o.loading?ev.createElement(eI.Spinner,null):ev.createElement(a_,{assignees:t,members:l,currentUserId:i?.id??null,hideUserPresence:!0,onUserSelect:e=>{s(e)&&n(e)},onPopupClose:()=>{},onPopupBlur:()=>{}})},ei6=function(e){let{menuButtonProps:t,handleClick:a,selectedAssignees:n}=e;if(0===n.length)return ev.createElement(ei8,{...t,onClick:a},ev.createElement(tn.Icon,{icon:"addon_assign"}),ev.createElement(eY.Z,{id:"general.assign",defaultMessage:"Assign"}));let l=n.map(e=>e.handle),r=n.map(e=>ev.createElement(ei7,{key:e.id,src:e.avatars_v2?.small?.mdpi.url,alt:e.handle}));return ev.createElement(ei8,{...t,onClick:a},r," ",ev.createElement("span",{className:"ml-1 whitespace-nowrap"},l.join(", ")))},ei8=eL.default.button.withConfig({displayName:"AssigneesButton__Button",componentId:"sc-382464de-0"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + column-gap: 4px; + + padding: ${eI.UiSpacing.getPx(.5)} ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(.5)} + ${eI.UiSpacing.getPx(2)}; + + border-radius: 20px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(20)}; + + margin-left: ${eI.UiSpacing.getPx(1)}; +`,ei7=(0,eL.default)(e1.UserAvatar).attrs({size:"xs",shape:"circle"}).withConfig({displayName:"AssigneesButton__Avatar",componentId:"sc-382464de-1"})` + margin-left: -5px; + + &:first-child { + margin-left: 0; + } +`,ei9=function(e){let{selectedAssignees:t,projectId:a,handleSelectedAssigneesChange:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useReducer(eI.popupReducer,{expanded:!1}),s=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:o,placement:"bottom"}),d=(0,eI.useMenuButton)({ref:l,state:o,dispatch:i});return ev.createElement(ev.Fragment,null,ev.createElement(ei6,{selectedAssignees:t,menuButtonProps:d.props,handleClick:()=>{o.expanded?i({type:"Collapse"}):i({type:"Expand"})}}),o.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:i,modal:!0},ev.createElement(ei4,{selectedAssignees:t,projectId:a,handleUserSelect:n})))},ese=function(e){let{projectId:t,date:a,time:n,type:l,exit:r,isExiting:o}=e,i=(0,eF.k6)(),s=(0,eK.Z)(),[d,c]=ev.useState([]),m=ev.useCallback(e=>{if(d.find(t=>t.id===e.id)){c(d.filter(t=>t.id!==e.id));return}c([...d,e])},[d]),[u,p]=(0,ev.useState)(null),[g,f]=(0,ev.useState)(!1),[h,y]=(0,ev.useState)(new(CI())({ops:[{insert:"\n",attributes:{paragraph:!0}}]})),b=(0,ev.useCallback)(e=>{y(e)},[]),v=(0,ev.useMemo)(()=>{let e;let t=eG().tz.guess(),r=ez.DateTimeDescHelpers.toMoment({date:a,time:n??void 0,timezone:t}),o=ez.MomentHelpers.toDateTimeDesc(r);switch(l){case"all_day":e=r.clone().add(1,"day");break;case"hourly":e=r.clone().add(1,"hour")}let i=ez.MomentHelpers.toDateTimeDesc(e);return ez.DateDuration.fromDateRangeDesc({start:o,end:i})},[a,n,l]),[k,{loading:E}]=(0,cs.D)(eiH),x=1===h.ops.length,_=(0,ev.useCallback)(async()=>{let e=d.length>0?{}:void 0;if(null!=e)for(let t of d){let a=t.id;e[a]={type:"user",id:a}}let{data:a}=await k({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:t,placement:"beforeend",nodeID:null,type:"application/vnd.taskade.taskast",content:{type:"fragment",children:[{type:"text",completed:g,collapsed:!1,text:h,children:[],attributes:{_dueDate:v.toDateRangeDesc(),_assignees:e}}]}}}}),n=a?.projectNodesImport?.nodeID;null!=n&&(i.replace({...i.location,hash:`#node-${n}`}),r())},[g,v,h,r,i,t,k,d]),w=(0,ev.useCallback)(()=>!x&&!o&&!E&&(_(),!0),[_,x,o,E]),N=function(e){let{onEnter:t,onPaste:a}=e;return ev.useMemo(()=>[RH.OnEscape(),RH.MarkHotKey({key:"b",type:"bold"}),RH.MarkHotKey({key:"u",type:"underline"}),RH.MarkHotKey({key:"i",type:"italic"}),RH.MarkHotKey({key:"e",type:"highlight"}),RH.OnEnter({onEnter:t}),{onPaste(e,t){let n=e.clipboardData;return a?.(n,t.value.selection),t}}],[t,a])}({onEnter:w,onPaste:ev.useCallback((e,t)=>{let a=e.getData("text").replaceAll("\n"," ");if(ts()(a))return;let{anchorOffset:n,focusOffset:l}=t,r=Math.min(n,l),o=Math.max(n,l),i=[];r>0&&i.push({retain:r}),o>r&&i.push({delete:o-r}),i.push({insert:a});let s=new(CI())(i);y(e=>e.compose(s))},[])});return(0,ev.useLayoutEffect)(()=>{u?.focus()},[u]),ev.createElement(eiY,null,ev.createElement(eiJ,null,ev.createElement(eiQ,{onChange:e=>{f(e.target.checked)}}),ev.createElement(eiX,{ref:p,delta:h,onChange:b,placeholder:s.formatMessage({id:"general.add_node_prompt",defaultMessage:"Type something to do..."}),plugins:N})),ev.createElement(ei5,null,ev.createElement(ei3,null,ev.createElement(tn.Icon,{icon:"addon_date"}),v.toReadableFormat()),ev.createElement(ei9,{selectedAssignees:d,projectId:t,handleSelectedAssigneesChange:m})),ev.createElement(ei0,null,E?ev.createElement(eI.Spinner,null):ev.createElement(ev.Fragment,null,ev.createElement(ei2,{onClick:r},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(ei1,{onClick:w,disabled:x},ev.createElement(eY.Z,{id:"general.add_task",defaultMessage:"Add Task"})))))},est=(0,d9.oM)({name:"dialogs.calendarAddNode",initialState:{isOpen:!1},reducers:{toggleCalendarAddNodeDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{...t.payload,isOpen:!0}}}),esa=(0,e$.connect)(function(e){return e.dialogs.calendarAddNode})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=(0,ev.useCallback)(()=>{a(est.actions.toggleCalendarAddNodeDialog())},[a]);return t?ev.createElement(eI.ModalDialog,{close:n,isOpen:t,autofocus:!1,backdropOpacity:eI.ModalDialogOpacity.Translucent},t=>{let{exit:a,state:n}=t,l=n.matches("exiting");return ev.createElement(ese,{exit:a,isExiting:l,...e})}):null});var esn=a(98913),esl=a.n(esn);let esr=ev.createContext(void 0),eso=function(e){let[t,a]=ev.useState(new Set),n=ev.useCallback((e,t)=>{a(a=>{let n=new Set(a);return t?n.add(e):n.delete(e),n})},[]);return ev.createElement(esr.Provider,{value:{draggingEventIds:t,setIsEventDragging:n}},e.children)};function esi(){let e=ev.useContext(esr);if(null==e)throw Error("CalendarDragContext unavailable");return e}let ess=eL.default.div.withConfig({displayName:"CalendarEvent__Wrapper",componentId:"sc-b392965c-0"})` + grid-row: ${e=>e.$row} / span 1; + flex-shrink: 0; + ${e=>(0,eL.css)` + width: calc(${100*e.$dayCount}% + ${e.$extraPixels}px); + `} + ${e=>e.$isEventStart&&` + margin-left: 5px; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + `}; + ${e=>e.$isEventEnd&&` + margin-right: 5px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + `}; + margin-bottom: 2px; + overflow: hidden; + z-index: 2; + + ${e=>e.$disablePointerEvents&&(0,eL.css)` + pointer-events: none; + `}; + + > * { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +`,esd=function(e){let{event:t,children:a,onEventClicked:n}=e,{dateDuration:l,chunkStart:r,chunkEnd:o,row:i,id:s,data:d}=t,c=Math.max(1,Math.ceil(o.diff(r,"days",!0))),m=l.startMoment.isSame(r,"days"),u=l.endMoment.isSameOrBefore(o,"days"),p=function(e){let t=e.event,a=ev.useRef(),n=esi(),l=ev.useCallback(e=>{if(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.target instanceof HTMLElement&&"true"!==e.target.dataset.dragHandle){e.preventDefault();return}e.dataTransfer.setData("application/vnd.taskade.calendarevent",JSON.stringify(t)),requestAnimationFrame(()=>{n.setIsEventDragging(t.id,!0)})},[n,t]),r=ev.useCallback(()=>{a.current?.(),n.setIsEventDragging(t.id,!1)},[n,t.id]);return ev.useEffect(()=>()=>{a.current?.()},[]),{isAnyEventDragging:n.draggingEventIds.size>0,props:{onDragStart:l,onDragEnd:r}}}({event:t}),g=(0,ev.useCallback)(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),n?.(t)},[t,n]),f=c;return m&&(f-=5),u&&(f-=5),6===o.day()&&(f-=1),ev.createElement(ess,{$dayCount:c,$extraPixels:f,$row:i+1,$isEventStart:m,$isEventEnd:u,$disablePointerEvents:p.isAnyEventDragging,...p.props,draggable:null==t.disableDrag||!1===t.disableDrag,"data-drag-handle":!0,onClick:g},a)},esc=eL.default.div.withConfig({displayName:"CalendarEventHourly__Wrapper",componentId:"sc-e2f57b3e-0"})` + position: absolute; + ${e=>(0,eL.css)` + top: ${e.$start/60*100}%; + left: ${e.$col/e.$totalCols*100}%; + height: calc( + ${e.$minuteCount/60*100}% + ${Math.floor(e.$minuteCount/60)}px - 1px + ); + width: calc(${1/e.$totalCols*100}%); + `}; + ${e=>e.$isEventStart&&` + border-top-left-radius: 5px; + border-top-right-radius: 5px; + `}; + ${e=>e.$isEventEnd&&` + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + `}; + overflow: hidden; + z-index: 1; + + ${e=>e.$disablePointerEvents&&(0,eL.css)` + pointer-events: none; + `}; + + & > div { + display: inline-flex; + height: 100%; + justify-content: flex-start; + border-left: 2px solid ${e=>e.$color??e.theme.primaryColorScheme?.base}; + } +`,esm=function(e){let{children:t,event:a,totalCols:n,onEventClicked:l,color:r}=e,{dateDuration:o,chunkStart:i,chunkEnd:s,col:d,id:c,data:m}=a,u=Math.max(30,s.diff(i,"minutes")),p=o.startMoment.isSame(i,"hours"),g=o.endMoment.isSame(s,"hours"),f=function(e){let t=e.event,a=ev.useRef(),n=esi(),l=ev.useCallback(e=>{if(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.target instanceof HTMLElement&&"true"!==e.target.dataset.dragHandle){e.preventDefault();return}e.dataTransfer.setData("application/vnd.taskade.calendarevent",JSON.stringify(t)),requestAnimationFrame(()=>{n.setIsEventDragging(t.id,!0)})},[n,t]),r=ev.useCallback(()=>{a.current?.(),n.setIsEventDragging(t.id,!1)},[n,t.id]);return ev.useEffect(()=>()=>{a.current?.()},[]),{isAnyEventDragging:n.draggingEventIds.size>0,props:{onDragStart:l,onDragEnd:r}}}({event:a}),h=(0,ev.useCallback)(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l?.(a)},[a,l]);return ev.createElement(esc,{$start:i.minute(),$minuteCount:u,$totalCols:n,$col:d,$isEventStart:p,$isEventEnd:g,$disablePointerEvents:f.isAnyEventDragging,$color:r||null,...f.props,draggable:null==a.disableDrag||!1===a.disableDrag,"data-drag-handle":!0,onClick:h},t)},esu=eL.default.div.withConfig({displayName:"HourlyDropPoint__Wrapper",componentId:"sc-cfc17830-0"})` + width: 100%; + height: ${6}%; + flex-grow: 1; + + ${e=>e.$isDraggingOver&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha10}; + `} +`,esp=function(e){let{onEventDragged:t,day:a,time:n,start:l,children:r}=e,o=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.calendarevent"===t)return t;return null},[]),onDrop:ev.useCallback((e,l)=>{null!=l.dropType&&t(JSON.parse(e.dataTransfer.getData("application/vnd.taskade.calendarevent")),a,n,"hourly")},[a,n,t])}),i=o.state.counter>0;return ev.createElement(esu,{...o.props,$isDraggingOver:i},r)},esg=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-5a67795c-0"})` + display: flex; + height: 100%; + flex-direction: column; + background: ${e=>e.theme.backgroundColorHex}; + overflow: hidden; +`,esf=eL.default.div.withConfig({displayName:"styled__Toolbar",componentId:"sc-5a67795c-1"})` + display: flex; + margin-bottom: 16px; + padding: 20px 20px 0px; + width: 100%; + flex-direction: row; + flex-wrap: wrap; +`,esh=eL.default.div.withConfig({displayName:"styled__Header",componentId:"sc-5a67795c-2"})` + display: flex; + padding: 0px 20px 10px; + text-align: center; +`,esy=eL.default.span.withConfig({displayName:"styled__Title",componentId:"sc-5a67795c-3"})` + ${e1.ArticleTypography.heading3} + font-weight: 400; + color: ${e=>e.theme.textColors.hex(10)}; + flex-grow: 1; +`,esb=eL.default.div.withConfig({displayName:"styled__ViewControlsContainer",componentId:"sc-5a67795c-4"})` + margin-right: 10px; + display: flex; +`,esv=eL.default.div.withConfig({displayName:"styled__NavigationControlsContainer",componentId:"sc-5a67795c-5"})` + display: flex; +`,esk=eL.default.div.withConfig({displayName:"styled__Corner",componentId:"sc-5a67795c-6"})` + display: flex; + align-self: flex-end; + height: 36px; + margin-left: auto; + transform: scale(0.95); +`,esE=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-5a67795c-7"})` + background-color: ${e=>e.$active?e.theme.appColors.hex(90):"transparent"}; + padding: 7px 12px; + color: ${e=>e.theme.textColors.hex(10)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + ${e1.UiTypography.sm}; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + &.first-item { + border-radius: 10px 0 0 10px; + } + &.last-item { + border-radius: 0 10px 10px 0; + } +`,esx=(0,eL.css)` + &:hover { + background-color: ${e=>e.theme.appColors.hex(90)}; + & .add-event { + display: flex; + } + cursor: pointer; + } +`,es_=eL.default.div.withConfig({displayName:"AllDayCell__Wrapper",componentId:"sc-d424a2d7-0"})` + flex-grow: 1; + + display: grid; + grid-auto-rows: 30px; + padding-top: 1px; + border-style: solid; + border-width: 1px 1px 0 0; + border-color: ${e=>e.theme.appColors.hex(70)}; + + &:last-child { + border-right: 0; + } + + ${e=>e.$isDraggingOver&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha10}; + `} + + ${esx}; +`,esw=function(e){let{day:t,onEventDragged:a,children:n,onEmptySpaceClick:l}=e,r=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.calendarevent"===t)return t;return null},[]),onDrop:ev.useCallback((e,n)=>{null!=n.dropType&&a(JSON.parse(e.dataTransfer.getData("application/vnd.taskade.calendarevent")),t,null,"all_day")},[t,a])}),o=r.state.counter>0,i=(0,ev.useCallback)(()=>{l(t,null,"all_day")},[l,t]);return ev.createElement(es_,{$isDraggingOver:o,onClick:i,...r.props},n)},esN=eL.default.div.withConfig({displayName:"CurrentTime__EmptySpacer",componentId:"sc-2d465d33-0"})``,esC=eL.default.div.withConfig({displayName:"CurrentTime__Wrapper",componentId:"sc-2d465d33-1"})` + position: relative; +`,esM=eL.default.div.withConfig({displayName:"CurrentTime__InnerLine",componentId:"sc-2d465d33-2"})` + position: absolute; + + top: ${e=>(60*e.$currentTimeValue).toFixed(2)}px; + left: 0; + right: 0; + height: 1px; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + + display: flex; + align-items: center; + + z-index: 2; +`,esS=eL.default.div.withConfig({displayName:"CurrentTime__Ball",componentId:"sc-2d465d33-3"})` + transform: translateX(-50%); + width: 10px; + height: 10px; + border-radius: 100%; + background-color: ${e=>e.theme.primaryColorScheme?.base}; +`;function esI(){let e=eG()();return e.hour()+e.minutes()/60}let esD=function(e){let{isToday:t}=e,[a,n]=(0,ev.useState)(esI);return(0,ev.useEffect)(()=>{if(!t)return;let e=setInterval(()=>{n(esI)},6e4);return()=>{clearInterval(e)}},[t]),ev.createElement(ev.Fragment,null,ev.createElement(esN,null),ev.createElement(esC,null,t&&ev.createElement(esM,{$currentTimeValue:a},ev.createElement(esS,null))))},esT=eL.default.div.withConfig({displayName:"EventsAllDayContainer__Wrapper",componentId:"sc-d289fc28-0"})` + display: flex; + flex-direction: column; + min-height: 31px; + padding-top: 1px; + + ${esx} +`,es$=function(e){let{children:t}=e;return ev.createElement(esT,null,t)},esP=eL.default.div.withConfig({displayName:"EventsTimedContainer__Wrapper",componentId:"sc-dfa97eb4-0"})` + position: relative; + display: flex; + flex-direction: column; + height: 60px; + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + + &:nth-last-child(2) { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + } + + ${esx} +`,esF=function(e){let{children:t,onEmptySpaceClick:a,day:n,time:l}=e,r=(0,ev.useCallback)(()=>{a(n,l,"hourly")},[a,n,l]);return ev.createElement(esP,{onClick:r},t)};function esA(e){let t=[];for(let a of e){let{startMoment:e,endMoment:n}=a.dateDuration,l=e.clone(),r=e.clone();for(;r.isSameOrBefore(n,"hour");){let e=r.isSame(n,"hour"),o=23===r.hour();if(e){let e=n.clone();t.push({...a,type:"EventChunkHourly",chunkStart:l,chunkEnd:e})}else if(o){let e=r.clone();e.add(1,"hours");let n=r.clone().endOf("day");e.isAfter(n)&&(e=n),t.push({...a,type:"EventChunkHourly",chunkStart:l,chunkEnd:e}),l=r.clone().add(1,"hours").startOf("day")}r.add(1,"hours")}}return t}function esR(e){let{chunkStart:t,chunkEnd:a}=e,n=t.hour(),l=Math.floor((60*n+t.minute())/10),r=Math.max(Math.ceil(3),Math.ceil((a.diff(t,"minutes")+t.minute()%10)/10));return l+r>=144&&(l=144-Math.ceil(3),r=Math.ceil(3)),{chunkStartHour:n,segmentStartIndex:l,segmentCount:r}}function esj(e){let t=e.dateDuration.startMoment.clone().tz(eG().tz.guess(),!1),a=e.dateDuration.endMoment.clone().tz(eG().tz.guess(),!1),n=ez.DateDuration.fromDateRangeDesc({start:ez.MomentHelpers.toDateTimeDesc(t),end:ez.MomentHelpers.toDateTimeDesc(a)});return{id:e.id,dateDuration:n,data:e.data,disableDrag:e.disableDrag,stripeColor:e.stripeColor}}function esO(e){let t=[],a=[];for(let n of e)n.dateDuration.toReadableFormat().includes(":")?a.push(n):t.push(n);return{allDay:t,others:a}}!function(e){e[e.Month=0]="Month",e[e.Week=1]="Week",e[e.Day=2]="Day"}(K||(K={}));class esU{#e=0;isOccupied(){return 1===this.#e}markOccupied(){this.#e=1}toJSON(){return{type:"AllDayRowOccupancyManager",value:this.#e}}}class esZ{#t=[];get count(){return this.#t.length}row(e){let t=this.#t[e];if(null==t)throw Error("invalid row index");return t}isRowExists(e){return this.#t.length-1>=e}addRow(){return this.#t.push(new esU),this.#t.length-1}findAvailableRow(){if(0===this.count)return null;for(let e=0;ee.isOccupied()).length}column(e){let t=this.#a[e];if(null==t)throw Error("invalid column index");return t}toJSON(){return{type:"HourlySegmentOccupancyManager",columns:this.#a}}}class esz{#n;#l=[];constructor(){this.#n=new esZ;for(let e=0;e<144;e++)this.#l.push(new esB)}get allDay(){return this.#n}segment(e){let t=this.#l[e];if(null==t){let t=Error("invalid segment index");throw er.$e(a=>{a.addBreadcrumb({category:"Calendar-DayOccupancyManager",message:"Segment Index: "+e,level:"debug"}),er.Tb(t)}),t}return t}addHourlyColumn(){for(let e of this.#l)e.addColumn();return this.columnCount-1}hasHourlyColumn(e){return 0!==this.#l.length&&this.#l[0].hasColumn(e)}get columnCount(){return 0===this.#l.length?0:this.#l[0].columnCount}maxColumnCountAcrossSegments(e,t){let a=0;for(let n=0;n({hourlySegmentOccupancyManager:e,index:t}))}}}let esV=eL.default.div.withConfig({displayName:"styled__DayHeading",componentId:"sc-4128cfdc-0"})` + grid-column: 1 / span 2; + padding-bottom: 10px; + ${e1.UiTypography.lg} + color: ${e=>e.theme.textColors.hex(10)}; + text-align: center; + + ${e=>e.$isToday&&(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + `} +`,esq=eL.default.div.withConfig({displayName:"styled__AllDaySection",componentId:"sc-4128cfdc-1"})` + display: grid; + grid-template-columns: auto 1fr; + border-color: ${e=>e.theme.appColors.hex(70)}; + border-style: solid; + border-width: 1px 0 4px; +`,esW=eL.default.div.withConfig({displayName:"styled__HourlySection",componentId:"sc-4128cfdc-2"})` + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: 1fr 0 repeat(24, ${60}px) 1fr; + overflow-y: scroll; + ${tM} +`,esH=eL.default.div.withConfig({displayName:"styled__Spacer",componentId:"sc-4128cfdc-3"})` + height: 7px; +`,esG=eL.default.div.withConfig({displayName:"styled__Time",componentId:"sc-4128cfdc-4"})` + width: 60px; + padding-right: 6px; + ${e1.UiTypography.xxs} + text-align: right; + color: ${e=>e.theme.textColors.hex(50)}; +`,esK=eL.default.span.withConfig({displayName:"styled__AllDay",componentId:"sc-4128cfdc-5"})` + display: block; + line-height: 31px; +`,esY=eL.default.span.withConfig({displayName:"styled__Hour",componentId:"sc-4128cfdc-6"})` + display: block; + margin-top: -6px; +`,esQ=function(e){let{calendarState:t,events:a,eventRender:n,onEventDragged:l,onEventClicked:r,onEmptySpaceClick:o}=e,i=(0,ev.useMemo)(()=>{let e=eG()().set({hour:0,minute:0,second:0}),t=[];do t.push({hour:e.hour(),formatted:e.format("h A"),isoFormatted:e.format(ez.ISO_TIME_FORMAT),mmt:e.clone()}),e.add(1,"hours");while(0!==e.hour())return t},[]),s=t.currentDay.format(ez.ISO_DATE_FORMAT),d=(0,ev.useMemo)(()=>eG()().startOf("day"),[]),c=(0,ev.useMemo)(()=>t.currentDay.isSame(d,"day"),[t.currentDay,d]),m=function(e,t){let a=ev.useMemo(()=>e.map(e=>esj(e)).filter(e=>(function(e,t){let a=t.clone().startOf("day"),n=e.dateDuration.startMoment.isSameOrBefore(a,"day"),l=e.dateDuration.endMoment.isAfter(a);return n&&l})(e,t)),[e,t]),n=ev.useMemo(()=>esO(a),[a]),l=ev.useMemo(()=>{let e=new esz,a=[],l=[],r=K.Day;for(let l of n.allDay.sort((e,t)=>e.dateDuration.startMoment.diff(e.dateDuration.endMoment,"days")-t.dateDuration.startMoment.diff(t.dateDuration.endMoment,"days"))){let n=t.clone(),o=t.clone().add(1,"days"),i=e.allDay.findAvailableRow();null==i&&(i=e.allDay.addRow()),a.push({...l,type:"EventChunkAllDay",chunkStart:n,chunkEnd:o,row:i,view:r}),e.allDay.row(i).markOccupied()}for(let a of esA(n.others.sort((e,t)=>e.dateDuration.duration.as("hours")-t.dateDuration.duration.as("hours")))){let{chunkStart:n,chunkEnd:o}=a;if(!n.isSame(t,"day"))continue;let{chunkStartHour:i,segmentStartIndex:s,segmentCount:d}=esR(a),c=e.findAvailableColumn(s,d);null==c&&(c=e.addHourlyColumn()),e.markSegmentsOccupied(s,d,c);let m=l[i]??[];m.push({...a,type:"EventChunkHourly",chunkStart:n,chunkEnd:o,col:c,view:r,segmentCount:d,segmentStartIndex:s}),l[i]=m}return{occupancyManager:e,chunksAllDay:a,chunksHourly:l}},[t,n.allDay,n.others]);return{currentDay:t,relevantEvents:a,occupancyManager:l.occupancyManager,chunksAllDay:l.chunksAllDay,chunksHourly:l.chunksHourly}}(a,t.currentDay);return ev.createElement(ev.Fragment,null,ev.createElement(esV,{$isToday:c},t.currentDay.format("dddd")),ev.createElement(esq,null,ev.createElement(esG,null,ev.createElement(esK,null,ev.createElement(eY.Z,{id:"general.all_day",defaultMessage:"all-day"}))),ev.createElement(es$,null,ev.createElement(esw,{day:s,onEventDragged:l,onEmptySpaceClick:o},m.chunksAllDay.map(e=>ev.createElement(esd,{key:e.id,event:e,onEventClicked:r},n(e)))))),ev.createElement(esW,null,ev.createElement(esH,null),ev.createElement(esH,null),ev.createElement(esD,{isToday:c}),i.map(e=>ev.createElement(ev.Fragment,null,ev.createElement(esG,null,ev.createElement(esY,null,e.formatted)),ev.createElement(esF,{onEmptySpaceClick:o,day:s,time:e.mmt.format(ez.ISO_TIME_FORMAT)},m.chunksHourly[e.hour]?.map(e=>ev.createElement(esm,{key:e.id,event:e,onEventClicked:r,color:e.stripeColor,totalCols:m.occupancyManager.maxColumnCountAcrossSegments(e.segmentStartIndex,e.segmentCount)},n(e))),esl()(6,t=>ev.createElement(esp,{day:s,time:e.mmt.clone().add(10*t,"minutes").format(ez.ISO_TIME_FORMAT),onEventDragged:l}))))),ev.createElement(esH,null),ev.createElement(esH,null)))},esJ=function(e){let{currentDay:t}=e;return ev.createElement(ev.Fragment,null,ev.createElement("b",null,t.format("MMMM"))," ",t.format("YYYY"))},esX=function(e){let{currentDay:t}=e,a=(0,ev.useMemo)(()=>t.clone().weekday(0).startOf("day"),[t]),n=(0,ev.useMemo)(()=>t.clone().weekday(6).startOf("day"),[t]);return a.year()!==n.year()?ev.createElement(ev.Fragment,null,ev.createElement("b",null,a.format("MMMM"))," ",a.format("YYYY")," - ",ev.createElement("b",null,n.format("MMMM"))," ",n.format("YYYY")):a.month()!==n.month()?ev.createElement(ev.Fragment,null,ev.createElement("b",null,a.format("MMMM")," - ",n.format("MMMM"))," ",n.format("YYYY")):ev.createElement(ev.Fragment,null,ev.createElement("b",null,t.format("MMMM"))," ",t.format("YYYY"))},es0=function(e){let{currentDay:t,currentView:a}=e;return ev.createElement(esy,null,a===K.Day&&ev.createElement(ev.Fragment,null,ev.createElement("b",null,t.format("D MMMM"))," ",t.format("YYYY")),a===K.Week&&ev.createElement(esX,{currentDay:t}),a===K.Month&&ev.createElement(esJ,{currentDay:t}))},es1=eL.default.div.withConfig({displayName:"DayBox__Wrapper",componentId:"sc-5904988-0"})` + display: flex; + flex-direction: column; + border-right: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + + &:nth-child(7n) { + border-right: 0; + } + + ${esx}; +`,es2=function(e){let{children:t,day:a,onEmptySpaceClick:n}=e,l=(0,ev.useCallback)(()=>{n(a,null,"all_day")},[n,a]);return ev.createElement(es1,{onClick:l},t)},es5=eL.default.div.withConfig({displayName:"EventRows__Wrapper",componentId:"sc-4f20efc2-0"})` + display: grid; + grid-auto-rows: 30px; + height: 100%; + overflow-y: clip; + + ${e=>e.$isDraggingOver&&(0,eL.css)` + background-color: ${e.theme.primaryColorScheme?.alpha10}; + `} + +} +`,es3=function(e){let{day:t,onEventDragged:a,children:n}=e,l=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.calendarevent"===t)return t;return null},[]),onDrop:ev.useCallback((e,n)=>{null!=n.dropType&&a(JSON.parse(e.dataTransfer.getData("application/vnd.taskade.calendarevent")),t,null,"all_day")},[t,a])}),r=l.state.counter>0;return ev.createElement(es5,{className:"event-row",$isDraggingOver:r,...l.props},n)},es4=function(e,t){let a=t[0];return e.diff(a,"day")};class es6{#e=0;get type(){switch(this.#e){case 0:return"unoccupied";case 1:return"occupied"}return"overoccupied"}get overOccupancyCount(){if("overoccupied"!==this.type)throw Error("row is not overoccupied");return this.#e}markOccupied(){this.#e=1}increment(){this.#e+=1}toJSON(){return{type:"MonthDayRowOccupancyManager",value:this.#e}}}class es8{#t=[];constructor(){for(let e=0;e<4;e++)this.#t.push(new es6)}row(e){let t=this.#t[e];if(null==t){let t=Error("invalid row index");throw er.$e(a=>{a.addBreadcrumb({category:"Calendar-MonthDayOccupancyManager",message:"Row Index: "+e,level:"debug"}),er.Tb(t)}),t}return t}get lastRow(){return this.#t[3]}toJSON(){return{type:"MonthDayOccupancyManager",rows:this.#t}}}class es7{#r=[];constructor(){for(let e=0;e<42;e++)this.#r.push(new es8)}day(e){let t=this.#r[e];if(null==t){let t=Error("invalid day index");throw er.$e(a=>{a.addBreadcrumb({category:"Calendar-MonthOccupancyManager",message:"Day Index: "+e,level:"debug"}),er.Tb(t)}),t}return t}findAvailableRow(e,t){t:for(let a=0;a<3;a++){for(let n=0;n({index:t,manager:e}))}}}let es9=eL.default.div.withConfig({displayName:"MoreItem__Wrapper",componentId:"sc-848526c6-0"})` + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + z-index: 10; + flex-shrink: 0; + margin-bottom: 1px; + + grid-row: 4 / span 1; + + display: block; + padding: 4px 8px; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,ede=function(e){let{count:t,day:a,calendarDispatch:n}=e;return ev.createElement(es9,{onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),n({type:"setCurrentView",payload:K.Day,day:a})}},ev.createElement(eY.Z,{id:"general.n_more",defaultMessage:"{count} more",values:{count:t}}))},edt=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-fa08b4a3-0"})` + overflow-x: hidden; + overflow-y: scroll; + ${tM} + display: flex; + flex-direction: column; + flex: 1; +`,eda=eL.default.div.withConfig({displayName:"styled__StickySection",componentId:"sc-fa08b4a3-1"})` + position: sticky; + top: 0; + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); + border-bottom: 1px solid ${e=>e.theme.appColors.hex(60)}; + background: ${e=>e.theme.backgroundColorHex}; + z-index: 1; +`,edn=eL.default.div.withConfig({displayName:"styled__DaysSection",componentId:"sc-fa08b4a3-2"})` + position: relative; + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); + grid-template-rows: repeat(6, minmax(auto, 1fr)); + height: 100%; +`,edl=eL.default.span.withConfig({displayName:"styled__WeekdayHeading",componentId:"sc-fa08b4a3-3"})` + padding: 0 10px 10px; + ${e1.UiTypography.md} + color: ${e=>e.theme.textColors.hex(10)}; + text-align: right; +`,edr=eL.default.button.withConfig({displayName:"styled__Date",componentId:"sc-fa08b4a3-4"})` + width: 32px; + height: 32px; + + align-self: flex-end; + padding: 7px; + + ${e1.UiTypography.md} + color: ${e=>e.theme.textColors.hex(10)}; + + border-radius: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } + + ${e=>e.$isToday&&(0,eL.css)` + background: ${e.theme.primaryColorScheme?.base}; + color: #fff; + + &:hover { + background: ${e.theme.primaryColorScheme?.alpha80}; + } + `}; +`;eL.default.div.withConfig({displayName:"styled__Spacer",componentId:"sc-fa08b4a3-5"})` + opacity: 0.3; + z-index: 11; + border: 1px solid transparent; + padding: 4px 8px; + font-size: 14px; +`;let edo=function(e){let{calendarState:t,calendarDispatch:a,events:n,eventRender:l,onEventDragged:r,onEventClicked:o,onEmptySpaceClick:i}=e,s=function(e,t){let a=ev.useMemo(()=>(function(e){let t=e.clone().startOf("month"),a=e.clone().endOf("month").startOf("day"),n=[];for(let e=t.weekday();e>0;e--)n.push(t.clone().subtract(e,"days"));for(let e=t.date();e<=a.date();e++)n.push(t.clone().date(e));let l=42-n.length;for(let e=1;e<=l;e++)n.push(a.clone().add(e,"days"));return n})(t),[t]),n=ev.useMemo(()=>e.map(e=>esj(e)).filter(e=>(function(e,t){let a=e.dateDuration.startMoment.isSameOrBefore(t[41],"day"),n=e.dateDuration.endMoment.isAfter(t[0]);return a&&n})(e,a)),[e,a]),l=ev.useMemo(()=>n.sort((e,t)=>t.dateDuration.duration.as("days")-e.dateDuration.duration.as("days")),[n]),r=ev.useMemo(()=>{let e=new es7,t={};for(let n of function(e){let t=[];for(let a of e){let{startMoment:e,endMoment:n}=a.dateDuration,l=e.clone().startOf("day"),r=e.clone().startOf("day");for(;r.isSameOrBefore(n);){let e=r.isSame(n,"days"),o=6===r.weekday();if(e){let e=n.clone();t.push({...a,type:"EventChunkMonthDay",chunkStart:l,chunkEnd:e,isLastChunk:!0})}else if(o){let e=r.clone();e.add(1,"day"),n.isAfter(e)&&(t.push({...a,type:"EventChunkMonthDay",chunkStart:l,chunkEnd:e,isLastChunk:!1}),l=r.clone().add(1,"days"))}r.add(1,"day")}}return t}(l)){let{chunkStart:l,chunkEnd:r}=n,o=es4(l,a);if(o<0||o>=42)continue;let i=Math.max(1,Math.ceil(r.diff(l,"days",!0))),s=e.findAvailableRow(o,i);null!=s?e.markRowOccupied(o,i,s):(s=3,e.incrementLastRowCounter(o,i));let d=t[o]??[];d.push({...n,type:"EventChunkMonthDay",chunkStart:l,chunkEnd:r,view:K.Month,row:s}),t[o]=d}return{occupancyManager:e,chunks:t}},[a,l]);return{days:a,relevantEvents:n,occupancyManager:r.occupancyManager,eventChunks:r.chunks}}(n,t.currentDay),d=(0,ev.useCallback)((e,t)=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),a({type:"setCurrentView",payload:K.Day,day:t})},[a]),c=(0,ev.useMemo)(()=>cc()().startOf("day"),[]);return ev.createElement(edt,null,ev.createElement(eda,null,s.days.slice(0,7).map((e,t)=>ev.createElement(edl,{key:`title-${t}`},e.format("ddd")))),ev.createElement(edn,null,s.days.map((e,t)=>ev.createElement(es2,{key:e.toISOString(),day:e.format(ez.ISO_DATE_FORMAT),onEmptySpaceClick:i},ev.createElement(edr,{onClick:t=>d(t,e),$isToday:e.isSame(c,"day")},e.format("D")),ev.createElement(es3,{day:e.format(ez.ISO_DATE_FORMAT),onEventDragged:r},null!=s.eventChunks[t]&&s.eventChunks[t].map(e=>{let a=s.occupancyManager.day(t).row(e.row);return 3===e.row&&"overoccupied"===a.type?null:ev.createElement(esd,{key:e.id,event:e,onEventClicked:o},l(e))}),"overoccupied"===s.occupancyManager.day(t).lastRow.type&&ev.createElement(ede,{count:s.occupancyManager.day(t).lastRow.overOccupancyCount,day:e,calendarDispatch:a}))))))},edi=eL.default.div.withConfig({displayName:"CurrentTime__EmptySpacer",componentId:"sc-8ccfef67-0"})``,eds=eL.default.div.withConfig({displayName:"CurrentTime__Wrapper",componentId:"sc-8ccfef67-1"})` + position: relative; +`,edd=eL.default.div.withConfig({displayName:"CurrentTime__InnerLine",componentId:"sc-8ccfef67-2"})` + position: absolute; + + top: ${e=>(60*e.$currentTimeValue).toFixed(2)}px; + left: 0; + right: 0; + height: 1px; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + + display: flex; + align-items: center; + + z-index: 2; +`,edc=eL.default.div.withConfig({displayName:"CurrentTime__Ball",componentId:"sc-8ccfef67-3"})` + transform: translateX(-50%); + width: 10px; + height: 10px; + border-radius: 100%; + background-color: ${e=>e.theme.primaryColorScheme?.base}; +`;function edm(){let e=eG()();return e.hour()+e.minutes()/60}let edu=function(e){let{todayIndex:t}=e,[a,n]=(0,ev.useState)(edm);if((0,ev.useEffect)(()=>{if(null==t)return;let e=setInterval(()=>{n(edm)},6e4);return()=>{clearInterval(e)}},[t]),null==t)return ev.createElement(ev.Fragment,null,ev.createElement(edi,null),ev.createElement(edi,null),ev.createElement(edi,null),ev.createElement(edi,null),ev.createElement(edi,null),ev.createElement(edi,null),ev.createElement(edi,null),ev.createElement(edi,null));let l=7-t-1;return ev.createElement(ev.Fragment,null,ev.createElement(edi,null),esl()(t,()=>ev.createElement(eds,null,ev.createElement(edd,{$currentTimeValue:a}))),ev.createElement(eds,null,ev.createElement(edd,{$currentTimeValue:a},ev.createElement(edc,null))),esl()(l,()=>ev.createElement(eds,null,ev.createElement(edd,{$currentTimeValue:a}))))};class edp{#r=[];constructor(){for(let e=0;e<7;e++)this.#r.push(new esz)}day(e){let t=this.#r[e];if(null==t){let t=Error("invalid day index");throw er.$e(a=>{a.addBreadcrumb({category:"Calendar-WeekOccupancyManager",message:"Day Index: "+e,level:"debug"}),er.Tb(t)}),t}return t}findAvailableAllDayRow(e,t){let a=0;for(;this.day(e).allDay.isRowExists(a);){let n=!0;for(let l=0;l({dayManager:e,index:t}))}}}let edg=eL.default.div.withConfig({displayName:"HourCell__Wrapper",componentId:"sc-ba01137-0"})` + position: relative; + display: flex; + flex-direction: column; + height: 60px; + border-color: ${e=>e.theme.appColors.hex(70)}; + border-style: solid; + border-width: 1px 1px 0 0; + + &:nth-child(8n) { + border-right: 0; + } + + ${esx} +`,edf=function(e){let{children:t,day:a,time:n,onEmptySpaceClick:l}=e,r=(0,ev.useCallback)(()=>{l(a,n,"hourly")},[l,a,n]);return ev.createElement(edg,{onClick:r},t)},edh=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-1b49a4da-0"})` + overflow-y: scroll; + ${tM} +`,edy=eL.default.div.withConfig({displayName:"styled__StickySection",componentId:"sc-1b49a4da-1"})` + position: sticky; + top: 0; + display: grid; + grid-template-columns: auto repeat(7, minmax(0, 1fr)); + grid-template-rows: 1fr auto; + border-bottom: 4px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.backgroundColorHex}; + z-index: 3; +`,edb=eL.default.span.withConfig({displayName:"styled__WeekdayHeading",componentId:"sc-1b49a4da-2"})` + padding-bottom: 10px; + ${e1.UiTypography.sm} + color: ${e=>e.theme.textColors.hex(10)}; + text-align: center; + + border-radius: 100%; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.primaryColorScheme?.base}; + } + + ${e=>e.$isToday&&(0,eL.css)` + color: ${e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e.theme.primaryColorScheme?.alpha80}; + } + `} +`,edv=eL.default.div.withConfig({displayName:"styled__HourlySection",componentId:"sc-1b49a4da-3"})` + display: grid; + grid-template-columns: auto repeat(7, minmax(0, 1fr)); + grid-template-rows: 1fr 0 repeat(24, 60px) 1fr; +`,edk=eL.default.div.withConfig({displayName:"styled__Spacer",componentId:"sc-1b49a4da-4"})` + height: 7px; + border-right: 1px solid ${e=>e.theme.appColors.hex(70)}; + + ${e=>e.$borderTop&&` + border-top: 1px solid ${e.theme.appColors.hex(70)}; + `}; + + &:nth-child(8n) { + border-right: 0; + } +`,edE=eL.default.div.withConfig({displayName:"styled__Time",componentId:"sc-1b49a4da-5"})` + width: 60px; + padding-right: 6px; + ${e1.UiTypography.xxs} + text-align: right; + color: ${e=>e.theme.textColors.hex(50)}; + + ${e=>e.$borderTop&&` + border-top: 1px solid ${e.theme.appColors.hex(70)}; + `}; +`,edx=eL.default.span.withConfig({displayName:"styled__AllDay",componentId:"sc-1b49a4da-6"})` + display: block; + line-height: 31px; +`,ed_=eL.default.span.withConfig({displayName:"styled__Hour",componentId:"sc-1b49a4da-7"})` + display: block; + margin-top: -6px; +`,edw=function(e){let{calendarState:t,calendarDispatch:a,events:n,eventRender:l,onEventDragged:r,onEventClicked:o,onEmptySpaceClick:i}=e,s=function(e,t){let a=ev.useMemo(()=>(function(e){let t=[];for(let a=0;a<7;a++)t.push(e.clone().weekday(a).startOf("day"));return t})(t),[t]),n=ev.useMemo(()=>e.map(e=>esj(e)).filter(e=>(function(e,t){let a=e.dateDuration.startMoment.isSameOrBefore(t[6],"day"),n=e.dateDuration.endMoment.isAfter(t[0]);return a&&n})(e,a)),[e,a]),l=ev.useMemo(()=>esO(n),[n]),r=ev.useMemo(()=>{let e=new edp,t={},n={},r=K.Week;for(let n of function(e){let t=[];for(let a of e){let{startMoment:e,endMoment:n}=a.dateDuration,l=e.clone(),r=e.clone();for(;r.isSameOrBefore(n,"day");){let e=r.isSame(n,"day"),o=6===r.weekday();if(e){let e=n.clone();t.push({...a,type:"EventChunkAllDay",chunkStart:l,chunkEnd:e})}else if(o){let e=r.clone();e.add(1,"days"),t.push({...a,type:"EventChunkAllDay",chunkStart:l,chunkEnd:e}),l=r.clone().add(1,"days")}r.add(1,"days")}}return t}(l.allDay.sort((e,t)=>e.dateDuration.startMoment.diff(e.dateDuration.endMoment,"days")-t.dateDuration.startMoment.diff(t.dateDuration.endMoment,"days")))){let{chunkStart:l,chunkEnd:o}=n,i=es4(l,a);if(i<0||i>=7)continue;let s=o.diff(l,"days"),d=e.findAvailableAllDayRow(i,s);null==d&&(d=e.insertNewAllDayRow()),e.markAllDayRowOccupied(i,s,d);let c=t[i]??[];c.push({...n,type:"EventChunkAllDay",chunkStart:l,chunkEnd:o,row:d,view:r}),t[i]=c}for(let t of esA(l.others.sort((e,t)=>e.dateDuration.startMoment.diff(t.dateDuration.startMoment,"hours")))){let{chunkStart:l,chunkEnd:o}=t,i=es4(l,a);if(i<0||i>=7)continue;let{chunkStartHour:s,segmentStartIndex:d,segmentCount:c}=esR(t),m=e.day(i),u=m.findAvailableColumn(d,c);null==u&&(u=m.addHourlyColumn()),m.markSegmentsOccupied(d,c,u);let p=n[i]??{},g=p[s]??[];g.push({...t,type:"EventChunkHourly",chunkStart:l,chunkEnd:o,col:u,segmentStartIndex:d,segmentCount:c,view:r}),p[s]=g,n[i]=p}return{occupancyManager:e,chunksAllDay:t,chunksHourly:n}},[a,l]);return{days:a,relevantEvents:n,occupancyManager:r.occupancyManager,chunksAllDay:r.chunksAllDay,chunksHourly:r.chunksHourly}}(n,t.currentDay),d=(0,ev.useMemo)(()=>{let e=eG()().set({hour:0,minute:0,second:0}),t=[];do t.push({hour:e.hour(),formatted:e.format("h A"),mmt:e.clone()}),e.add(1,"hours");while(0!==e.hour())return t},[]),c=(0,ev.useCallback)(e=>{a({type:"setCurrentView",payload:K.Day,day:e})},[a]),m=(0,ev.useMemo)(()=>eG()().startOf("day"),[]),u=(0,ev.useMemo)(()=>{let e=null;for(let[t,a]of s.days.entries())if(a.isSame(m,"day")){e=t;break}return e},[m,s.days]);return ev.createElement(edh,null,ev.createElement(edy,null,ev.createElement(edb,{$isToday:!1}),s.days.map((e,t)=>ev.createElement(edb,{key:`title-${t}`,onClick:()=>c(e),$isToday:e.isSame(m,"day")},e.format("ddd D"))),ev.createElement(edE,{$borderTop:!0},ev.createElement(edx,null,ev.createElement(eY.Z,{id:"general.all_day",defaultMessage:"all-day"}))),s.days.map((e,t)=>ev.createElement(esw,{key:e.toISOString(),day:e.format(ez.ISO_DATE_FORMAT),onEventDragged:r,onEmptySpaceClick:i},null!=s.chunksAllDay[t]&&s.chunksAllDay[t].map(e=>ev.createElement(esd,{key:e.id,event:e,onEventClicked:o},l(e)))))),ev.createElement(edv,null,ev.createElement(edE,null),ev.createElement(edk,null),ev.createElement(edk,null),ev.createElement(edk,null),ev.createElement(edk,null),ev.createElement(edk,null),ev.createElement(edk,null),ev.createElement(edk,null),ev.createElement(edu,{todayIndex:u}),d.map(e=>ev.createElement(ev.Fragment,null,ev.createElement(edE,null,ev.createElement(ed_,null,e.formatted)),s.days.map((t,a)=>ev.createElement(edf,{key:t.toISOString(),day:t.format(ez.ISO_DATE_FORMAT),time:e.mmt.format(ez.ISO_TIME_FORMAT),onEmptySpaceClick:i},null!=s.chunksHourly[a]&&s.chunksHourly[a][e.hour]?.map(e=>ev.createElement(esm,{key:e.id,event:e,totalCols:s.occupancyManager.day(a).maxColumnCountAcrossSegments(e.segmentStartIndex,e.segmentCount),onEventClicked:o,color:e.stripeColor},l(e))),esl()(6,a=>ev.createElement(esp,{day:t.format(ez.ISO_DATE_FORMAT),time:e.mmt.clone().add(10*a,"minutes").format(ez.ISO_TIME_FORMAT),onEventDragged:r})))))),ev.createElement(edE,null),ev.createElement(edk,{$borderTop:!0}),ev.createElement(edk,{$borderTop:!0}),ev.createElement(edk,{$borderTop:!0}),ev.createElement(edk,{$borderTop:!0}),ev.createElement(edk,{$borderTop:!0}),ev.createElement(edk,{$borderTop:!0}),ev.createElement(edk,{$borderTop:!0})))},edN=function(e){let{events:t,eventRender:a,onDayViewDragged:n,onWeekViewDragged:l,onMonthViewDragged:r,onEventClicked:o,onDayEmptySpaceClick:i,onWeekEmptySpaceClick:s,onMonthEmptySpaceClick:d,calendarProps:c}=e,{state:m,dispatch:u}=c,{currentDay:p,currentView:g}=m;return ev.createElement(esg,null,ev.createElement(esh,null,ev.createElement(es0,{currentDay:p,currentView:g})),ev.createElement(zO.Wh,null,ev.createElement(Xe,null,ev.createElement(eso,null,g===K.Month?ev.createElement(edo,{calendarState:m,calendarDispatch:u,events:t,eventRender:a,onEventDragged:r,onEventClicked:o,onEmptySpaceClick:d}):g===K.Week?ev.createElement(edw,{calendarState:m,calendarDispatch:u,events:t,eventRender:a,onEventDragged:l,onEventClicked:o,onEmptySpaceClick:s}):g===K.Day?ev.createElement(esQ,{calendarState:m,events:t,eventRender:a,onEventDragged:n,onEventClicked:o,onEmptySpaceClick:i}):void 0))))},edC=(e,t)=>{let{currentDay:a,currentView:n}=e;switch(t.type){case"previous":switch(n){case K.Month:return{currentDay:a.clone().startOf("month").subtract(1,"month"),currentView:n};case K.Week:return{currentDay:a.clone().startOf("week").subtract(1,"week"),currentView:n};case K.Day:return{currentDay:a.clone().startOf("day").subtract(1,"day"),currentView:n};default:return e}case"next":switch(n){case K.Month:return{currentDay:a.clone().startOf("month").add(1,"month"),currentView:n};case K.Week:return{currentDay:a.clone().startOf("week").add(1,"week"),currentView:n};case K.Day:return{currentDay:a.clone().startOf("day").add(1,"day"),currentView:n};default:return e}case"today":return{currentDay:cc()(),currentView:n};case"setCurrentView":{let e=a;return"month"in t&&null!=t.month?e=cc()().month(t.month).startOf("month"):"startOfWeek"in t&&null!=t.startOfWeek?e=t.startOfWeek.clone().startOf("week"):"day"in t&&null!=t.day&&(e=t.day.clone()),{currentDay:e,currentView:t.payload}}default:return e}};function edM(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K.Month,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eG()(),[a,n]=ev.useReducer(edC,{currentDay:t,currentView:e});return(0,ev.useMemo)(()=>({props:{state:a,dispatch:n}}),[a])}let edS=function(e){let{onNavigate:t}=e;return ev.createElement(esv,null,ev.createElement(esE,{className:"first-item",onClick:()=>{t("previous")}},ev.createElement(eY.Z,{id:"general.previous",defaultMessage:"Previous"})),ev.createElement(esE,{onClick:()=>{t("today")}},ev.createElement(eY.Z,{id:"general.today",defaultMessage:"Today"})),ev.createElement(esE,{className:"last-item",onClick:()=>{t("next")}},ev.createElement(eY.Z,{id:"general.next",defaultMessage:"Next"})))},edI=function(e){let{calendarDispatch:t,value:a}=e;return ev.createElement(esb,null,ev.createElement(esE,{className:"first-item",$active:a===K.Month,onClick:()=>{t({type:"setCurrentView",payload:K.Month})}},ev.createElement(eY.Z,{id:"react_big_calendar.month",defaultMessage:"Month"})),ev.createElement(esE,{$active:a===K.Week,onClick:()=>{t({type:"setCurrentView",payload:K.Week})}},ev.createElement(eY.Z,{id:"react_big_calendar.week",defaultMessage:"Week"})),ev.createElement(esE,{className:"last-item",$active:a===K.Day,onClick:()=>{t({type:"setCurrentView",payload:K.Day})}},ev.createElement(eY.Z,{id:"react_big_calendar.day",defaultMessage:"Day"})))},edD=function(e){let{calendarProps:t}=e,{dispatch:a}=t;return ev.createElement(esk,null,ev.createElement(edI,{value:t.state.currentView,calendarDispatch:a}),ev.createElement(edS,{onNavigate:e=>{a({type:e})}}))},edT=function(e,t,a,n){if(e!==K.Month&&t||e===K.Month)return 1;let l=n.diff(a,"minutes");return l>30?Math.floor(l/20):1};function ed$(e){if("EventChunkMonthDay"!==e.type||!e.isLastChunk)return null;let t=e.dateDuration.toDisplayState();if(e.isAllDay||null==t.startTime&&null==t.endTime||null!=t.startDate&&"00:00:00"===t.endTime)return null;let a=e.dateDuration.startMoment.clone().tz(eG().tz.guess(),!1),n=e.dateDuration.endMoment.clone().tz(eG().tz.guess(),!1),l=a.isSame(n,"day"),r=l?a:n,o=0===r.minutes()?"h A":"h:mm A";return l?r.format(o):`ends ${r.format(o)}`}let edP=eL.default.div.withConfig({displayName:"NodeEvent__NodeText",componentId:"sc-17bc262c-0"})` + display: flex; + flex-direction: row; + overflow: hidden; + justify-content: space-between; + position: relative; + width: 100%; + min-height: 28px; + padding: 2px 8px; + border-radius: 10px; + ${e1.UiTypography.sm}; + text-decoration: ${e=>e.$completed?"line-through":"inherit"}; + background: ${e=>e.$completed?e.theme.appColors.hex(80):e.theme.primaryColorScheme?.alpha30}; + border-color: ${e=>e.$completed&&e.theme.appColors.hex(60)} !important; + color: ${e=>e.$completed?e.theme.appColors.hex(50):e.theme.appColors.hex(10)}; + + cursor: pointer; + align-items: center; + + & span { + color: ${e=>e.$completed?e.theme.appColors.hex(50):e.theme.appColors.hex(10)} !important; + border-color: ${e=>e.$completed&&e.theme.appColors.hex(60)} !important; + } + + &:hover { + background: ${e=>e.$completed?e.theme.appColors.hex(70):e.theme.primaryColorScheme?.alpha50}; + } + + ${e=>e.$isHashHighlighted&&(0,eL.css)` + padding-left: 22px; + &:before { + display: flex; + content: ' '; + width: 8px; + height: 8px; + background: ${e.theme.primaryColorScheme?.base}; + border-radius: 8px; + position: absolute; + left: 8px; + top: 10px; + } + `} +`,edF=(0,eL.default)(eiK).withConfig({displayName:"NodeEvent__StyledSlateEditor",componentId:"sc-17bc262c-1"})` + position: relative; + overflow: hidden; + + & > div { + overflow: hidden; + white-space: ${e=>e.$isMonthView?"nowrap":"pre-wrap"}; + text-overflow: ellipsis; + + ${e=>!e.$isMonthView&&(0,eL.css)` + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: ${e.$lines}; + `} + } + + .mention, + .hashtag, + .anchor { + pointer-events: none; + } +`,edA=eL.default.div.withConfig({displayName:"NodeEvent__StyledTimeIndicator",componentId:"sc-17bc262c-2"})` + ${e1.UiTypography.xs}; + color: ${e=>e.theme.textColors.hex(30)}; + padding-top: 3px; + text-align: right; +`,edR=(0,e$.connect)(function(e,t){let a=t.event.data.attachment.nodeId;return{node:e.contents.findNodeByID(a)}})(function(e){let{node:t,event:a}=e,{view:n}=a,l=a.data.attachment.nodeId,r=n===K.Month,o=`node-${l}`,i=(0,eF.TH)(),s=ev.useMemo(()=>i.hash===`#node-${l}`,[i.hash,l]),d=a.dateDuration.toDisplayState(),c="EventChunkAllDay"===a.type||"EventChunkMonthDay"===a.type&&a.isAllDay||null==d.startTime&&null==d.endTime,m=ev.useMemo(()=>ed$(a),[a]),u=ev.useMemo(()=>edT(n,c,a.chunkStart,a.chunkEnd),[a.chunkEnd,a.chunkStart,c,n]);return null==t?null:ev.createElement(edP,{id:o,$isHashHighlighted:s,$completed:t?.completed},ev.createElement(edF,{className:"flex items-center",delta:t.text,readOnly:!0,$isMonthView:r,$lines:u}),null!=m&&ev.createElement(edA,null,m))}),edj=eL.default.span.withConfig({displayName:"ProjectEvent__ProjectTitle",componentId:"sc-ae40784b-0"})` + display: block; + border: 2px solid ${e=>e.theme.primaryColorScheme?.base}; + padding: 4px 8px; + font-size: 14px; +`,edO=(0,e$.connect)(function(e){return{node:ij(e)}})(function(e){let{node:t}=e;return ev.createElement(edj,null,t.textString)});var edU=a(95534),edZ=a.n(edU);let edL=eL.default.header.withConfig({displayName:"RootNode__Header",componentId:"sc-fd4df16c-0"})` + cursor: auto; + display: block; + overflow: hidden; + margin-left: 10px; +`,edB=eL.default.div.withConfig({displayName:"RootNode__Wrapper",componentId:"sc-fd4df16c-1"})` + display: flex; + position: relative; + flex-wrap: wrap; +`,edz=eL.default.div.withConfig({displayName:"RootNode__RightSide",componentId:"sc-fd4df16c-2"})` + display: flex; + flex-direction: column; +`,edV=eL.default.div.withConfig({displayName:"RootNode__ProjectTitle",componentId:"sc-fd4df16c-3"})` + display: flex; + align-items: center; +`,edq=(0,eL.default)(RV.ML).withConfig({displayName:"RootNode__StyledEditor",componentId:"sc-fd4df16c-4"})` + flex-grow: 1; + font-size: 22px; + min-width: 268px; + line-height: 28px; + font-weight: 400; + color: ${e=>e.theme.textColors.hex("10")}; + margin-bottom: 4px; +`,edW=(0,e$.connect)(function(e){return{rootNodeID:iR(e),readOnly:dq(e),value:iO(e),documentId:dP(e),percentCompleted:dY(e)}},void 0,void 0,{})(function(e){let{rootNodeID:t,readOnly:a,value:n,documentId:l,percentCompleted:r,isNewTemplate:o}=e,i=(0,e$.useDispatch)(),s=(0,eK.Z)(),d=ev.useMemo(()=>{let e=o?edZ()(elc):edZ()(elm);return null==e?o?s.formatMessage({id:"general.untitled_project",defaultMessage:"Untitled Project"}):s.formatMessage({id:"general.untitled_template",defaultMessage:"Untitled Template"}):s.formatMessage(e)},[o,s]),c=ev.useCallback(e=>{i(mN(t,e))},[i,t]),m=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return null==n?null:ev.createElement(edL,{onMouseDown:m},ev.createElement(edB,{className:"project-title-wrapper"},ev.createElement(Kd,{readOnly:a}),ev.createElement(edz,null,ev.createElement(edV,{className:"project-title"},ev.createElement(edq,{className:"mousetrap notranslate",value:n,placeholder:d,autoCorrect:!0,spellCheck:!0,onChange:c,readOnly:a}),null!=l&&ev.createElement(eos,{documentId:l})),ev.createElement("div",{className:"mt-1.5 inline-flex min-h-7 flex-wrap items-center"},null!=l&&ev.createElement(ev.Fragment,null,ev.createElement(er7,{documentId:l}),ev.createElement(elu,{documentId:l})),ev.createElement(pl,{percentCompleted:r,showTooltip:!0})))))}),edH=(0,la.ZP)` + mutation DocumentUserPreferencesUpdateMutation($input: DocumentUserPreferencesUpdateInput!) { + documentUserPreferencesUpdate(input: $input) { + clientMutationId + } + } +`,edG=(0,la.ZP)` + mutation TaskDueDateUpdateMutation($input: TaskDueDateUpdateInput!) { + taskDueDateUpdate(input: $input) { + clientMutationId + ok + } + } +`,edK=(0,tB.P1)([iL],e=>e.nodes.keySeq().toArray()),edY=(0,tB.wN)(tB.PW,bW())([edK],e=>e),edQ=(0,tB.P1)([edY,e=>e.attachments],(e,t)=>{let a=[];for(let n of e){let e=t?.[n]?.dates??null;null!=e&&a.push(...e.attachments)}return a});function edJ(e){return null!=e&&"object"==typeof e&&"type"in e&&"EventChunkAllDay"===e.type}function edX(e,t,a,n,l){let r=e.data.attachment,o={date:t,time:a??void 0,timezone:l};if("all_day"===n)return{start:o};let i=ez.DateTimeDescHelpers.toMoment(o),s=i.clone().add(1,"hour");if(!edJ(e)){let e=ez.DateDuration.fromDateRangeDesc({start:r.addonDate.start,end:r.addonDate.end});s=i.clone().add(e.duration.toObject())}return{start:o,end:ez.MomentHelpers.toDateTimeDesc(s)}}let ed0=eL.default.div.withConfig({displayName:"CalendarView__Wrapper",componentId:"sc-8abaf6dc-0"})` + width: 100%; + display: flex; + flex-direction: column; +`,ed1=(0,e$.connect)(function(e){return{projectDateAttachments:edQ(e),doc:dV(e),isLoggedIn:t9(e),calendarViewPreferences:e.meta.preferences?.viewPreferences?.calendar??null,documentPreferences:iG(e)}})(function(e){let{projectDateAttachments:t,documentID:a,doc:n,isLoggedIn:l,calendarViewPreferences:r,match:o,documentPreferences:i}=e,s=(0,e$.useDispatch)();ev.useEffect(()=>(Mousetrap.bind("mod+\\",()=>{s(xk(a))}),()=>{Mousetrap.unbind("mod+\\")}),[s,a]);let d=o?.params?.isNewDocument!=null,c=n?.isTemplate||o?.params?.isTemplate!=null,m=ev.useMemo(()=>{let e=[];for(let a of t){let t=ez.DateDuration.fromDateRangeDesc(a.addonDate);(!0!==i.hideCompleted||!1!==i.visibleNodes.has(a.nodeId))&&e.push({id:a.nodeId,dateDuration:t,data:{type:"node",attachment:a},disableDrag:!l})}return e},[i,l,t]),u=ev.useCallback(e=>"project"===e.data.type?ev.createElement(edO,null):ev.createElement(edR,{event:e}),[]),[p]=(0,cs.D)(edG),[g]=(0,cs.D)(edH),f=ev.useCallback((e,t)=>{if(null==a)return;let n=e.id,l=e.data.attachment,r=ez.DateDuration.fromDateRangeDesc({start:l.addonDate.start,end:l.addonDate.end}),o=eG().tz.guess(),i={date:t,time:l.addonDate.start.time??void 0,timezone:o},s=ez.DateTimeDescHelpers.toMoment(i).clone().add(r.duration.toObject()),d=ez.MomentHelpers.toDateTimeDesc(s);p({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:a,nodeId:n,dateRangeDesc:{start:i,end:d}}}})},[a,p]),h=ev.useCallback((e,t,n,l)=>{if(null==a)return;let r=e.id,o=edX(e,t,n,l,eG().tz.guess());p({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:a,nodeId:r,dateRangeDesc:o}}})},[a,p]),y=ev.useCallback((e,t,n,l)=>{if(null==a)return;let r=e.id,o=edX(e,t,n,l,eG().tz.guess());p({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:a,nodeId:r,dateRangeDesc:o}}})},[a,p]),b=ev.useCallback(e=>{"node"===e.data.type&&s(jr.actions.toggleNodeDialog({projectId:a,nodeId:e.id}))},[s,a]),v=ev.useCallback((e,t,n)=>{if(null==a){s(Fd());return}s(est.actions.toggleCalendarAddNodeDialog({projectId:a,date:e,time:t,type:n}))},[s,a]),{props:k}=edM(r?.defaultView);return(0,ev.useEffect)(()=>{null!=a&&l&&g({variables:{input:{clientMutationId:(0,ld.Z)(),documentId:a,preferences:{viewPreferences:{calendar:{defaultView:k.state.currentView}}}}}})},[k.state.currentView,a,g,l]),ev.createElement(ed0,null,ev.createElement(esf,null,ev.createElement(edW,{isNewTemplate:d&&c}),ev.createElement(edD,{calendarProps:k})),ev.createElement(edN,{events:m,eventRender:u,onDayViewDragged:y,onWeekViewDragged:h,onMonthViewDragged:f,onEventClicked:b,onDayEmptySpaceClick:v,onWeekEmptySpaceClick:v,onMonthEmptySpaceClick:v,calendarProps:k}),l&&ev.createElement(UO,{role:n?.role,action:{project:"edit"}},ev.createElement(esa,null)),ev.createElement(zZ,{location:e.location,isLoggedIn:l}),ev.createElement(KA,null),ev.createElement(H5,null))}),ed2=eL.default.button.withConfig({displayName:"ChartControls__Button",componentId:"sc-a174082c-0"})` + &.first-item { + border-radius: 10px 0 0 10px; + } + &.last-item { + border-radius: 0 10px 10px 0; + } +`,ed5=function(e){let{handleChartScaleChange:t}=e,a=og()("px-2 py-1 text-textcolor-1000 border border-appcolor-300 text-sm hover:bg-appcolor-200");return ev.createElement("div",{className:"ml-auto flex self-end"},ev.createElement(ed2,{className:og()("first-item",a),onClick:()=>{t("daily")}},ev.createElement(eY.Z,{id:"general.daily",defaultMessage:"Daily"})),ev.createElement(ed2,{className:a,onClick:()=>{t("weekly")}},ev.createElement(eY.Z,{id:"general.weekly",defaultMessage:"Weekly"})),ev.createElement(ed2,{className:a,onClick:()=>{t("monthly")}},ev.createElement(eY.Z,{id:"general.monthly",defaultMessage:"Monthly"})),ev.createElement(ed2,{className:og()("last-item",a),onClick:()=>{t("yearly")}},ev.createElement(eY.Z,{id:"general.yearly",defaultMessage:"Yearly"})))},ed3=(0,e$.connect)(function(e){return{rootNodeID:iR(e),readOnly:dq(e),value:iO(e),documentId:dP(e),percentCompleted:dY(e)}},void 0,void 0,{})(function(e){let{rootNodeID:t,readOnly:a,value:n,documentId:l,percentCompleted:r,isNewTemplate:o}=e,i=(0,e$.useDispatch)(),s=(0,eK.Z)(),d=ev.useMemo(()=>{let e=o?edZ()(elc):edZ()(elm);return null==e?o?s.formatMessage({id:"general.untitled_project",defaultMessage:"Untitled Project"}):s.formatMessage({id:"general.untitled_template",defaultMessage:"Untitled Template"}):s.formatMessage(e)},[o,s]),c=ev.useCallback(e=>{i(mN(t,e))},[i,t]),m=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return null==n?null:ev.createElement("div",{className:"ml-2.5 block cursor-auto overflow-hidden",onMouseDown:m},ev.createElement("div",{className:"project-title-wrapper relative flex flex-wrap"},ev.createElement(Kd,{readOnly:a}),ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"project-title flex items-center"},ev.createElement(RV.ML,{className:"mousetrap notranslate color-textcolor-100 mb-1 min-w-72 grow text-heading3 font-normal",value:n,placeholder:d,autoCorrect:!0,spellCheck:!0,onChange:c,readOnly:a}),null!=l&&ev.createElement(eos,{documentId:l})),ev.createElement("div",{className:"mt-1.5 inline-flex min-h-7 flex-wrap items-center"},null!=l&&ev.createElement(ev.Fragment,null,ev.createElement(er7,{documentId:l}),ev.createElement(elu,{documentId:l})),ev.createElement(pl,{percentCompleted:r,showTooltip:!0})))))});var ed4=a(88e3),ed6=a(27484),ed8=a.n(ed6),ed7=a(98388);let ed9=()=>"container",ece=()=>"timeline",ect=(e,t)=>`block.${e}.${t}`;class eca{idToElement;constructor(){this.idToElement=new Map}register(e,t){return t?(this.idToElement.set(e,t),()=>{this.get(e)===t&&this.idToElement.delete(e)}):()=>{}}get(e){return this.idToElement.get(e)}safeGet(e,t){let a=this.get(e);a&&t(a)}}let ecn=(e,t)=>{if(e){if("function"==typeof e){e(t);return}e.current=t}};function ecl(){for(var e=arguments.length,t=Array(e),a=0;ae>t+10?1:e{let{active:a,over:n}=e;if(!n||a.id===n.id)return null;let l=n.data.current,r=a.data.current;if(!r||!l)return null;let o=r.block,i=l.block,s=a.rect.current.translated?.top??0,d=a.rect.current.translated?.left??0,c=t.get(ect(i.id,"sidebar-item")),m=ecr(d,c?.getBoundingClientRect().left??0);return s>=n.rect.top?m>0&&i.id!==a.id?{selectedNodeId:o.id,targetNodeId:i.id,where:"first-child"}:i.children.size>0?{selectedNodeId:o.id,targetNodeId:i.children.first(),where:"before"}:{selectedNodeId:o.id,targetNodeId:i.id,where:"after"}:{selectedNodeId:o.id,targetNodeId:i.id,where:"before"}},eci=(e,t)=>{let{active:a,over:n}=e;if(!n)return null;let l=n.data.current;if(!a.data.current||!l)return null;let r=eco(e,t);return r?{placement:r,error:!1}:null};!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Y||(Y={}));let ecs=(e,t,a)=>{let{direction:n,speed:l}=function(e,t,a){let n={acceleration:2,lock:null,...a??{},offsets:{top:0,left:0,right:0,bottom:0,...a?.offsets}},l=e.getBoundingClientRect(),{isTop:r,isBottom:o,isLeft:i,isRight:s}=function(e){let t={x:0,y:0},a=e===document.scrollingElement?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-a.width,y:e.scrollHeight-a.height},l=e.scrollTop<=t.y;return{isTop:l,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}(e),d={x:0,y:0},c={x:0,y:0},m={height:.1*l.height,width:(l.width-n.offsets.left)*.1},u=l.left+n.offsets.left+m.width,p=l.right-m.width,g={left:Math.max(t.left,l.left+n.offsets.left-200),right:Math.min(t.right,l.right+200),top:Math.max(t.top,l.top-200),bottom:Math.min(t.bottom,l.bottom+200)};return!r&&t.top<=l.top+m.height?(d.y=-1,c.y=n.acceleration*Math.abs((l.top+m.height-t.top)/m.height)):!o&&t.bottom>=l.bottom-m.height&&(d.y=1,c.y=n.acceleration*Math.abs((l.bottom-m.height-t.bottom)/m.height)),!s&&g.right>=p?(d.x=1,c.x=n.acceleration*Math.abs((p-g.right)/m.width)):!i&&g.left<=u&&(d.x=-1,c.x=n.acceleration*Math.abs((u-g.left)/m.width)),"x"===n.lock&&(d.y=0),"y"===n.lock&&(d.x=0),{direction:d,speed:c}}(e,t,a),r=n.x*l.x,o=n.y*l.y;if(0!==r||0!==o){e.scrollBy(r,o);return}};var ecd=a(55183),ecc=a.n(ecd);ed8().extend(ecc());let ecm=e=>new Date(e),ecu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY/MM/DD HH:mm:ss";return ed8()(e).format(t)};function ecp(e,t,a){let n=t-e,l=e-n*(a-1)/2;return{canvasTimeStart:l,canvasTimeEnd:l+n*a}}let ecg=(e,t,a)=>e/(a-t);function ecf(e,t,a,n,l,r,o){let i={visibleTimeStart:e,visibleTimeEnd:t,canvasTimeStart:a,canvasTimeEnd:n},s=r-l;if(!(t-e===s&&e>=a+.5*s&&e<=n-1.5*s&&t>=a+1.5*s&&t<=n-.5*s)){let{canvasTimeStart:a,canvasTimeEnd:n}=ecp(e,t,o);i.canvasTimeStart=a,i.canvasTimeEnd=n}return i}let ech=(e,t,a,n)=>{let l=a.getInterval(e),r=[];for(;l.time{let n=e.getBoundingClientRect();return Math.floor(Math.min(t-n.left,n.right)/a)},ecb=(e,t,a,n)=>a/(t-e)*(n-e),ecv=(e,t)=>Math.round(e/t)*t,eck=(e,t,a,n)=>{let l=t/2,r=(n?.left??0)/a;return{visibleTimeStart:e-l-r/2,visibleTimeEnd:e+l-r/2}},ecE=e=>{let{preview:t,isOverlay:a,isDragging:n,innerRef:l,children:r,formatPreviewTime:o,...i}=e,s=e=>{if(o)return o(e);let t=eG()(e);return(0,ed4.isDateOnly)(t)?ed8()(e).format("MMM D, YYYY"):ed8()(e).format("MMM D, YYYY, hh:mma")};return ev.createElement("div",{...i,ref:e=>{e&&l&&l(e)},style:i.style,className:ecl("gantt-default-block-pill block-grid-content-item group relative flex h-[30px] cursor-pointer items-center overflow-visible whitespace-nowrap",i.className)},ev.createElement("div",{className:ecl("gantt-default-block-pill-bg-layer duration-400 absolute left-0 top-0 h-full w-full rounded-[var(--gantt-pill-border-radius)] border border-solid border-appcolor-300 bg-appcolor-0 shadow-none transition-shadow ease-in",{"bg-appcolor-100 ":!a&&!!t,"group-hover:shadow-[0px_5px_20px_-5px_var(--gantt-pill-shadow-color)]":!n&&!t})}),null!=t&&ev.createElement("span",{className:"absolute -top-full left-1/2 z-[99] -translate-x-1/2 rounded-md bg-[var(--gantt-pill-preview-date-bg-color)] px-2 py-1.5 text-xs text-[var(--gantt-pill-preview-date-text-color)]"},`${s(t.startTime)} - ${s(t.endTime)}`),ev.createElement("div",{className:"relative flex-1 overflow-visible px-3 py-1.5 text-xs text-textcolor-900"},(a||!t)&&ev.createElement(ev.Fragment,null,r)))},ecx=e=>ev.createElement("span",{className:ecl("z-[999px] block flex-none py-4",e.className),style:e.style,ref:t=>{e.innerRef&&t&&e.innerRef(t)}},e.children),ec_=ev.createContext(null),ecw=e=>{let t=ev.useContext(ec_),[a,n]=ev.useState(()=>e?e(t.getView()):{}),l=ev.useRef(a);l.current=a;let r=ev.useRef(e);return r.current=e,ev.useEffect(()=>{let e=r.current;if(!e)return;let a=t.subscribe(t=>{let a=e(t);(0,eq.isEqual)(l.current,a)||n(a)});return()=>{a()}},[t,n]),{...(0,eq.omit)(t,"view"),view:a}},ecN="undefined"!=typeof document?ev.useLayoutEffect:ev.useEffect,ecC=e=>{let t=ev.useRef(e);return t.current=e,ev.useCallback(()=>t.current,[])},ecM=ev.createContext(null),ecS=()=>{let{setView:e,refs:t}=ecw(),{width:a,canvasTimeStart:n,canvasTimeEnd:l,visibleTimeStart:r,visibleTimeEnd:o,multiplier:i,scale:s,nextScale:d,prevScale:c,unit:m,zoom:u,canvasWidth:p,gridVisibleTimeStart:g}=ev.useContext(ecM),f=ecC({width:a,scale:s,unit:m,prevScale:c,nextScale:d,canvasWidth:p,canvasTimeStart:n,canvasTimeEnd:l,visibleTimeStart:r,visibleTimeEnd:o,gridVisibleTimeStart:g,zoom:u}),h=ev.useCallback((t,a,n)=>{let{canvasTimeStart:l,canvasTimeEnd:r,visibleTimeStart:o,visibleTimeEnd:s}=f(),d=ecf(t,a,l,r,o,s,i);if(n){let{visibleTimeStart:e,visibleTimeEnd:t}=n(d);d=ecf(e,t,d.canvasTimeStart,d.canvasTimeEnd,d.visibleTimeStart,d.visibleTimeEnd,i)}return e(e=>{e.timeline.canvasTimeStart=d.canvasTimeStart,e.timeline.canvasTimeEnd=d.canvasTimeEnd,e.timeline.visibleTimeStart=d.visibleTimeStart,e.timeline.visibleTimeEnd=d.visibleTimeEnd}),d},[f,i,e]);return{width:a,setView:e,scale:s,unit:m,prevScale:c,nextScale:d,canvasWidth:p,canvasTimeStart:n,canvasTimeEnd:l,visibleTimeStart:r,visibleTimeEnd:o,gridVisibleTimeStart:g,zoom:u,refs:t,multiplier:i,getTimeline:f,updateVisibleTime:h}},ecI=[{type:"daily",value:864e5,offset:36e5,getInterval:e=>{let t=ed8()(e).startOf("day");return{time:t.valueOf(),label:`${t.date()}`,next:t.add(1,"days").valueOf()}}},{type:"weekly",value:6048e5,offset:864e5,getInterval:e=>{let t=ed8()(e).startOf("week");return{time:t.valueOf(),label:`${t.date()}`,parentLabel:`W${t.week()}`,next:t.add(1,"weeks").valueOf()}}},{type:"monthly",value:2592e6,offset:864e5,getInterval:e=>{let t=ed8()(e).startOf("month");return{time:t.valueOf(),label:`${t.format("MMMM")}`,next:t.add(1,"months").valueOf()}}},{type:"yearly",value:31104e6,offset:864e5,getInterval:e=>{let t=ed8()(e).startOf("year");return{time:t.valueOf(),label:`${t.format("YYYY")}`,next:t.add(1,"years").valueOf()}}}],ecD="gantt-chart-timeline-moveable",ecT=()=>{let{view:e,refs:t}=ecw(e=>({indicator:e.indicator})),a=ev.useRef(e.indicator);a.current=e.indicator;let[n,l]=ev.useState(null),r=ev.useCallback(e=>{let a=t.current.dom.get(ed9());if(!a)return;if(!e){l(null);return}let n=e.placement,r=t.current.dom.get(ect(n.targetNodeId,"sidebar-item")),o=t.current.dom.get(ect(n.targetNodeId,"sidebar-item-content"));if(!r||!o)return;let i=a.getBoundingClientRect(),s=r.getBoundingClientRect(),d=o.getBoundingClientRect().left,c=i.width,m=0;m="before"===n.where?s.top:s.bottom,"first-child"===n.where&&(d+=30,c-=30),l({left:`${d}px`,width:`${c}px`,top:`${m}px`})},[t]);return(ev.useEffect(()=>{r(e.indicator)},[e.indicator,r]),ev.useEffect(()=>{let e=()=>{let e=a.current;e&&r(e)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[r]),e.indicator&&n)?ev.createElement("div",{className:ecl("gantt-dnd-indicator fixed left-0 top-0 z-[99999] h-px w-full bg-primary transition-all duration-75 ease-in",{"bg-[var(--gantt-indicator-error-color)]":!!e.indicator.error}),style:{...n}}):null},ec$=()=>{let{gridVisibleTimeStart:e,canvasTimeStart:t,canvasTimeEnd:a,canvasWidth:n,scale:l}=ecS(),r=ev.useRef(ecv(Date.now(),l.value)),o=ev.useRef(null);return ecN(()=>{let{current:t}=o;if(t){if(r.current{let e;let i=e=>{let{current:l}=o;if(!l)return;let i=ecb(t,a,n,e);r.current=e,l.style.left=`${i}px`};i(r.current);let s=()=>{let t=Date.now();(t-r.current)/l.value>0&&i(t),e=requestAnimationFrame(s)};return s(),()=>{e&&cancelAnimationFrame(e)}},[l,t,a,n]),ev.createElement("div",{ref:o,className:"pointer-events-none absolute top-0 z-[50] h-full w-[1px] bg-[var(--gantt-now-line-color)]"})},ecP=()=>{let[e,t]=ev.useState(!1),{view:a,setView:n,onSidebarWidthChange:l}=ecw(e=>({sidebarWidth:e.sidebarWidth,editingSidebarWidth:e.editingSidebarWidth})),r=ev.useRef(null);return ev.createElement("div",{className:ecl("absolute top-0 z-[20] h-full w-px cursor-col-resize bg-appcolor-400 hover:w-1",{"w-1":e}),style:{left:`${a.editingSidebarWidth||a.sidebarWidth}px`},ref:r,onPointerDown:e=>{let{current:o}=r;if(!o)return;e.preventDefault(),e.stopPropagation();let i=a.sidebarWidth;t(!0);let s=e=>{i+=e.movementX,n(e=>{e.editingSidebarWidth=i})},d=()=>{t(!1),n(e=>{e.sidebarWidth=e.editingSidebarWidth,l(e.sidebarWidth)}),document.body.removeEventListener("pointermove",s),document.body.removeEventListener("pointerup",d)};document.body.addEventListener("pointermove",s),document.body.addEventListener("pointerup",d)}})},ecF=()=>{let{view:e,refs:t}=ecw(e=>({sidebarWidth:e.editingSidebarWidth||e.sidebarWidth}));return ev.useEffect(()=>{let a=t.current.dom.get("container");a&&requestAnimationFrame(()=>{a.style.setProperty("--gantt-dynamic-sidebar-width",`${e.sidebarWidth}px`)})},[e.sidebarWidth]),ev.createElement(ev.Fragment,null,ev.createElement("div",{style:{width:`${e.sidebarWidth}px`},className:"absolute left-0 h-full bg-appcolor-0"}),ev.createElement(ecP,null))};var ecA=a(95828);let ecR=eL.default.button.withConfig({displayName:"BlockSidebarItem__StyledButton",componentId:"sc-423582a3-0"})` + & svg path { + fill: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + } + + &:active { + cursor: grabbing; + cursor: -moz-grabbing; + cursor: -webkit-grabbing; + } + + &:hover { + & svg path { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } +`,ecj=ev.forwardRef((e,t)=>{let{depth:a,node:n,isDragging:l,...r}=e,{refs:o,renderBlockSidebarItemContent:i}=ecw();return ev.createElement("div",{ref:e=>(ecn(t,e),o.current.dom.register(ect(n.id,"sidebar-item"),e)),className:ecl("sidebar-item-root group flex h-full w-full flex-none items-center gap-2 px-1 text-xs text-textcolor-900",{"bg-black/10":l}),...r},ev.createElement(ecR,{className:"mb-0.5 text-xs opacity-0 group-hover:opacity-90"},ev.createElement(lT.VW,null)),ev.createElement("div",{className:"flex w-full items-center gap-2",style:{paddingLeft:`${30*a}px`}},ev.createElement(i,{block:n,innerRef:e=>o.current.dom.register(ect(n.id,"sidebar-item-content"),e)})))}),ecO=()=>{let[e,t]=ev.useState(null);return(0,ecA.IJ)({onDragEnd:()=>{t(null)},onDragStart:e=>{let{active:a}=e,n=a.data.current;n&&n.block&&void 0!==n.depth&&t({block:n.block,depth:n.depth})}}),ev.createElement(ecA.y9,{wrapperElement:"div",dropAnimation:null,className:"drag-preview"},e&&ev.createElement(ecj,{isDragging:!0,node:e.block,depth:e.depth}))},ecU=ev.createContext(null),ecZ=()=>ev.useContext(ecU),ecL=e=>{let{unit:t,scale:a}=ecS(),{onResizeStart:n,onResize:l,onResizeEnd:r,direction:o,block:i,dateDuration:s}=e,[d,c]=ev.useState(!1),m=ev.useRef(null);return ev.useEffect(()=>{let{current:e}=m;if(!e)return;let i=i=>{i.stopPropagation(),i.preventDefault(),c(!0),n?.(o);let d=s.startMoment.valueOf(),m=s.endMoment.valueOf(),u=e.getBoundingClientRect(),p="left"===o?u.left:u.right,g=e=>{if(0===e.movementX)return;let n=Math.round(Math.trunc((e.clientX-p)/t)/a.offset)*a.offset;if(0!==n){if("left"===o){let e=ecv(m-10/t,a.offset);d=Math.min(d+n,e)}else{let e=ecv(d+10/t,a.offset);m=Math.max(m+n,e)}p+=n*t,l?.(d,m,o)}},f=()=>{c(!1),r?.(d,m,o),document.removeEventListener("pointerup",f),document.removeEventListener("pointermove",g)};document.addEventListener("pointerup",f),document.addEventListener("pointermove",g)};return e.addEventListener("pointerdown",i),()=>{e.removeEventListener("pointerdown",i)}},[e.block,t,a,e,n,l,r,o,i,s]),ev.createElement("div",{ref:m,className:ecl("absolute top-1/2 z-10 h-5 w-1.5 -translate-y-1/2 cursor-ew-resize rounded-[var(--gantt-resize-handler-border-radius)] border border-solid border-appcolor-500 bg-appcolor-0 opacity-0 hover:opacity-100",e.className,{"opacity-100":d,"-left-1":"left"===o,"-right-1":"right"===o})})},ecB=e=>{let{renderBlockPill:t}=ecw(),{block:a,position:n,state:l}=ecZ();return ev.createElement(ev.Fragment,null,ev.createElement(t,{block:a,preview:l.preview??void 0,isDragging:l.dragging,isOverlay:e.isOverlay,isResizing:l.resizing,position:n,innerRef:e.innerRef}))},ecz=e=>{let{refs:t}=ecw(),{position:a}=ecZ(),{gridVisibleTimeStart:n,visibleTimeEnd:l}=ecS(),{block:r,dateDuration:o}=e,{attributes:i,listeners:s,setNodeRef:d}=(0,ecA.O1)({id:r.id,data:r,disabled:null!=o&&o.startMoment.isBefore(n)&&o.endMoment.isAfter(l)});return ev.createElement("div",{ref:d,...s,...i,style:{position:"absolute",left:a.left,width:a.width},suppressHydrationWarning:!0},ev.createElement("div",{className:"group",style:{}},ev.createElement(ecL,{direction:"left",block:e.block,onResizeStart:e.onResizeStart,onResize:e.onResize,onResizeEnd:e.onResizeEnd,dateDuration:o}),ev.createElement(ecL,{direction:"right",block:e.block,onResizeStart:e.onResizeStart,onResize:e.onResize,onResizeEnd:e.onResizeEnd,dateDuration:o}),ev.createElement(ecB,{innerRef:e=>{t.current.dom.register(ect(r.id,"pill"),e)}})))},ecV=e=>{let{onChange:t,onCancel:a,onCommit:n}=e,{position:l,state:r}=ecZ(),{refs:o}=ecw(),{scale:i,unit:s,visibleTimeStart:d}=ecS();return ev.createElement("div",{className:"flex h-full w-full items-center bg-transparent",onMouseMove:e=>{o.current.dom.safeGet(ece(),a=>{let n=ecv(d+ecy(a,e.clientX,s),i.offset),l=ecv(n+i.value,i.offset),r=l-n,o=eG()(n-r/2).set({hour:0,minute:0,second:0}),c=eG()(l-r/2).set({hour:0,minute:0,second:0});t(1e3*o.unix(),1e3*c.unix())})},onMouseLeave:()=>{a()},onMouseDown:()=>{n()}},r.preview&&ev.createElement("div",{style:{position:"absolute",left:l.left,width:l.width}},ev.createElement(ecB,null)))},ecq=e=>{let{dateDuration:t}=e,{refs:a}=ecw();return ev.createElement("button",{onClick:()=>{null!=t&&a.current.container.scrollToTime(t.startMoment.valueOf())},className:"hover:border-neutral-300 mx-2 flex items-center justify-center rounded-md border border-solid border-appcolor-300 bg-appcolor-0 p-1 text-textcolor-900 hover:shadow-sm"},ev.createElement(tn.Icon,{icon:"caret_prev",width:12,height:12,style:{transform:"left"===e.overflow?"none":"rotate(180deg)"}}))},ecW=(0,e$.connect)(function(e,t){let a=iA(e,{nodeID:t.block.id});return{dateAttachmentsState:a?.dates}})(e=>{let{block:t,dateAttachmentsState:a}=e,{getView:n,refs:l,onBlockTimeChange:r,onBlockAddTime:o}=ecw(),{visibleTimeStart:i,visibleTimeEnd:s,unit:d,gridVisibleTimeStart:c,scale:m,canvasTimeEnd:u,canvasTimeStart:p,canvasWidth:g}=ecS(),[f,h]=ev.useState(!1),[y,b]=ev.useState(!1),[v,k]=ev.useState(void 0),E=ev.useMemo(()=>null==a||0===a.total?null:a.attachments[0].addonDate,[a]),x=ev.useMemo(()=>null==E?null:ez.DateDuration.fromDateRangeDesc(E),[E]),_=ev.useMemo(()=>{let e=0,t=0;if(v)e=v.startTime,t=v.endTime;else{if(null==x)return{left:0,width:0};e=x.startMoment.valueOf(),t=x.endMoment.valueOf()}let a=ecb(p,u,g,e);return{left:a,width:ecb(p,u,g,t)-a}},[v,p,u,g,x]),w=ev.useMemo(()=>({dragging:f,resizing:y,preview:v||null}),[f,y,v]),N=e=>{if(e.active.id!==t.id)return;let a=l.current.dom.get(ece());if(!a)return;let n=ecy(a,e.active.rect.current.translated?.left??0,d);(0,ei.assert)(null!=x);let r=x.duration.as("milliseconds"),o=ecv(i+n,m.offset);k({startTime:o,endTime:o+r})},C=(0,ecA.VT)(ecA.we,{activationConstraint:{distance:{x:10}}}),M=ev.useMemo(()=>null!=x&&x.endMoment.isBefore(c),[x,c]),S=ev.useMemo(()=>null!=x&&x.startMoment.isAfter(s),[x,s]),I=M||S;return ev.createElement(ecA.LB,{sensors:[C],autoScroll:!1,onDragStart:()=>{h(!0),l.current.isBlockPillBeingDragged=!0},onDragMove:e=>{N(e);let t=l.current.dom.get(ece());if(!t)return;let{rect:a}=e.active,r=a.current.translated;r&&ecs(t,r,{acceleration:5,offsets:{left:n().sidebarWidth,right:0,bottom:0,top:0}})},onDragEnd:()=>{v&&(r(t.id,{start:v.startTime,end:v.endTime}),k(void 0),h(!1))}},ev.createElement(ecU.Provider,{value:{block:e.block,position:_,state:w}},ev.createElement("div",{className:ecl("flex h-full w-full items-center",ecD)},I&&!f?ev.createElement("div",{className:ecl("sticky left-0 z-[50] block",{"left-full":!M,"left-[var(--gantt-dynamic-sidebar-width)]":M})},ev.createElement("div",{style:{position:"relative",left:M?0:"-100%"}},ev.createElement(ecq,{dateDuration:x,block:e.block,overflow:M?"left":"right"}))):null!=x?ev.createElement(ecz,{dateDuration:x,position:_,block:t,onResizeStart:()=>{b(!0)},onResize:(e,t)=>{k({startTime:e,endTime:t})},onResizeEnd:(e,a)=>{b(!1),k(void 0),r(t.id,{start:e,end:a})}}):ev.createElement(ecV,{block:e.block,onChange:(e,t)=>{k({startTime:e,endTime:t})},onCancel:()=>k(void 0),onCommit:()=>{v&&(k(void 0),o(t.id,{start:v.startTime,end:v.endTime}))}})),ev.createElement(ecA.y9,{dropAnimation:null},f&&ev.createElement(ecB,{isOverlay:!0}))))}),ecH=e=>{let{refs:t}=ecw(),{node:a}=e,{setNodeRef:n}=(0,ecA.Zj)({id:e.node.id,data:{block:e.node}}),{attributes:l,listeners:r,setNodeRef:o}=(0,ecA.O1)({id:e.node.id,data:{block:e.node,depth:e.depth}});return ev.createElement("div",{className:"flex-direction relative -mb-px flex h-[var(--gantt-grid-track-height)] w-full items-center justify-center"},ev.createElement("div",{className:"pointer-events-none absolute bottom-0 z-[20] h-px w-full bg-appcolor-300"}),ev.createElement("div",{key:a.id,className:"block-row-root relative flex h-full flex-1 items-center",ref:a=>{if(a)return n(a),t.current.dom.register(ect(e.node.id,"row"),a)}},ev.createElement("div",{className:"sticky -bottom-px left-0 z-[12] -my-px h-full w-[var(--gantt-dynamic-sidebar-width)] flex-none overflow-hidden whitespace-nowrap bg-appcolor-0"},ev.createElement(ecj,{...e,...l,...r,ref:e=>o(e)})),ev.createElement(ecW,{block:e.node})))},ecG=(0,e$.connect)(function(e,t){return{node:iq()(e,{nodeID:t.nodeId}),documentPreferences:iG(e),documentSearch:iz(e)}})(e=>{let{node:t,documentPreferences:a,documentSearch:n,depth:l}=e,r=ev.useMemo(()=>(t?.children??tz.default.List()).filter(e=>a.isNodeIDVisible(e)&&n.isNodeIDVisible(e)),[a,n,t?.children]);return null==t?null:ev.createElement(ev.Fragment,null,ev.createElement(ecH,{node:t,depth:l}),r.map(t=>ev.createElement(ecG,{key:t,nodeId:t,renderBlockNode:e.renderBlockNode,depth:l+1})))}),ecK=(0,e$.connect)(function(e){return{documentPreferences:iG(e),documentSearch:iz(e),rootNode:ij(e)}})(function(e){let{rootNode:t,documentPreferences:a,documentSearch:n}=e,l=ev.useMemo(()=>t.children.filter(e=>a.isNodeIDVisible(e)&&n.isNodeIDVisible(e)),[a,n,t.children]);return ev.createElement(ev.Fragment,null,l.map(e=>ev.createElement(ecG,{key:e,nodeId:e,depth:0})))}),ecY=()=>{let{getView:e,setView:t,onBlockMove:a,refs:n}=ecw(),{width:l}=ecS(),r=(0,ecA.Dy)((0,ecA.VT)(ecA.we));return ev.createElement(ecA.LB,{sensors:r,autoScroll:!1,onDragMove:e=>{let a=n.current.dom.get(ece());if(!a)return;let{rect:l}=e.active,r=l.current.translated;if(!r)return;ecs(a,r,{acceleration:3,offsets:{left:0,right:0,bottom:0,top:0},lock:"y"});let o=eci(e,n.current.dom);o&&t(e=>{e.indicator=o})},onDragEnd:()=>{let n=e().indicator;n&&(n.error||a(n.placement),t(e=>{e.indicator=null}))}},ev.createElement("div",{className:"z-9 relative flex min-h-full w-full min-w-full flex-col",style:{width:`${l}px`}},ev.createElement("div",{className:"relative flex h-full w-full flex-col"},ev.createElement(ecK,null))),ev.createElement(ecO,null))},ecQ=()=>{let{canvasTimeStart:e,canvasTimeEnd:t,canvasWidth:a,scale:n}=ecS();return ev.createElement("div",{className:""},ech(e,t,n,n=>{let{time:l,next:r}=n,o=ecb(e,t,a,l),i=ecb(e,t,a,r);return ev.createElement("div",{key:`line-${l}`,className:ecl("absolute flex flex-col gap-2"),style:{pointerEvents:"none",top:"0px",left:`${o}px`,width:`${i-o}px`,height:"100%"}},ev.createElement("div",{className:"relative -left-px bottom-0 h-full w-px bg-appcolor-200"}))}))},ecJ=e=>{let{canvasTimeStart:t,canvasTimeEnd:a,canvasWidth:n,scale:l,nextScale:r}=ecS(),o="current"===e.scale?l:r,i=o?ech(t,a,o,e=>{let{time:l,label:r,next:o,parentLabel:i}=e,s=ecb(t,a,n,l);return{time:l,label:r,width:ecb(t,a,n,o)-s,left:s,parentLabel:i}}):[];return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:ecl("relative flex w-full",ecD),style:{left:i[0]?.left??0}},i.length>0?i.map(t=>{let{time:a,width:n,label:l,parentLabel:r}=t;return ev.createElement("div",{"data-date":ecu(new Date(a)),key:`line-${a}`,className:ecl("relative flex flex-none flex-col"),style:{top:"0px",width:`${n}px`,height:"100%"}},ev.createElement("div",{className:"relative"},ev.createElement("div",{className:ecl("inline-flex whitespace-nowrap",{"sticky left-[10px] text-textcolor-400":"parent"===e.scale,"text-textcolor-500":"current"===e.scale})},"parent"===e.scale&&r?r:l)))}):ev.createElement("div",null,ev.createElement("div",{className:"relative"},ev.createElement("div",{className:"inline-flex"})))))},ecX=()=>{let{canvasWidth:e}=ecS();return ev.createElement("div",{className:ecl("sticky top-0 z-[90] flex flex-col gap-2 border-b border-solid border-appcolor-300 bg-appcolor-0 py-2",ecD),style:{width:`${e}px`}},ev.createElement(ecJ,{scale:"parent"}),ev.createElement(ecJ,{scale:"current"}))},ec0=ev.forwardRef((e,t)=>{let a=ev.useRef(null),n=ev.useRef(null);return ev.useEffect(()=>{let t=a.current;if(!t)return;let n=t=>{if(t.ctrlKey||t.metaKey||t.altKey){t.preventDefault();let a=t.currentTarget.parentElement?.getBoundingClientRect().left??0,n=t.clientX-a;e.onWheelZoom?.(1,n,t.deltaY)}};return t.addEventListener("wheel",n,{passive:!1}),()=>{t.removeEventListener("wheel",n)}},[e]),ev.createElement("div",{ref:e=>{a.current=e,ecn(t,e)},className:ecl(e.className,"select-none",ecD),style:e.style,onScroll:()=>{let t=a.current;e.onScroll&&t&&e.onScroll(t.scrollLeft)},onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.classList.contains(ecD)&&(n.current={start:e.pageX,last:e.pageX})},onPointerMove:t=>{let l=a.current;n.current&&l&&e.onScroll&&(e.onScroll(l.scrollLeft+n.current.last-t.pageX),n.current.last=t.pageX)},onPointerLeave:()=>{n.current=null},onPointerUp:()=>{n.current=null}},e.children)}),ec1=e=>{let{getView:t}=ecw(),{canvasWidth:a,setView:n,refs:l,width:r,canvasTimeStart:o,zoom:i,visibleTimeStart:s,visibleTimeEnd:d,getTimeline:c,updateVisibleTime:m}=ecS(),[u,p]=ev.useState(0),g=ev.useCallback(()=>{let e=l.current.dom.get("container");if(!e)return;let t=e.getBoundingClientRect().width;n(e=>{e.timeline.width=t})},[l,n]);return ecN(()=>{let e=Math.round((s-o)/i*r),t=l.current.dom.get(ece());t&&t.scrollLeft!==e&&(t.scrollLeft=e)},[i,d,s,r,o]),l.current.container.scrollToTime=e=>{let a;a="number"==typeof e?e:e.getTime();let{zoom:n,unit:l}=c(),r=t().sidebarWidth,o=n/2,i=r/l;m(a-o-i/2,a+o-i/2)},l.current.container.updateScale=e=>{let{visibleTimeStart:a,visibleTimeEnd:n,gridVisibleTimeStart:l,scale:o,unit:i,canvasWidth:s}=c(),d=l+(n-l)/2,u=o.value*i,p=ecI.find(t=>t.type===e);if(!p)return;let g=Math.max(Math.min(a+r/u*p.value-a,15778368e4),864e5),f=t().sidebarWidth;m(a,a+g,e=>{let{visibleTimeStart:t,visibleTimeEnd:a,canvasTimeStart:n,canvasTimeEnd:l}=e;return eck(ecv(d,p.offset),a-t,ecg(s,n,l),{left:f})})},ev.useEffect(()=>{g(),requestAnimationFrame(()=>{l.current.container.scrollToTime(Date.now()),p(1)})},[g,l,p]),ev.useEffect(()=>{let e=l.current.dom.get(ed9());if(!e)return;let t=new ResizeObserver(()=>{g()});return t.observe(e),()=>{t.disconnect()}},[g]),ev.createElement(ec0,{ref:e=>l.current.dom.register(ece(),e),className:"gantt-timeline timeline-scroll absolute inset-0 flex flex-1 scroll-p-0 flex-col overflow-auto whitespace-normal bg-appcolor-0",onWheelZoom:(e,t,a)=>{let{zoom:n,width:l,visibleTimeStart:r}=c(),o=Math.min(Math.max(Math.round(n*(1+e*a/500)),864e5),15778368e4),i=Math.round(r+t/l*(n-o));m(i,i+o)},onScroll:e=>{let t=o+i*e/r,a=t+i;(s!==t||d!==a)&&m(t,a)},style:{width:`${r}px`,opacity:u,scrollbarColor:"transparent transparent",scrollbarWidth:"none"}},ev.createElement(ecX,null),ev.createElement("div",{className:"relative",style:{width:`${a}px`}},ev.createElement(ecQ,null),e.children))},ec2=e=>{let{view:t}=ecw(e=>({timeline:e.timeline,sidebarWidth:e.sidebarWidth})),{multiplier:a,width:n,canvasTimeEnd:l,canvasTimeStart:r,visibleTimeEnd:o,visibleTimeStart:i,scales:s}=t.timeline,d=ev.useMemo(()=>n*a,[n,a]),c=ev.useMemo(()=>o-i,[o,i]),m=ev.useMemo(()=>{let e=s[s.length-1];for(let t of s)if(c/t.value/1{let e=m.type,t=s.findIndex(t=>t.type===e);return -1===t||t===s.length-1?null:s[t+1]},[s,m]),p=ev.useMemo(()=>{let e=m.type,t=s.findIndex(t=>t.type===e);return -1===t||0===t?null:s[t-1]},[s,m]),g=ev.useMemo(()=>d/(l-r),[d,l,r]),f=ev.useMemo(()=>i+t.sidebarWidth/g,[i,g,t.sidebarWidth]);return ev.createElement(ecM.Provider,{value:{width:n,canvasTimeStart:r,canvasTimeEnd:l,visibleTimeStart:i,visibleTimeEnd:o,multiplier:a,scale:m,nextScale:u,prevScale:p,unit:g,zoom:c,gridVisibleTimeStart:f,canvasWidth:d}},ev.createElement(ec1,null,e.children))},ec5=e=>{let{refs:t}=ecw();return ev.createElement("div",{className:ecl("chart-container relative flex flex-1 flex-col",e.className),ref:e=>t.current.dom.register("container",e)},ev.createElement(ec2,null,ev.createElement(ecY,null),ev.createElement(ec$,null)),ev.createElement(ecF,null),ev.createElement(ecT,null))},ec3=e=>ev.createElement(ecE,e,ev.createElement("span",null,e.block.textString)),ec4=e=>ev.createElement(ecx,e,ev.createElement("span",null,e.block.textString)),ec6=()=>{let e=new Date;e.setHours(0,0,0,0);let t=ecm(e);t.setDate(t.getDate()+60);let{canvasTimeStart:a,canvasTimeEnd:n}=ecp(e.getTime(),t.getTime(),3);return{multiplier:3,scales:ecI,visibleTimeStart:e.getTime(),visibleTimeEnd:t.getTime(),canvasTimeStart:a,canvasTimeEnd:n,width:1e3}},ec8=ev.forwardRef((e,t)=>{let{projectId:a}=e,n=ev.useRef({timeline:ec6(),isSidebarHidden:e.hideSidebar??!1,sidebarWidth:e.hideSidebar?0:e.sidebarWidth||300,editingSidebarWidth:0,indicator:null}),l=ev.useRef([]),r=ev.useRef({timelineLeftWidthIncrementOnDrag:0,isBlockPillBeingDragged:!1,dom:new eca,container:{scrollToTime:()=>{},updateScale:()=>{}}}),o=ev.useCallback(e=>{let t=(0,es.Uy)(n.current,e);return n.current=t,l.current.forEach(e=>{e(n.current)}),t},[]),i=ev.useCallback(()=>n.current,[]),s=ev.useCallback(e=>{let t=l.current;return t.push(e),()=>{let a=l.current.indexOf(e);t.splice(a,1)}},[]);ev.useEffect(()=>{let t=void 0!==e.hideSidebar&&e.hideSidebar;(n.current.sidebarWidth!==e.sidebarWidth||t!==n.current.isSidebarHidden)&&o(a=>{a.sidebarWidth=t?0:e.sidebarWidth||300,a.isSidebarHidden=t})},[e.sidebarWidth,e.hideSidebar,o]),ev.useImperativeHandle(t,()=>r.current.container);let{setDueDate:d}=FS(a),c=ev.useCallback((e,t)=>{null!=a&&d([e],{start:ez.MomentHelpers.toDateTimeDesc(cc()(t.start)),end:ez.MomentHelpers.toDateTimeDesc(cc()(t.end))})},[a,d]);return ev.createElement(ec_.Provider,{value:{onBlockMove:()=>{},onBlockAddTime:c,onBlockTimeChange:c,onSidebarWidthChange:()=>{},onScaleChange:()=>{},renderBlockPill:e.renderBlockPill??ec3,renderBlockSidebarItemContent:e.renderBlockSidebarItem??ec4,subscribe:s,...e,setView:o,getView:i,refs:r}},ev.createElement(ec5,{className:e.className}))}),ec7=function(){let e=(0,e$.useDispatch)();return ev.createElement("div",{className:"flex w-full flex-col flex-wrap items-center justify-center px-5 pt-5 text-center"},ev.createElement("img",{className:"mb-4 h-64 w-96 bg-appcolor-200",src:"",alt:"Screenshot of Gantt Chart View"}),ev.createElement("h1",{className:"text-2xl mt-4 font-bold"},ev.createElement(eY.Z,{id:"paywall.gantt.header_1",defaultMessage:"Take Control of Your Deadlines"})),ev.createElement("p",{className:"mb-2 max-w-[500px] text-sm text-textcolor-600"},ev.createElement(eY.Z,{id:"paywall.gantt.line_1",defaultMessage:"Visualize your project's timeline with ease!"})),ev.createElement("p",{className:"mb-2 max-w-[500px] text-sm text-textcolor-600"},ev.createElement(eY.Z,{id:"paywall.gantt.line_2",defaultMessage:"The Gantt Chart view lets you see how tasks overlap and relate to one another, ensuring you stay on top of your deadlines."})),ev.createElement("h1",{className:"text-2xl mt-4 font-bold"},ev.createElement(eY.Z,{id:"paywall.gantt.header_2",defaultMessage:"Optimize Resource Allocation"})),ev.createElement("p",{className:"mb-2 max-w-[500px] text-sm text-textcolor-600"},ev.createElement(eY.Z,{id:"paywall.gantt.line_1",defaultMessage:"Avoid overloading team members and balance the workload effectively with our comprehensive Gantt Chart view."})),ev.createElement("h1",{className:"text-2xl mt-4 font-bold"},ev.createElement(eY.Z,{id:"paywall.gantt.header_3",defaultMessage:"Exclusive Access"})),ev.createElement("p",{className:"mb-2 max-w-[500px] text-sm text-textcolor-600"},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1 h-4 w-4 text-upgrade"}),ev.createElement(eY.Z,{id:"paywall.gantt.line_4",defaultMessage:"Upgrade now and transform the way you plan and execute your projects with our powerful Gantt Chart view!"})),ev.createElement("div",{className:"mt-10"},ev.createElement("button",{className:"flex w-full cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade px-4 py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75",onClick:()=>{e(d4())}},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))))},ec9=(0,e$.connect)(function(e){return{projectId:dP(e)??null,doc:dV(e),contents:iL(e)}})(function(e){let{projectId:t,doc:a,match:n,contents:l}=e,r=n?.params?.isNewDocument!=null,o=a?.isTemplate||n?.params?.isTemplate!=null,i=ev.useRef(null),s=(0,e$.useDispatch)(),d=ev.useCallback(e=>{let t;t="before"===e.where?"beforebegin":"after"===e.where?"afterend":"afterbegin",s(Di({ids:[e.selectedNodeId],ancestors:l.findAncestorsForNode(e.selectedNodeId)},{id:e.targetNodeId,ancestors:l.findAncestorsForNode(e.targetNodeId),position:t}))},[l,s]),c=gV().taskadePlanType,m=ev.useMemo(()=>!fR.Vl.getFeature("project.editor.use_gantt_view").plans[c??"free"],[c]);return null==c?ev.createElement(eI.Spinner,null):m?ev.createElement(ec7,null):ev.createElement("div",{className:"flex w-full flex-col overflow-auto pt-5"},ev.createElement("div",{className:"flex px-5"},ev.createElement(ed3,{isNewTemplate:r&&o}),ev.createElement(ed5,{handleChartScaleChange:e=>{null!=i.current&&i.current.updateScale(e)}})),ev.createElement(ec8,{ref:i,projectId:t,onBlockMove:d}),ev.createElement(Qc,null))});var eme=a(51463),emt=a.n(eme);let ema=function(e){let{projectID:t}=e,[a]=(0,cs.D)(Sa);return ev.useEffect(()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:t}},update:(e,t)=>{let a=t.data?.activitiesMarkAllAsRead?.activities?.length??0;if(a>0){let t=e.readQuery({query:M8}),n=t?.me;if(null==n)return;e.writeQuery({query:M8,data:{me:{...n,unread_activity_count:n.unread_activity_count-a}}})}}})},[a,t]),null},emn=eL.default.div.withConfig({displayName:"Styled__Wrapper",componentId:"sc-b750d2a6-0"})` + display: flex; + flex-direction: column; + width: 300px; + padding: 12px 18px; + border-radius: 10px; + color: ${e=>e.theme.textColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(100)}; + align-items: center; + justify-content: flex-start; + ${e1.UiTypography.sm}; + z-index: 5; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.1); + cursor: default; + + position: fixed; + bottom: 30px; + left: 30px; + + @media print { + display: none !important; + } + + @media (min-width: 768px) { + width: 360px; + } + + body.taskade-embed && { + display: none; + } +`,eml=eL.default.span.withConfig({displayName:"Styled__Message",componentId:"sc-b750d2a6-1"})` + text-align: left; +`,emr=eL.default.div.withConfig({displayName:"Styled__Actions",componentId:"sc-b750d2a6-2"})` + display: flex; + width: 100%; + margin-top: 12px; + & > button { + margin-right: 4px; + } +`;eL.default.button.withConfig({displayName:"Styled__ButtonAddTemplate",componentId:"sc-b750d2a6-3"})` + display: flex; + color: ${e=>e.theme.textColors.hex(50)}; + border: 0; + border-radius: 30px; + ${e1.UiTypography.sm}; + padding: 8px 16px; + font-weight: 500; + cursor: pointer; + background: ${e=>e.theme.appColors.hex(80)}; + transition: + background-color ease-in 0.2s, + color ease-in 0.2s; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.textColors.hex(10)}; + } +`;let emo=eL.default.button.withConfig({displayName:"Styled__ButtonCopy",componentId:"sc-b750d2a6-4"})` + display: flex; + border: 0; + border-radius: 30px; + padding: 8px 16px; + ${e1.UiTypography.sm}; + font-weight: 500; + cursor: pointer; + color: ${e=>e.theme.primaryColorScheme?.base}; + transition: background-color ease-in-out 0.2s; + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + + &:focus { + outline: 0; + } + + &:hover { + color: #fff; + background: ${e=>e.theme.primaryColorScheme?.base}; + } +`,emi=function(e){let{claimLink:t}=e;return ev.createElement(emn,{className:"project-alerts"},ev.createElement(eml,null,"You created this project before signing up, you can claim it by saving it to your account."),ev.createElement(emr,null,ev.createElement(emo,{as:"a",href:t},"Save Project")))},ems=(0,e$.connect)(function(e){return{doc:dV(e),claimable:ec()(e,["meta","claimable"],!1),user:t7(e)}})(function(e){let{claimable:t,doc:a,user:n}=e,{pathname:l}=(0,eF.TH)();return null==a?null:t&&null!=l&&null!=n?ev.createElement(emi,{claimLink:`${l}/claim`}):null});function emd(e){let{status:t}=e;if(eu()(t))return null;let{createdBy:a,updatedBy:n,updatedAt:l}=t;return ev.createElement(G7,{className:"update-status"},"Created by ",a," · Updated by ",n," ",cc()(l).fromNow())}emd.propTypes={status:l7().shape({createdBy:l7().string.isRequired,updatedBy:l7().string.isRequired,updatedAt:l7().string.isRequired})},emd.defaultProps={status:null};let emc=(0,e$.connect)(function(e,t){return{status:dL(e,t)}},void 0)(emd),emm={hideCompleted:!1,visibleNodes:(0,tz.Set)()};class emu extends(0,tz.Record)(emm){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new emu(e)}get isActive(){return this.hideCompleted}isNodeIDVisible(e){return!this.isActive||this.visibleNodes.has(e)}checkNodes(e,t){return this.isActive?this.withMutations(a=>{t.forEach(t=>{let n=e.findParentNodeByID(t.id);null!=n&&e.traverseNode(n.id,[],(e,t)=>(e.completed?a.removeVisibleNodes([e.id]):a.addVisibleNodes([...t,e.id]),!0))})}):this}addVisibleNodes(e){return this.isActive?this.updateIn(["visibleNodes"],t=>t.union((0,tz.Set)(e))):this}removeVisibleNodes(e){return this.updateIn(["visibleNodes"],t=>t.subtract(e))}updateContents(e,t){return this.withMutations(a=>{a.set("hideCompleted",t),a.isActive?(a.set("visibleNodes",(0,tz.Set)()),e.traverse((e,t)=>(e.completed||a.addVisibleNodes([...t,e.id]),!0))):a.set("visibleNodes",(0,tz.Set)())})}}var emp=a(98611),emg=a.n(emp),emf=a(35161),emh=a.n(emf);let emy=(0,tB.P1)([e=>e.query],e=>e.match(/\S+/g)||[]),emb=(0,tB.P1)([emy],e=>RegExp(emg()(emh()(e,e=>(0,sX.escapeStringRegExp)(e)),"|"),"gi")),emv={query:"",expandedNodes:(0,tz.Set)(),visibleNodes:(0,tz.Set)(),getQueryItems:emy,getRegExp:emb,isOpen:!1};class emk extends(0,tz.Record)(emv){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new emk(e)}get isActive(){return!ts()(this.query)}match(e){let t=[];return e.replace(this.getRegExp(this),(e,a)=>{let n=a+e.length;t.push({match:e,indices:[a,n]})}),t}isNodeIDVisible(e){return!this.isActive||this.visibleNodes.has(e)}isNodeIDCollapsed(e,t){return this.isActive?!this.expandedNodes.has(e):t}updateContentsAndQuery(e,t,a){return this.withMutations(n=>{n.set("query",a),n.isActive?(n.set("isOpen",!0),n.set("visibleNodes",(0,tz.Set)()),n.set("expandedNodes",(0,tz.Set)()),e.traverse((e,a)=>{let l=[...n.match(e.textString),...n.match(e.attributes.note?.value??"")];if(ts()(l)){if(e.id in t){let l=t[e.id]??null;for(let t of l?.assignees?.attachments??[]){let l=t.assignee.handle,r=n.match(`@${l}`);if(!ts()(r)){n.addVisibleNodes([...a,e.id]),n.addExpandedNodes(a);break}}}}else n.addVisibleNodes([...a,e.id]),n.addExpandedNodes(a);return!0})):(n.set("visibleNodes",(0,tz.Set)()),n.set("expandedNodes",(0,tz.Set)()))})}addVisibleNodes(e){return this.isActive?this.updateIn(["visibleNodes"],t=>t.union((0,tz.Set)(e))):this}addExpandedNodes(e){return this.isActive?this.updateIn(["expandedNodes"],t=>t.union((0,tz.Set)(e))):this}toggleCollapseOfNodeID(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.isActive?this.updateIn(["expandedNodes"],a=>(eu()(t)&&(t=a.has(e)),t)?a.delete(e):a.add(e)):this}}let emE=ev.createContext("list");class emx extends ev.PureComponent{static contextType=emE;static propTypes={documentID:l7().string,nodeID:l7().string.isRequired,user:l7().shape(),projectSharedPreferences:l7().shape(),nodeCompleted:l7().bool.isRequired,attachments:l7().shape({media:l7().shape({total:l7().number.isRequired,attachments:l7().arrayOf(l7().shape()),uploadingAttachments:l7().arrayOf(l7().shape())})}),dueDatePopupState:l7().shape().isRequired,dueDatePopupDispatch:l7().func.isRequired,toggleDueDate:l7().func.isRequired,readOnly:l7().bool,hasFileDeletePermission:l7().bool,deleteAttachment:l7().func.isRequired,toggleAssignment:l7().func.isRequired,assignmentPopupState:l7().shape().isRequired,assignmentPopupDispatch:l7().func.isRequired,mediaAttachmentPreviews:l7().arrayOf(l7().shape({id:l7().string})),toggleMediaDialog:l7().func.isRequired,isPaywallEnabled:l7().bool,toggleCountdown:l7().func.isRequired,countdownPopupState:l7().shape().isRequired,countdownPopupDispatch:l7().func.isRequired,toggleReaction:l7().func.isRequired,reactionPopupState:l7().shape().isRequired,reactionPopupDispatch:l7().func.isRequired};static defaultProps={attachments:null,documentID:null,hasFileDeletePermission:!1,user:null,readOnly:!1};handleMediaSelect=(e,t)=>{let{mediaAttachmentPreviews:a,toggleMediaDialog:n}=this.props;n({media:a,index:t})};handleMediaDelete=e=>{let{deleteAttachment:t,documentID:a,nodeID:n}=this.props;null!=a&&null!=n&&null!=e&&t(a,{id:e.id,type:e.data.type,nodeID:n})};renderFilePreviews(){let{mediaAttachmentPreviews:e,hasFileDeletePermission:t,readOnly:a,user:n}=this.props;return null==e||0===e.length?null:ev.createElement(eau,{documentId:this.props.documentID,currentUserId:n?n.id:null,media:e,hasFileDeletePermission:t,readOnly:a,onDelete:this.handleMediaDelete,onSelect:this.handleMediaSelect})}renderUploadButton(){let{attachments:e,documentID:t,isPaywallEnabled:a,nodeID:n,readOnly:l,nodeCompleted:r}=this.props;return(e?.media?.total??0)>0?ev.createElement(eoJ,{attachments:e,documentID:t,isPaywallEnabled:a,nodeID:n,readOnly:l,nodeCompleted:r}):null}render(){let{documentID:e}=this.props;if(null==e)return null;let{attachments:t,isPaywallEnabled:a,nodeID:n,nodeCompleted:l,toggleAssignment:r,assignmentPopupState:o,assignmentPopupDispatch:i,toggleDueDate:s,dueDatePopupState:d,dueDatePopupDispatch:c,countdownPopupState:m,countdownPopupDispatch:u,toggleCountdown:p,toggleReaction:g,reactionPopupState:f,reactionPopupDispatch:h,readOnly:y,projectSharedPreferences:b}=this.props,v=t?.assignees,k=t?.dates,E=t?.countdowns,x=t?.reactionCollections,_=(k?.total??0)>0||d.expanded,w=o.expanded||v?.total>0,N=t?.comments?.total??0,C=!y;return ev.createElement(G1,{className:"attachment-wrapper"},this.renderFilePreviews(),ev.createElement("div",{className:"addon-badges"},_&&ev.createElement(RM,{projectId:e,nodeId:n,popupState:d,popupDispatch:c,dateAttachment:k?.attachments?.[0]??null,readOnly:y,nodeCompleted:l}),w&&ev.createElement(G4,null,ev.createElement(FM,{assignees:v,documentID:e,nodeID:n,popupState:o,popupDispatch:i,readOnly:y,nodeCompleted:l})),b.commentsMode===j.ENABLED&&N>0&&ev.createElement(G2,null,ev.createElement(et3,{documentID:e,nodeID:n,numberOfComments:N,readOnly:y,nodeCompleted:l})),ev.createElement(G3,null,this.renderUploadButton()),ev.createElement(enm,{projectId:e,nodeId:n,popupState:m,popupDispatch:u,countdownAttachments:E,readOnly:y,nodeCompleted:l}),ev.createElement(G5,null,ev.createElement(eaL,{projectId:e,nodeId:n,popupState:f,popupDispatch:h,reactionCollections:x,nodeCompleted:l}),C&&ev.createElement(eoH,{documentId:e,isPaywallEnabled:a,nodeId:n,onAssign:r,onCountdown:p,onDueDate:s,onReaction:g}))))}}var em_=a(98491),emw=a.n(em_);let emN=function(e){let t=(0,e$.useDispatch)();return ev.createElement(Gz,{className:"add-sibling-button",type:"button",onClick:()=>{emw()(e.ancestors,-1)&&t(qk(e.nodeId))},"data-html2canvas-ignore":"true"})},emC=(0,e$.connect)(function(e,t){return{value:e.slate.get(t.nodeID)?.text,hasPlaceholder:iQ(e,t)}})(function(e){let{ancestors:t,hasPlaceholder:a,nodeID:n,onAddOnMenu:l,onMoreMenu:r,readOnly:o,search:i,value:s}=e,d=(0,e$.useDispatch)(),c=(0,eK.Z)(),m=function(e){let{ancestors:t,nodeID:a,onAddOnMenu:n,onMoreMenu:l}=e,r=(0,e$.useDispatch)();return ev.useMemo(()=>{let e=()=>{r(mM(a,t))};return[RH.MarkHotKey({key:"b",type:"bold"}),RH.MarkHotKey({key:"u",type:"underline"}),RH.MarkHotKey({key:"i",type:"italic"}),RH.MarkHotKey({key:"e",type:"highlight"}),RH.OnPreviousNode({up:void 0}),RH.OnNextNode({down:void 0}),RH.OnEnter({onEnter:()=>(r(Dr(a,t)),!0),onModShiftEnter:()=>r(X4(a)),onComplete:()=>(r(P0(a)),!0),onShiftEnter:()=>{r(mJ(a))}}),RH.OnEscape(),RH.OnPreviousNode({up:e=>r(X5(a,t,e)),left:e=>(r(Dv(a,t,e)),!0),move:e=>(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(Xl([a],t)),!0)}),RH.OnNextNode({down:e=>r(XP(a,t,e)),right:e=>(r(Dk(a,t,e)),!0),move:e=>(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(Xn([a],t)),!0)}),RH.OnBackspace({onBackspace:()=>(r(Dl(a,t)),!0),onForceBackspace:e}),RH.OnTab({indent:()=>(r(m$(a,t)),!0),outdent:()=>(r(mC(a,t)),!0)}),RH.OnDelete({onDelete:()=>(r(Do(a,t)),!0),onForceDelete:e}),RH.OnCollapseExpandNode({onCollapse:()=>{r(DE(a,!0))},onExpand:()=>{r(DE(a,!1))}}),RH.OnPaste({onPaste:e=>{r(X3(e,a,t))}}),RH.OnDuplicate({onDuplicate:()=>{r(mT(a,t))}}),RH.OnHistory(),RH.OnAddOnMenu({onAddOnMenu:n}),RH.OnMoreMenu({onMoreMenu:l})]},[t,r,a,n,l])}({ancestors:t,nodeID:n,onAddOnMenu:l,onMoreMenu:r}),u=ev.useMemo(()=>i.isOpen&&i.isActive&&i.query?{decorateNode(e){let t=PC(e);for(let a of"text"===e.object?[e]:e.getTexts().toArray()){let e=a.text;for(let n of i.match(e)){let{indices:e}=n,[l,r]=e,o={anchorKey:a.key,anchorOffset:l,focusKey:a.key,focusOffset:r,marks:[{type:"search"}]};t.push(o)}}return t}}:null,[i]),p=ev.useMemo(()=>null==u?m:[...m,u],[m,u]),g=ev.useCallback(e=>{d(mN(n,e))},[d,n]);return null==s?null:ev.createElement(RV.ML,{className:"content mousetrap notranslate",plugins:p,value:s,autoCorrect:!0,spellCheck:!0,onChange:g,readOnly:o,decorateNode:null==u?PC:void 0,renderMark:PX,placeholder:a?c.formatMessage(eo9):void 0})}),emM=function(e){let{completed:t,nodeID:a,onToggleComplete:n}=e,l=(0,ev.useCallback)(e=>{"LABEL"===e.target.tagName&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]),r=(0,ev.useCallback)(()=>{n()},[n]);return ev.createElement("div",{className:"format-controls"},ev.createElement("input",{id:`checkbox-${a}`,type:"checkbox",className:"left",checked:t,onChange:r}),ev.createElement("label",{htmlFor:`checkbox-${a}`,onMouseDown:l}))},emS=eL.default.span.withConfig({displayName:"NodeDragger__TooltipText",componentId:"sc-8bc6fc50-0"})` + color: #cccccc; +`,emI=eL.default.span.withConfig({displayName:"NodeDragger__Highlight",componentId:"sc-8bc6fc50-1"})` + font-weight: 700; + color: #ffffff; +`,emD=function(e){let{nodeID:t,ancestors:a}=e,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{referenceProps:s,arrowProps:d,popperProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,visible:n,placement:"top"}),m=(0,ev.useCallback)(()=>{l(!0)},[l]),u=(0,ev.useCallback)(()=>{l(!1)},[l]),p=(0,ev.useCallback)(e=>{"LABEL"===e.target.tagName&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l(!1)},[l]),[g,f]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),h=ev.useRef(null),y=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:h,state:g,placement:"left"}),b=ev.useCallback(()=>{y.popper.instanceRef.current?.update()},[y.popper.instanceRef]),v=ev.useCallback(()=>{f({type:"Collapse"})},[]),k=(0,eI.useMenuButton)({ref:r,state:g,dispatch:f});return ev.createElement("div",{className:"drag-controls"},ev.createElement("span",{...s,...k.props,"data-node-id":t,draggable:!0,"data-drag-handle":!0,className:"node-drag-handle",onMouseDown:p,onMouseEnter:m,onMouseLeave:u},ev.createElement(lT.VW,null)),n&&ev.createElement(eI.Tooltip,{arrowProps:d,popperProps:c},ev.createElement(emS,null,ev.createElement(eY.Z,{id:"general.drag_menu_hint",defaultMessage:"Drag to move {br} Click to open",values:{highlight:e=>ev.createElement(emI,null,e),br:ev.createElement("br",null)}}))),g.expanded&&ev.createElement(eI.Popup,{dispatch:f,...y.props,modal:!0},ev.createElement(etR,{initialFocus:y.initialFocus,ancestors:a,nodeId:t,reposition:b,close:v})))},emT=function(e){let{nodeId:t,collapsed:a}=e,n=(0,e$.useDispatch)(),l=(0,ev.useContext)(emE),{referenceProps:r,arrowProps:o,popperProps:i,visible:s,setVisible:d}=(0,eI.useTooltip)({placement:"top"}),c=e=>{e.preventDefault(),e.stopPropagation(),n(DE(t)),d(!1)},m=()=>{d(!0)},u=()=>{d(!1)};return a?ev.createElement(ev.Fragment,null,ev.createElement(Ku,{...r,type:"button",className:"node-unfold-button",onClick:c,onMouseEnter:m,onMouseLeave:u},l===ds||l===dd?ev.createElement(lT.zl,null):ev.createElement(tn.Icon,{icon:"default_caret_right"})),s&&ev.createElement(eI.Tooltip,{arrowProps:o,popperProps:i},ev.createElement(eY.Z,{id:"general.unfold",defaultMessage:"Unfold"}),ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"↓")))):ev.createElement(ev.Fragment,null,ev.createElement(Km,{...r,type:"button",className:"node-fold-button",onClick:c,onMouseEnter:m,onMouseLeave:u},l===ds||l===dd?ev.createElement(lT.X8,null):ev.createElement(tn.Icon,{icon:"default_caret_down"})),s&&ev.createElement(eI.Tooltip,{arrowProps:o,popperProps:i},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.fold",defaultMessage:"Fold"}),ev.createElement(eI.Shortcut.Combo,{alwaysDark:!0},ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"↑")))))},em$=VX({ancestors:bW()}),emP=ev.memo(function(e){let{ancestors:t,nodeID:a,nodeCompleted:n,doc:l,node:r,readOnly:o,user:i,attachments:s,selectableRef:d,noVisibleChildren:c,search:m,computedCollapsed:u,last:p}=e,g=ev.useRef(null),f=ev.useRef(null),[h,y]=ev.useReducer(eI.popupReducer,{expanded:!1}),[b,v]=ev.useReducer(eI.popupReducer,{expanded:!1}),[k,E]=ev.useReducer(eI.popupReducer,{expanded:!1}),[x,_]=ev.useReducer(eI.popupReducer,{expanded:!1}),w=(0,e$.useDispatch)(),N=gV(),C=ev.useCallback(e=>{w(Z$.actions.toggleMediaDialog(e))},[w]),M=ev.useCallback(()=>{w(mI(a,null))},[a,w]);(0,eI.usePopupEvents)({state:h,onCollapse:M}),(0,eI.usePopupEvents)({state:b,onCollapse:M});let S=(0,ev.useContext)(emE),I=l?.id,D=null!=i,T=null==i&&!o||D,$=lm({role:l?.role,action:{project:"delete_file"}}),P=(0,ev.useCallback)(()=>{w(P0(a))},[w,a]),F=(0,ev.useCallback)(()=>{if(null==i){w(rh({isOpen:!0,activeView:rI}));return}if(null==I){w(Fd());return}b.expanded?v({type:"Collapse"}):v({type:"Expand",payload:"first"})},[w,I,b.expanded,i]),A=(0,ev.useCallback)(()=>{if(null==i){w(rh({isOpen:!0,activeView:rI}));return}if(null==I){w(Fd());return}h.expanded?y({type:"Collapse"}):y({type:"Expand",payload:"first"})},[h.expanded,w,I,i]),R=(0,ev.useCallback)(()=>{if(null==i){w(rh({isOpen:!0,activeView:rI}));return}if(null==I){w(Fd());return}k.expanded?E({type:"Collapse"}):E({type:"Expand",payload:"first"})},[k.expanded,w,I,i]),O=(0,ev.useCallback)(()=>{if(null==i){w(rh({isOpen:!0,activeView:rI}));return}if(null==I){w(Fd());return}x.expanded?_({type:"Collapse"}):_({type:"Expand",payload:"first"})},[w,I,x.expanded,i]),U=(0,ev.useContext)(jz),Z=ev.useMemo(()=>{let e=s?.media;if(null==e)return[];let t=e.uploadingAttachments??[],a=e.attachments??[],n=uz()(t,12),l=uz()(a,12-n.length);return[...n,...l]},[s?.media]),L=(0,ev.useMemo)(()=>{let e=(s?.comments?.total??0)>0&&U.commentsMode===j.ENABLED,t=(s?.assignees?.total??0)>0,a=(s?.countdowns?.total??0)>0,n=(s?.dates?.total??0)>0,l=(Z?.length??0)>0,r=(s?.reactionCollections?.total??0)>0;return e||t||a||n||l||r},[s,Z,U]),B=function(e){let{attachments:t,dispatch:a,documentID:n,nodeID:l,readOnly:r,user:o}=e,i=null==o,s=(0,eK.Z)(),[d,c]=ev.useState(0);return{props:ev.useMemo(()=>{if(null!=n&&!i&&!r)return{onDragEnter(e){e.dataTransfer.types.includes("Files")&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),c(e=>e+1))},onDragOver(e){e.dataTransfer.types.includes("Files")&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault())},onDragLeave(e){e.dataTransfer.types.includes("Files")&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),c(e=>e-1))},onDrop(e){if(!e.dataTransfer.types.includes("Files"))return;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault(),c(e=>e-1);let r=new Set(cx.UPLOAD_VALID_EXTENSIONS),o=[],i=[];for(let t of Array.from(e.dataTransfer.files)){let e=(0,sX.extractFileExtension)(t.name);r.has(e)?o.push(t):i.push(t)}if(i.length>0){let e=o.length+i.length,t=i.map(e=>e.name).join("\n");if(a((0,l3.error)({uid:"attachment-upload-error",message:s.formatMessage({id:"general.upload_attachment_error",defaultMessage:"There was an error uploading {invalidFileCount} of {totalFileCount} file(s): {fileNames}"},{invalidFileCount:i.length,totalFileCount:e,fileNames:t}),position:"tc",autoDismiss:8,dismissible:!1})),0===o.length)return}if((t?.media?.total??0)+(t?.media?.uploadingAttachments?.length??0)+o.length>12){a((0,l3.error)({uid:"attachment-upload-error",message:m4,position:"tc",autoDismiss:8,dismissible:!1}));return}a(mG(n,l,o))}}},[t,a,n,s,i,l,r]),visible:d>0}}({attachments:s,dispatch:w,documentID:I,nodeID:a,readOnly:o??!0,user:i??null}),z=ev.useCallback(()=>{f.current?.expand()},[]),V=ev.useCallback(()=>{g.current?.expand()},[]),q=ev.useMemo(()=>!!r.hasChild&&(!!m.isActive||!c),[c,r.hasChild,m.isActive]),W=ev.useCallback((e,t)=>{w(mB(e,t))},[w]),H=X2({ancestors:t,nodeID:a,dispatch:w});return ev.createElement(Kf,{ref:d,className:"title",...B.props,...H.props},ev.createElement(Kp,{className:"left-controls",$hasChild:r.hasChild&&!c},T&&ev.createElement(emD,{ancestors:t,nodeID:a}),q&&ev.createElement(emT,{nodeId:a,collapsed:u})),ev.createElement(emM,{ancestors:t,nodeID:a,completed:n,onToggleComplete:P}),ev.createElement(GH,{className:"guideline-from"}),ev.createElement(GW,{className:"guideline-to"}),ev.createElement(Kg,{className:"node-title-right"},ev.createElement(Ky,{className:"node-editor"},ev.createElement(emC,{ancestors:t,nodeID:a,readOnly:o??!1,search:m,onAddOnMenu:z,onMoreMenu:V}),ev.createElement(Kh,{className:"right-side"},ev.createElement(eoW,{ref:f,nodeID:a,onAssign:A,onCountdown:R,onDueDate:F,onReaction:O,documentId:I}),T&&ev.createElement(eip,{ref:g,nodeID:a,ancestors:t}))),ev.createElement("div",{className:"text-sm text-textcolor-500"},ev.createElement(X1,{nodeId:a,ancestors:t})),(L||h.expanded||k.expanded||b.expanded||x.expanded)&&ev.createElement(emx,{nodeCompleted:n,attachments:s,deleteAttachment:W,documentID:I,mediaAttachmentPreviews:Z,hasFileDeletePermission:$,isPaywallEnabled:N.isPaywallEnabled,nodeID:a,readOnly:o,toggleAssignment:A,toggleCountdown:R,toggleDueDate:F,toggleMediaDialog:C,toggleReaction:O,user:i,assignmentPopupState:h,assignmentPopupDispatch:y,countdownPopupState:k,countdownPopupDispatch:E,dueDatePopupState:b,dueDatePopupDispatch:v,reactionPopupState:x,reactionPopupDispatch:_,projectSharedPreferences:U})),B.visible&&ev.createElement(Kb,null),p&&S===ds&&ev.createElement(emN,{ancestors:t,nodeId:a}))},em$);function emF(e){if(null==e.nodeId)return null;let t=document.getElementById(`node-${e.nodeId}`);if(null==t)return null;let a=t.querySelector(":scope > div.title");if(null==a)return null;let n=a.getBoundingClientRect();if(!eoT(n,e)){let a=t.getBoundingClientRect();return(eoE(e,a).y??0)<.5?{nodeId:e.nodeId,position:"beforebegin",rect:DOMRect.fromRect({x:a.x+28,width:a.width-28,y:a.top-2,height:4})}:{nodeId:e.nodeId,position:"afterend",rect:DOMRect.fromRect({x:a.x+28,width:a.width-28,y:a.bottom-2,height:4})}}let l=eoE(e,n);if((l.y??0)<.5)return{nodeId:e.nodeId,position:"beforebegin",rect:DOMRect.fromRect({x:n.x+28,width:n.width-28,y:n.top-2,height:4})};let r=t.querySelector(":scope > div.children");if(null!=r){let t=r.getBoundingClientRect();return{nodeId:e.nodeId,position:"afterbegin",rect:DOMRect.fromRect({x:t.x+28,width:t.width-28,y:t.top-2,height:4})}}return(l.x??0)<.05?{nodeId:e.nodeId,position:"afterend",rect:DOMRect.fromRect({x:n.x+28,width:n.width-28,y:n.bottom-2,height:4})}:{nodeId:e.nodeId,position:"afterbegin",rect:DOMRect.fromRect({x:n.x+58,width:n.width-58,y:n.bottom-2,height:4})}}let emA=function(e){let t=(0,e$.useDispatch)();return ev.createElement(GV,{className:"add-child-button",type:"button",onClick:()=>{t(XD(e.nodeId))},"data-html2canvas-ignore":"true",onMouseDown:e=>e.stopPropagation()})},emR=function(e){let{childAncestors:t,className:a,computedCollapsed:n,visibleChildren:l}=e;return ev.createElement(GB,{className:a},!n&&l.map((e,a,n)=>ev.createElement(emO,{last:a===n.size-1||void 0,key:e,nodeID:e,nodeIndex:a,ancestors:t})))},emj=VX({ancestors:bW()}),emO=(0,e$.connect)(function(){let e=iq();return function(t,a){return{attachments:iA(t,a),doc:dV(t),node:e(t,a),documentPreferences:iG(t),readOnly:dq(t),search:iz(t),nodeFormatClassName:iW(t,a),childrenFormatClassName:iH(t,a),user:t7(t),isFocused:i6(t,a)}}},void 0,void 0,{areOwnPropsEqual:emj})(Vr(function(e){let{ancestors:t,isFocused:a,node:n,nodeID:l,nodeIndex:r,documentPreferences:o,search:i,selectableRef:s,selecting:d,selected:c,last:m}=e,u=e.attachments??null,p=e.doc??null,g=e.nodeFormatClassName??null,f=e.childrenFormatClassName??null,h=e.user??null,y=e.readOnly??!1,b=n.completed,v=(0,eK.Z)(),k=(0,e$.useDispatch)(),E=ev.useMemo(()=>[...t,l],[t,l]),x=ev.useMemo(()=>n.children.filter(e=>o.isNodeIDVisible(e)&&i.isNodeIDVisible(e)),[o,n.children,i]),_=i.isActive?!i.expandedNodes.has(l):n.collapsed,w=og()("node",{collapsed:_,completed:b,selected:d||c,"has-child":n.hasChild,"node-isfocused":a},g),N=og()("children",f),C=1===t.length,M=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback((e,t)=>{if(e.currentTarget.dataset.nodeId!==l||null==t.dropType)return;let a=emF({nodeId:l,x:e.clientX,y:e.clientY});null!=a&&k(Xh({...a,dropType:t.dropType},e.dataTransfer,v))},[k,v,l]),nodeId:l});return ev.createElement(GJ,{...M.props,id:`node-${l}`,className:w,"data-node-id":l},ev.createElement(GW,{className:"guideline-to"}),(C&&n.children.size>0||C&&0===r)&&ev.createElement(GX,{className:"add-block-wrapper"},ev.createElement(G0,{className:"add-block",nodeId:l},ev.createElement("span",{className:"icon-text"},ev.createElement(tn.Icon,{icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.add_block",defaultMessage:"Add Block"})))),ev.createElement(emP,{ancestors:t,nodeID:l,nodeCompleted:b,doc:p,node:n,readOnly:y,user:h,attachments:u,selectableRef:s,noVisibleChildren:0===x.size||void 0,search:i,computedCollapsed:_,last:m}),x.size>0&&ev.createElement(emR,{childAncestors:E,className:N,computedCollapsed:_,visibleChildren:x}),m&&ev.createElement(emN,{ancestors:t,nodeId:l}),0===x.size&&ev.createElement(emA,{nodeId:l}))})),emU=function(){let e=Xt(),t=(0,zO.sJ)(e.clientPointAtom),a=ev.useContext(eI.LayersContext),n=a?.overlay,l=(0,eI.useTheme)(),r=ev.useMemo(()=>gW()(l.primaryColor??eI.Colors.BRAND).rgb().join(" "),[l.primaryColor]),[o,i]=ev.useState(null);return(ev.useEffect(()=>{let e=emF(t);if(null==e){i(()=>null);return}i({position:"absolute",pointerEvents:"none",left:e.rect.left,top:e.rect.top,width:e.rect.width,height:e.rect.height,"--color-primary":r})},[t,r]),null==n||null==o)?null:ep.createPortal(ev.createElement("div",{className:"bg-primary",style:o}),n)},emZ=function(e){let{readOnly:t}=e,a=ev.useMemo(()=>[...e.ancestors,e.nodeId],[e.ancestors,e.nodeId]),n=ev.useMemo(()=>e.node.children.filter(t=>e.documentPreferences.isNodeIDVisible(t)&&e.search.isNodeIDVisible(t)),[e.documentPreferences,e.node.children,e.search]);return ev.createElement(ev.Fragment,null,ev.createElement(emU,null),e.search.isActive&&0===n.size&&ev.createElement("div",{className:"no-search-results"},ev.createElement(eY.Z,{id:"general.no_search_result",defaultMessage:'No results found for "{query}"',values:{query:e.search.query}})),ev.createElement("div",{className:"children","data-node-id":e.nodeId},n.map((e,t)=>ev.createElement(emO,{key:e,nodeIndex:t,nodeID:e,ancestors:a})),!t&&ev.createElement(Xg,null)))};class emL extends ev.Component{constructor(e){super(e),this.plugins=[RH.OnEnter({onEnter:this.handleEnter}),RH.OnEscape(),RH.OnNextNode({down:this.handleNextNode,right:this.handleNextNode}),RH.OnTab({indent:this.handleNextNode}),RH.OnPaste({onPaste:this.handlePaste}),RH.OnHistory(),RH.OnMoreMenu({onMoreMenu:this.handleMoreMenu})],this.titlePlaceholder=e.isNewTemplate?ev.createElement(eY.Z,edZ()(elc)):ev.createElement(eY.Z,edZ()(elm)),this.moreRef=ev.createRef()}handleEnter=()=>{let{ancestors:e,enter:t,nodeID:a}=this.props;return t(a,e),!0};handleChange=e=>{let{nodeID:t,setNodeTextChange:a}=this.props;a(t,e)};handleNextNode=e=>{let{ancestors:t,down:a,nodeID:n}=this.props;return a(n,t,e),!0};handlePaste=e=>{let{ancestors:t,nodeID:a,paste:n,pasteFragment:l}=this.props;"application/vnd.taskade.taskast"===e.type?l(a,t,e.fragment):n(a,t,e)};handleMoreMenu=()=>{this.moreRef.current.showMenu()};render(){let{doc:e,editorText:t,node:a,nodeID:n,percentCompleted:l,readOnly:r,selectableRef:o,selected:i,selecting:s,scale:d,documentView:c}=this.props;return ev.createElement(GO,{className:og()("root","node",{selected:s||i}),"data-node-id":n,id:"data-export-image-capture",style:1!==d?{transform:`scale(${d})`}:null},ev.createElement(GU,{className:"project-title",ref:o},ev.createElement(GL,{className:"project-title-wrapper",onMouseDown:e=>e.stopPropagation()},ev.createElement(Kd,{readOnly:r}),ev.createElement(GZ,null,ev.createElement("div",null,ev.createElement(RV.ML,{className:og()("content mousetrap notranslate"),plugins:this.plugins,value:t,placeholder:this.titlePlaceholder,placeholderClassName:"placeholder",autoCorrect:!0,spellCheck:!0,onChange:this.handleChange,readOnly:r}),null!=e&&ev.createElement(eos,{documentId:e.id}),ev.createElement(eol,{nodeId:n,documentId:e?.id,ref:this.moreRef})),ev.createElement("div",{className:"mt-1.5 inline-flex min-h-7 flex-wrap items-center"},null!=e&&ev.createElement(ev.Fragment,null,ev.createElement(er7,{documentId:e.id}),ev.createElement(elu,{documentId:e.id})),ev.createElement(pl,{percentCompleted:l,showTooltip:!0}))))),ev.createElement(emZ,{ancestors:this.props.ancestors,nodeId:n,node:a,documentPreferences:this.props.documentPreferences,search:this.props.search,readOnly:r}))}}emL.propTypes={ancestors:l7().arrayOf(l7().string).isRequired,doc:l7().shape({id:l7().string,isStarred:l7().bool.isRequired,role:l7().shape({project:l7().string,workspace:l7().string}),space:l7().shape({id:l7().string,color:l7().string})}),documentPreferences:l7().instanceOf(emu).isRequired,nodeID:l7().string.isRequired,node:l7().instanceOf(li.Node).isRequired,editorText:l7().instanceOf(eg.B4).isRequired,readOnly:l7().bool.isRequired,search:l7().instanceOf(emk).isRequired,down:l7().func.isRequired,enter:l7().func.isRequired,paste:l7().func.isRequired,pasteFragment:l7().func.isRequired,percentCompleted:l7().number.isRequired,setNodeTextChange:l7().func.isRequired,scale:l7().number.isRequired,isNewTemplate:l7().bool.isRequired,documentView:l7().string.isRequired,selectableRef:l7().oneOfType([l7().func,l7().object]).isRequired,selecting:l7().bool.isRequired,selected:l7().bool.isRequired},emL.defaultProps={doc:null};let emB=(0,ek.qC)((0,e$.connect)(function(e){return{doc:dV(e),documentPreferences:iG(e),nodeID:iR(e),node:ij(e),editorText:iO(e),ancestors:iZ(e),readOnly:dq(e),search:iz(e),percentCompleted:dY(e),documentView:dA(e)}},function(e){return(0,ek.DE)({down:Dk,enter:Dr,paste:Dh,pasteFragment:Db,setNodeTextChange:mN},e)}),Vr)(emL),emz=ev.memo(function(e){let{fetchStatus:t,scale:a,isNewTemplate:n}=e;switch(t){case uv:case uE:return ev.createElement(eI.Spinner,{wrapperClassName:"wrapper-small"});case uk:return ev.createElement(emB,{scale:a,isNewTemplate:n});default:return null}}),emV=ev.forwardRef(function(e,t){let{documentView:a,coverImage:n,onMouseDown:l,children:r}=e,o=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback(()=>{},[])});return eox(),ev.createElement(RG,{...o.props,id:"project-canvas",ref:t,className:"empty-wrapper",$documentView:a,$coverImage:n,onMouseDown:l},r)}),emq=(0,e$.connect)(function(e){return{contents:iL(e),readOnly:dq(e),user:t7(e),doc:dV(e)}},function(e){return{...(0,ek.DE)({deleteNodes:mS,indentNodes:De,outdentNodes:Dt,toggleHideChat:xk,toggleShortcutsModalDialog:_c,unfocusNode:mD,undo:I7,redo:I9,multiselectEnter:Dd,multiselectDown:Dc,multiselectUp:Dm},e),canSelectAllNodes:()=>e(Xa()),fetchFocusNodeId:()=>e(zY()),toggleSelectionComplete:t=>e(JE(t)),toggleSelectionMark:(t,a,n)=>e(Ds(t,a,n)),moveNodesToPreviousLocation:t=>e(Xl(t)),moveNodesToNextLocation:t=>e(Xn(t)),findNextNodeIdForSelection:t=>e(Xr(t)),findPreviousNodeIdForSelection:t=>e(Xo(t))}});class emW extends ev.Component{container;editor;document;presenceOverlay;spaceAgentRunsOverlay;emojiCommandMenuRef;commandMonitorMenuRef;dragScrollPos;mutationObserver;constructor(e){super(e),this.container=null,this.editor=null,this.document=null,this.presenceOverlay=ev.createRef(),this.spaceAgentRunsOverlay=ev.createRef(),this.emojiCommandMenuRef=ev.createRef(),this.commandMonitorMenuRef=ev.createRef(),this.dragScrollPos=ev.createRef(),this.state={scale:1},Object.defineProperty(this,"resizeObserver",{get:emt()(()=>ZZ(this.onResize))}),Object.defineProperty(this,"mutationObserver",{get:emt()(()=>new MutationObserver(this.onMutation))})}componentDidMount(){uS().bind("mod+\\",this.handleChatToggle)}componentWillUnmount(){this.resizeObserver.disconnect(),uS().unbind("mod+\\")}componentDidUpdate(e){null!=this.editor&&this.props.documentView!==e.documentView&&(this.setState({scale:1}),this.centerVertically())}onResize=()=>{this.positionPresenceOverlay(),this.positionspaceAgentRunsOverlay()};onMutation=()=>{this.positionPresenceOverlay(),this.positionspaceAgentRunsOverlay()};positionPresenceOverlay=Xb()(()=>{this.presenceOverlay.current?.forceUpdate()},100);positionspaceAgentRunsOverlay=Xb()(()=>{this.spaceAgentRunsOverlay.current?.forceUpdate()},100);setContainerRef=e=>{eu()(this.container)||this.resizeObserver.unobserve(this.container),this.container=e,eu()(e)||this.resizeObserver.observe(e)};setEditorRef=e=>{eu()(this.editor)||this.resizeObserver.unobserve(this.editor),this.editor=e,eu()(e)||(this.centerVertically(),this.resizeObserver.observe(e))};centerVertically=()=>{null!=this.editor&&(this.editor.scrollTop=0,this.editor.scrollLeft=0)};setDocumentRef=e=>{null!=this.document&&this.mutationObserver.disconnect(),this.document=e,null!=this.document&&this.mutationObserver.observe(this.document,{childList:!0,subtree:!0})};handleChatToggle=()=>{let{documentID:e,toggleHideChat:t}=this.props;t(e)};handleClearFocus=()=>{let{documentID:e}=this.props;this.props.unfocusNode(e)};handleDeleteNodes=e=>{let{documentID:t,readOnly:a}=this.props;a||this.props.deleteNodes(t,e)};handleDocumentKeyDownCapture=e=>{this.emojiCommandMenuRef.current?.handleKeyDownCapture(e),this.commandMonitorMenuRef.current?.handleKeyDownCapture(e)};handleScale=e=>{this.setState({scale:e})};render(){let{documentID:e,documentView:t,fetchStatus:a,hideChat:n,isNewBorn:l,doc:r,match:o,spaceId:i,coverImageType:s}=this.props;if(a===uE)return ev.createElement(J8,null);let d=!eu()(ec()(o,["params","isNewDocument"])),c=r?.isTemplate||!eu()(ec()(o,["params","isTemplate"])),m=d&&c,u=e=>{if(null!=this.dragScrollPos.current&&null!=this.editor){let t=this.dragScrollPos.current,a=e.clientX-t.x,n=e.clientY-t.y;this.editor.scrollLeft=t.left-a,this.editor.scrollTop=t.top-n}},p=()=>{this.dragScrollPos.current=null,null!=this.editor&&this.editor.classList.remove("dragging"),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return ev.createElement(G6,{className:"empty-wrapper"},ev.createElement(Qc,null),ev.createElement("div",{ref:this.setContainerRef,className:og()("tc-container",{"with-chat-open":!n,"with-chat-closed":n})},ev.createElement(zO.Wh,null,ev.createElement(Xe,null,ev.createElement(emV,{ref:this.setEditorRef,documentView:t,coverImage:s,onMouseDown:e=>{null!=this.editor&&PO(e)&&(this.dragScrollPos.current={left:this.editor.scrollLeft,top:this.editor.scrollTop,x:e.clientX,y:e.clientY},this.editor.classList.add("dragging"),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p))}},this.props.user&&c&&ev.createElement(zz,{isNewTemplate:m,documentID:e,documentView:t,spaceID:i}),ev.createElement(ems,null),ev.createElement(QD,null),ev.createElement(jz.Consumer,null,a=>ev.createElement(G8,{ref:this.setDocumentRef,onKeyDownCapture:this.handleDocumentKeyDownCapture,$isReadOnly:this.props.readOnly,className:"project-wrapper",id:"project-wrapper"},ev.createElement(emE.Provider,{value:t},ev.createElement(Va,{contents:this.props.contents,canSelectAllNodes:this.props.canSelectAllNodes,fetchFocusNodeId:this.props.fetchFocusNodeId,toggleSelectionComplete:this.props.toggleSelectionComplete,toggleSelectionMark:this.props.toggleSelectionMark,onClearFocus:this.handleClearFocus,onDeleteNodes:this.handleDeleteNodes,indentNodes:this.props.indentNodes,outdentNodes:this.props.outdentNodes,undo:this.props.undo,redo:this.props.redo,moveNodesToPreviousLocation:this.props.moveNodesToPreviousLocation,moveNodesToNextLocation:this.props.moveNodesToNextLocation,multiselectEnter:this.props.multiselectEnter,multiselectDown:this.props.multiselectDown,multiselectUp:this.props.multiselectUp,findNextNodeIdForSelection:this.props.findNextNodeIdForSelection,findPreviousNodeIdForSelection:this.props.findPreviousNodeIdForSelection},ev.createElement(emz,{editorId:this.props.editorId,rootId:this.props.rootId,siteId:this.props.siteId,fetchStatus:this.props.fetchStatus,scale:this.state.scale,isNewTemplate:m}),ev.createElement(V2,{documentId:e}),ev.createElement(J4,{ref:this.emojiCommandMenuRef}),ev.createElement(W9,{ref:this.commandMonitorMenuRef,documentId:this.props.documentID}),ev.createElement(G9,null,ev.createElement(Ke,null,!this.props.readOnly&&ev.createElement(JH,null))),ev.createElement(z0,{documentID:this.props.documentID}),ev.createElement(emc,null))),null!=e&&ev.createElement(ev.Fragment,null,ev.createElement(Q_,{ref:this.presenceOverlay,documentID:e}),ev.createElement(eok,{ref:this.spaceAgentRunsOverlay,projectId:e})))))))),ev.createElement(zZ,{location:this.props.location,isLoggedIn:null!=this.props.user}),this.props.documentID&&ev.createElement(zQ,{projectID:this.props.documentID}),!l&&this.props.documentID&&this.props.user&&ev.createElement(ema,{projectID:this.props.documentID}),ev.createElement(Q$,{fetchStatus:a}),ev.createElement(YA,null),ev.createElement(H5,null),ev.createElement(KA,null),ev.createElement(Y0,null))}}let emH=emq(emW);var emG=a(30988),emK=a.n(emG);let emY=eL.default.button.withConfig({displayName:"styled__ZoomButton",componentId:"sc-6eb506d4-0"})` + border: none; + display: flex; + color: ${e=>e.theme.appColors.hex(10)}; + cursor: pointer; + background: ${e=>e.theme.isNightMode?"#1A1C1D":"rgba(255, 255, 255, 0.85)"}; + height: 2.375rem; + width: 2.375rem; + fill: ${e=>e.theme.appColors.hex(10)}; + align-items: center; + justify-content: center; + + /* Note: (sheldon@taskade.com) Using $disabled property instead of [disabled] attribute, because + [disabled] elements do not emit mouseleave events, which we need for Tooltip */ + ${e=>e.$disabled&&(0,eL.css)` + cursor: not-allowed; + svg { + opacity: 0.25; + } + `} + + &:hover { + background: ${e=>e.theme.isNightMode?"#1A1C1D":"rgba(255, 255, 255, 1)"}; + color: ${e=>e.theme.appColors.hex(50)}; + fill: ${e=>e.theme.appColors.hex(50)}; + } + &:focus { + outline: none; + } + &:first-of-type { + border-radius: 10px 0 0 10px; + } + &:last-of-type { + border-radius: 0 10px 10px 0; + } +`,emQ=eL.default.div.withConfig({displayName:"styled__ZoomWrapper",componentId:"sc-6eb506d4-1"})` + position: absolute; + left: 20px; + bottom: 20px; + display: none; + align-items: center; + z-index: 2; + + @media (min-width: 768px) { + display: flex; + } + + @media print { + opacity: 0; + } +`,emJ=eL.default.span.withConfig({displayName:"styled__ZoomText",componentId:"sc-6eb506d4-2"})` + position: absolute; + left: 100%; + margin-left: 1rem; + pointer-events: none; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + &.mounted { + opacity: 0; + transition: opacity 500ms 1000ms linear; + } +`,emX=ev.createElement("svg",{width:"13",height:"13",xmlns:"http://www.w3.org/2000/svg"},ev.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.313 0c.4 0 .725.325.725.725v4.863h4.864a.725.725 0 0 1 0 1.45H7.038v4.864a.725.725 0 0 1-1.45 0V7.038H.725a.725.725 0 1 1 0-1.45h4.863V.725c0-.4.325-.725.725-.725Z"})),em0=ev.createElement("svg",{width:"13",height:"2",xmlns:"http://www.w3.org/2000/svg"},ev.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 .725C0 .325.325 0 .725 0h11.177a.725.725 0 0 1 0 1.45H.725A.725.725 0 0 1 0 .725Z"})),em1=e=>{let{direction:t,onClick:a,disabled:n=!1}=e,l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useState(!1),{arrowProps:d,popperProps:c,referenceProps:m}=(0,eI.useControlledTooltip)({placement:"top",referenceElementRef:l,arrowElementRef:r,popperElementRef:o,visible:i}),u=ev.useCallback(()=>{s(!0)},[s]),p=ev.useCallback(()=>{s(!1)},[s]);return ev.createElement(emY,{$disabled:n,onMouseEnter:u,onMouseLeave:p,onClick:a,...m},"in"===t?emX:em0,i&&ev.createElement(eI.Tooltip,{arrowProps:d,popperProps:c},ev.createElement(IN,null,"in"===t?ev.createElement(eY.Z,{id:"general.zoomin",defaultMessage:"Zoom In"}):ev.createElement(eY.Z,{id:"general.zoomout",defaultMessage:"Zoom Out"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"in"===t?ev.createElement(ev.Fragment,null,"+"):ev.createElement(ev.Fragment,null,"−"))))))},em2=[.25,.5,.75,1],em5=function(e){let{scale:t,onScale:a}=e,n=ev.useCallback(()=>{let e=emK()(em2,e=>e{let e=em2.find(e=>e>t);null!=e&&a(e)},[a,t]),r=ev.useMemo(()=>(100*t).toFixed(),[t]),o=t<=.25,i=t>=1,s=ev.useCallback(e=>{e.preventDefault(),l()},[l]),d=ev.useCallback(e=>{e.preventDefault(),n()},[n]);return ev.useEffect(()=>(uS().bind("mod+=",s),uS().bind("mod+shift+=",s),uS().bind("mod+-",d),uS().bind("mod+shift+-",d),()=>{uS().unbind("mod+="),uS().unbind("mod+shift+="),uS().unbind("mod+-"),uS().unbind("mod+shift+-")}),[s,d]),ev.createElement(emQ,{className:"zoom-wrapper"},ev.createElement(em1,{direction:"out",disabled:o,onClick:n}),ev.createElement(em1,{direction:"in",disabled:i,onClick:l}),ev.createElement(emJ,{ref:e=>{null!=e&&(e.classList.remove("mounted"),window.requestAnimationFrame(()=>{e.classList.add("mounted")}))}},r,"%"))};function em3(e){if(null==e.nodeId)return null;let t=document.getElementById(`node-${e.nodeId}`);if(null==t)return null;let a=t.querySelector(":scope > div.title");if(null==a)return null;let n=a.getBoundingClientRect();if(!eoT(n,e)){let a=t.getBoundingClientRect();return(eoE(e,a).y??0)<.5?{nodeId:e.nodeId,position:"beforebegin",rect:DOMRect.fromRect({x:a.x+28,width:a.width-28,y:a.top-2,height:4})}:{nodeId:e.nodeId,position:"afterend",rect:DOMRect.fromRect({x:a.x+28,width:a.width-28,y:a.bottom-2,height:4})}}let l=eoE(e,n);if((l.y??0)<.5)return{nodeId:e.nodeId,position:"beforebegin",rect:DOMRect.fromRect({x:n.x+28,width:n.width-28,y:n.top-2,height:4})};let r=t.querySelector(":scope > div.children");if(null!=r){let t=r.getBoundingClientRect();return{nodeId:e.nodeId,position:"afterbegin",rect:DOMRect.fromRect({x:t.x+28,width:t.width-28,y:t.top-2,height:4})}}return(l.x??0)<.05?{nodeId:e.nodeId,position:"afterend",rect:DOMRect.fromRect({x:n.x+28,width:n.width-28,y:n.bottom-2,height:4})}:{nodeId:e.nodeId,position:"afterbegin",rect:DOMRect.fromRect({x:n.x+58,width:n.width-58,y:n.bottom-2,height:4})}}let em4=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement("button",{...o.props,className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":o.navigated})},t)},em6=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{className:"flex w-52 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",initialFocus:t,loop:!0},ev.createElement("div",{className:"flex flex-col"},ev.createElement(G_,{name:"ai_generator",value:"ai_generator"}),ev.createElement(em4,{name:"brainstorm"},ev.createElement(tn.Icon,{className:"scale-80",icon:"dd_ai"}),ev.createElement(eY.Z,{id:"general.brainstorm",defaultMessage:"Brainstorm"})),ev.createElement(em4,{name:"subtask"},ev.createElement(tn.Icon,{className:"scale-80",icon:"dd_ai"}),ev.createElement(eY.Z,{id:"general.subtask",defaultMessage:"Subtask"})),ev.createElement(em4,{name:"generate_questions"},ev.createElement(tn.Icon,{className:"scale-80",icon:"dd_ai"}),ev.createElement(eY.Z,{id:"general.generate_questions",defaultMessage:"Generate Questions"})),ev.createElement(em4,{name:"new"},ev.createElement(tn.Icon,{icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.new_task",defaultMessage:"New Task"})))))},em8=function(e){let{nodeId:t,documentId:a}=e,n=(0,e$.useDispatch)(),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"right-start"}),c=ev.useCallback(()=>{n(XD(e.nodeId))},[n,e]),m=ev.useCallback(e=>{if(null==a)return;let l=n(Vj([t]));if(0===l.children.length)return;let r=l.children[0],o=(0,lD.textDeltaToString)(r.text);"brainstorm"===e?n(DT.actions.toggleAiAssistantDialog({nodeId:t,nodeText:o,command:{type:"brainstorm"},projectId:a})):"subtask"===e?n(DT.actions.toggleAiAssistantDialog({nodeId:t,nodeText:o,command:{type:"subtask"},projectId:a})):n(DT.actions.toggleAiAssistantDialog({nodeId:t,nodeText:o,command:{type:"generate_questions"},projectId:a}))},[n,a,t]),u=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:a}=e.payload;switch(a){case"brainstorm":case"subtask":case"generate_questions":m(a);break;case"new":c();break;case"ai_generator":n(Gx.actions.toggleProjectAiAddBlockDialog({nodeId:t}))}r({type:"Collapse",payload:"none"});break}case"Dismiss":r({type:"Collapse"})}},[m,c,n,t]);return ev.createElement(ev.Fragment,null,ev.createElement(GV,{className:"add-child-button",type:"button",...s.props,"data-html2canvas-ignore":"true",onMouseDown:e=>e.stopPropagation()}),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(em6,{nodeID:t,initialFocus:d.initialFocus,menuGroupDispatch:u})))},em7=function(e){let t=(0,e$.useDispatch)();return ev.createElement(Gz,{className:"add-sibling-button",type:"button",onClick:()=>{emw()(e.ancestors,-1)&&t(qk(e.nodeId))},"data-html2canvas-ignore":"true"})},em9=function(e){let{childAncestors:t,className:a,computedCollapsed:n,visibleChildren:l}=e;return ev.createElement(GB,{className:a},!n&&l.map((e,a,n)=>ev.createElement(eut,{last:a===n.size-1||void 0,key:e,nodeID:e,nodeIndex:a,ancestors:t})))},eue=VX({ancestors:bW()}),eut=(0,e$.connect)(function(){let e=iq();return function(t,a){return{attachments:iA(t,a),doc:dV(t),node:e(t,a),documentPreferences:iG(t),readOnly:dq(t),search:iz(t),nodeFormatClassName:iW(t,a),childrenFormatClassName:iH(t,a),user:t7(t),isFocused:i6(t,a)}}},void 0,void 0,{areOwnPropsEqual:eue})(Vr(function(e){let{ancestors:t,isFocused:a,node:n,nodeID:l,documentPreferences:r,search:o,selectableRef:i,selecting:s,selected:d,last:c}=e,m=e.attachments??null,u=e.doc??null,p=e.nodeFormatClassName??null,g=e.childrenFormatClassName??null,f=e.user??null,h=e.readOnly??!1,y=n.completed,b=(0,eK.Z)(),v=(0,e$.useDispatch)(),k=ev.useMemo(()=>[...t,l],[t,l]),E=ev.useMemo(()=>n.children.filter(e=>r.isNodeIDVisible(e)&&o.isNodeIDVisible(e)),[r,n.children,o]),x=o.isActive?!o.expandedNodes.has(l):n.collapsed,_=og()("node",{collapsed:x,completed:y,selected:s||d,"has-child":n.hasChild,"node-isfocused":a},p),w=og()("children",g),N=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback((e,t)=>{if(e.currentTarget.dataset.nodeId!==l||null==t.dropType)return;let a=em3({nodeId:l,x:e.clientX,y:e.clientY});null!=a&&v(Xh({...a,dropType:t.dropType},e.dataTransfer,b))},[v,b,l]),nodeId:l});return ev.createElement(GJ,{...N.props,id:`node-${l}`,className:_,"data-node-id":l},ev.createElement(GW,{className:"guideline-to"}),ev.createElement(emP,{ancestors:t,nodeID:l,nodeCompleted:y,doc:u,node:n,readOnly:h,user:f,attachments:m,selectableRef:i,noVisibleChildren:0===E.size||void 0,search:o,computedCollapsed:x,last:c}),E.size>0&&ev.createElement(em9,{childAncestors:k,className:w,computedCollapsed:x,visibleChildren:E}),c&&ev.createElement(em7,{ancestors:t,nodeId:l}),0===E.size&&ev.createElement(em8,{nodeId:l,documentId:u?.id}))})),eua=function(){let e=Xt(),t=(0,zO.sJ)(e.clientPointAtom),a=ev.useContext(eI.LayersContext),n=a?.overlay,l=(0,eI.useTheme)(),r=ev.useMemo(()=>gW()(l.primaryColor??eI.Colors.BRAND).rgb().join(" "),[l.primaryColor]),[o,i]=ev.useState(null);return(ev.useEffect(()=>{let e=em3(t);if(null==e){i(()=>null);return}i({position:"absolute",pointerEvents:"none",left:e.rect.left,top:e.rect.top,width:e.rect.width,height:e.rect.height,"--color-primary":r})},[t,r]),null==n||null==o)?null:ep.createPortal(ev.createElement("div",{className:"bg-primary",style:o}),n)},eun=function(){return ev.createElement(GG,{className:"node-add-block text-sm"},ev.createElement(GK,{className:"guideline-block-to"}),ev.createElement(GQ,{className:"add-block-title mt-2"},ev.createElement(GY,{className:"guideline-block-from"}),ev.createElement(GC,{className:"node-styled-insert flex items-center"},ev.createElement(tn.Icon,{icon:"plus_invite"}),ev.createElement(eY.Z,{id:"general.add_block",defaultMessage:"Add Block"}))))},eul=function(e){let{readOnly:t}=e,a=ev.useMemo(()=>[...e.ancestors,e.nodeId],[e.ancestors,e.nodeId]),n=ev.useMemo(()=>e.node.children.filter(t=>e.documentPreferences.isNodeIDVisible(t)&&e.search.isNodeIDVisible(t)),[e.documentPreferences,e.node.children,e.search]);return ev.createElement(ev.Fragment,null,ev.createElement(eua,null),e.search.isActive&&0===n.size&&ev.createElement("div",{className:"no-search-results"},ev.createElement(eY.Z,{id:"general.no_search_result",defaultMessage:'No results found for "{query}"',values:{query:e.search.query}})),ev.createElement("div",{className:"children","data-node-id":e.nodeId},n.map((e,t)=>ev.createElement(eut,{key:e,nodeIndex:t,nodeID:e,ancestors:a})),!t&&ev.createElement(eun,null)))},eur=(0,e$.connect)(function(){return function(e){return{doc:dV(e),documentPreferences:iG(e),nodeID:iR(e),node:ij(e),editorText:iO(e),ancestors:iZ(e),readOnly:dq(e),search:iz(e),percentCompleted:dY(e)}}})(Vr(function(e){let{ancestors:t,doc:a,editorText:n,node:l,nodeID:r,percentCompleted:o,readOnly:i,selectableRef:s,selected:d,selecting:c,scale:m,isNewTemplate:u}=e,p=(0,e$.useDispatch)(),g=ev.useRef(null),f=ev.useMemo(()=>{let e=e=>(p(Dk(r,t,e)),!0);return[RH.OnEnter({onEnter:()=>(p(Dr(r,t)),!0)}),RH.OnEscape(),RH.OnNextNode({down:e,right:e}),RH.OnTab({indent:e}),RH.OnPaste({onPaste:e=>{"application/vnd.taskade.taskast"===e.type?p(Db(r,t,e.fragment)):p(Dh(r,t,e))}}),RH.OnHistory(),RH.OnMoreMenu({onMoreMenu:()=>{g.current?.showMenu()}})]},[t,p,r]),h=ev.useMemo(()=>u?ev.createElement(eY.Z,edZ()(elc)):ev.createElement(eY.Z,edZ()(elm)),[u]),y=ev.useCallback(e=>{p(mN(r,e))},[p,r]);return ev.createElement(GO,{className:og()("root","node",{selected:c||d}),"data-node-id":r,id:"data-export-image-capture",style:1!==m?{transform:`scale(${m})`}:null},ev.createElement(GU,{className:"project-title",ref:s},ev.createElement(Gq,{className:"guideline-path"}),ev.createElement(GL,{className:"project-title-wrapper",onMouseDown:e=>e.stopPropagation()},ev.createElement(Kd,{readOnly:i}),ev.createElement(GZ,null,ev.createElement("div",null,ev.createElement(RV.ML,{className:og()("content mousetrap notranslate"),plugins:f,value:n,placeholder:h,placeholderClassName:"placeholder",autoCorrect:!0,spellCheck:!0,onChange:y,readOnly:i}),null!=a&&ev.createElement(eos,{documentId:a.id}),ev.createElement(eol,{nodeId:r,documentId:a?.id,ref:g})),ev.createElement("div",{className:"mt-1.5 inline-flex min-h-7 flex-wrap items-center"},null!=a&&ev.createElement(ev.Fragment,null,ev.createElement(er7,{documentId:a.id}),ev.createElement(elu,{documentId:a.id})),ev.createElement(pl,{percentCompleted:o,showTooltip:!0}))))),ev.createElement(eul,{ancestors:e.ancestors,nodeId:r,node:l,documentPreferences:e.documentPreferences,search:e.search,readOnly:i}))})),euo=ev.memo(function(e){let{fetchStatus:t,scale:a,isNewTemplate:n}=e;switch(t){case uv:case uE:return ev.createElement(eI.Spinner,{wrapperClassName:"wrapper-small"});case uk:return ev.createElement(eur,{scale:a,isNewTemplate:n});default:return null}}),eui=ev.forwardRef(function(e,t){let{documentView:a,coverImage:n,onMouseDown:l,children:r}=e,o=XE({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback(()=>{},[])});return eox(),ev.createElement(RG,{...o.props,id:"project-canvas",ref:t,className:"empty-wrapper",$documentView:a,$coverImage:n,onMouseDown:l},r)}),eus=e=>e.theme.primaryColorScheme?.base,eud=eL.default.div.withConfig({displayName:"styled__EmptyWrapper",componentId:"sc-514a1142-0"})` + background: ${e=>e.theme.appColors.hex(100)}; + + display: flex; + flex: 1 1 auto; + flex-direction: row; + justify-content: space-between; + align-items: stretch; + min-height: 0; + min-width: 0; + z-index: 0; + + @media (min-width: 768px) { + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(100):e.theme.primaryColorScheme?.alpha5}; + & .project-title, + & .title { + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(90):e.theme.appColors.hex(100)}; + box-shadow: ${e=>e.theme.isNightMode?(0,eL.css)`0 2px 0px 0px ${e.theme.appColors.hex(70)}`:"0 1px 2px 0 rgba(0, 0, 0, 0.18)"}; + } + } +`,euc=eL.default.div.withConfig({displayName:"styled__ProjectWrapper",componentId:"sc-514a1142-1"})` + display: flex; + flex-direction: column; + position: relative; + + /* Note: Default is hidden (mobile web), controlled by mindmap/orgchart */ + & .node-toggle-button { + display: none; + } + & .node-add-block { + margin: 20px 0 0 8px; + } + + & .add-sibling-button { + display: none; + } + + & .node-drag-handle { + display: none; + } + + & .root.node > .children .node.collapsed > .title .attachment-items-wrapper { + display: none; + } + + & .right-side { + & .node-unfold-button { + opacity: 1 !important; + } + } + + & .update-status { + margin-bottom: 40px; + } + + /* Panning Styles */ + .nodes-wrapper { + pointer-events: none; + + & .title, + & .project-title-wrapper, + & .project-addons, + & .toggle-completed, + & .progress-bar, + & .starred-badge, + & .node-add-block, + & .add-block, + & .add-sibling-button, + & .add-child-button { + pointer-events: fill; + } + } + + width: 100%; + + & .root.node { + flex-direction: column; + padding: 0 0 40px; + } + + & .addon-badges { + & > div:empty { + display: none; + } + } + + /* Note: Mobile Web Selection */ + & .root.node > .children .node { + &.selected { + background: ${e=>e.theme.primaryColorScheme?.alpha10}; + & .title:hover { + background: none; + } + } + &.node-isfocused:focus-within { + & > .title { + background: ${e=>e.theme.appColors.hex(90)}; + } + & > .title:hover { + background: ${e=>e.theme.appColors.hex(90)}; + } + &.selected { + & .title { + background: none; + } + } + } + } + + @media (min-width: 768px) { + padding: 0 10px; + /* Note: Default is visible (mobile web), hidden for desktop, controlled by views */ + & .project-alerts { + display: none; + } + & .update-status { + display: none; + } + & .toggle-completed { + display: none; + } + + & .node-drag-handle { + display: flex; + align-items: center; + justify-content: center; + opacity: 0; + width: 18px; + height: 23px; + cursor: grab; + + & svg path { + fill: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + } + + &:active { + cursor: grabbing; + cursor: -moz-grabbing; + cursor: -webkit-grabbing; + } + + &:hover { + & svg path { + fill: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } + } + /* Note: Show drag handle on hover */ + & .title:hover { + .node-drag-handle { + opacity: 1 !important; + } + } + + /* Mindmap Rules */ + ${e=>"mindmap"===e.$documentView&&(0,eL.css)` + margin: auto 0; + + & .node-toggle-button { + display: flex !important; + } + & .nodes-wrapper { + display: flex; + justify-content: center; + } + & .root.node { + flex-direction: row; + } + + /* Left Guidelines */ + & .root.node .node.has-child > .children:before { + display: none; + } + & .root.node .node { + margin-top: 0 !important; + } + & .root.node .left-controls { + position: unset; + padding: 0; + width: inherit; + left: 0; + } + + /* View Specific Fold */ + & .root.node > .children .node .node-fold-button { + position: absolute; + top: 1px; + right: -30px; + & svg { + transform: translateX(0) translateY(0); + & path { + fill: #fff !important; + } + } + } + & .root.node > .children .node .node-unfold-button { + position: absolute; + top: -1px; + right: -30px; + & svg { + transform: translateX(0) translateY(0); + & path { + fill: #fff !important; + } + } + } + & .right-side { + & .node-fold-button, + & .node-unfold-button { + opacity: 1 !important; + } + } + & .project-title { + display: inline-block; + min-height: 24px; + max-width: 400px; + min-width: 400px; + position: relative; + padding: 12px 18px; + border-radius: 10px; + margin-bottom: 0; + + & > .content { + min-width: 280px; + max-width: 400px; + padding-right: 40px; + } + } + & .children .title { + &:hover { + box-shadow: ${()=>e.theme.isNightMode?`0 2px 0px 0px ${e.theme.appColors.hex(60)}`:"0 1px 2px 0 rgba(0, 0, 0, 0.18)"}; + } + } + + /* Mindmap Selection */ + & .root.node > .children .node { + &.selected { + & .title { + box-shadow: ${()=>`0px 0px 0px 3px ${e.theme.primaryColorScheme?.alpha80}`}; + &:hover { + background: ${e.theme.appColors.hex(80)}; + } + } + } + } + + & .node-add-block { + margin: 0; + & .add-block-title { + background: ${e=>e.theme.primaryColorScheme?.base}; + transition: background-color ease-in-out 200ms; + } + &:hover { + & .add-block-title { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } + & .node-styled-insert { + opacity: 1; + color: #fff; + & .icon-text { + padding: 0 12px; + color: #fff !important; + } + } + } + & .add-block-title { + margin-left: 20px; + border-radius: 10px; + padding: 12px 16px 11px 10px; + } + & .guideline-block-to { + display: flex; + width: 2px; + height: 50%; + background: ${eus}; + align-self: flex-start; + } + & .guideline-block-from { + display: flex; + top: 50%; + left: 0; + height: 24px !important; + width: 18px !important; + border-bottom: 2px solid ${eus}; + border-left: 2px solid ${eus}; + border-radius: 0 0 0 4px; + margin-top: -22px !important; + background: none !important; + } + + .children .children:not(:empty) { + padding-top: 40px; + } + + & .add-sibling-button { + display: none; + } + + & .node-drag-handle { + position: relative; + float: left; + left: -4px; + width: 12px; + height: 30px; + background: none; + } + + .children .children > .node { + &:last-child { + margin-bottom: 40px !important; + } + & .add-sibling-button { + position: absolute; + left: 50%; + bottom: 0; + transform: translateX(-15px) translateY(20px) rotate(90deg); + border-radius: 30px; + width: 23px !important; + height: 23px !important; + background: ${e.theme.primaryColorScheme?.base} + url('/../images/sprite_node_toggle.svg') no-repeat -30px -46px; + + &:hover { + background-color: ${e.theme.primaryColorScheme?.alpha80} !important; + } + &:focus { + outline: 0; + } + } + .title > .add-sibling-button { + bottom: -10px; + display: ${e.$isReadOnly?"none":"block"}; + } + &.collapsed:last-child > .add-sibling-button { + display: ${e.$isReadOnly?"none":"block"} !important; + } + } + + /* Fold/Unfold */ + /* NOTE: (stan@taskade.com) We have introduced and thus shifted the responsibility of toggling collapse to JS */ + & .root.node > .children .node .node-fold-button { + width: 22px; + height: 22px; + top: 50% !important; + margin-top: -13px !important; + right: -32px; + border-radius: 30px; + background-position: -30px 0; + background-color: ${e.theme.primaryColorScheme?.base}; + } + & .root.node > .children .node .node-unfold-button { + width: 22px; + height: 22px; + top: 50% !important; + margin-top: -13px !important; + right: -32px; + border-radius: 30px; + background-position: -30px -23px; + background-color: ${e.theme.primaryColorScheme?.base}; + } + & .root.node > .children .node.collapsed .node-fold-button { + display: none; + } + & .root.node > .children .node.collapsed .node-unfold-button { + display: flex; + } + + /* Add Child Button: Mindmap Rules */ + & .add-child-button { + display: ${e.$isReadOnly?"none":"block"}; + width: 23px; + height: 23px; + border-radius: 30px; + margin-left: -10px; + margin-top: -10px; + background: ${()=>e.theme.primaryColorScheme?.base} + url('/../images/sprite_node_toggle.svg') no-repeat -30px -46px; + position: relative; + z-index: 1; + + &:hover { + background-color: ${()=>e.theme.primaryColorScheme?.alpha80} !important; + opacity: 0.8; + } + } + + /* Guidelines To: Project */ + & .node.root > .project-title > .guideline-to { + display: block; + height: 20px; + width: 20px; + background: ${eus}; + position: absolute; + top: 50%; + + height: ${"2px"}; + width: 22px; + right: -22px; /* subtract width */ + margin-top: -2px; + } + + /* Guideline To: Node */ + & .node.root .children .node > .guideline-to { + display: flex; + width: ${"2px"}; + background: ${eus}; + align-self: stretch; + + &::after { + content: ' '; + height: 100%; + } + } + + /* Guideline To: Node First Child */ + & .node.root .children .node:first-child > .guideline-to { + height: auto; + background: transparent !important; + + &::after { + display: flex; + width: ${"2px"}; + height: 50%; + background: ${eus}; + align-self: flex-end; + } + } + + /* Guideline To: Node Last Child */ + & .node.root .children .node:last-child > .guideline-to { + height: auto; + background: transparent !important; + + &::after { + display: flex; + width: ${"2px"}; + height: 50%; + background: ${eus}; + align-self: flex-start; + } + } + + /* Guideline To: Node Only Child */ + & .node.root .children .node:only-child > .guideline-to { + opacity: 0; + width: 0 !important; + } + + & .node.root .children .node .title > .guideline-to { + background: ${eus}; + height: ${"2px"}; + width: 20px; + right: -20px; /* subtract width */ + margin-top: -2px; + opacity: 0; /* hide by default */ + } + + & .node.root .children .node .title > .guideline-to, + & .node.root .children .node .title > .guideline-from { + display: block; + position: absolute; + top: 50%; + } + + /* Hide/Show Guideline To If Child Exists */ + & .node.root .children .node.has-child > .title > .guideline-to { + opacity: 1; + } + + /* Guideline From: Node */ + & .node.root .children .node .title > .guideline-from { + left: -20px; /* subtract width */ + height: ${"2px"}; + width: 20px; + margin-top: -2px; /* half of height */ + background: ${eus}; + } + + /* Guideline From: Node First Child */ + & .node.root .children .node:first-child > .title > .guideline-from { + height: 24px !important; + width: 18px !important; + border-top: ${"2px"} solid ${eus}; + border-left: ${"2px"} solid ${eus}; + border-radius: 4px 0 0 0; + background: none !important; + } + + /* Guideline From: Node Last Child */ + & .node.root .children .node:last-child > .title > .guideline-from { + height: 24px !important; + width: 18px !important; + border-bottom: ${"2px"} solid ${eus}; + border-left: ${"2px"} solid ${eus}; + border-radius: 0 0 0 4px; + margin-top: -16px !important; + background: none !important; + } + + /* Guideline From: Node Only Child */ + & .node.root .children .node:only-child > .title > .guideline-from { + width: 20px !important; + border-top: 0; + border-left: 0; + margin-top: -24px !important; + border-radius: 0; + } + + /* Mindmap Layout Starts */ + display: table; // when mindmap folds, empty space is not generated below + + & .node.root { + display: flex; + align-items: center; + margin-top: 30px; + + & .node-create { + & .title { + padding: 0 10px 0 0 !important; + margin-top: 5px; + min-width: 100px; + } + & .create-node-action { + min-width: 100px; + margin-left: 10px; + } + } + + & .no-search-results { + display: none; + min-height: 24px; + background: white; + padding: 12px 16px; + border-radius: 10px; + margin-left: 2px; + } + + /* All Alignments */ + /* Level 1 */ + & > .children > .node > .title { + margin-bottom: 10px; + } + /* Level 1 Ends */ + + /* Level 2 */ + & > .children .node .title { + margin-bottom: 10px; + } + + /* Formatting Adjustments */ + /* All Children & All Nodes */ + & .children { + display: flex; + flex-direction: column; + align-items: flex-start; + + /* Reset */ + border: 0 !important; + margin-left: -16px !important; + padding-left: 16px !important; + + & .node { + display: flex; + position: relative; /* required for guidelines */ + align-items: center; + + // min-width: max-content; // for stretching, very important + min-width: max-content; + max-width: 404px; + + /* Reset */ + padding: 0; + margin: 0; + + /* All Titles */ + & .title { + min-height: 24px; + position: relative; + margin-right: 20px; + padding: 10px 16px 10px 10px; + border-radius: 10px; + min-width: 360px; + max-width: 404px; + margin-left: 18px; + justify-content: left; + + & .content { + min-width: 200px; + padding-top: 1px; + } + } + } + } + + & > .children { + margin-left: 5px !important; + } + } + /* Mindmap Layout Ends */ + `} + + /* Orgchart Rules */ + ${e=>"orgchart"===e.$documentView&&(0,eL.css)` + margin: 20px auto; + & .node-toggle-button { + display: flex !important; + } + + /* Left Guidelines */ + & .root.node .node.has-child > .children:before { + display: none; + } + & .root.node .node { + margin-top: 0 !important; + } + & .root.node .left-controls { + position: unset; + padding: 0; + width: inherit; + left: 0; + } + + /* View Specific Fold */ + & .root.node > .children .node .node-fold-button { + position: absolute; + top: 1px; + right: -30px; + & svg { + transform: translateX(0) translateY(0); + & path { + fill: #fff !important; + } + } + } + & .root.node > .children .node .node-unfold-button { + position: absolute; + top: -1px; + right: -30px; + & svg { + transform: translateX(0) translateY(0); + & path { + fill: #fff !important; + } + } + } + & .right-side { + & .node-fold-button, + & .node-unfold-button { + opacity: 1 !important; + } + } + & .project-title { + display: inline-block; + min-height: 24px; + max-width: 600px; + min-width: 280px; + position: relative; + padding: 12px 18px; + border-radius: 10px; + margin-bottom: 0; + + & > .content { + min-width: 280px; + max-width: 400px; + padding-right: 40px; + } + } + & .children .title { + &:hover { + box-shadow: ${()=>e.theme.isNightMode?`0 2px 0px 0px ${e.theme.appColors.hex(60)}`:"0 1px 2px 0 rgba(0, 0, 0, 0.18)"}; + } + } + /* Orgchart Selection */ + & .root.node > .children .node { + &.selected { + & .title { + box-shadow: ${()=>`0px 0px 0px 3px ${e.theme.primaryColorScheme?.alpha80}`}; + &:hover { + background: ${e.theme.appColors.hex(80)}; + } + } + } + } + + & .node-add-block { + margin: 0; + } + & .guideline-block-to { + display: flex; + width: calc(50% - 16px); + align-self: flex-start; + height: 2px; + background: ${e.theme.primaryColorScheme?.base}; + } + & .add-block-title { + width: 330px; + margin: 22px 0 18px; + border-radius: 10px; + padding: 12px 16px 11px 10px; + } + & .guideline-block-from { + display: flex; + top: 16px; + left: 50%; + height: 22px !important; + width: 18px !important; + border-top: 2px solid ${eus}; + border-right: 2px solid ${eus}; + border-radius: 0 4px 0 0; + margin-top: -16px !important; + margin-left: -16px; + background: none !important; + } + & .add-sibling-button { + display: none; + } + & .node-drag-handle { + position: relative; + float: left; + left: -4px; + width: 12px; + height: 30px; + background: none; + } + + /* Fold/Unfold */ + /* NOTE: (stan@taskade.com) We have introduced and thus shifted the responsibility of toggling collapse to JS */ + & .root.node > .children .node .node-fold-button { + width: 22px; + height: 22px; + left: 50%; + margin-left: -10px; + bottom: -32px; + border-radius: 30px; + top: inherit; + background-position: -30px 0; + background-color: ${e.theme.primaryColorScheme?.base}; + } + & .root.node > .children .node .node-unfold-button { + width: 22px; + height: 22px; + left: 50%; + margin-left: -10px; + bottom: -32px; + border-radius: 30px; + top: inherit; + background-position: -30px -23px; + background-color: ${e.theme.primaryColorScheme?.base}; + } + & .root.node > .children .node.collapsed .node-fold-button { + display: none; + } + & .root.node > .children .node.collapsed .node-unfold-button { + display: flex; + } + + /* Add Child Button: Org Rules */ + .add-child-button { + display: ${e.$isReadOnly?"none":"block"}; + width: 23px; + height: 23px; + border-radius: 30px; + margin-left: -10px; + margin-top: -10px !important; + background: ${e.theme.primaryColorScheme?.base} + url('/../images/sprite_node_toggle.svg') no-repeat -30px -46px; + position: relative; + z-index: 1; + transform: rotate(90deg); + margin-left: -16px !important; + + &:hover { + background-color: ${e.theme.primaryColorScheme?.alpha80} !important; + } + } + + /* Guideline To: Project */ + & .node.root > .project-title > .guideline-to { + display: block !important; + width: ${"2px"}; + left: 50%; + height: 22px; + background: ${eus}; + position: absolute; + bottom: -22px; + } + + /* Guideline To: Node */ + & .node.root .children .node > .guideline-to { + display: block; + width: 100%; + height: ${"2px"}; + background: ${eus}; + } + + /* Guideline To: Node First Child */ + & .node.root .children .node:first-child > .guideline-to { + width: 50%; + align-self: flex-end; + } + + /* Guideline To: Node Last Child */ + & .node.root .children .node:last-child > .guideline-to { + width: calc(50% - 16px); + align-self: flex-start; + } + + & .node.root .children .node .title > .guideline-to, + & .node.root .children .node .title > .guideline-from { + display: block; + position: absolute; + left: 50%; + } + + /* Guideline To: Node Title */ + & .node.root .children .node .title > .guideline-to { + background: ${e.theme.primaryColorScheme?.base}; + width: ${"2px"}; + height: 20px; + bottom: -20px; /* subtract width */ + opacity: 0; /* hide by default */ + } + + /* Guideline To: Node Only Child */ + & .node.root .children .node:only-child > .guideline-to { + width: ${"2px"}; + height: 22px; + justify-self: center; + align-self: inherit; + margin-left: -16px; + } + + & .node.root .children .node-create:only-child .guideline-to { + margin-left: 2px; + } + + /* Guideline From: Node Title */ + & .node.root .children .node .title > .guideline-from { + top: -18px; /* subtract width */ + width: ${"2px"}; + height: 20px; + margin-top: -2px; /* half of height */ + background: ${eus}; + } + + /* Guideline From: Node First Child */ + & .node.root .children .node:first-child > .title > .guideline-from { + top: -20px; + height: 22px !important; + width: 18px !important; + border-top: ${"2px"} solid ${eus}; + border-left: ${"2px"} solid ${eus}; + border-radius: 4px 0 0 0; + background: none !important; + } + + /* Guideline From: Node Last Child */ + & .node.root .children .node:last-child > .title > .guideline-from { + top: -6px; + height: 22px !important; + width: 18px !important; + border-top: ${"2px"} solid ${eus}; + border-right: ${"2px"} solid ${eus}; + border-radius: 0 4px 0 0; + margin-top: -16px !important; + margin-left: -16px; + background: none !important; + } + + /* Only Child */ + & .node.root .children .node:only-child > .title > .guideline-from { + display: none; + } + + /* Hide/Show Guideline To If Child Exists */ + & .node.root .children .node.has-child > .title > .guideline-from, + & .node.root .children .node.has-child > .title > .guideline-to { + opacity: 1; + } + + /* Orgchart Layout Starts */ + display: flex; + width: fit-content; + + & .node.root { + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + transform-origin: top center; + + & > .children > .node.collapsed.has-child { + margin-bottom: 30px !important; + } + + & .node-create { + & .title { + padding: 0 10px 0 0 !important; + margin-top: 5px; + min-width: 100px; + grid-template-columns: auto !important; + } + & .create-node-action { + min-width: 100px; + margin-left: 10px; + } + } + + & .no-search-results { + display: none; + min-height: 24px; + background: white; + padding: 12px 16px; + border-radius: 10px; + margin-left: 2px; + } + + & .title { + justify-self: center; + width: max-content; + min-width: 300px; + max-width: 500px; + position: relative; /* required for guidelines */ + padding: 12px 18px; + border-radius: 10px; + } + + /* Formatting Adjustments */ + & > .children > .node { + &.node-format-h1 > .title > .content { + /* Align vertically with drag handle */ + margin-top: -4px; + } + + &.node-format-h2 > .title > .content { + /* Align vertically with drag handle */ + margin-top: -2px; + } + } + + /* 90deg Rotation */ + & > .children { + flex-direction: column; + & > .node { + margin-bottom: 30px !important; + & > .guideline-to { + display: none; + } + & > .title { + & .guideline-from { + display: none; + } + } + } + } + + /* All Children & All Nodes */ + & .children { + display: flex; + + /* Reset */ + border: 0 !important; + margin-left: 0 !important; + padding-left: 0 !important; + + & .node { + display: flex; + flex-direction: column; + align-items: center; + position: relative; /* required for guidelines */ + grid-gap: inherit; + height: 100%; // needed for guideline vertical line + + min-width: max-content; // for stretching, very important + + /* Reset */ + padding: 0; + margin: 0; + + /* All Titles */ + & .title { + min-height: 24px; + position: relative; + padding: 10px 16px 10px 10px; + border-radius: 10px; + min-width: 330px; + max-width: 404px; + margin-top: 20px; + margin-bottom: 18px; + margin-right: 18px; + + /* Drag, CheckBox */ + & > div:first-child { + grid-area: map-left; + } + } + + &.has-child > .children { + & > .node:only-child > .title { + margin-top: 0px !important; + } + } + } + + .node-add-block { + align-self: center; + max-width: fit-content !important; + & .guideline-block-to, + & .guideline-block-from { + display: none !important; + } + & .add-block-title { + width: inherit !important; + } + } + } + } + /* Orgchart Layout Ends */ + `} + } +`,eum=(0,e$.connect)(function(e){return{contents:iL(e),readOnly:dq(e),user:t7(e),doc:dV(e)}},function(e){return{...(0,ek.DE)({deleteNodes:mS,indentNodes:De,outdentNodes:Dt,toggleHideChat:xk,toggleShortcutsModalDialog:_c,unfocusNode:mD,undo:I7,redo:I9,multiselectEnter:Dd,multiselectDown:Dc,multiselectUp:Dm},e),canSelectAllNodes:()=>e(Xa()),fetchFocusNodeId:()=>e(zY()),toggleSelectionComplete:t=>e(JE(t)),toggleSelectionMark:(t,a,n)=>e(Ds(t,a,n)),moveNodesToPreviousLocation:t=>e(Xl(t)),moveNodesToNextLocation:t=>e(Xn(t)),findNextNodeIdForSelection:t=>e(Xr(t)),findPreviousNodeIdForSelection:t=>e(Xo(t))}});class euu extends ev.Component{container;editor;document;presenceOverlay;emojiCommandMenuRef;commandMonitorMenuRef;dragScrollPos;mutationObserver;constructor(e){super(e),this.container=null,this.editor=null,this.document=null,this.presenceOverlay=ev.createRef(),this.emojiCommandMenuRef=ev.createRef(),this.commandMonitorMenuRef=ev.createRef(),this.dragScrollPos=ev.createRef(),this.state={scale:1},Object.defineProperty(this,"resizeObserver",{get:emt()(()=>ZZ(this.onResize))}),Object.defineProperty(this,"mutationObserver",{get:emt()(()=>new MutationObserver(this.onMutation))})}componentDidMount(){uS().bind("mod+\\",this.handleChatToggle)}componentWillUnmount(){this.resizeObserver.disconnect(),uS().unbind("mod+\\")}componentDidUpdate(e){null!=this.editor&&this.props.documentView!==e.documentView&&(this.setState({scale:1}),this.centerVertically())}onResize=()=>{this.positionPresenceOverlay()};onMutation=()=>{this.positionPresenceOverlay()};positionPresenceOverlay=Xb()(()=>{this.presenceOverlay.current?.forceUpdate()},100);setContainerRef=e=>{eu()(this.container)||this.resizeObserver.unobserve(this.container),this.container=e,eu()(e)||this.resizeObserver.observe(e)};setEditorRef=e=>{eu()(this.editor)||this.resizeObserver.unobserve(this.editor),this.editor=e,eu()(e)||(this.centerVertically(),this.resizeObserver.observe(e))};centerVertically=()=>{if(null==this.editor)return;let{scrollWidth:e,scrollHeight:t,clientWidth:a,clientHeight:n}=this.editor;this.props.documentView===dd?(this.editor.scrollLeft=(e-a)/2,this.editor.scrollTop=0):this.props.documentView===ds&&null!=this.document&&(this.editor.scrollTop=(t-n+this.document.offsetTop)/2,this.editor.scrollLeft=0)};setDocumentRef=e=>{null!=this.document&&this.mutationObserver.disconnect(),this.document=e,null!=this.document&&this.mutationObserver.observe(this.document,{childList:!0,subtree:!0})};handleChatToggle=()=>{let{documentID:e,toggleHideChat:t}=this.props;t(e)};handleClearFocus=()=>{let{documentID:e}=this.props;this.props.unfocusNode(e)};handleDeleteNodes=e=>{let{documentID:t,readOnly:a}=this.props;a||this.props.deleteNodes(t,e)};handleDocumentKeyDownCapture=e=>{this.emojiCommandMenuRef.current?.handleKeyDownCapture(e),this.commandMonitorMenuRef.current?.handleKeyDownCapture(e)};handleWheel=e=>{(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.setState(t=>({scale:Math.min(Math.max(.25,t.scale+-.001*e.deltaY),1)})))};handleScale=e=>{this.setState({scale:e})};render(){let{documentID:e,documentView:t,fetchStatus:a,hideChat:n,isNewBorn:l,doc:r,match:o,spaceId:i,coverImageType:s}=this.props;if(a===uE)return ev.createElement(J8,null);let d=!eu()(ec()(o,["params","isNewDocument"])),c=r?.isTemplate||!eu()(ec()(o,["params","isTemplate"])),m=d&&c,u=e=>{if(null!=this.dragScrollPos.current&&null!=this.editor){let t=this.dragScrollPos.current,a=e.clientX-t.x,n=e.clientY-t.y;this.editor.scrollLeft=t.left-a,this.editor.scrollTop=t.top-n}},p=()=>{this.dragScrollPos.current=null,null!=this.editor&&this.editor.classList.remove("dragging"),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return ev.createElement(eud,{className:"empty-wrapper"},ev.createElement(Qc,null),ev.createElement("div",{ref:this.setContainerRef,className:og()("tc-container relative flex min-w-0 flex-auto",{"with-chat-open":!n,"with-chat-closed":n})},ev.createElement(zO.Wh,null,ev.createElement(Xe,null,ev.createElement(eui,{ref:this.setEditorRef,documentView:t,coverImage:s,onMouseDown:e=>{null!=this.editor&&PO(e)&&(this.dragScrollPos.current={left:this.editor.scrollLeft,top:this.editor.scrollTop,x:e.clientX,y:e.clientY},this.editor.classList.add("dragging"),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p))}},this.props.user&&c&&ev.createElement(zz,{isNewTemplate:m,documentID:e,documentView:t,spaceID:i}),ev.createElement(ems,null),ev.createElement(QD,null),ev.createElement(jz.Consumer,null,a=>ev.createElement(euc,{ref:this.setDocumentRef,onKeyDownCapture:this.handleDocumentKeyDownCapture,$documentView:t,$isGuest:null==this.props.user,$isNewProject:null==e,$isReadOnly:this.props.readOnly,$commentsMode:a.commentsMode,className:"project-wrapper",id:"project-wrapper"},ev.createElement(emE.Provider,{value:t},ev.createElement(Va,{contents:this.props.contents,canSelectAllNodes:this.props.canSelectAllNodes,fetchFocusNodeId:this.props.fetchFocusNodeId,toggleSelectionComplete:this.props.toggleSelectionComplete,toggleSelectionMark:this.props.toggleSelectionMark,onClearFocus:this.handleClearFocus,onDeleteNodes:this.handleDeleteNodes,indentNodes:this.props.indentNodes,outdentNodes:this.props.outdentNodes,undo:this.props.undo,redo:this.props.redo,moveNodesToPreviousLocation:this.props.moveNodesToPreviousLocation,moveNodesToNextLocation:this.props.moveNodesToNextLocation,multiselectEnter:this.props.multiselectEnter,multiselectDown:this.props.multiselectDown,multiselectUp:this.props.multiselectUp,findNextNodeIdForSelection:this.props.findNextNodeIdForSelection,findPreviousNodeIdForSelection:this.props.findPreviousNodeIdForSelection},ev.createElement(euo,{editorId:this.props.editorId,rootId:this.props.rootId,siteId:this.props.siteId,fetchStatus:this.props.fetchStatus,scale:this.state.scale,isNewTemplate:m}),ev.createElement(V2,{documentId:e}),ev.createElement(J4,{ref:this.emojiCommandMenuRef}),ev.createElement(W9,{ref:this.commandMonitorMenuRef,documentId:this.props.documentID}),ev.createElement(G9,null,ev.createElement(Ke,null,!this.props.readOnly&&ev.createElement(JH,null))),ev.createElement(z0,{documentID:this.props.documentID}),ev.createElement(emc,null))),null!=e&&ev.createElement(Q_,{ref:this.presenceOverlay,documentID:e}))))))),ev.createElement(zZ,{location:this.props.location,isLoggedIn:null!=this.props.user}),this.props.documentID&&ev.createElement(zQ,{projectID:this.props.documentID}),!l&&this.props.documentID&&this.props.user&&ev.createElement(ema,{projectID:this.props.documentID}),ev.createElement(Q$,{fetchStatus:a}),ev.createElement(YA,null),ev.createElement(H5,null),ev.createElement(KA,null),ev.createElement(Y0,null),ev.createElement(em5,{scale:this.state.scale,onScale:this.handleScale}))}}let eup=eum(euu),eug=function(e){let{documentView:t}=e;return ev.createElement(RG,{$documentView:t})},euf=(0,la.ZP)` + fragment ProjectUnreadFragment on Document { + id + is_unread + } +`,euh=(0,e$.connect)(function(e,t){return{isLoggedIn:t9(e)}})(function(e){let{projectId:t,isLoggedIn:a}=e,n=(0,ll.x)();return(0,ev.useEffect)(()=>{if(!a)return;let e=n.readFragment({fragment:euf,id:`Document:${t}`});if(null==e)return;let l=(0,es.ZP)(e,e=>{e.is_unread=!1});n.writeFragment({fragment:euf,id:`Document:${t}`,data:l})},[a,n,t]),null}),euy="@@taskade/Chatroom/CHATROOM_DID_MOUNT",eub="@@taskade/Chatroom/CHATROOM_WILL_UNMOUNT",euv="@@taskade/Chatroom/RECEIVE_EVENT";function euk(e,t){return{type:"@@taskade/Chatroom/SET_CHATROOM_FETCH_STATUS",payload:{to:e,fetchStatus:t}}}function euE(e){return{type:"@@taskade/Chatroom/RESET_CHATROOM",payload:{to:e}}}let eux=function(e){let{projectId:t}=e,a=(0,e$.useDispatch)();return ev.useEffect(()=>{let e={type:"document",id:t};return a(function(e){if("document"===e.type&&eu()(e.id))try{throw Error("Invalid Schema Detected: to")}catch(t){console.warn({to:e,error:t}),er.$e(a=>{a.setExtra("to",e),er.Tb(t)})}return{type:euy,payload:{to:e}}}(e)),()=>{a({type:eub,payload:{to:e}})}},[a,t]),(0,ev.useEffect)(()=>{let e=BO.ChatroomCommand.encode({type:BO.ChatroomCommandType.JOIN,projectId:t}).finish();return a({type:r_,payload:{eventName:"CHATROOM_COMMAND",args:[new Blob([e])]}}),()=>{let e=BO.ChatroomCommand.encode({type:BO.ChatroomCommandType.LEAVE,projectId:t}).finish();a({type:r_,payload:{eventName:"CHATROOM_COMMAND",args:[new Blob([e])]}})}},[t,a]),null},eu_=eL.default.div.withConfig({displayName:"DocumentBeta__Wrapper",componentId:"sc-7468bcb5-0"})` + flex: 1 1 auto; + min-height: 0; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: stretch; + overflow-x: hidden; +`,euw=(0,e$.connect)(function(e){return{documentID:dP(e),hideChat:dD(e),documentView:dA(e),spaceId:dU(e)}})(function(e){let{documentID:t,hideChat:a,documentView:n,spaceId:l}=e,r=ev.useMemo(()=>({[di]:eof,[dl]:eiW,[dr]:ed1,[dn]:emH,[ds]:eup,[dd]:eup,[dc]:ec9}),[])[n]??eug,o=(0,ev.useContext)(jz),i=null!=t&&o.chatMode===R.ENABLED&&!a;return ev.createElement(eu_,null,ev.createElement(r,{...e,coverImageType:o.coverImageType??jZ}),i&&ev.createElement(zj,{documentID:t,spaceId:l}),null!=t&&ev.createElement(ev.Fragment,null,ev.createElement(euh,{projectId:t}),ev.createElement(eux,{projectId:t})))});function euN(e){let t=fH(e.type);return`avatar.${t}`}async function euC(e,t){let{s3Policy:a,s3URL:n}=e.payload,l=euN(t),{formData:r,s3ObjectKey:o}=uo(fq(t.dataURL),a,l);if(null==o)throw new ei.HttpError({code:"INTERNAL_SERVER_ERROR",message:"Something went wrong. Please try again."});let i=await fB(n,{},r);if(!i.ok)throw new ei.FetchError(i);return o}async function euM(e,t,a){let n=await fB(`${a}/uploads`,{"uploads-authorization-jwt":t,"Content-Type":"application/json"},JSON.stringify({body:{s3ObjectKey:e}}));if(!n.ok)throw new ei.FetchError(n);return n.json()}async function euS(e,t){let a=euN(t),n=t.size,l=await OI("space_agent_avatar",a,n,void 0,e);if(!l.ok)throw new ei.HttpError({code:"BAD_REQUEST",message:"Invalid request"});let r=await euC(l,t),{token:o,awsUploadAPIBaseURL:i}=l.payload;return await euM(r,o,i)}let euI=function(e){let{onEmojiPick:t}=e;return ev.createElement(gm,{onClick:t,hideBorder:!0})};eL.default.div.withConfig({displayName:"styled__EventPropagationTrap",componentId:"sc-4b060312-0"})` + display: flex; + flex-direction: column; + border: 0px; + border-radius: 5px; + padding: 0px; +`;let euD=eL.default.div.withConfig({displayName:"styled__StyledTab",componentId:"sc-4b060312-1"})` + display: flex; + align-items: center; + color: ${e=>e.selected?e.theme.appColors.hex(10):e.theme.appColors.hex(50)}; + border-bottom: 2px solid + ${e=>e.selected?e.theme.appColors.hex(50):"transparent"}; + font-weight: ${e=>e.selected?"500":"400"}; + padding: 0 0 8px; + font-size: 14px; + + &:hover { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(10)}; + } +`,euT=eL.default.div.withConfig({displayName:"styled__PopoverBody",componentId:"sc-4b060312-2"})` + min-width: 395px; + padding: 16px 20px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + + & .emoji-mart { + display: flex; + flex-direction: column; + border: 0; + background: none; + border-radius: 0; + } + & .emoji-mart-bar { + border-color: transparent; + display: none; + } + & .emoji-mart-search, + & .emoji-mart-scroll { + padding: 0; + } + & .emoji-mart-category-label span { + padding-left: 0; + } +`,eu$=function(e){let{disabled:t,onChange:a}=e;return ev.createElement("div",{className:"flex pt-5"},ev.createElement("label",{className:"flex flex-1 cursor-pointer justify-center rounded-xl border border-dashed border-appcolor-500 p-5 text-textcolor-500 transition-colors hover:border-appcolor-800 hover:text-textcolor-800",htmlFor:"avatar-editor-file-popover"},ev.createElement(eY.Z,{id:"general.select_image_to_upload",defaultMessage:"Select image to upload"})),ev.createElement("input",{className:"hidden",id:"avatar-editor-file-popover",name:"avatar",type:"file",accept:".jpg,.jpeg,.png",onChange:a,disabled:t}))};!function(e){e.Emoji="emoji",e.Upload="upload"}(Q||(Q={}));let euP=function(e){let{onEmojiPick:t,onImageChange:a}=e,[n,l]=ev.useState("emoji"),r=ev.useCallback(e=>l(e),[]);return ev.createElement(euT,null,ev.createElement(eI.TabList,{className:"flex gap-2.5 border-b border-appcolor-300 text-textcolor-900",value:n,onChange:r},ev.createElement(euD,{value:"emoji"},ev.createElement(eY.Z,{id:"general.choose_emoji",defaultMessage:"Choose Emoji"})),ev.createElement(euD,{value:"upload"},ev.createElement(eY.Z,{id:"general.upload",defaultMessage:"Upload"}))),ev.createElement(eI.TabPanelSwitch,{value:n},ev.createElement(euI,{value:"emoji",onEmojiPick:t}),ev.createElement(eu$,{value:"upload",onChange:a})))},euF=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-a8ffa239-0"})` + display: flex; + width: 60px; + height: 60px; + overflow: hidden; + margin: 0px auto; + border-radius: 100%; + border: 1px dashed ${e=>e.$isEmpty?e.theme.appColors.hex(70):"transparent"}; + position: relative; + + &:hover { + border-color: ${e=>e.$isEmpty?e.theme.appColors.hex(60):"transparent"}; + } + transition: border-color 0.2s ease-in-out; +`,euA=eL.default.div.withConfig({displayName:"styled__AvatarPlaceholder",componentId:"sc-a8ffa239-1"})` + display: flex; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + position: absolute; +`,euR=eL.default.div.withConfig({displayName:"styled__AvatarContainer",componentId:"sc-a8ffa239-2"})` + display: flex; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + font-size: 26px; + line-height: 26px; + position: absolute; + + img { + width: 60px; + height: 60px; + } +`,euj=ev.forwardRef(function(e,t){let{disabled:a,emoji:n,imageURL:l,onClose:r,onDeleteButtonClick:o,onEmojiPick:i,onImageLoadFailure:s,onImageLoadSuccess:d}=e,c=e.popoverPlacement??"bottom",m=e.hasNewImage??!1,u=null!=l||m||null!=n,p=(0,eI.useUncontrolledPopover)({placement:c}),g=p.visible,f=p.setVisible,h=ev.useRef(null),y=ev.useCallback(()=>{f(()=>!a)},[a,f]),b=ev.useCallback(e=>{"native"in e&&null!=e.native&&i?.(e.native),f(!1)},[i,f]),v=ev.useCallback(e=>{h.current?.setImage(e),f(!1)},[h,f]),k=ev.useCallback(()=>{let e=!g;f(e),e||r?.()},[r,g,f]),E=ev.useCallback(()=>h.current?.getImage()??null,[h]),x=ev.useCallback(()=>{h.current?.reset()},[h]);return ev.useImperativeHandle(t,()=>({getImage:E,resetImage:x}),[E,x]),ev.createElement("div",{className:"flex items-center gap-4"},ev.createElement(euF,{$isEmpty:!l||!m||null==n},!m&&ev.createElement(ev.Fragment,null,ev.createElement(euR,null,l&&null==n&&ev.createElement("img",{alt:"avatar",src:l}),n),!l&&null==n&&ev.createElement(euA,{className:"text-appcolor-500 hover:text-appcolor-200"},ev.createElement(tn.Icon,{className:"scale-125",icon:"agent_avatar"}))),ev.createElement(f5,{isOpen:!0,editorHeight:60,editorWidth:60,minimumAvatarDimension:100,onLoadFailure:s,onLoadSuccess:d,ref:h}),!m&&ev.createElement("button",{...p.referenceProps,className:"absolute m-0 h-15 w-15 cursor-pointer border-none bg-none p-0 shadow-none outline-none",type:"button",onClick:y,disabled:a}),p.visible&&ev.createElement(f4,{popperProps:p.popperProps,onToggle:k},ev.createElement(euP,{onEmojiPick:b,onImageChange:v}))),u&&ev.createElement("button",{className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-1.5 text-sm hover:bg-appcolor-200",type:"button",onClick:o},ev.createElement(eY.Z,{id:"agent.remove",defaultMessage:"Remove"})),!u&&ev.createElement("button",{className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-1.5 text-sm hover:bg-appcolor-200",type:"button",onClick:y},ev.createElement(eY.Z,{id:"agent.upload",defaultMessage:"Upload"})))}),euO=[{id:"template-tasker",emoji:"✅",value:"Tasker",name:(0,te.Em)({id:"agent.task",defaultMessage:"Task"})},{id:"template-researcher",emoji:"\uD83E\uDDE0",value:"Researcher",name:(0,te.Em)({id:"agent.researcher",defaultMessage:"Researcher"})},{id:"template-marketer",emoji:"\uD83D\uDE80",value:"Marketer",name:(0,te.Em)({id:"agent.marketer",defaultMessage:"Marketer"})},{id:"template-email_writer",emoji:"\uD83D\uDCE7",value:"EmailWriter",name:(0,te.Em)({id:"agent.email_writer",defaultMessage:"Email Writer"})},{id:"template-editor",emoji:"✍️",value:"Editor",name:(0,te.Em)({id:"agent.editor",defaultMessage:"Editor"})},{id:"template-sales_analyst",emoji:"\uD83D\uDCC8",value:"Sales",name:(0,te.Em)({id:"agent.sales_analyst",defaultMessage:"Sales Analyst"})},{id:"template-customer_support",emoji:"\uD83C\uDFA7",value:"CustomerSupport",name:(0,te.Em)({id:"agent.customer_support",defaultMessage:"Customer Support"})},{id:"template-project_manager",emoji:"\uD83D\uDCCB",value:"ProjectManager",name:(0,te.Em)({id:"agent.project_manager",defaultMessage:"Project Manager"})},{id:"template-content_creator",emoji:"\uD83C\uDF89",value:"ContentCreator",name:(0,te.Em)({id:"agent.content_creator",defaultMessage:"Content Creator"})},{id:"template-copywriter",emoji:"✍️",value:"Copywriter",name:(0,te.Em)({id:"agent.copywriter",defaultMessage:"Copywriter"})},{id:"template-legal_advisor",emoji:"\uD83D\uDC69‍⚖️",value:"LegalAdvisor",name:(0,te.Em)({id:"agent.legal_advisor",defaultMessage:"Legal Advisor"})},{id:"template-seo_specialist",emoji:"\uD83D\uDD0D",value:"SeoSpecialist",name:(0,te.Em)({id:"agent.seo",defaultMessage:"SEO"})},{id:"template-productivity_coach",emoji:"⚡️",value:"ProductivityCoach",name:(0,te.Em)({id:"agent.productivity_coach",defaultMessage:"Productivity"})},{id:"template-engineering_expert",emoji:"\uD83D\uDD27",value:"EngineeringExpert",name:(0,te.Em)({id:"agent.engineer",defaultMessage:"Engineer"})},{id:"template-translator",emoji:"\uD83C\uDF10",value:"Translator",name:(0,te.Em)({id:"agent.translator",defaultMessage:"Translator"})},{id:"template-summarizer",emoji:"\uD83D\uDCDD",value:"Summarizer",name:(0,te.Em)({id:"agent.summarizer",defaultMessage:"Summarizer"})},{id:"template-resume_builder",emoji:"\uD83D\uDCC4",value:"ResumeBuilder",name:(0,te.Em)({id:"agent.resume_builder",defaultMessage:"Resume"})},{id:"template-storyteller",emoji:"\uD83D\uDCD6",value:"Storyteller",name:(0,te.Em)({id:"agent.storyteller",defaultMessage:"Storyteller"})},{id:"template-tutor",emoji:"\uD83D\uDCDA",value:"Tutor",name:(0,te.Em)({id:"agent.tutor",defaultMessage:"Tutor"})},{id:"template-brand_strategist",emoji:"\uD83C\uDF4E",value:"BrandStrategist",name:(0,te.Em)({id:"agent.brand_strategist",defaultMessage:"Brand Strategist"})},{id:"template-social_media_specialist",emoji:"\uD83D\uDCF1",value:"SocialMediaSpecialist",name:(0,te.Em)({id:"agent.social_media_specialist",defaultMessage:"Social Media"})},{id:"template-business_strategist",emoji:"\uD83D\uDCCA",value:"BusinessStrategist",name:(0,te.Em)({id:"agent.business_strategist",defaultMessage:"Business Strategist"})},{id:"template-sustainability_consultant",emoji:"\uD83C\uDF3F",value:"SustainabilityConsultant",name:(0,te.Em)({id:"agent.sustainability_consultant",defaultMessage:"Sustainability"})},{id:"template-product_manager",emoji:"\uD83D\uDE80",value:"ProductManager",name:(0,te.Em)({id:"agent.product_manager",defaultMessage:"Product Manager"})},{id:"template-financial_analyst",emoji:"\uD83D\uDCB9",value:"FinancialAnalyst",name:(0,te.Em)({id:"agent.financial_analyst",defaultMessage:"Financial Analyst"})},{id:"template-human_resources_manager",emoji:"\uD83E\uDDD1‍\uD83D\uDCBC",value:"HumanResourcesManager",name:(0,te.Em)({id:"agent.human_resources_manager",defaultMessage:"Human Resources"})},{id:"template-data_scientist",emoji:"\uD83D\uDD2C",value:"DataScientist",name:(0,te.Em)({id:"agent.data_scientist",defaultMessage:"Data Scientist"})},{id:"template-it_consultant",emoji:"\uD83D\uDCBB",value:"ITConsultant",name:(0,te.Em)({id:"agent.it_consultant",defaultMessage:"IT Consultant"})},{id:"template-financial_advisor",emoji:"\uD83E\uDD11",value:"FinancialAdvisor",name:(0,te.Em)({id:"agent.financial_advisor",defaultMessage:"Financial Advisor"})},{id:"template-health_coach",emoji:"\uD83C\uDF4F",value:"HealthCoach",name:(0,te.Em)({id:"agent.health_coach",defaultMessage:"Health"})},{id:"template-ux_designer",emoji:"\uD83C\uDFA8",value:"UXDesigner",name:(0,te.Em)({id:"agent.ux_designer",defaultMessage:"UX Designer"})},{id:"template-quality_assurance_analyst",emoji:"\uD83D\uDD0D",value:"QualityAssuranceAnalyst",name:(0,te.Em)({id:"agent.quality_assurance_analyst",defaultMessage:"Quality Assurance"})},{id:"template-growth_hacker",emoji:"\uD83D\uDCA1",value:"GrowthHacker",name:(0,te.Em)({id:"agent.growth_hacker",defaultMessage:"Growth Hacker"})},{id:"template-business_development_manager",emoji:"\uD83D\uDCC8",value:"BusinessDevelopmentManager",name:(0,te.Em)({id:"agent.business_development_manager",defaultMessage:"Business Development"})},{id:"template-public_relations_specialist",emoji:"\uD83D\uDDE3️",value:"PublicRelationsSpecialist",name:(0,te.Em)({id:"agent.public_relations_specialist",defaultMessage:"Public Relations"})},{id:"template-event_planner",emoji:"\uD83C\uDF89",value:"EventPlanner",name:(0,te.Em)({id:"agent.event_planner",defaultMessage:"Event Planner"})},{id:"template-data_analyst",emoji:"\uD83D\uDCCA",value:"DataAnalyst",name:(0,te.Em)({id:"agent.data_analyst",defaultMessage:"Data Analyst"})},{id:"template-ceo",emoji:"\uD83D\uDC54",value:"CEO",name:(0,te.Em)({id:"agent.ceo",defaultMessage:"CEO"})},{id:"template-interview-coach",emoji:"\uD83C\uDFA4",value:"InterviewCoach",name:(0,te.Em)({id:"agent.interview_coach",defaultMessage:"Interview Coach"})},{id:"template-tech-support-advisor",emoji:"\uD83D\uDD27",value:"TechSupportAdvisor",name:(0,te.Em)({id:"agent.tech_support_advisor",defaultMessage:"Tech Support Advisor"})},{id:"template-doctor",emoji:"\uD83D\uDC69‍⚕️",value:"Doctor",name:(0,te.Em)({id:"agent.doctor",defaultMessage:"Doctor"})},{id:"template-blog-expert",emoji:"✍️",value:"BlogExpert",name:(0,te.Em)({id:"agent.blog_expert",defaultMessage:"Blog Expert"})},{id:"template-tweet-optimizer",emoji:"\uD83D\uDC26",value:"TweetOptimizer",name:(0,te.Em)({id:"agent.tweet_optimizer",defaultMessage:"Tweet Optimizer"})},{id:"template-email-marketer",emoji:"\uD83D\uDCE7",value:"EmailMarketer",name:(0,te.Em)({id:"agent.email_marketer",defaultMessage:"Email Marketer"})},{id:"template-course-creator",emoji:"\uD83C\uDF93",value:"CourseCreator",name:(0,te.Em)({id:"agent.course_creator",defaultMessage:"Course Creator"})},{id:"template-script-creator",emoji:"\uD83D\uDCDD",value:"ScriptCreator",name:(0,te.Em)({id:"agent.script_creator",defaultMessage:"Script Creator"})},{id:"template-screenplay-writer",emoji:"\uD83C\uDFAC",value:"ScreenplayWriter",name:(0,te.Em)({id:"agent.screenplay_writer",defaultMessage:"Screenplay Writer"})},{id:"template-proofreader",emoji:"\uD83D\uDCD6",value:"Proofreader",name:(0,te.Em)({id:"agent.proofreader",defaultMessage:"Proofreader"})},{id:"template-sales-email-coach",emoji:"\uD83D\uDCE4",value:"SalesColdEmailCoach",name:(0,te.Em)({id:"agent.sales_email_coach",defaultMessage:"Sales Cold Email Coach"})},{id:"template-code-explainer",emoji:"\uD83D\uDCBB",value:"CodeExplainer",name:(0,te.Em)({id:"agent.code_explainer",defaultMessage:"Code Explainer"})},{id:"template-creative-writing-coach",emoji:"\uD83D\uDD8B️",value:"CreativeWritingCoach",name:(0,te.Em)({id:"agent.creative_writing_coach",defaultMessage:"Creative Writing Coach"})},{id:"template-advertising-copywriter",emoji:"\uD83D\uDCDD",value:"AdvertisingCopywriter",name:(0,te.Em)({id:"agent.advertising_copywriter",defaultMessage:"Advertising Copywriter"})},{id:"template-video-script-writer",emoji:"\uD83C\uDFA5",value:"VideoScriptWriter",name:(0,te.Em)({id:"agent.video_script_writer",defaultMessage:"Video Script Writer"})},{id:"template-project-architect",emoji:"\uD83D\uDC77",value:"ProjectArchitect",name:(0,te.Em)({id:"agent.project_architect",defaultMessage:"Project Architect"})},{id:"template-ai-council",emoji:"\uD83E\uDDD1‍\uD83D\uDCBC",value:"AICouncil",name:(0,te.Em)({id:"agent.ai_council",defaultMessage:"AI Council"})},{id:"template-negotiator",emoji:"\uD83C\uDFD3",value:"Negotiator",name:(0,te.Em)({id:"agent.negotiator",defaultMessage:"Negotiator"})},{id:"template-vc-associate",emoji:"\uD83D\uDCBC",value:"VCAssociate",name:(0,te.Em)({id:"agent.vc_associate",defaultMessage:"VC Associate"})},{id:"template-books",emoji:"\uD83D\uDCDA",value:"Books",name:(0,te.Em)({id:"agent.books",defaultMessage:"Books"})},{id:"template-startup-mentor",emoji:"\uD83D\uDCDA",value:"StartupMentor",name:(0,te.Em)({id:"agent.startup_mentor",defaultMessage:"Startup Mentor"})},{id:"template-small-business",emoji:"\uD83D\uDE80",value:"SmallBusiness",name:(0,te.Em)({id:"agent.small_business",defaultMessage:"Small Business"})},{id:"template-web-development",emoji:"\uD83C\uDF10",value:"WebDevelopment",name:(0,te.Em)({id:"agent.web_development",defaultMessage:"Web Development"})},{id:"template-prompt-engineer",emoji:"\uD83E\uDD16",value:"PromptEngineer",name:(0,te.Em)({id:"agent.prompt_engineer",defaultMessage:"Prompt Engineer"})},{id:"template-article-writer",emoji:"✍️",value:"ArticleWriter",name:(0,te.Em)({id:"agent.article_writer",defaultMessage:"Article Writer"})}],euU={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"agent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]},euZ=function(e){let{spaceId:t,onExit:a}=e,n=(0,eK.Z)(),[l,r]=ev.useState(null),[o,i]=ev.useState(null),[s,d]=ev.useState(!1),c=T_((0,eI.useTheme)()),m=(0,e$.useDispatch)(),u=ev.useMemo(()=>({name:"",description:"",template:"Blank"}),[]),{register:p,setError:g,setValue:f,formState:{errors:h},setFocus:y,handleSubmit:b}=(0,sz.cI)({defaultValues:u});ev.useEffect(()=>{y("name")},[y]);let v=ev.useRef(null),k=(0,ll.x)(),E=async e=>{if(!(0,sX.isStringNotBlank)(e.name)){g("name",{message:"Name cannot be whitespaces only."});return}if(null!=o&&null!=l)throw new ei.HttpError({code:"BAD_REQUEST",message:"Should not have both emoji and avatar."});let n=(0,sX.isStringNotBlank)(e.description)?e.description:void 0;d(!0);try{let r,i;if(null!=l){let e=v.current?.getImage();if(null==e)throw new ei.HttpError({code:"BAD_REQUEST",message:"Should have avatar info."});let a=await euS(t,e);if(null==a)throw new ei.HttpError({code:"CONFLICT",message:"Upload failed"});i={type:"custom",data:{file:{...a.data}}}}else null!=o&&(i={type:"emoji",data:{value:o}});let s=hR.PE.safeParse(e.template);s.success?(r={type:"template",template:{type:s.data}},null!=i&&(r.template.avatar=i)):(r={type:"data",data:{commands:[]}},null!=i&&(r.data.avatar=i),null!=n&&(r.data.description=n)),(0,ei.assert)(null!=r);let d={clientMutationId:(0,ld.Z)(),spaceId:t,name:e.name,data:r},c=await k.mutate({mutation:euU,variables:{input:d}}),{cache:m}=k;m.evict({fieldName:"spaceAgents",args:{filterby:{spaceId:t}}}),m.gc();let u=c.data?.spaceAgentCreate?.agent?.id;u&&C(u),a()}catch(e){g("name",{message:(0,ei.getMessageFromError)(e)??"Unknown error"})}finally{d(!1)}},x=ev.useCallback(()=>{i(null),r(null),v.current&&v.current.resetImage()},[]),_=ev.useCallback(e=>{i(e),r(null),v.current&&v.current.resetImage()},[]),w=ev.useCallback(()=>{},[]),N=ev.useCallback(()=>{null!=v.current&&(r({avatarEditor:v.current}),i(null))},[]),C=e=>{e&&m(TS.actions.toggleEditSpaceAgentDialog({agentId:e}))},M=(e,t,a)=>{f("name",e),f("template",a),_(t)},S=og()("flex items-center gap-2 rounded-full border border-appcolor-300 bg-appcolor-100 px-4 py-1.5 text-sm text-textcolor-800 hover:border-appcolor-400 hover:bg-appcolor-200 peer-checked:border-primary peer-checked:bg-primary/20 peer-checked:text-primary cursor-pointer");return ev.createElement("form",{className:"flex h-full flex-col items-stretch",style:c,onSubmit:b(E)},ev.createElement("div",{className:"flex w-full flex-col gap-4 overflow-auto p-10"},ev.createElement("h1",{className:"text-lg text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.create_agent",defaultMessage:"Create agent"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.build_an_agent_and_personalize",defaultMessage:"Build and train your virtual workforce and team: Craft personas, enrich with knowledge, build custom AI commands, select tools like web browsing, and more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}})),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.avatar",defaultMessage:"Select an image or emoji for your agent, serving as a visual identifier for tasks it manages in project backgrounds."}))},ev.createElement(eY.Z,{id:"agent.avatar",defaultMessage:"Avatar"})),ev.createElement("div",{className:"w-fit"},ev.createElement(euj,{ref:v,emoji:o,onDeleteButtonClick:x,onEmojiPick:_,onImageLoadFailure:w,onImageLoadSuccess:N,hasNewImage:null!=l}))),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.name",defaultMessage:"Give your agent a distinct name for effortless recognition, especially useful in /ai slash commands within Taskade's Project Editor. A unique name simplifies interactions and personalizes your AI experience."}))},ev.createElement(eY.Z,{id:"agent.name",defaultMessage:"Name"})),h.name&&ev.createElement("div",{className:"mt-2 rounded-lg border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,h.name.message)),ev.createElement("input",{className:"flex rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",...p("name"),type:"text",required:!0,placeholder:"Agent name",autoFocus:!0})),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.select_agent",defaultMessage:"Start from scratch, or pick a pre-designed agent template with built-in commands and prompts. Remember, any agent template can be fully customized to suit your needs, even after creation."}))},ev.createElement(eY.Z,{id:"agent.select_agent",defaultMessage:"Select agent"})),ev.createElement("ul",{className:"mt-1 flex flex-wrap gap-2"},ev.createElement("li",null,ev.createElement("input",{...p("template",{required:!0}),id:"template-blank",value:"Blank",type:"radio",className:"peer hidden",onChange:()=>M("","\uD83D\uDCC4","Blank")}),ev.createElement("label",{htmlFor:"template-blank",className:S},ev.createElement("span",null,"\uD83D\uDCC4"),ev.createElement(eY.Z,{id:"agent.start_from_scratch",defaultMessage:"Blank agent"}))),euO.map(e=>{let t=n.formatMessage(e.name);return ev.createElement("li",{key:e.id},ev.createElement("input",{...p("template",{required:!0}),type:"radio",id:e.id,value:e.value,className:"peer hidden",onChange:()=>M(t,e.emoji,e.value)}),ev.createElement("label",{htmlFor:e.id,className:S},ev.createElement("span",null,e.emoji),t))})))),ev.createElement("div",{className:"mx-8 mb-8 mt-auto flex items-center justify-end border-t border-solid border-appcolor-300 py-3"},ev.createElement("button",{className:"flex items-center rounded-xl px-6 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:()=>{a()}},ev.createElement(eY.Z,{id:"agent.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{type:"submit",className:"flex h-8 items-center self-end rounded-xl bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-primary/80",disabled:s},s?ev.createElement(eI.Spinner,null):ev.createElement(eY.Z,{id:"agent.create",defaultMessage:"Create"}))))},euL=(0,e$.connect)(function(e){return e.dialogs.createSpaceAgent})(function(e){let{isOpen:t,spaceId:a}=e,n=(0,e$.useDispatch)(),l=()=>{n(TN.actions.toggleCreateSpaceAgentDialog())};return t&&null!=a?ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-3xl overflow-auto rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Translucent,close:l,isOpen:t,autofocus:!1},()=>ev.createElement(euZ,{spaceId:a,onExit:l})):null}),euB={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"publicSpaceAgent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"publicUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"medias"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created"},directives:[{kind:"Directive",name:{kind:"Name",value:"client"}}]},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMediaParts"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]},euz={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"agent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]}}]},euV=function(e){let{agent:t,size:a}=e;if(null==t.data.avatar)return ev.createElement(tn.Icon,{icon:"dd_ai"});if("emoji"===t.data.avatar.type)return ev.createElement(e1.AgentAvatar,{name:t.data.avatar.data.value,size:"sm"});if("custom"!==t.data.avatar.type)return ev.createElement(tn.Icon,{icon:"dd_ai"});let n=Td(t.data.avatar.data.file,"h_100,w_100","hdpi");return null==n?ev.createElement(tn.Icon,{icon:"dd_ai"}):ev.createElement(e1.AgentAvatar,{src:n,size:a})},euq=function(){let e=ev.useRef(null),t=ev.useRef(null),a=ev.useRef(null),[n,l]=ev.useState(!1),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:e,arrowElementRef:t,popperElementRef:a,placement:"top",visible:n}),s=(0,sz.qo)({name:"knowledgeEnabled"});return ev.createElement(ev.Fragment,null,ev.createElement("div",{...i,className:"ml-auto flex items-center",onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)}},ev.createElement(e1.Switch,{className:"pointer-events-none cursor-pointer opacity-50",checked:!0===s,onChange:()=>{}})),n&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_always_use_knowledge",defaultMessage:"To toggle this, visit the Knowledge tab."}))))},euW=function(e){let{addCommand:t,exit:a}=e,n=T_((0,eI.useTheme)()),l=(0,e$.useDispatch)(),r=ev.useMemo(()=>({commandName:"",prompt:"",isBackgroundJob:!1,searchToolEnabled:!1}),[]),[o,i]=(0,ev.useState)(""),{control:s,register:d,setError:c,formState:{errors:m},handleSubmit:u,setFocus:p}=(0,sz.cI)({defaultValues:r});ev.useEffect(()=>{p("commandName")},[p]);let g=async e=>{if(!(0,sX.isStringNotBlank)(e.commandName)){c("commandName",{message:"Name cannot be whitespaces only."});return}if(!(0,sX.isStringNotBlank)(e.prompt)){c("prompt",{message:"Prompt cannot be whitespaces only."});return}t({name:e.commandName,prompt:e.prompt,isBackgroundJob:e.isBackgroundJob,id:(0,ld.Z)()}),a()};return ev.createElement("form",{className:"flex h-full flex-col items-stretch",onSubmit:u(g),style:n},ev.createElement("div",{className:"flex w-full flex-1 flex-col gap-4 overflow-auto px-8 py-6"},ev.createElement("div",{className:"flex flex-col gap-1 pt-2"},ev.createElement("h2",{className:"text-md text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.create_agent_new_command",defaultMessage:"Create a new command"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.type_slash_command_name_to_execute_commands_in_your_projects",defaultMessage:"Type /command name to execute commands in your project. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_name",defaultMessage:"Set a single or multi-word trigger for your command, accessible via /slash commands in projects, linking to your Custom Prompt."}))},ev.createElement(eY.Z,{id:"agent.name",defaultMessage:"Name"})),m.commandName&&ev.createElement("div",{className:"mt-2 rounded border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,m.commandName.message)),ev.createElement("input",{className:"flex rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",...d("commandName"),type:"text",required:!0,placeholder:"Command"})),ev.createElement("div",{className:"mt-5 flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_prompt",defaultMessage:"Tailor the prompt to guide your agent's command, ensuring it aligns with specific tasks or queries for more effective responses."}))},ev.createElement("div",{className:"flex gap-1"},ev.createElement(eY.Z,{id:"agent.prompt",defaultMessage:"Prompt"}),ev.createElement("span",{className:"text-appcolor-500"},"(",o.length,"/",5e3,")"))),m.prompt&&ev.createElement("div",{className:"mt-2 rounded border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,m.prompt.message)),ev.createElement("div",{className:"flex flex-col rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{className:"resize-vertical bg-transparent px-3 py-3 placeholder:text-appcolor-500",...d("prompt",{onChange:e=>i(e.target.value)}),minRows:10,maxRows:20,maxLength:5e3,placeholder:"Write your command prompt...",required:!0}),ev.createElement("div",{className:"flex border-t border-solid border-appcolor-300 px-3 py-2"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>{l(co.actions.toggleAiPromptTemplatesDialog())}},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"}))))),ev.createElement("div",{className:"mt-4 flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools",defaultMessage:"Incorporate tools to expand the capabilities of your command prompts."}))},ev.createElement(eY.Z,{id:"agent.tools",defaultMessage:"Tools"})),ev.createElement("div",{className:"flex items-center gap-4 text-sm"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_background",defaultMessage:" Turn custom /agent commands into autonomous, long-running agents. This will transform your agents from basic task executors into advanced assistants."}))},ev.createElement("div",{className:"flex items-center gap-3 text-sm normal-case text-appcolor-800"},ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"agent.background_task",defaultMessage:"Background Task"}))),ev.createElement(sz.Qr,{control:s,name:"isBackgroundJob",render:e=>{let{field:t}=e;return ev.createElement(e1.Switch,{className:"ml-auto cursor-pointer",checked:t.value,onChange:t.onChange})}})),ev.createElement("div",{className:"flex items-center gap-3 text-sm text-appcolor-800"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_web_search",defaultMessage:"Enable web browsing to search automatically for the latest news and sources, and conduct more in-depth research."}))},ev.createElement("div",{className:"flex items-center gap-3 text-sm normal-case text-appcolor-800"},ev.createElement(tn.Icon,{icon:"agent_browsing"}),ev.createElement(eY.Z,{id:"agent.search_tool",defaultMessage:"Web Search"}))),ev.createElement(sz.Qr,{control:s,name:"searchToolEnabled",render:e=>{let{field:t}=e;return ev.createElement(e1.Switch,{className:"ml-auto cursor-pointer",checked:t.value,onChange:t.onChange})}}))),ev.createElement("div",{className:"mt-4 flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_settings",defaultMessage:"Configure command settings."}))},ev.createElement(eY.Z,{id:"agent.settings",defaultMessage:"Settings"})),ev.createElement("div",{className:"flex items-center gap-4 text-sm text-appcolor-800"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_use_knowledge",defaultMessage:"Enhance your AI Agent commands with knowledge loaded in the Knowledge tab."}))},ev.createElement("div",{className:"flex items-center gap-3 text-sm normal-case text-appcolor-800"},ev.createElement(tn.Icon,{icon:"agent_knowledge"}),ev.createElement(eY.Z,{id:"agent.use_knowledge",defaultMessage:"Use Knowledge"}))," "),ev.createElement(euq,null)))),ev.createElement("div",{className:"mx-8 mb-8 mt-auto flex items-center justify-end border-t border-solid border-appcolor-300 py-3"},ev.createElement("button",{className:"flex items-center rounded-xl px-6 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:()=>{a()}},ev.createElement(eY.Z,{id:"agent.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{type:"submit",className:"flex items-center self-end rounded-xl bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-primary/80 disabled:bg-primary/50 disabled:text-white/50"},ev.createElement(eY.Z,{id:"agent.create",defaultMessage:"Create"}))))},euH=function(e){let{isOpen:t,handleClose:a,addCommand:n}=e;return t?ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-3xl rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:a,isOpen:t,autofocus:!1,dialogBackdropValue:"second"},e=>{let{exit:t}=e;return ev.createElement(euW,{addCommand:n,exit:t})}):null},euG=function(e){let{command:t,editCommand:a,handleExit:n}=e,l=T_((0,eI.useTheme)()),r=(0,e$.useDispatch)(),o=ev.useMemo(()=>({commandName:t.name,prompt:t.prompt,isBackgroundJob:t.isBackgroundJob,searchToolEnabled:t.searchToolEnabled??!1}),[t.isBackgroundJob,t.name,t.prompt,t.searchToolEnabled]),{control:i,register:s,handleSubmit:d,setError:c,formState:{errors:m},setFocus:u,getValues:p}=(0,sz.cI)({defaultValues:o}),[g,f]=(0,ev.useState)(p("prompt"));ev.useEffect(()=>{u("commandName")},[u]);let h=async e=>{if(!(0,sX.isStringNotBlank)(e.commandName)){c("commandName",{message:"Name cannot be whitespaces only."});return}if(!(0,sX.isStringNotBlank)(e.prompt)){c("prompt",{message:"Prompt cannot be whitespaces only."});return}a({name:e.commandName,prompt:e.prompt,id:t.id,isBackgroundJob:e.isBackgroundJob,searchToolEnabled:e.searchToolEnabled}),n()};return ev.createElement("form",{className:"flex h-full flex-col items-stretch",style:l,onSubmit:d(h)},ev.createElement("div",{className:"flex w-full flex-1 flex-col gap-4 overflow-auto px-8 py-6"},ev.createElement("div",{className:"flex flex-col gap-1 pt-2"},ev.createElement("h2",{className:"text-md text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.create_agent_edit_command",defaultMessage:"Edit command"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.type_slash_command_name_to_execute_commands_in_your_projects",defaultMessage:"Type /command name to execute commands in your project. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_name",defaultMessage:"Set a single or multi-word trigger for your command, accessible via /slash commands in projects, linking to your Custom Prompt."}))},ev.createElement(eY.Z,{id:"agent.name",defaultMessage:"Name"})),m.commandName&&ev.createElement("div",{className:"mt-2 rounded border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,m.commandName.message)),ev.createElement("input",{className:"flex rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",...s("commandName"),type:"text",required:!0})),ev.createElement("div",{className:"mt-5 flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_prompt",defaultMessage:"Tailor the prompt to guide your agent's command, ensuring it aligns with specific tasks or queries for more effective responses."}))},ev.createElement("div",{className:"flex gap-1"},ev.createElement(eY.Z,{id:"agent.prompt",defaultMessage:"Prompt"}),ev.createElement("span",{className:"text-appcolor-500"},"(",g.length,"/",5e3,")"))),m.prompt&&ev.createElement("div",{className:"mt-2 rounded border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,m.prompt.message)),ev.createElement("div",{className:"flex flex-col rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{className:"resize-vertical bg-transparent px-3 py-3 placeholder:text-appcolor-500",...s("prompt",{onChange:e=>f(e.target.value)}),minRows:10,maxRows:20,maxLength:5e3,placeholder:"Write your command prompt...",required:!0}),ev.createElement("div",{className:"flex border-t border-solid border-appcolor-300 px-3 py-2"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>{r(co.actions.toggleAiPromptTemplatesDialog())}},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"}))))),ev.createElement("div",{className:"mt-4 flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools",defaultMessage:"Incorporate tools to expand the capabilities of your command prompts."}))},ev.createElement(eY.Z,{id:"agent.tools",defaultMessage:"Tools"})),ev.createElement("div",{className:"flex items-center gap-4 text-sm"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_background",defaultMessage:" Turn custom /agent commands into autonomous, long-running agents. This will transform your agents from basic task executors into advanced assistants."}))},ev.createElement("div",{className:"flex items-center gap-3 text-sm normal-case text-appcolor-800"},ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"agent.background_task",defaultMessage:"Background Task"}))),ev.createElement(sz.Qr,{control:i,name:"isBackgroundJob",render:e=>{let{field:t}=e;return ev.createElement(e1.Switch,{className:"ml-auto cursor-pointer",checked:t.value,onChange:t.onChange})}})),ev.createElement("div",{className:"flex items-center gap-4 text-sm"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_web_search",defaultMessage:"Enable web browsing to search automatically for the latest news and sources, and conduct more in-depth research."}))},ev.createElement("div",{className:"flex items-center gap-3 text-sm normal-case text-appcolor-800"},ev.createElement(tn.Icon,{icon:"agent_browsing"}),ev.createElement(eY.Z,{id:"agent.web_search",defaultMessage:"Web Search"}))),ev.createElement(sz.Qr,{control:i,name:"searchToolEnabled",render:e=>{let{field:t}=e;return ev.createElement(e1.Switch,{className:"ml-auto cursor-pointer",checked:t.value,onChange:t.onChange})}}))),ev.createElement("div",{className:"mt-4 flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_settings",defaultMessage:"Configure command settings."}))},ev.createElement(eY.Z,{id:"agent.settings",defaultMessage:"Settings"})),ev.createElement("div",{className:"flex items-center gap-4 text-sm"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.command_tools_use_knowledge",defaultMessage:"Enhance your AI Agent commands with knowledge loaded in the Knowledge tab."}))},ev.createElement("div",{className:"flex items-center gap-3 text-sm normal-case text-appcolor-800"},ev.createElement(tn.Icon,{icon:"agent_knowledge"}),ev.createElement(eY.Z,{id:"agent.use_knowledge",defaultMessage:"Use Knowledge"}))),ev.createElement(euq,null)))),ev.createElement("div",{className:"mx-8 mb-8 mt-auto flex items-center justify-end border-t border-solid border-appcolor-300 py-3"},ev.createElement("button",{className:"flex items-center rounded-xl px-6 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:()=>{n()}},ev.createElement(eY.Z,{id:"agent.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{type:"submit",className:"flex items-center self-end rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/80 disabled:bg-primary/50 disabled:text-white/50"},ev.createElement(eY.Z,{id:"agent.update",defaultMessage:"Update"}))))},euK=function(e){let{isOpen:t,command:a,editCommand:n,handleClose:l}=e;return t&&null!=a?ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-3xl rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:l,isOpen:t,autofocus:!1,dialogBackdropValue:"second"},e=>{let{exit:t}=e;return ev.createElement(euG,{command:a,editCommand:n,handleExit:t})}):null},euY=function(e){let{knowledgeEnabled:t,command:a,index:n,remove:l}=e,{setValue:r}=(0,sz.Gc)(),[o,i]=ev.useState(!1);return ev.createElement("div",{className:"group/delete flex items-center overflow-hidden whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 text-left text-sm hover:border-appcolor-400 hover:bg-appcolor-200"},ev.createElement("button",{type:"button",onClick:()=>{i(!0)},className:"flex shrink grow flex-col gap-1 overflow-hidden py-3 pl-4 text-left"},ev.createElement("h3",{className:"truncate font-medium text-appcolor-800"},a.name),ev.createElement("p",{className:"line-clamp-1 flex-wrap whitespace-normal break-all text-appcolor-500"},a.prompt),ev.createElement("div",{className:"mt-1 flex gap-1"},ev.createElement("div",{className:og()("flex items-center gap-1 rounded-full bg-appcolor-300 px-2 py-0.5 text-xs text-appcolor-600",{"opacity-50":!a.searchToolEnabled,grayscale:!a.searchToolEnabled})},ev.createElement(tn.Icon,{className:"shrink-0 scale-90 text-success",icon:"agent_browsing"}),ev.createElement(eY.Z,{id:"agent.web_search",defaultMessage:"Web Search"})),ev.createElement("div",{className:og()("flex items-center gap-1 rounded-full bg-appcolor-300 px-2 py-0.5 text-xs text-appcolor-600",{"opacity-50":!a.isBackgroundJob})},ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_check"}),ev.createElement(eY.Z,{id:"agent.background_task",defaultMessage:"Background Task"})),ev.createElement("div",{className:og()("flex items-center gap-1 rounded-full bg-appcolor-300 px-2 py-0.5 text-xs text-appcolor-600",{"opacity-50":!t})},ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"agent_knowledge"}),ev.createElement(eY.Z,{id:"agent.knowledge",defaultMessage:"Knowledge"})))),ev.createElement("button",{type:"button",onClick:()=>{l(n)},className:"m-2 flex shrink-0 items-center justify-center rounded-full p-2 text-danger opacity-0 transition duration-150 ease-in-out hover:bg-appcolor-400 group-hover/delete:opacity-100"},ev.createElement(tn.Icon,{icon:"agent_delete"})),o&&ev.createElement(euK,{isOpen:o,handleClose:()=>{i(!1)},command:a,editCommand:e=>{r(`commands.${n}`,e,{shouldDirty:!0})}}))},euQ=function(e){let{agent:t}=e,{control:a}=(0,sz.Gc)(),{fields:n,append:l,remove:r,update:o}=(0,sz.Dq)({name:"commands"}),[i,s]=ev.useState(!1);return ev.createElement("div",{className:e.className,role:e.role},ev.createElement("div",{className:"flex flex-col gap-1 pt-2"},ev.createElement("h1",{className:"text-md text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.commands",defaultMessage:"Commands"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.create_custom_commands_to_use_in_projects",defaultMessage:"Create custom /commands to use in projects. Enable tools per command for more refined results. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),ev.createElement("button",{type:"button",className:"mt-2 flex animate-color-rainbow items-center gap-3 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-1 pl-2 pr-3 text-sm font-semibold transition duration-300 ease-in-out hover:bg-appcolor-200",onClick:()=>{s(!0)}},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"ai_add",className:"text-appcolor-400"})),ev.createElement(eY.Z,{id:"agent.add_command",defaultMessage:"Add command"})),ev.createElement("div",{className:"mt-1 min-w-full pb-8 align-middle"},n.length>0&&ev.createElement("div",{className:"flex flex-col gap-5"},n.map((e,n)=>ev.createElement(sz.Qr,{key:e.id,control:a,render:e=>ev.createElement(euY,{command:e.field.value,knowledgeEnabled:t.data.knowledgeEnabled,index:n,remove:r,update:o}),name:`commands.${n}`})))),ev.createElement(euH,{isOpen:i,handleClose:()=>{s(!1)},addCommand:e=>{l(e)}}))},euJ=function(e){let{menuGroupDispatch:t,initialFocus:a,toneOptions:n,selectedTone:l}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eI.Menu,{className:"max-h-[50vh] overflow-y-scroll rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm",initialFocus:a,loop:!0},ev.createElement("div",{className:"my-2"},n.map(e=>ev.createElement(Up,{key:e.value,value:e.value,className:"flex max-h-7 w-60 cursor-pointer items-center justify-between border-none bg-appcolor-100 px-3 py-1.5 text-appcolor-900 outline-0 hover:bg-appcolor-300 focus:bg-appcolor-300"},e.label,l?.value===e.value&&ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_check"}))))))},euX=function(e){let{className:t,selectToneValue:a,selectedToneValue:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{o.current?.focus()},[]);(0,eI.usePopupEvents)({state:l,onCollapse:s});let d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"top-start"}),c=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),m=function(){let e=(0,eK.Z)();return[{value:"default",label:e.formatMessage({id:"default",defaultMessage:"Default"})},{value:"creative",label:e.formatMessage({id:"general.ai_chat_persona_creative",defaultMessage:"\uD83C\uDFA8 Creative"})},{value:"inspiring",label:e.formatMessage({id:"general.ai_chat_persona_inspiring",defaultMessage:"\uD83D\uDCA1 Inspiring"})},{value:"casual",label:e.formatMessage({id:"general.ai_chat_persona_casual",defaultMessage:"\uD83D\uDE0E Casual"})},{value:"confident",label:e.formatMessage({id:"general.ai_chat_tone_confident",defaultMessage:"\uD83D\uDCBC Confident"})},{value:"authoritative",label:e.formatMessage({id:"general.ai_chat_tone_authoritative",defaultMessage:"\uD83D\uDC51 Authoritative"})},{value:"friendly",label:e.formatMessage({id:"general.ai_chat_tone_friendly",defaultMessage:"\uD83D\uDE0A Friendly"})},{value:"empathetic",label:e.formatMessage({id:"general.ai_chat_tone_empathetic",defaultMessage:"\uD83D\uDC95 Empathetic"})},{value:"optimistic",label:e.formatMessage({id:"general.ai_chat_tone_optimistic",defaultMessage:"\uD83C\uDF08 Optimistic"})},{value:"formal",label:e.formatMessage({id:"general.ai_chat_tone_formal",defaultMessage:"\uD83D\uDC54 Formal"})},{value:"serious",label:e.formatMessage({id:"general.ai_chat_tone_serious",defaultMessage:"\uD83D\uDC69‍\uD83D\uDCBC Serious"})},{value:"warm",label:e.formatMessage({id:"general.ai_chat_tone_warm",defaultMessage:"\uD83D\uDD25 Warm"})},{value:"humourous",label:e.formatMessage({id:"general.ai_chat_tone_humourous",defaultMessage:"\uD83D\uDE02 Humourous"})},{value:"informal",label:e.formatMessage({id:"general.ai_chat_tone_informal",defaultMessage:"\uD83D\uDC5F Informal"})},{value:"clinical",label:e.formatMessage({id:"general.ai_chat_tone_clinical",defaultMessage:"\uD83D\uDC89 Clinical"})},{value:"playful",label:e.formatMessage({id:"general.ai_chat_tone_playful",defaultMessage:"\uD83C\uDF88 Playful"})},{value:"emotional",label:e.formatMessage({id:"general.ai_chat_tone_emotional",defaultMessage:"\uD83D\uDE2D Emotional"})},{value:"sympathetic",label:e.formatMessage({id:"general.ai_chat_tone_sympathetic",defaultMessage:"\uD83D\uDE22 Sympathetic"})},{value:"tentative",label:e.formatMessage({id:"general.ai_chat_tone_tentative",defaultMessage:"\uD83D\uDC63 Tentative"})},{value:"cold",label:e.formatMessage({id:"general.ai_chat_tone_cold",defaultMessage:"\uD83E\uDDCA Cold"})},{value:"cynical",label:e.formatMessage({id:"general.ai_chat_tone_cynical",defaultMessage:"\uD83D\uDE12 Cynical"})},{value:"ironic",label:e.formatMessage({id:"general.ai_chat_tone_ironic",defaultMessage:"\uD83D\uDE43 Ironic"})},{value:"sarcastic",label:e.formatMessage({id:"general.ai_chat_tone_sarcastic",defaultMessage:"\uD83D\uDE0F Sarcastic"})},{value:"pessimistic",label:e.formatMessage({id:"general.ai_chat_tone_pessimistic",defaultMessage:"☔ Pessimistic"})}]}(),u=ev.useMemo(()=>new Map(m.map(e=>[e.value,e])),[m]),p=null!=n?u.get(n):null,g=ev.useCallback(e=>{switch(e.type){case"Activate":{let{value:t}=e.payload;if(null==t)break;let n=u.get(t);if(null==n)break;a("default"===n.value?null:n.value),r({type:"Collapse",payload:"none"});break}case"Dismiss":r({type:"Collapse"})}},[a,u]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex cursor-pointer items-center rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 text-left hover:bg-appcolor-300",t),...c.props,type:"button"},ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col"},null==p?ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.default",defaultMessage:"Default"})):ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},p?.label))),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(euJ,{initialFocus:d.initialFocus,menuGroupDispatch:g,toneOptions:m,selectedTone:p??null})))},eu0=function(e){let{avatar:t,onAvatarChange:a}=e,n=ev.useMemo(()=>null==t||"emoji"!==t.type?null:t.data.value,[t]),l=ev.useMemo(()=>{if(null!=t)switch(t.type){case"pending":return t.data.dataURL;case"custom":return Td(t.data.file,"h_100,w_100","hdpi")??void 0;default:return}},[t]),r=ev.useRef(null),o=ev.useCallback(()=>{r.current&&r.current.resetImage(),a(null)},[a]),i=ev.useCallback(e=>{a({type:"emoji",data:{value:e}})},[a]),s=ev.useCallback(()=>{},[]),d=ev.useCallback(()=>{if(null==r.current)return;let e=r.current.getImage();null!=e&&a({type:"pending",data:e})},[a]);return ev.createElement("div",{className:e.className},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.avatar",defaultMessage:"Select an image or emoji for your agent, serving as a visual identifier for tasks it manages in project backgrounds."}))},ev.createElement(eY.Z,{id:"agent.avatar",defaultMessage:"Avatar"})),ev.createElement("div",{className:"w-fit"},ev.createElement(euj,{ref:r,emoji:n,imageURL:l,onDeleteButtonClick:o,onEmojiPick:i,onImageLoadFailure:s,onImageLoadSuccess:d,hasNewImage:null!=t&&"pending"===t.type})))},eu1=new Map(S6),eu2=function(e){let{name:t,value:a,selected:n,children:l}=e,r=(0,ev.useRef)(null),o=(0,eI.useMenuItem)({stopRef:r,name:t,value:a});return ev.createElement("button",{...o.props,className:"flex max-h-7 w-60 cursor-pointer items-center justify-between border-none bg-appcolor-100 px-3 py-1.5 text-appcolor-900 outline-0 hover:bg-appcolor-300 focus:bg-appcolor-300",type:"button"},l,n&&ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_check"}))},eu5=function(e){let{initialFocus:t,value:a}=e;return ev.createElement(eI.Menu,{className:"max-h-[50vh] overflow-y-scroll rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm",initialFocus:t,loop:!0},ev.createElement("div",{className:"my-2"},ev.createElement(eu2,{value:null,selected:null==a},"Default"),S6.map(e=>{let{name:t,locale:n}=e[1];return ev.createElement(eu2,{key:e[0],value:n,selected:n===a},t)})))},eu3=function(e){let{className:t,value:a,onSelect:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"top-start"}),d=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),c=ev.useCallback(e=>{switch(e.type){case"Activate":n(e.payload.value??null),r({type:"Collapse",payload:"none"});break;case"Dismiss":r({type:"Collapse"})}},[n]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex cursor-pointer items-center rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 text-left hover:bg-appcolor-300",t),...d.props,type:"button"},ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col"},null==a?ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.default",defaultMessage:"Default"})):ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"overflow-hidden text-ellipsis text-sm text-appcolor-600"},eu1.get(a)?.name??a))),ev.createElement(tn.Icon,{icon:"date_caret",className:"flex-none scale-90"})),l.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:r,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:c},ev.createElement(eu5,{initialFocus:s.initialFocus,value:a}))))},eu4=function(e){let{className:t,role:a}=e,{control:n,register:l,formState:{errors:r},setFocus:o,getValues:i}=(0,sz.Gc)(),s=(0,e$.useDispatch)(),[d,c]=ev.useState(i("description"));return ev.useEffect(()=>{o("name")},[o]),ev.createElement("div",{className:t,role:a},ev.createElement("div",{className:"flex flex-col gap-1 pt-2"},ev.createElement("h1",{className:"text-md text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.general",defaultMessage:"General"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.build_an_agent_and_personalize",defaultMessage:"Build and train your virtual workforce and team: Craft personas, enrich with knowledge, build custom AI commands, select tools like web browsing, and more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),ev.createElement("div",{className:"mt-4 flex w-full flex-col gap-4"},ev.createElement(sz.Qr,{control:n,name:"avatar",render:e=>{let{field:t,fieldState:a}=e;return ev.createElement(eu0,{avatar:t.value,isDirty:a.isDirty,onAvatarChange:t.onChange,className:"flex flex-col gap-2"})}}),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.name",defaultMessage:"Give your agent a distinct name for effortless recognition, especially useful in /ai slash commands within Taskade's Project Editor. A unique name simplifies interactions and personalizes your AI experience."}))},ev.createElement(eY.Z,{id:"agent.name",defaultMessage:"Name"})),r.name&&ev.createElement("div",{className:"mt-2 rounded border border-danger px-2 py-2 text-xs text-danger",role:"alert"},ev.createElement("span",null,r.name.message)),ev.createElement("input",{className:"flex rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",...l("name"),type:"text",required:!0})),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.instructions",defaultMessage:"Define the AI Agent's role, such as a Marketer, and desired response style. Detail tasks like understanding demographics, crafting campaigns, and optimizing strategies. Your guidance will shape the Agent's focus on data-driven initiatives for brand awareness, engagement, and lead generation, ensuring tailored and effective responses."}))},ev.createElement("div",{className:"flex gap-1"},ev.createElement(eY.Z,{id:"agent.instructions",defaultMessage:"Instructions"}),ev.createElement("span",{className:"text-appcolor-500"},"(",d.length,"/",1e4,")"))),ev.createElement("div",{className:"flex flex-col rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{className:"resize-vertical bg-transparent px-3 py-3 placeholder:text-appcolor-500",...l("description",{onChange:e=>c(e.target.value)}),placeholder:"Personalize your agent...",maxLength:1e4,minRows:10,maxRows:16}),ev.createElement("div",{className:"flex border-t border-solid border-appcolor-300 px-3 py-2"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>{s(co.actions.toggleAiPromptTemplatesDialog())}},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"}))))),ev.createElement("div",{className:"flex gap-2"},ev.createElement("div",{className:"flex w-full flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.tone",defaultMessage:"Choose the tone of your agent's interactions, ranging from professional and formal to casual and friendly. This setting tailors the communication style to suit your audience and context, ensuring the agent's responses align with the desired approach."}))},ev.createElement(eY.Z,{id:"agent.tone",defaultMessage:"Tone"})),ev.createElement(sz.Qr,{control:n,name:"tone",render:e=>{let{field:t}=e;return ev.createElement(euX,{className:"min-w-0 flex-1",selectedToneValue:t.value,selectToneValue:t.onChange})}}))),ev.createElement("div",{className:"mb-10 flex gap-2"},ev.createElement("div",{className:"flex w-full flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.language",defaultMessage:"Choose the language of your agent's interactions."}))},ev.createElement(eY.Z,{id:"general.language",defaultMessage:"Language"})),ev.createElement(sz.Qr,{control:n,name:"language",render:e=>{let{field:t}=e;return ev.createElement(eu3,{className:"min-w-0 flex-1",value:t.value,onSelect:t.onChange})}})))))},eu6={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentAddMediaMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentAddMediaInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentAddMedia"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"media"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceMediaParts"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceMediaParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceMedia"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}}]}},{kind:"Field",name:{kind:"Name",value:"canAskAi"}},{kind:"Field",name:{kind:"Name",value:"transcriptEmbeddingStatus"}}]}}]},eu8={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentRemoveMediaMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentRemoveMediaInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentRemoveMedia"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},eu7=function(e){let{value:t,name:a,children:n,disabled:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a});return ev.createElement("button",{className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"opacity-50":l}),...o.props},n)},eu9=function(e){let{onDelete:t,onResync:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-end"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(async e=>{if("Activate"===e.type){let{name:n}=e.payload;switch(n){case"resync":a();break;case"edit":console.log("todo: edit source");break;case"remove":t()}}o({type:"Collapse"})},[t,a]);return ev.createElement("div",null,ev.createElement("button",{...s.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),r.expanded?o({type:"Collapse"}):o({type:"Expand"})},className:"flex items-center px-2 py-1 text-appcolor-500 transition duration-150 ease-in-out hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"header_more"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(eI.Menu,{className:"flex w-48 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0},ev.createElement(eu7,{name:"resync"},ev.createElement(tn.Icon,{className:"shrink-0 scale-75",icon:"dd_restore"}),ev.createElement("span",{className:"truncate"},ev.createElement(eY.Z,{id:"ai.resync",defaultMessage:"Resync"}))),ev.createElement(eu7,{name:"remove"},ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"agent_delete"}),ev.createElement("span",{className:"truncate"},ev.createElement(eY.Z,{id:"ai.remove",defaultMessage:"Remove"})))))))},epe=function(e){let{created:t,spaceMedia:a,onDelete:n}=e,l=(0,cx.computeMediaKind)(a.data.fileDesc.mimetype),r=ev.useMemo(()=>{let e=$k(a.data.fileDesc)??"",t=(0,sX.extractFileExtension)(e),n=t.length>0?e.slice(0,-1*(t.length+1)):e;return`${n}.${t}`},[a.data.fileDesc]),o=a.data.fileDesc.extension,[i,{called:s,loading:d,error:c}]=(0,cs.D)($v),m=ev.useCallback(()=>{i({variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:a.id}}})},[a.id,i]),u=ev.useMemo(()=>{if(d)return ei.StatusCode.ACCEPTED;if(null!=c){let e=bH(c,["spaceMediaTrain"]);return console.log({error:c,graphqlError:e}),ei.StatusCode.INTERNAL_SERVER_ERROR}return a.transcriptEmbeddingStatus},[c,d,a.transcriptEmbeddingStatus]);return ev.useEffect(()=>{t&&!s&&a.transcriptEmbeddingStatus===ei.StatusCode.NOT_FOUND&&m()},[s,t,m,a.transcriptEmbeddingStatus]),ev.createElement("tr",{className:"border-b border-appcolor-300"},ev.createElement("td",{className:"text-gray-900 w-7/12 truncate whitespace-normal py-2 text-sm font-medium"},ev.createElement("div",{className:"flex gap-2 whitespace-normal pr-2"},ev.createElement(tn.Icon,{className:"h-4 w-4 flex-none",icon:"dd_project"}),ev.createElement("span",null,r))),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},ev.createElement(H_,{mediaKind:l,transcriptEmbeddingStatus:u})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},o),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 text-sm"},ev.createElement(eu9,{onDelete:n,onResync:m})))},ept=function(e){let{created:t,spaceMedia:a,onDelete:n}=e,l=(0,cx.computeMediaKind)(a.data.fileDesc.mimetype);(0,ei.assert)("webpage"===l);let[r,{loading:o,error:i,called:s}]=(0,cs.D)($v),d=ev.useCallback(()=>{r({variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:a.id}}})},[a.id,r]);ev.useEffect(()=>{t&&!s&&a.transcriptEmbeddingStatus===ei.StatusCode.NOT_FOUND&&d()},[s,t,d,a.transcriptEmbeddingStatus]);let{s3KeyOriginal:c}=a.data.fileDesc,m=(0,wo.a)(["ogp",c],async()=>{let e=`https://files.taskade.com/${c}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),u=m.data?.ogTitle,p=ev.useMemo(()=>{if(null!=u)return u;let e=(0,cx.getMediaLocationDesc)(a.data.fileDesc.id);return null==e||"webpage"!==e.type?"Webpage (Unknown)":`Webpage (${e.id})`},[u,a.data.fileDesc.id]),g=ev.useMemo(()=>{if(o)return ei.StatusCode.ACCEPTED;if(null!=i){let e=bH(i,["spaceMediaTrain"]);return console.log({error:i,graphqlError:e}),ei.StatusCode.INTERNAL_SERVER_ERROR}return a.transcriptEmbeddingStatus},[i,o,a.transcriptEmbeddingStatus]);return ev.createElement("tr",{className:"border-b border-appcolor-300"},ev.createElement("td",{className:"text-gray-900 w-7/12 truncate whitespace-normal py-2 text-sm font-medium"},ev.createElement("div",{className:"flex gap-2 whitespace-normal pr-2"},ev.createElement(tn.Icon,{className:"shrink-0 scale-75",icon:"ai_url"}),p)),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},ev.createElement(H_,{mediaKind:l,transcriptEmbeddingStatus:g})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.type.link",defaultMessage:"link"})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 text-sm"},ev.createElement(eu9,{onDelete:n,onResync:d})))},epa=function(e){let{created:t,spaceMedia:a,onDelete:n}=e,l=(0,cx.computeMediaKind)(a.data.fileDesc.mimetype);(0,ei.assert)("youtube"===l);let[r,{loading:o,error:i,called:s}]=(0,cs.D)($v),d=ev.useCallback(()=>{r({variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:a.id}}})},[a.id,r]);ev.useEffect(()=>{t&&!s&&a.transcriptEmbeddingStatus===ei.StatusCode.NOT_FOUND&&d()},[s,t,d,a.transcriptEmbeddingStatus]);let{s3KeyOriginal:c}=a.data.fileDesc,m=(0,wo.a)(["ogp",c],async()=>{let e=`https://files.taskade.com/${c}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),u=m.data?.ogTitle,p=ev.useMemo(()=>{if(null!=u)return u;let e=(0,cx.getMediaLocationDesc)(a.data.fileDesc.id);return null==e||"youtube"!==e.type?"Youtube (Unknown)":`Youtube (${e.id})`},[u,a.data.fileDesc.id]),g=ev.useMemo(()=>{if(o)return ei.StatusCode.ACCEPTED;if(null!=i){let e=bH(i,["spaceMediaTrain"]);return console.log({error:i,graphqlError:e}),ei.StatusCode.INTERNAL_SERVER_ERROR}return a.transcriptEmbeddingStatus},[i,o,a.transcriptEmbeddingStatus]);return ev.createElement("tr",{className:"border-b border-appcolor-300"},ev.createElement("td",{className:"text-gray-900 w-7/12 truncate whitespace-normal py-2 text-sm font-medium"},ev.createElement("div",{className:"flex gap-2 whitespace-normal pr-2"},ev.createElement(tn.Icon,{className:"shrink-0 scale-75",icon:"ai_youtube"}),p)),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},ev.createElement(H_,{mediaKind:l,transcriptEmbeddingStatus:g})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.type.youtube",defaultMessage:"youtube"})),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 text-sm"},ev.createElement(eu9,{onDelete:n,onResync:d})))},epn=function(e){let t=(0,ll.x)(),a=(0,wu.D)({mutationFn:async e=>{let{id:a,spaceId:n,file:l}=e,r=await OI("space_file",l.name,l.size,void 0,n);if(!r.ok)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Something went wrong. Please try again."});let o=r.payload,{s3ObjectKey:i}=await OD(l,o,l.name),s=await OS(i,o),d=await t.mutate({mutation:Hh,variables:{input:{clientMutationId:a,spaceId:n,fileDesc:{...s.data}}}});(0,ei.assert)(null!=d.data);let{clientMutationId:c,media:m}=d.data.spaceMediaCreate;return{clientMutationId:c,media:m}},onSuccess(t){let{clientMutationId:a,media:n}=t;e.onMediaCreate?.(a,n)}}),{mutate:n}=a;ev.useEffect(()=>{n(e.pendingFileUpload)},[n,e.pendingFileUpload]);let{ext:l,name:r}=function(e){let t=e.name??"",a=(0,sX.extractFileExtension)(e.name),n=a.length>0?t.slice(0,-1*(a.length+1)):t;return{base:t,ext:a,name:n}}(e.pendingFileUpload.file);return ev.createElement("tr",{className:"border-b border-appcolor-300"},ev.createElement("td",{className:"text-gray-900 w-7/12 py-2 text-sm font-medium"},ev.createElement("div",{className:"flex gap-2 whitespace-normal break-all pr-2"},a.isLoading?ev.createElement(eI.Spinner,{size:16,width:16,height:16}):null!=a.error?ev.createElement(tn.Icon,{className:"flex-none shrink-0 scale-75",icon:"dd_project"}):null,r)),ev.createElement("td",{className:"text-gray-500 w-3/12 whitespace-nowrap py-2 pr-4 text-center text-sm text-appcolor-500"},a.isLoading?ev.createElement("span",{className:"mx-auto flex w-fit rounded-full bg-appcolor-300 px-3 py-1 text-xs text-textcolor-600"},ev.createElement(eY.Z,{id:"agent.status.uploading",defaultMessage:"Uploading"})):null!=a.error?ev.createElement(HE.R,{className:"mx-auto w-fit cursor-help",tooltipContent:ev.createElement("div",{className:"max-w-xs"},(0,ei.getMessageFromError)(a.error)??ev.createElement(eY.Z,{id:"general.an_error_occurred",defaultMessage:"An error occurred"}))},ev.createElement("span",{className:"flex w-fit rounded-full bg-danger/30 px-3 py-1 text-xs text-danger"},ev.createElement(eY.Z,{id:"agent.status.error",defaultMessage:"Error"}))):null),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 pr-4 text-sm text-appcolor-500"},l),ev.createElement("td",{className:"text-gray-500 w-1/12 whitespace-nowrap py-2 text-sm"},ev.createElement("button",{className:"mx-auto text-appcolor-500 hover:text-danger",type:"button",onClick:e.onDelete},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_delete"}))))},epl=function(e){let{agent:t,className:a,role:n}=e,[l,r]=ev.useState([]),o=ev.useMemo(()=>[...Bn,...Bl].map(e=>`.${e}`).join(","),[]),i=ev.useRef(null),{control:s,watch:d}=(0,sz.Gc)(),c=d("knowledgeEnabled"),m=(0,ll.x)(),[u,p]=ev.useState({isOpen:!1}),[g,f]=ev.useState({isOpen:!1}),[h,y]=ev.useState({isOpen:!1}),b=e=>{switch(e){case"add_media":y({isOpen:!0,spaceId:t.space_id});break;case"add_file":i.current?.click();break;case"add_link":f({isOpen:!0,spaceId:t.space_id});break;case"add_youtube":p({isOpen:!0,spaceId:t.space_id})}},v=ev.useCallback(async e=>{let a=(0,ld.Z)();await m.mutate({mutation:eu6,variables:{input:{clientMutationId:a,agentId:t.id,mediaId:e.id}},optimisticResponse:{__typename:"Mutation",spaceAgentAddMedia:{__typename:"SpaceAgentAddMediaPayload",clientMutationId:a,media:e}},update:a=>{let n=a.readQuery({query:euB,variables:{id:t.id}});if(null==n||null!=n.spaceAgent.medias.edges.find(t=>t.node.id===e.id))return;let l=`${n.spaceAgent.medias.edges.length}`;n=Ml()(n,{spaceAgent:{medias:{edges:{$push:[{created:!0,cursor:l,node:e}]}}}}),a.writeQuery({query:euB,variables:{id:t.id},data:n})}})},[t.id,m]),k=ev.useCallback(async e=>{if(null==e.currentTarget.files)return;let a=e.currentTarget.files[0];null!=a&&r(e=>Ml()(e,{$push:[{id:(0,ld.Z)(),spaceId:t.space_id,file:a}]}))},[t.space_id]),E=(e,t)=>{r(t=>{let a=t.findIndex(t=>t.id===e);return -1===a?t:Ml()(t,{$splice:[[a,1]]})}),v(t)},x=async e=>{let a=(0,ld.Z)();await m.mutate({mutation:eu8,variables:{input:{clientMutationId:a,agentId:t.id,mediaId:e.id}},optimisticResponse:{__typename:"Mutation",spaceAgentRemoveMedia:{__typename:"SpaceAgentRemoveMediaPayload",clientMutationId:a}},update:a=>{let n=a.readQuery({query:euB,variables:{id:t.id}});if(null==n)return;let l=n.spaceAgent.medias.edges.findIndex(t=>t.node.id===e.id);-1!==l&&(n=Ml()(n,{spaceAgent:{medias:{edges:{$splice:[[l,1]]}}}}),a.writeQuery({query:euB,variables:{id:t.id},data:n}))}})},_=e=>{r(t=>t.filter(t=>t.id!==e))};return ev.createElement("div",{className:a,role:n},ev.createElement("div",{className:"flex flex-col pt-2"},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("h1",{className:"text-md text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.knowledge",defaultMessage:"Knowledge"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.knowledge_description",defaultMessage:"Enhance your agent's knowledge to improve its awareness and achieve better results. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}}))),ev.createElement("div",{className:"mt-4 flex items-center rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm"},ev.createElement(eY.Z,{id:"agent.enable_knowledge",defaultMessage:"Enable knowledge"}),ev.createElement(sz.Qr,{control:s,name:"knowledgeEnabled",render:e=>{let{field:t}=e;return ev.createElement(e1.Switch,{className:"ml-auto cursor-pointer",checked:t.value,onChange:t.onChange})}}))),ev.createElement("div",{className:"mt-4 flex flex-col"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.upload_files",defaultMessage:"Add knowledge by uploading files, choosing existing files from your workspace media, from web pages or YouTube transcripts."}))},ev.createElement(eY.Z,{id:"agent.add_source",defaultMessage:"Add source"})),ev.createElement("div",{className:og()("relative mt-2 flex cursor-pointer rounded-xl border border-dashed border-appcolor-400 text-appcolor-500 transition duration-300 ease-out hover:border-appcolor-500 hover:bg-appcolor-100 hover:text-appcolor-800",!c&&"pointer-events-none opacity-50",l.length>0&&"pointer-events-none")},ev.createElement("div",{className:"w-full"},ev.createElement("input",{ref:i,accept:o,onChange:k,type:"file",title:"",disabled:l.length>0,className:"absolute h-full w-full cursor-pointer opacity-0"}),ev.createElement("div",{className:"flex h-16 w-full items-center justify-center gap-x-2 text-sm"},l.length>0?ev.createElement(ev.Fragment,null,ev.createElement(eI.Spinner,{width:20,height:20,size:20}),ev.createElement(eY.Z,{id:"agent.drag_document_here_or_select_to_upload",defaultMessage:"Drag file here or select to upload (.pdf, .csv, .txt)"})):ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_upload"}),ev.createElement(eY.Z,{id:"agent.drag_document_here_or_select_to_upload",defaultMessage:"Drag file here or select to upload (.pdf, .csv, .txt)"}))))),ev.createElement("div",{className:"mt-2 flex gap-2"},ev.createElement("button",{onClick:()=>b("add_media"),className:og()("flex w-full items-center gap-3 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-3 py-3 text-left hover:border-appcolor-400 hover:bg-appcolor-200",(!c||l.length>0)&&"pointer-events-none opacity-50")},ev.createElement(tn.Icon,{className:"shrink-0 animate-color-rainbow",icon:"ai_media"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium text-moving-rainbow flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.add_media",defaultMessage:"Add Media"})))),ev.createElement("button",{onClick:()=>b("add_link"),className:og()("flex w-full items-center gap-3 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-3 py-3 text-left hover:border-appcolor-400 hover:bg-appcolor-200",(!c||l.length>0)&&"pointer-events-none opacity-50")},ev.createElement(tn.Icon,{className:"shrink-0 animate-color-rainbow",icon:"share_link"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium text-moving-rainbow flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.add_link",defaultMessage:"Add Link"})))),ev.createElement("button",{onClick:()=>b("add_youtube"),className:og()("flex w-full items-center gap-3 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-3 py-3 text-left hover:border-appcolor-400 hover:bg-appcolor-200",(!c||l.length>0)&&"pointer-events-none opacity-50")}," ",ev.createElement(tn.Icon,{className:"shrink-0 animate-color-rainbow text-primary",icon:"ai_youtube"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium text-moving-rainbow flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.add_youtube",defaultMessage:"Add Youtube"})))))),ev.createElement("div",{className:og()("mt-2 flex flex-col gap-2",!c&&"pointer-events-none opacity-50")},ev.createElement("div",{className:"overflow-x-auto"},ev.createElement("table",{className:"min-w-full table-auto"},ev.createElement("thead",{className:"border-b border-appcolor-300"},ev.createElement("tr",null,ev.createElement("th",{className:"min-w-7/12 py-3 text-left text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.filename",defaultMessage:"Enhance your agent's knowledge with documents, links, or video transcripts."}))},ev.createElement(eY.Z,{id:"agent.title",defaultMessage:"Title"}))),ev.createElement("th",{className:"min-w-3/12 py-3 pr-4 text-center text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.status",defaultMessage:"Only 'Trained' knowledge is accessible by the agent."}))},ev.createElement(eY.Z,{id:"agent.status",defaultMessage:"Status"}))),ev.createElement("th",{className:"min-w-1/12 py-3 pr-4 text-left text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.type",defaultMessage:"Knowledge types can be documents, links, or video transcripts."}))},ev.createElement(eY.Z,{id:"agent.type",defaultMessage:"Type"}))),ev.createElement("th",{className:"min-w-1/12 py-3 text-left text-xs font-medium uppercase tracking-wider text-appcolor-500"}))),ev.createElement("tbody",null,ts()(t.medias.edges)&&ev.createElement("tr",null,ev.createElement("td",{colSpan:4},ev.createElement("div",{className:"flex py-3 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.you_have_not_added_any_sources_to_your_knowledge_base_please_add_documents_links_or_youtube_transcriptions",defaultMessage:"You have not added any sources to your knowledge base. Please add documents, links, or YouTube transcriptions."})))),t.medias.edges.map(e=>{let{created:t,node:a}=e,n=(0,cx.computeMediaKind)(a.data.fileDesc.mimetype);return"webpage"===n?ev.createElement(ept,{key:a.id,created:t,spaceMedia:a,onDelete:()=>x(a)}):"youtube"===n?ev.createElement(epa,{key:a.id,created:t,spaceMedia:a,onDelete:()=>x(a)}):ev.createElement(epe,{key:a.id,created:t,spaceMedia:a,onDelete:()=>x(a)})}),l.map(e=>ev.createElement(epn,{key:e.id,pendingFileUpload:e,onMediaCreate:E,onDelete:()=>_(e.id)})))))),ev.createElement(HD,{state:h,onClose:()=>{y({isOpen:!1})},onSelectMedia:v}),ev.createElement(Hv,{state:g,onClose:()=>{f({isOpen:!1})},onSelectMedia:v}),ev.createElement(H$,{state:u,onClose:()=>{p({isOpen:!1})},onSelectMedia:v}))},epr=function(e){let{hasUnsavedChanges:t,state:a,send:n}=e,l=(0,eK.Z)(),r=ev.useMemo(()=>l.formatMessage({id:"flow.you_have_unsaved_changes",defaultMessage:"You have unsaved changes, are you sure you want to leave?"}),[l]);ev.useEffect(()=>{function e(e){t&&e.preventDefault()}return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[r,t]);let o=a.matches("entered.confirming");return ev.useEffect(()=>{o&&(window.confirm(r)?n("CONFIRM"):n("CANCEL"))},[r,o,n]),ev.createElement(eF.NL,{message:()=>!t||r})},epo=[{name:"general",messageDescriptor:(0,te.Em)({id:"agent.general",defaultMessage:"General"}),iconName:"agent_edit"},{name:"tools",messageDescriptor:(0,te.Em)({id:"agent.tools",defaultMessage:"Tools"}),iconName:"agent_tools"},{name:"knowledge",messageDescriptor:(0,te.Em)({id:"agent.knowledge",defaultMessage:"Knowledge"}),iconName:"agent_knowledge"},{name:"commands",messageDescriptor:(0,te.Em)({id:"agent.commands",defaultMessage:"Commands"}),iconName:"agent_commands"}],epi=function(e){let{selected:t,tab:a,role:n,onClick:l}=e;return ev.createElement("div",{role:n,onClick:l,className:og()(t&&"bg-appcolor-200","flex cursor-pointer items-center justify-items-stretch gap-3 rounded-xl px-3 py-1.5 text-sm hover:bg-appcolor-200")},ev.createElement(tn.Icon,{icon:a.iconName,className:"flex-none"}),ev.createElement("span",{className:"w-full overflow-hidden text-ellipsis"},ev.createElement(eY.Z,a.messageDescriptor)))},eps=function(e){return ev.createElement(eI.TabList,e,epo.map(e=>ev.createElement(epi,{key:e.name,tab:e,value:e.name})))},epd={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PublicSpaceAgentUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PublicSpaceAgentUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicSpaceAgentUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"agent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"publicSpaceAgent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"publicUrl"}}]}}]}}]}}]}}]},epc=function(e){let{isCopied:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:r});return ev.createElement(ev.Fragment,null,ev.createElement("div",{...d,onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},className:"w-fit cursor-pointer"},e.children),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},t?ev.createElement(eY.Z,{id:"agent.copy_link",defaultMessage:"Copy link"}):ev.createElement(eY.Z,{id:"agent.copied",defaultMessage:"Copied!"})))},epm=function(e){let{agent:t,style:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(null),[i,s]=ev.useState(!1),[d,{loading:c}]=(0,cs.D)(epd);ev.useEffect(()=>{if(null==r)return;let e=new(hF())(r);return e.on("success",()=>{s(!0)}),()=>{e.destroy()}},[r,i,s]);let[m,u]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),p=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:m,placement:"bottom-end"}),g=(0,eI.useMenuButton)({ref:n,state:m,dispatch:u}),f=async e=>{let a=(0,ld.Z)();await d({variables:{input:{clientMutationId:a,agentId:t.id,isEnabled:e}}})};return ev.createElement("div",null,ev.createElement("button",{...g.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),m.expanded?u({type:"Collapse"}):u({type:"Expand"})},className:"flex items-center gap-1 whitespace-nowrap rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 px-4 py-1.5 text-sm font-medium transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-0"},ev.createElement(tn.Icon,{icon:"embed_open"}),ev.createElement(eY.Z,{id:"agent.share",defaultMessage:"Share"})),m.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:u,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u({type:"Collapse"})}},ev.createElement("div",{className:"flex w-80 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 px-4 py-5"},ev.createElement("div",{className:"flex w-full flex-col",style:a},ev.createElement("div",{className:"flex items-center rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-3 py-2 text-sm"},ev.createElement("div",{className:"flex items-center gap-2"},ev.createElement(eY.Z,{id:"agent.public_access",defaultMessage:"Public access"}),ev.createElement("span",{className:"ml-auto flex h-5 items-center rounded-full bg-appcolor-200 px-2 text-xs"},ev.createElement(eY.Z,{id:"agent.beta",defaultMessage:"Beta"}))),ev.createElement(e1.Switch,{className:"ml-auto cursor-pointer",checked:null!=t.publicSpaceAgent,onChange:()=>f(null==t.publicSpaceAgent)})),null!=t.publicSpaceAgent?ev.createElement("div",null,ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.agent_link",defaultMessage:"Use the agent share link to publish and distribute your agent outside your team or workspace, facilitating broader sharing and access."}))},ev.createElement("div",{className:"mb-2 mt-4"},ev.createElement(eY.Z,{id:"agent.agent_link",defaultMessage:"Agent link"}))),ev.createElement("div",{className:"mt-1 flex items-center rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 text-sm"},ev.createElement("div",{className:"flex flex-grow items-center gap-2 px-3"},ev.createElement("input",{className:"w-full truncate border-0 bg-transparent py-2 shadow-transparent",type:"text",value:t.publicSpaceAgent.publicUrl,disabled:!0})),ev.createElement(epc,{isCopied:i},ev.createElement("div",{ref:o,"data-clipboard-action":"copy","data-clipboard-text":t.publicSpaceAgent.publicUrl,className:"mr-2 cursor-pointer transition duration-150 ease-in-out hover:text-appcolor-500"},ev.createElement(tn.Icon,{className:"mr-1",icon:"embed_copy"})))),ev.createElement("button",{className:"mt-2 flex w-full items-center justify-center rounded-xl bg-primary py-1.5 text-sm text-white transition duration-150 ease-in-out hover:bg-primary/80",onClick:()=>{null!=t.publicSpaceAgent&&window.open(t.publicSpaceAgent.publicUrl,"_blank","noopener,noreferrer")}},ev.createElement(tn.Icon,{className:"mr-1",icon:"embed_open"}),ev.createElement(eY.Z,{id:"agent.view_agent",defaultMessage:"View agent"}))):null,c&&ev.createElement(eI.Spinner,null)))))},epu=function(e){let{className:t,role:a,onClick:n}=e;return ev.createElement("div",{className:t,role:a},ev.createElement("div",{className:"flex items-end pt-2"},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("h1",{className:"text-md text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.tools",defaultMessage:"Tools"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.tools_description",defaultMessage:"Enhance your agent with tools for comprehensive data gathering and preprocessing inside commands. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}})))),ev.createElement("div",{className:"mt-4 flex flex-col gap-2"},ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement("button",{onClick:n,className:"flex items-center gap-4 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-3 text-left hover:border-appcolor-400 hover:bg-appcolor-200"},ev.createElement(tn.Icon,{className:"shrink-0 text-success",icon:"agent_browsing"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.web_search",defaultMessage:"Web Search"})),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.can_be_enabled_in_commands_to_access_information_from_the_web",defaultMessage:"Can be enabled with each commands to access information from the web."})))),ev.createElement("div",{className:"flex items-center gap-4 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-3"},ev.createElement(lT._d,{className:"shrink-0"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.wolfram_alpha",defaultMessage:"WolframAlpha"}),ev.createElement("span",{className:"ml-2 flex h-5 items-center rounded-full bg-appcolor-200 px-2 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"ai.coming_soon",defaultMessage:"Coming soon"}))),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.use_wolframalpha_state_of_the_art_computational_intelligence_engine",defaultMessage:"Use WolframAlpha's state-of-the-art computational intelligence engine."})))),ev.createElement("div",{className:"flex items-center gap-4 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-3"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"dd_date"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.addons",defaultMessage:"Add-ons"}),ev.createElement("span",{className:"ml-2 flex h-5 items-center rounded-full bg-appcolor-200 px-2 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"ai.coming_soon",defaultMessage:"Coming soon"}))),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.use_natural_language_to_dynamically)add)dates_assign_tasks_and_other_addons",defaultMessage:"Use natural language to dynamically add dates, assign tasks, and other add-ons."})))))))},epp=function(e){let{agent:t,exit:a,state:n,send:l,tab:r}=e,o=(0,e$.useDispatch)(),i=T_((0,eI.useTheme)()),[s,d]=ev.useState(r),c=ev.useMemo(()=>({name:t.name,description:t.data.description??"",persona:t.data.persona??null,tone:t.data.tone??null,avatar:t.data.avatar??null,commands:t.data.commands,knowledgeEnabled:t.data.knowledgeEnabled??!1,language:t.data.language??null}),[t.data.avatar,t.data.commands,t.data.description,t.data.knowledgeEnabled,t.data.language,t.data.persona,t.data.tone,t.name]),m=(0,sz.cI)({defaultValues:c}),{isSubmitting:u,isDirty:p,dirtyFields:g}=m.formState,f=(0,ll.x)();ev.useEffect(()=>{p?l({type:"BLOCK",payload:{source:"dirty"}}):l({type:"UNBLOCK",payload:{source:"dirty"}})},[p,l]);let h=async e=>{if(!p)return;if(g.name&&!(0,sX.isStringNotBlank)(e.name)){m.setError("name",{message:"Name cannot be whitespaces only."});return}let n=t.data;if(g.avatar){if(null!=e.avatar){if("pending"===e.avatar.type){let a=await euS(t.space_id,e.avatar.data);if(null==a)throw new ei.HttpError({code:"CONFLICT",message:"receipt should not be null"});n=Ml()(n,{avatar:{$set:{type:"custom",data:{file:a.data}}}})}else n=Ml()(n,{avatar:{$set:e.avatar}})}else n=Ml()(n,{$unset:["avatar"]})}g.description&&(n=Ml()(n,(0,sX.isStringNotBlank)(e.description)?{description:{$set:e.description}}:{$unset:["description"]})),g.persona&&(n=Ml()(n,null!=e.persona?{persona:{$set:e.persona}}:{$unset:["persona"]})),g.tone&&(n=Ml()(n,null!=e.tone?{tone:{$set:e.tone}}:{$unset:["tone"]})),g.knowledgeEnabled&&(n=Ml()(n,e.knowledgeEnabled?{knowledgeEnabled:{$set:!0}}:{$unset:["knowledgeEnabled"]})),g.language&&(n=Ml()(n,e.language?{language:{$set:e.language}}:{$unset:["language"]})),g.commands&&(n=Ml()(n,{commands:{$set:e.commands}}));let r={input:{clientMutationId:(0,ld.Z)(),spaceId:t.space_id,id:t.id,name:e.name,data:n}};await f.mutate({mutation:euz,variables:r}),l({type:"UNBLOCK",payload:{source:"dirty"}}),a()},y=m.handleSubmit(h),b=async e=>{e.stopPropagation(),await y(),o(Uy.actions.toggleSpaceAgentChatDialog({agent:t}))};return ev.createElement(sz.RV,m,ev.createElement("div",{className:"flex h-full flex-col items-stretch",style:i},ev.createElement("div",{className:"flex h-14 flex-none items-center justify-between border-b border-solid border-appcolor-300 px-4 py-2 text-sm"},ev.createElement("div",{className:"flex items-center gap-2 pl-1.5"},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(euV,{agent:t,size:"sm"})),t.name),ev.createElement("div",{className:"flex items-center gap-2"},ev.createElement("button",{type:"button",className:"flex items-center whitespace-nowrap rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 px-4 py-1.5 text-sm font-medium transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-0",onClick:b},ev.createElement(tn.Icon,{className:"mr-2 scale-90 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.chat",defaultMessage:"Chat"}))),ev.createElement(epm,{agent:t,onExit:a,style:i}))),ev.createElement("div",{className:"flex gap-5 overflow-hidden"},ev.createElement("div",{className:"flex w-3/12 flex-col py-4 pl-3"},ev.createElement(eps,{className:"flex flex-col gap-y-1",value:s,onChange:d}),ev.createElement("div",{className:"mt-4 flex flex-col"},ev.createElement(e1.Overline,{className:"pl-3"},ev.createElement(eY.Z,{id:"agent.discover",defaultMessage:"Discover"})),ev.createElement("div",{onClick:()=>{o(co.actions.toggleAiPromptTemplatesDialog())},className:"mt-1 flex cursor-pointer items-center justify-items-stretch gap-3 rounded-xl px-3 py-1.5 text-sm hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"flex-none"}),ev.createElement("span",{className:"w-full overflow-hidden text-ellipsis"},ev.createElement(eY.Z,{id:"agent.prompt_templates",defaultMessage:"Prompt Templates"}))))),ev.createElement(eI.TabPanelSwitch,{className:"flex w-9/12 flex-col gap-4 overflow-y-auto pr-5 pt-3",value:s},ev.createElement(eu4,{value:"general",agent:t}),ev.createElement(epu,{value:"tools",agent:t,onClick:()=>d("commands"),onExit:a}),ev.createElement(epl,{value:"knowledge",agent:t,onExit:a}),ev.createElement(euQ,{value:"commands",agent:t,onExit:a}))),ev.createElement("div",{className:"mt-auto flex gap-5 pr-5"},ev.createElement("div",{className:"flex w-4/12"}),ev.createElement("div",{className:"flex w-8/12 items-center justify-end gap-1 border-t border-solid border-appcolor-300 py-5"},ev.createElement("button",{className:"flex items-center rounded-xl px-4 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",type:"button",onClick:()=>{a()}},ev.createElement(eY.Z,{id:"agent.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{type:"button",className:"flex items-center rounded-xl px-4 py-2 text-sm font-medium text-appcolor-500 hover:text-appcolor-800",onClick:b},ev.createElement(eY.Z,{id:"agent.preview",defaultMessage:"Preview"})),ev.createElement("button",{type:"submit",className:"flex h-8 items-center self-end rounded-xl border border-solid border-transparent bg-primary px-6 py-2 text-sm font-medium text-white transition duration-150 ease-in-out hover:bg-primary/80 disabled:border-appcolor-400 disabled:bg-appcolor-300 disabled:text-appcolor-500",disabled:u||!p,onClick:y},u?ev.createElement("div",{className:"scale-75"},ev.createElement(eI.Spinner,null)):ev.createElement(eY.Z,{id:"agent.update",defaultMessage:"Update"}))))),ev.createElement(epr,{hasUnsavedChanges:p,state:n,send:l,exit:a}))},epg=function(e){let{agentId:t,...a}=e,n=og()("flex h-full items-center justify-center"),{data:l,loading:r,error:o}=(0,eB.a)(euB,{variables:{id:t}});if(r)return ev.createElement("div",{className:n},ev.createElement(eI.Spinner,null));if(null!=o||null==l){let e=(0,ei.getMessageFromError)(o)??"Unknown Error";return ev.createElement("div",{className:n},e)}let i=l.spaceAgent;return ev.createElement(epp,{agent:i,...a})},epf=(0,e$.connect)(function(e){return e.dialogs.editSpaceAgent})(function(e){let{isOpen:t,agentId:a}=e,n=e.tab??"general",l=(0,e$.useDispatch)();return t&&null!=a?ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-5xl rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Translucent,close:()=>{l(TS.actions.toggleEditSpaceAgentDialog())},isOpen:t,autofocus:!1},e=>ev.createElement(epg,{agentId:a,tab:n,...e})):null}),eph="AI_DOCUMENT",epy="AI_SPREADSHEET",epb="MARKDOWN",epv="TODOIST",epk="DYNALIST",epE="WORKFLOWY",epx="ActionItem",ep_="create_project",epw=(0,la.ZP)` + mutation ProjectsCreateWithTaskast($input: ProjectsCreateWithTaskastInput!) { + projectsCreateWithTaskast(input: $input) { + clientMutationId + trees + spaceId + documents { + edges { + node { + id + } + } + } + } + } +`;function epN(e){return ev.useCallback(t=>{t.data.action.itemType===ep_&&e()},[e])}function epC(){return[{type:"section",label:"actions",items:[{label:"Create Project",itemType:ep_}].map(e=>{let{label:t,itemType:a}=e;return{label:t,values:[t],data:{action:e},itemType:a,render:epx}})}]}let epM={isUploading:!1,isAnalyzing:!1,isAllowedToUpload:!0,uploadError:null,fileName:null,errorMessage:null},epS=(e,t)=>{switch(t.type){case"start_upload":{let{fileName:a}=t.payload;if(0===a.length)return e;return{...e,isUploading:!0,isAllowedToUpload:!1,errorMessage:null}}case"upload_error":{let{message:a}=t.payload;if(0===a.length)return e;return{...e,isUploading:!1,errorMessage:a,isAllowedToUpload:!0}}case"upload_complete":return{...e,isUploading:!1,isAnalyzing:!0};case"analysis_complete":return{...e,isAnalyzing:!1};case"analysis_error":{let{message:a}=t.payload;return{...e,isAnalyzing:!1,errorMessage:a,isAllowedToUpload:!0}}}};function epI(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:epM;return ev.useReducer(epS,e)}let epD=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("bg-moving-rainbow relative mx-3 flex cursor-pointer items-center rounded px-4 py-2 text-sm hover:bg-appcolor-200",t.focused&&"bg-appcolor-200")},ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_newtemplate"}),ev.createElement("span",{className:"pl-2.5"},t.label))},epT=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-9100b3b-0"})` + text-align: center; + border-radius: 20px; + padding: 1.25rem 1.875rem 1.875rem; + min-width: 480px !important; + max-width: 480px !important; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,ep$=eL.default.h2.withConfig({displayName:"styled__Title",componentId:"sc-9100b3b-1"})` + font-size: 1rem; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; + text-align: center; + margin-bottom: 0.25rem; +`,epP=eL.default.p.withConfig({displayName:"styled__ImportDescription",componentId:"sc-9100b3b-2"})` + ${e1.UiTypography.sm}; + padding-bottom: 1.25rem; + color: ${e=>e.theme.appColors.hex(50)}; + text-align: center; + + & > a { + margin-left: 4px; + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,epF=eL.default.p.withConfig({displayName:"styled__Description",componentId:"sc-9100b3b-3"})` + ${e1.UiTypography.sm}; + margin-bottom: 1.875rem; + color: ${e=>e.theme.appColors.hex(40)}; + text-align: center; + + & > a { + margin-left: 4px; + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,epA=eL.default.textarea.withConfig({displayName:"styled__Textarea",componentId:"sc-9100b3b-4"})` + ${e1.UiTypography.sm}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + margin-bottom: 20px; + padding: 12px; + width: 100%; + color: ${e=>e.theme.textColors.hex(10)}; + ::-webkit-input-placeholder { + color: ${e=>e.theme.appColors.hex(50)}; + } + ::placeholder { + color: ${e=>e.theme.appColors.hex(50)}; + } + background: ${e=>e.theme.appColors.hex(90)}; + :focus { + border-color: ${e=>e.theme.appColors.hex(60)}; + } +`,epR=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-9100b3b-5"})` + ${e1.UiTypography.sm}; + font-weight: 500; + padding: 14px 16px; + color: #fff; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + border-radius: 10px; + transition: background-color 120ms ease-in-out; + width: 100%; + + &:hover { + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &:disabled { + background: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(50)}; + cursor: not-allowed; + } +`,epj=eL.default.div.withConfig({displayName:"styled__ImportButtonsRow",componentId:"sc-9100b3b-6"})` + padding: 1.25rem 1.875rem 0 1.875rem; + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; +`,epO=eL.default.button.withConfig({displayName:"styled__ImportButton",componentId:"sc-9100b3b-7"})` + display: flex; + ${e1.UiTypography.sm}; + border: 2px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + flex: 1; + padding: 0.5rem 0.75rem; + align-items: center; + justify-content: flex-start; + color: ${e=>e.theme.appColors.hex(10)}; + svg { + margin-right: 10px; + width: 30px; + } + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + background: ${e=>e.theme.appColors.hex(90)}; + } +`,epU=eL.default.a.withConfig({displayName:"styled__ImportLink",componentId:"sc-9100b3b-8"})` + display: flex; + ${e1.UiTypography.sm}; + border: 2px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + padding: 0.5rem 0.75rem; + align-items: center; + justify-content: flex-start; + color: ${e=>e.theme.appColors.hex(10)}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + background: ${e=>e.theme.appColors.hex(90)}; + } + + svg { + margin-right: 10px; + } +`;eL.default.div.withConfig({displayName:"styled__FetchLoading",componentId:"sc-9100b3b-9"})` + padding: 0 0 24px; +`,eL.default.div.withConfig({displayName:"styled__ImportLoading",componentId:"sc-9100b3b-10"})` + padding: 4px 0; +`;let epZ=eL.default.div.withConfig({displayName:"styled__ErrorWrapper",componentId:"sc-9100b3b-11"})` + margin-bottom: 1rem; + text-align: start; +`,epL=ev.forwardRef(function(e,t){let{fileType:a,onFileAccepted:n,onFileRejected:l}=e,r=ev.useRef(0),o=ev.useCallback(e=>{e.preventDefault(),r.current+=1},[]),i=ev.useCallback(e=>{e.preventDefault(),r.current-=1},[]),s=ev.useCallback(e=>{e.preventDefault()},[]),d=ev.useCallback(e=>{e.preventDefault(),r.current=0},[]);ev.useEffect(()=>(document.addEventListener("dragenter",o),document.addEventListener("dragleave",i),document.addEventListener("dragover",s),document.addEventListener("drop",d),()=>{r.current=0,document.removeEventListener("dragenter",o),document.removeEventListener("dragleave",i),document.removeEventListener("dragover",s),document.removeEventListener("drop",d)}),[o,i,s,d]);let c=ev.useCallback(e=>{for(let t of(r.current=0,e))n(t)},[n]),m=ev.useCallback(e=>{for(let t of e)l(t)},[l]),{getRootProps:u,getInputProps:p,isDragActive:g,open:f}=(0,OM.u)({onDrop:c,onDropRejected:m,multiple:!0,accept:"document"===a?Bn.map(e=>`.${e}`).join(","):Bl.map(e=>`.${e}`).join(","),noDragEventsBubbling:!0});return ev.useImperativeHandle(t,()=>({open:()=>{f()}}),[f]),ev.createElement("div",{className:og()("flex cursor-pointer rounded-xl border-2 border-dashed border-appcolor-300 text-appcolor-500 transition duration-300 ease-out hover:border-appcolor-500 hover:bg-appcolor-100 hover:text-appcolor-800",g&&"border-appcolor-500 bg-appcolor-100 text-appcolor-800")},ev.createElement("div",{className:"w-full",...u()},ev.createElement("input",p()),ev.createElement("div",{className:"text-md flex h-20 w-full items-center justify-center gap-x-4"},ev.createElement(tn.Icon,{icon:"dd_upload"}),"document"===a?ev.createElement(eY.Z,{id:"general.drag_document_here_or_select_to_upload",defaultMessage:"Drag file here or select to upload (.pdf, .docx, .txt)"}):ev.createElement(eY.Z,{id:"general.drag_spreadsheet_here_or_select_to_upload",defaultMessage:"Drag file here or select to upload (.csv)"}))))}),epB=eL.default.div.withConfig({displayName:"AiDocumentDialog__AiContainer",componentId:"sc-21f83491-0"})` + position: relative; + z-index: 1; + + @media (min-width: 768px) { + width: 40rem; + } + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,epz={[epx]:e=>ev.createElement(epD,{morseChildProps:e})},epV=function(e){let{space:t,exit:a}=e,[n,l]=epI(),r=(0,eF.k6)(),{id:o}=t,[i,s]=ev.useState(null),d=ev.useRef(null),[c,m]=ev.useState(null),u=ev.useRef(null),[p,{data:g,error:f,loading:h}]=(0,cs.D)(epw,{refetchQueries:["SpaceDocuments"]}),[y,b]=ev.useState(null);ev.useEffect(()=>{null!=i&&i.focus()},[i]);let v=(0,ll.x)(),k=epC(),E=epN(()=>{if(null==c)return;let e=(0,lo.markdownTextToTaskastFragment)(c,{shouldRemoveCodeFence:!0}),t=JSON.stringify((0,lo.fragmentToRoot)(e));p({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:o,trees:[t]}}})}),[x,{loading:_,error:w}]=$N(ev.useCallback(e=>{l({type:"analysis_complete"}),e.text.length>1e3?m(e.text.slice(e.text.length-1e3)):m(e.text),null!=u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]),ev.useCallback(e=>{l({type:"analysis_complete"}),m(e.text),null!=u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]));D$({error:y||w,onError:a});let N=ev.useRef(null);ev.useEffect(()=>{if(null!=w&&l({type:"analysis_error",payload:{message:w.message}}),null!=f||null==g)return;let e=g.projectsCreateWithTaskast.documents.edges?.[0].node?.id;null!=e&&(a(),r.push(`/d/${e}`))},[g,f,w,r,a,l]);let C=ev.useCallback(async e=>{l({type:"start_upload",payload:{fileName:e.name}});let t=null;try{let a=await OI("space_file",e.name,e.size,void 0,o);if(!a.ok)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Something went wrong. Please try again."});let n=a.payload,{s3ObjectKey:r}=await OD(e,n,e.name);t=await OS(r,n);let i=await v.mutate({mutation:Hh,variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:o,fileDesc:{...t.data}}}}),s=i.data?.spaceMediaCreate.media;(0,ei.assert)(null!=s),l({type:"upload_complete"}),await v.mutate({mutation:$v,variables:{input:{clientMutationId:(0,ld.Z)(),spaceMediaId:s.id}}}),l({type:"analysis_complete"}),await x("/web-api/ai/import-document",{method:"POST",credentials:"same-origin",body:JSON.stringify({fileId:t.data.id,spaceId:o}),headers:{"Content-Type":"application/json"}})}catch(t){let e;e=t instanceof ei.TaskadeError?t.message:"There was an error importing the document. Please try again.",b(t),l({type:"upload_error",payload:{message:e}});return}if(null==t){l({type:"upload_error",payload:{message:"There was an error importing the document. Please try again."}});return}},[v,l,x,o]),M=ev.useCallback(async e=>{await C(e)},[C]),S=ev.useCallback(e=>{l({type:"upload_error",payload:{message:"File not supported. Only .pdf, .docx and .txt files are supported."}})},[l]);return ev.createElement(epB,{className:"rounded-3xl bg-appcolor-100"},ev.createElement("div",{className:"w-full rounded-xl p-4"},ev.createElement("div",{className:"rounded-t-xl border-[1px] border-b-0 border-appcolor-300 bg-appcolor-100 py-5"},ev.createElement("div",{className:"flex flex-col items-center justify-center"},ev.createElement(ep$,null,ev.createElement(eY.Z,{id:"general.import_document_with_ai",defaultMessage:"Summarize Document with AI"})),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.upload_files_to_generate_a_project",defaultMessage:"Upload files to generate a project."})))),ev.createElement("div",{className:"w-full overflow-clip rounded-b-xl border-[1px] border-appcolor-300 p-4"},f&&ev.createElement(rO,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."})),null!=n.errorMessage&&ev.createElement("div",{className:"mb-3"},ev.createElement(rO,{className:"!break-normal"},n.errorMessage)),null!=c&&ev.createElement("div",{ref:s,onKeyDownCapture:e=>{e.key===eI.KeyboardKeys.Enter&&N.current?.activateCurrentItem()},tabIndex:0},ev.createElement("div",{ref:u,className:"max-h-[60vh] overflow-y-auto border-b-2 border-appcolor-200 px-5 py-4 text-left"},ev.createElement(DA,{value:c??"",shouldRemoveCodeFence:!0})),!_&&null!=c&&!h&&ev.createElement("div",null,ev.createElement(tT,{ref:N,term:"",data:k,renderMap:epz,onActivate:E}))),n.isUploading&&ev.createElement("div",{className:"flex h-16 cursor-pointer items-center justify-center gap-x-3 rounded-xl border-2 border-solid border-appcolor-300 bg-appcolor-100 pl-4 pr-4 text-appcolor-500"},ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement("div",{className:"flex flex-[2] flex-col"},null!=n.fileName&&ev.createElement("span",{className:"text-appcolor-800"},n.fileName),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.uploading",defaultMessage:"Uploading"}),"…")),ev.createElement("div",{className:"flex"},ev.createElement(eI.Spinner,null))),n.isAnalyzing&&ev.createElement("div",{className:"flex h-16 cursor-pointer items-center justify-center gap-x-3 rounded-xl border-2 border-solid border-appcolor-300 bg-appcolor-100 pl-4 pr-4 text-appcolor-500"},ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement("div",{className:"flex flex-[2] flex-col"},null!=n.fileName&&ev.createElement("span",{className:"text-appcolor-800"},n.fileName),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.analyzing",defaultMessage:"Analyzing"}),"…")),ev.createElement("div",{className:"flex"},ev.createElement(eI.Spinner,null))),n.isAllowedToUpload&&ev.createElement(epL,{ref:d,fileType:"document",onFileAccepted:M,onFileRejected:S}))))},epq=eL.default.div.withConfig({displayName:"AiSpreadsheetDialog__AiContainer",componentId:"sc-25227c4f-0"})` + position: relative; + z-index: 1; + + @media (min-width: 768px) { + width: 40rem; + } + + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,epW={[epx]:e=>ev.createElement(epD,{morseChildProps:e})},epH=function(e){let{space:t,exit:a}=e,[n,l]=epI(),[r,o]=ev.useState(null),i=(0,eF.k6)(),{id:s}=t,d=ev.useRef(null),[c,m]=ev.useState(null),u=ev.useRef(null),[p,{data:g,error:f,loading:h}]=(0,cs.D)(epw,{refetchQueries:["SpaceDocuments"]}),[y,b]=ev.useState(null),v=(0,ll.x)();ev.useEffect(()=>{null!=r&&r.focus()},[r]);let k=epC(),E=epN(()=>{if(null==c)return;let e=(0,lo.markdownTextToTaskastFragment)(c,{shouldRemoveCodeFence:!0}),t=JSON.stringify((0,lo.fragmentToRoot)(e));p({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:s,trees:[t]}}})}),[x,{loading:_,error:w}]=$N(ev.useCallback(e=>{l({type:"analysis_complete"}),e.text.length>1e3?m(e.text.slice(e.text.length-1e3)):m(e.text),null!=u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]),ev.useCallback(e=>{l({type:"analysis_complete"}),m(e.text),null!=u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]));D$({error:y||w,onError:a});let N=ev.useRef(null);ev.useEffect(()=>{if(null!=w&&l({type:"analysis_error",payload:{message:w.message}}),null!=f){console.error(f);return}if(null==g)return;let e=g.projectsCreateWithTaskast.documents.edges?.[0].node?.id;null!=e&&(a(),i.push(`/d/${e}`))},[g,f,w,i,a,l]);let C=ev.useCallback(async e=>{l({type:"start_upload",payload:{fileName:e.name}});let t=null;try{let a=await OI("space_file",e.name,e.size,void 0,s);if(!a.ok)throw new ei.HttpError({code:"UNKNOWN_ERROR",message:"Something went wrong. Please try again."});let n=a.payload,{s3ObjectKey:l}=await OD(e,n,e.name);t=await OS(l,n),await v.mutate({mutation:Hh,variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:s,fileDesc:t.data}}})}catch(t){let e;e=t instanceof ea.cA?(0,ei.getMessageFromError)(bH(t,["spaceMediaCreate"])??t)??"There was an error importing the document. Please try again.":t instanceof ei.TaskadeError?t.message:"There was an error importing the document. Please try again.",b(t),l({type:"upload_error",payload:{message:e}});return}if(null==t){l({type:"upload_error",payload:{message:"There was an error importing the document. Please try again."}});return}l({type:"upload_complete"}),await x("/web-api/ai/import-csv",{method:"POST",credentials:"same-origin",body:JSON.stringify({fileId:t.data.id,spaceId:s}),headers:{"Content-Type":"application/json"}})},[v,l,x,s]),M=ev.useCallback(async e=>{await C(e)},[C]),S=ev.useCallback(e=>{l({type:"upload_error",payload:{message:"File not supported. Only .csv files are supported."}})},[l]);return ev.createElement(epq,{className:"rounded-3xl bg-appcolor-100"},ev.createElement("div",{className:"w-full rounded-xl p-4"},ev.createElement("div",{className:"rounded-t-xl border-[1px] border-b-0 border-appcolor-300 bg-appcolor-100 py-5"},ev.createElement("div",{className:"flex flex-col items-center justify-center"},ev.createElement(ep$,null,ev.createElement(eY.Z,{id:"general.import_spreadsheet_with_ai",defaultMessage:"Convert Spreadsheet with AI"})),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.upload_files_to_generate_a_project",defaultMessage:"Upload files to generate a project."})))),ev.createElement("div",{className:"w-full overflow-clip rounded-b-xl border-[1px] border-appcolor-300 p-4"},f&&ev.createElement(rO,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."})),null!=n.errorMessage&&ev.createElement("div",{className:"mb-3"},ev.createElement(rO,{className:"!break-normal"},n.errorMessage)),null!=c&&ev.createElement("div",{ref:o,onKeyDownCapture:e=>{e.key===eI.KeyboardKeys.Enter&&N.current?.activateCurrentItem()},tabIndex:0},ev.createElement("div",{ref:u,className:"max-h-[60vh] overflow-y-auto border-b-2 border-appcolor-200 px-5 py-4 text-left"},ev.createElement(DA,{value:c??"",shouldRemoveCodeFence:!0})),!_&&null!=c&&!h&&ev.createElement("div",null,ev.createElement(tT,{ref:N,term:"",data:k,renderMap:epW,onActivate:E}))),n.isUploading&&ev.createElement("div",{className:"flex h-16 cursor-pointer items-center justify-center gap-x-3 rounded-xl border-2 border-solid border-appcolor-300 bg-appcolor-100 pl-4 pr-4 text-appcolor-500"},ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement("div",{className:"flex flex-[2] flex-col"},null!=n.fileName&&ev.createElement("span",{className:"text-appcolor-800"},n.fileName),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.uploading",defaultMessage:"Uploading"}),"…")),ev.createElement("div",{className:"flex"},ev.createElement(eI.Spinner,null))),n.isAnalyzing&&ev.createElement("div",{className:"flex h-16 cursor-pointer items-center justify-center gap-x-3 rounded-xl border-2 border-solid border-appcolor-300 bg-appcolor-100 pl-4 pr-4 text-appcolor-500"},ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement("div",{className:"flex flex-[2] flex-col"},null!=n.fileName&&ev.createElement("span",{className:"text-appcolor-800"},n.fileName),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.analyzing",defaultMessage:"Analyzing"}),"…")),ev.createElement("div",{className:"flex"},ev.createElement(eI.Spinner,null))),n.isAllowedToUpload&&ev.createElement(epL,{ref:d,fileType:"spreadsheet",onFileAccepted:M,onFileRejected:S}))))},epG=eL.default.div.withConfig({displayName:"ImportDialog__AiButton",componentId:"sc-9aef003c-0"})` + background: ${e=>e.theme.isNightMode?e.theme.appColors.rgba(100,.6):e.theme.appColors.hex(100)}; + position: relative; + + &:before { + content: ''; + position: absolute; + inset: -2px; + pointer-events: none; + padding: 2px; + border-radius: 0.75rem; + background-image: linear-gradient(0deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotateonce 1s linear 1 forwards; + } + + &:hover::before { + animation: rotateforever 3s linear infinite; + } + + @keyframes rotateforever { + 100% { + filter: hue-rotate(360deg); + } + } + + @keyframes rotateonce { + 0% { + filter: hue-rotate(0deg); + } + 80% { + filter: hue-rotate(180deg); + } + 100% { + filter: hue-rotate(360deg); + opacity: 0; + } + } + + @keyframes rainbowIconOne { + 0% { + color: #4fcf70; + } + 25% { + color: #fad648; + } + 50% { + color: #a767e5; + } + 75% { + color: #12bcfe; + } + 99% { + color: #44ce7b; + } + 100% { + color: inherit; + } + } + + & svg { + animation: rainbowIconOne 3s linear infinite 1 forwards; + } + + &:hover { + & svg { + animation: rainbowIconOne 3s linear infinite; + } + & .rainbow { + background: linear-gradient(to right, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-background-clip: text; + background-clip: text; + background-size: 200% 100%; + animation: movingGradient 3s linear infinite; + -webkit-text-fill-color: transparent; + + @keyframes movingGradient { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } + } + } + } +`,epK=function(e){let{onToggle:t,space:a}=e;return ev.createElement("div",{className:"!min-w-[480px] max-w-[480px] overflow-clip rounded-xl border border-appcolor-300 px-0 pb-8 pt-0 text-center"},ev.createElement("div",{className:"border-b border-appcolor-300 bg-appcolor-100 pt-5"},ev.createElement("div",{className:"mb-1.5 text-lg font-medium text-textcolor-900"},"Import to ",a.name),ev.createElement(epP,null,ev.createElement(eY.Z,{id:"general.import_subtitle",defaultMessage:"Import with AI or from other services."}),ev.createElement("a",{target:"_blank",href:"https://help.taskade.com/hc/en-us/sections/8742803439763--Import-Export",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.learn_more",defaultMessage:"Learn more."})))),ev.createElement("div",{className:"flex flex-col px-7.5 py-5"},ev.createElement(epG,{onClick:()=>t(eph),className:"flex w-full cursor-pointer items-center justify-center gap-x-3 rounded-xl border border-appcolor-400 px-4 py-3 hover:bg-appcolor-100"},ev.createElement(tn.Icon,{icon:"dd_ai",className:"-mt-1 shrink-0 text-appcolor-500"}),ev.createElement("p",{className:"item-title rainbow overflow-hidden overflow-ellipsis whitespace-nowrap text-sm font-medium"},ev.createElement(eY.Z,{id:"general.import_document_with_ai",defaultMessage:"Summarize Document with AI"}))),ev.createElement("div",{className:"py-2"}),ev.createElement(epG,{onClick:()=>t(epy),className:"flex w-full cursor-pointer items-center justify-center gap-x-3 rounded-xl border border-appcolor-400 px-4 py-3 hover:bg-appcolor-100"},ev.createElement(tn.Icon,{icon:"dd_ai",className:"-mt-1 shrink-0 text-appcolor-500"}),ev.createElement("p",{className:"item-title rainbow overflow-hidden overflow-ellipsis whitespace-nowrap text-sm font-medium"},ev.createElement(eY.Z,{id:"general.import_spreadsheet_with_ai",defaultMessage:"Convert Spreadsheet with AI"})))),ev.createElement("div",{className:"flex justify-center px-7.5 text-sm text-textcolor-500"},"Or import from"),ev.createElement(epj,null,ev.createElement(epO,{onClick:()=>t(epb)},ev.createElement(tn.Icon,{icon:"dd_export_markdown"}),"Markdown & Text"),ev.createElement(epO,{onClick:()=>t(epv)},ev.createElement(lT.uJ,null),"Todoist"),ev.createElement(epO,{onClick:()=>t(epk)},ev.createElement(lT.lz,null),"Dynalist"),ev.createElement(epO,{onClick:()=>t(epE)},ev.createElement(lT.gY,null),"Workflowy"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958592-import-from-notion",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.gW,null),"Notion"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958604-import-from-evernote",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.Y$,null),"Evernote"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958595-import-from-google-docs",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.gA,null),"Google Docs"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958598-import-from-obsidian",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.S9,null),"Obsidian"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958600-import-from-logseq",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.ni,null),"Logseq"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958605-import-from-bear",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.xV,null),"Bear"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958591-import-from-trello",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.yH,null),"Trello"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958607-import-from-asana",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.C,null),"Asana"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958596-import-from-monday",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.V0,null),"Monday"),ev.createElement(epU,{href:"https://help.taskade.com/en/articles/8958597-import-from-clickup",target:"_blank",rel:"noopener noreferrer"},ev.createElement(lT.Ew,null),"ClickUp")))},epY=eL.default.label.withConfig({displayName:"FileUpload__Label",componentId:"sc-5d234473-0"})` + cursor: pointer; + margin-top: 10px; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(50)}; + & > input[type='file'] { + display: none; + } + & > span { + color: ${e=>e.theme.primaryColorScheme?.base}; + font-weight: 500; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } + } +`,epQ=ev.forwardRef(function(e,t){let{spaceId:a,onChange:n,validFileExtension:l,label:r}=e;return ev.createElement(epY,null,ev.createElement("span",null,r),ev.createElement("input",{ref:t,accept:l,id:`markdown-import-file-upload-${a}`,multiple:!0,onChange:n,type:"file"}))});function epJ(e){let t=(0,lo.markdownTextToTaskastFragment)(e,{shouldRemoveCodeFence:!0}),a=t.children.shift();return null==a?null:a.format?.node==="h1"?(a.children.push(...t.children),{type:"root",children:[a]}):{type:"root",children:[{type:"text",text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},children:[a,...t.children]}]}}let epX=function(e){let{space:t,onToggle:a}=e,n=(0,eK.Z)(),{id:l,name:r}=t,[o,i]=ev.useState(""),[s,d]=ev.useState(!1),[c,{data:m,error:u,loading:p}]=(0,cs.D)(epw,{refetchQueries:["SpaceDocuments"]}),g=(0,ev.useRef)(null),f=e=>{c({variables:{input:{clientMutationId:(0,ld.Z)(),trees:e,spaceId:l}}})};(0,ev.useEffect)(()=>{if(null!=u){console.error(u);return}null!=m&&d(!0)},[m,u]);let h=async e=>{let t=[];if(null!=e.currentTarget.files)for(let a of e.currentTarget.files){let e=epJ(await a.text());null!=e&&t.push(e)}f(t.map(e=>JSON.stringify(e)))},y=n.formatMessage({id:"general.import_markdown_file_upload",defaultMessage:"or select file to upload (.txt, .md)"});return ev.createElement(epT,null,ev.createElement("div",{className:"flex items-center justify-center"},ev.createElement(ep$,null,ev.createElement(eY.Z,{id:"general.import_markdown",defaultMessage:"Import Markdown"})),ev.createElement("a",{target:"_blank",href:"https://help.taskade.com/hc/en-us/articles/8742907764755-%E2%93%82-Import-from-Markdown",rel:"noopener noreferrer",className:"flex"},ev.createElement(tn.Icon,{icon:"dd_help",className:"ml-1 h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-700"}))),u&&ev.createElement(epZ,null,ev.createElement(rO,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}))),s?ev.createElement(ev.Fragment,null,ev.createElement(epF,null,"Your project has been successfully imported to ",ev.createElement("strong",null,r),"!"),ev.createElement(epR,{onClick:()=>a()},"Done")):ev.createElement(ev.Fragment,null,ev.createElement(epF,null,"Paste your markdown below to create a project",ev.createElement("br",null),"or upload a file (.txt, .md)"),ev.createElement(epA,{rows:6,onChange:e=>i(e.target.value),className:"resize-none",placeholder:"Paste your markdown below to create a project or upload a file (.txt, .md)"},o),ev.createElement(epR,{disabled:p||0===o.trim().length,onClick:function(){if(o?.trim()==null)return;let e=epJ(o);null!=e&&f([JSON.stringify(e)])}},p?ev.createElement(eI.Spinner,null):ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"})),ev.createElement(epQ,{ref:g,onChange:h,spaceId:l,validFileExtension:".txt,.md",label:y})))};function ep0(e){let t;try{t=(0,DP.opmlTextToTaskastFragment)(e)}catch(e){return null}return null==t?null:{type:"root",children:[{type:"text",text:{ops:[{insert:"\n",attributes:{paragraph:!0}}]},children:[...t.children]}]}}let ep1=function(e){let{space:t,onToggle:a,platform:n}=e,l=(0,eK.Z)(),{id:r,name:o}=t,[i,s]=ev.useState(""),[d,c]=ev.useState(!1),[m,{data:u,error:p,loading:g}]=(0,cs.D)(epw,{refetchQueries:["SpaceDocuments"]}),f=(0,ev.useRef)(null),h=e=>{0!==e.length&&m({variables:{input:{clientMutationId:(0,ld.Z)(),trees:e,spaceId:r}}})};(0,ev.useEffect)(()=>{if(null!=p){console.error(p);return}null!=u&&c(!0)},[u,p]);let y=async e=>{let t=[];if(null!=e.currentTarget.files)for(let a of e.currentTarget.files){let e=ep0(await a.text());null!=e&&t.push(e)}h(t.map(e=>JSON.stringify(e)))},b=l.formatMessage({id:"general.import_opml_file_upload",defaultMessage:"or select file to upload (.opml)"});return ev.createElement(epT,null,ev.createElement("div",{className:"flex items-center justify-center"},ev.createElement(ep$,null,ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"}),n===epk&&" Dynalist",n===epE&&" Workflowy"),n===epk&&ev.createElement("a",{target:"_blank",href:"https://help.taskade.com/hc/en-us/articles/8743448739731--Import-from-Dynalist",rel:"noopener noreferrer",className:"flex"},ev.createElement(tn.Icon,{icon:"dd_help",className:"ml-1 h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-700"}))),p&&ev.createElement(epZ,null,ev.createElement(rO,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}))),d?ev.createElement(ev.Fragment,null,ev.createElement(epF,null,ev.createElement(eY.Z,{id:"general.import_dialog_success",defaultMessage:"Your project has been successfully imported to {spaceName}!",values:{strong:e=>ev.createElement("strong",null," ",e),spaceName:o}})),ev.createElement(epR,{onClick:()=>a()},ev.createElement(eY.Z,{id:"general.done",defaultMessage:"Done"}))):ev.createElement(ev.Fragment,null,ev.createElement(epF,null,ev.createElement(eY.Z,{id:"general.import_opml_description",defaultMessage:"Paste your opml below to create a project {br} or upload a file (.opml)",values:{br:ev.createElement("br",null)}})),ev.createElement(epA,{rows:6,onChange:e=>s(e.target.value),placeholder:l.formatMessage({id:"general.import_opml_placeholder",defaultMessage:"Paste your opml below to create a project or upload a file (.opml)"})},i),ev.createElement(epR,{disabled:g||0===i.trim().length,onClick:function(){if(i?.trim()==null)return;let e=ep0(i);null!=e&&h([JSON.stringify(e)])}},g?ev.createElement(eI.Spinner,null):ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"})),ev.createElement(epQ,{ref:f,onChange:y,spaceId:r,validFileExtension:".opml",label:b})))};var ep2=a(78086);function ep5(e,t){let a=(0,ep2.todoistCsvToTaskast)(e);if(null==a)return null;let n={ops:[{insert:"\n",attributes:{paragraph:!0}}]};return(0,sX.isStringNotBlank)(t)&&((0,ei.assert)(t.length>0),n.ops.unshift({insert:t})),{type:"root",children:[{type:"text",text:n,children:[...a.children]}]}}let ep3=function(e){let{space:t,onToggle:a}=e,n=(0,eK.Z)(),{id:l,name:r}=t,[o,i]=ev.useState(""),[s,d]=ev.useState(!1),[c,{data:m,error:u,loading:p}]=(0,cs.D)(epw,{refetchQueries:["SpaceDocuments"]}),g=(0,ev.useRef)(null),f=e=>{c({variables:{input:{clientMutationId:(0,ld.Z)(),trees:e,spaceId:l}}})};(0,ev.useEffect)(()=>{if(null!=u){console.error(u);return}null!=m&&d(!0)},[m,u]);let h=async e=>{let t=[];if(null!=e.currentTarget.files)for(let a of e.currentTarget.files){let e=ep5(await a.text(),a.name.replace(/\.csv$/i,""));null!=e&&t.push(e)}f(t.map(e=>JSON.stringify(e)))},y=n.formatMessage({id:"general.import_todoist_file_upload",defaultMessage:"or select file to upload (.csv)"});return ev.createElement(epT,null,ev.createElement("div",{className:"flex items-center justify-center"},ev.createElement(ep$,null,ev.createElement(eY.Z,{id:"general.import_todoist",defaultMessage:"Import Todoist"})),ev.createElement("a",{target:"_blank",href:"https://help.taskade.com/hc/en-us/articles/14862649902227--Import-from-Todoist",rel:"noopener noreferrer",className:"flex"},ev.createElement(tn.Icon,{icon:"dd_help",className:"ml-1 h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-700"}))),u&&ev.createElement(epZ,null,ev.createElement(rO,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}))),s?ev.createElement(ev.Fragment,null,ev.createElement(epF,null,ev.createElement(eY.Z,{id:"general.import_dialog_success",defaultMessage:"Your project has been successfully imported to {spaceName}!",values:{strong:e=>ev.createElement("strong",null," ",e),spaceName:r}})),ev.createElement(epR,{onClick:()=>a()},ev.createElement(eY.Z,{id:"general.done",defaultMessage:"Done"}))):ev.createElement(ev.Fragment,null,ev.createElement(epF,null,ev.createElement(eY.Z,{id:"general.import_todoist_description",defaultMessage:"Paste your csv below to create a project {br} or upload a file (.csv)",values:{br:ev.createElement("br",null)}})),ev.createElement(epA,{rows:6,onChange:e=>i(e.target.value),placeholder:n.formatMessage({id:"general.import_todoist_placeholder",defaultMessage:"Paste your csv below to create a project or upload a file (.csv)"})},o),ev.createElement(epR,{disabled:p||0===o.trim().length,onClick:function(){if(o?.trim()==null)return;let e=ep5(o);null!=e&&f([JSON.stringify(e)])}},p?ev.createElement(eI.Spinner,null):ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"})),ev.createElement(epQ,{ref:g,onChange:h,spaceId:l,validFileExtension:".csv",label:y})))},ep4=(0,e$.connect)(function(e){return{isOpen:e?.modal?.import?.isOpen??!1,platform:e?.modal?.import?.platform??void 0}},function(e){return(0,ek.DE)({onToggle:NU},e)})(function(e){let{isOpen:t,onToggle:a,platform:n,space:l}=e,r=()=>{a()};return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:r,backdropOpacity:eI.ModalDialogOpacity.Opaque},e=>{let{exit:t}=e;switch(n){case eph:return ev.createElement(epV,{space:l,exit:t});case epy:return ev.createElement(epH,{space:l,exit:t});case epb:return ev.createElement(epX,{space:l,onToggle:r});case epv:return ev.createElement(ep3,{space:l,onToggle:r});case epk:case epE:return ev.createElement(ep1,{space:l,onToggle:r,platform:n});default:return ev.createElement(epK,{space:l,onToggle:a})}}):null}),ep6=(0,la.ZP)` + query CurrentSpaceQuery($spaceID: ID) { + membership(space_id: $spaceID) { + id + role + preferences { + orderby { + sort + direction + } + } + space { + id + name + color + archived_at + is_subspace + is_trial + type + visibility + taskadePlanType + taskadePlan { + id + type + usage + } + preferences { + trialEndedAt + projectDefaults + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + default { + hdpi { + url + } + } + } + } + } + memberships { + id + role + user { + ...BasicUserFields + } + } + parent_membership { + id + space { + id + name + color + archived_at + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + default { + hdpi { + url + } + } + } + } + } + } + } + documents_v2 { + totalCount + } + } + } + } + ${up} +`,ep8=eL.default.span.withConfig({displayName:"styled__IconWrapper",componentId:"sc-df28b717-0"})` + display: flex; + align-items: center; + justify-content: center; + width: 26px; + height: 26px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(10)}; + font-size: 0.75rem; +`,ep7=eL.default.div.withConfig({displayName:"styled__OverlineTitle",componentId:"sc-df28b717-1"})` + margin: 1.25rem 0 0.5rem 0.625rem; + text-transform: uppercase; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.xs} +`,ep9=eL.default.span.withConfig({displayName:"styled__StyledSpaceName",componentId:"sc-df28b717-2"})` + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + color: ${e=>e.$isUnread?e.theme.textColors.hex(10):"inherit"}; + font-weight: ${e=>e.$isUnread?"500":"400"}; +`,ege=eL.default.div.withConfig({displayName:"styled__InviteOnly",componentId:"sc-df28b717-3"})` + display: flex; + margin-left: auto; + color: ${e=>e.theme.appColors.hex(50)}; +`,egt=eL.default.div.withConfig({displayName:"styled__JoinButton",componentId:"sc-df28b717-4"})` + display: flex; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(50)}; + padding: 0.25rem 0.75rem; + border-radius: 10px; + margin-left: auto; + ${e1.UiTypography.xs}; + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(70)}; + } +`,ega=eL.default.div.withConfig({displayName:"styled__UnreadBadge",componentId:"sc-df28b717-5"})` + width: 14px; + height: 14px; + border: 3px solid ${e=>e.theme.appColors.hex(90)}; + border-radius: 16px; + position: absolute; + top: 0; + left: 26px; + background: ${e=>e.theme.primaryColorScheme?.base}; +`,egn=eL.default.div.withConfig({displayName:"styled__Backdrop",componentId:"sc-df28b717-6"})` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 6; + transition: background-color 300ms cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0ms 300ms; + visibility: hidden; + pointer-events: none; + ${e=>e.isActive&&(0,eL.css)` + visibility: visible; + background-color: rgba(0, 0, 0, 0.6); + transition: background-color 300ms cubic-bezier(0.22, 0.61, 0.36, 1); + pointer-events: auto; + `} + @media (min-width: 991px) { + display: none; + } +`,egl={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"RecentProjectsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NamedType",name:{kind:"Name",value:"RecentProjectsFiltering"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"recentProjects"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"edit_path"}},{kind:"Field",name:{kind:"Name",value:"has_move_permission"}},{kind:"Field",name:{kind:"Name",value:"has_leave_permission"}},{kind:"Field",name:{kind:"Name",value:"is_owner"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"pinned_at"}},{kind:"Field",name:{kind:"Name",value:"role"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"project"}},{kind:"Field",name:{kind:"Name",value:"workspace"}}]}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}}]}},{kind:"Field",name:{kind:"Name",value:"starred_at"}},{kind:"Field",name:{kind:"Name",value:"templated_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},egr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StarredProjectQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"starredProjects"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}}]}},{kind:"Field",name:{kind:"Name",value:"starred_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]};function ego(e){let{owned:t,member:a}=tL.parse(e),n={};return ts()(t)||pA()(n,["filterby","owned"],t),ts()(a)||pA()(n,["filterby","member"],a),n}function egi(e,t){let a,n;let{page:l,size:r}=tL.parse(e);if(a=ts()(r)||Number.isNaN(r)?t:Number(r),ts()(l)||Number.isNaN(l))n=null;else{let e=Math.max(1,Number(l));n=e>1?`${(e-1)*a}`:null}return{first:a,after:n}}let egs=(0,eL.default)(sC.rU).withConfig({displayName:"SidebarBackButton__FloatLink",componentId:"sc-19640ebf-0"})` + display: inline-flex; + height: 26px; + align-items: center; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.textColors.hex(10)}; + transition: ease-in-out color 0.2s; + margin-left: 0.5rem; + margin-top: 4px; + + & > svg { + margin-right: 0.125rem; + transform: var(--menu-item-icon-scale); + } + + & > .workspace-icon { + width: 26px; + height: 26px; + margin-right: 0.25rem; + transition: transform 0.2s ease-in-out; + transform: var(--menu-item-icon-scale); + } + + &:hover { + color: ${e=>e.theme.textColors.hex(50)}; + } +`,egd=eL.default.span.withConfig({displayName:"SidebarBackButton__SpaceTitle",componentId:"sc-19640ebf-1"})` + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + display: -webkit-box; +`,egc=function(e){let{doc:t,routerSpace:a,user:n}=e,{pathname:l,search:r,hash:o}=(0,eF.TH)(),i=new URLSearchParams(r).get("from")??null,s=t?.space??a,d=null,c=null,m=null,u=ev.useMemo(()=>null==s?"":s.is_subspace?null!=s.parent_membership?`/spaces/${s.parent_membership.space.id}/subspaces/${s.id}`:`/subspaces/${s.id}`:`/spaces/${s.id}`,[s]);if("starred"===i?(d="/lists/starred",c="Starred",m="starred"):"recent"===i?(d="/recent",c="Recent",m="recent"):"shared"===i?(d="/shared",c="Shared",m="shared"):null!=s?(null==t?(c=s.name,d=u):"tasks"===i?(c="Tasks",d=`${u}/tasks`):null!=t.archived_at?(c="Completed",d=`${u}/archive`,m="archive"):null!=t.templated_at?(c="Templates",d=`${u}/templates`,m="templates"):(c=t.space?.name??s.name,d=u),l&&((0,eF.LX)(l,{path:eZ.spaceNewTemplate,exact:!0})||(0,eF.LX)(l,{path:eZ.spaceNewTemplateFromDocumentID,exact:!0})||(0,eF.LX)(l,{path:eZ.spaceNewTemplateWithDocumentType,exact:!0}))&&(c="Templates",d=`${u}/templates`,m="templates")):t&&null!=t.starred_at?(d="/lists/starred",c="Starred",m="starred"):null==s&&null!=n&&null!=t?(d="/shared",c="Shared",m="shared"):null!=l&&(0,eF.LX)(l,{path:eZ.newList})&&(d=eZ.index,c="Workspace"),d&&c)switch(m){case"shared":case"search":case"recent":case"activity":case"starred":case"tasks":return ev.createElement(egs,{to:d},ev.createElement(tn.Icon,{icon:"header_back"}),c);case"calendar":return ev.createElement(egs,{to:d},ev.createElement(tn.Icon,{icon:"header_back"}));default:return ev.createElement(egs,{to:d},ev.createElement(tn.Icon,{icon:"header_back"}),null!=s?ev.createElement(pJ,{className:"workspace-icon",space:s,size:"small"}):ev.createElement(pY,{className:"workspace-icon",name:c}),ev.createElement(egd,null,c))}return null},egm=eL.default.div.withConfig({displayName:"PanelButton__StyledButton",componentId:"sc-825ff84c-0"})` + display: flex; + width: 100%; + color: ${e=>e.theme.appColors.hex(40)}; + align-items: center; + border-radius: 0.625rem; + padding: 0.25rem 0.625rem; + margin-bottom: ${eI.UiSpacing.getPx(.5)}; + position: relative; + ${e1.UiTypography.sm}; + + &:focus { + outline: none; + } + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + .active > & { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } +`,egu=eL.default.span.withConfig({displayName:"PanelButton__IconSlot",componentId:"sc-825ff84c-1"})` + width: 1.625rem; + height: 1.625rem; + display: inline-flex; + align-items: center; + justify-content: center; + margin-right: 8px; + transform: var(--global-icon-scale); +`,egp=e=>{let{children:t,iconSlot:a,...n}=e;return ev.createElement(egm,n,a&&ev.createElement(egu,null,a),t)};!function(e){e[e.DragEnter=0]="DragEnter",e[e.DragOver=1]="DragOver",e[e.DragLeave=2]="DragLeave",e[e.Drop=3]="Drop"}(J||(J={}));let egg={actions:{dragEnter:function(e,t){let a=t?.(e,J.DragEnter)??null;return{type:J.DragEnter,dropType:a}},dragLeave:function(e,t){let a=t?.(e,J.DragLeave)??null;return{type:J.DragLeave,dropType:a}},dragOver:function(e,t){let a=t?.(e,J.DragOver)??null;return{type:J.DragOver,dropType:a}},drop:function(e,t){let a=t?.(e,J.Drop)??null;return{type:J.Drop,dropType:a}}},initialState:{counter:0,dropType:null},reducer:function(e,t){switch(t.type){case J.DragEnter:return{counter:e.counter+1,dropType:t.dropType};case J.DragOver:if(e.dropType===t.dropType)return e;return{counter:e.counter,dropType:t.dropType};case J.DragLeave:{let a=e.counter-1;return{counter:a,dropType:a>0?t.dropType:null}}case J.Drop:return{counter:e.counter-1,dropType:null};default:return e}}};function egf(e){let{canDrop:t,onDrop:a}=e,[n,l]=ev.useReducer(egg.reducer,egg.initialState),r=ev.useCallback(e=>{let a=egg.actions.dragEnter(e,t);e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),null!=a.dropType&&e.preventDefault(),l(a)},[t]);return{state:n,props:{onDragEnter:r,onDragOver:ev.useCallback(e=>{let a=egg.actions.dragOver(e,t);e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault(),l(a)},[t]),onDragLeave:ev.useCallback(e=>{let a=egg.actions.dragLeave(e,t);e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault(),l(a)},[t]),onDrop:ev.useCallback(e=>{let n=egg.actions.drop(e,t);e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault(),l(n),a?.(e,n)},[t,a])}}}let egh=eL.default.span.withConfig({displayName:"PanelProjectButton__EmojiWrapper",componentId:"sc-20d28c34-0"})` + width: 0.75rem; + height: 0.75rem; + line-height: 1.1; + @media (-webkit-max-device-pixel-ratio: 1), + (max--moz-device-pixel-ratio: 1), + (max-resolution: 1dppx), + (max-resolution: 72dpi) { + margin-left: -0.125rem; + } +`,egy=ev.memo(function(e){let{document:t}=e,a=nQ(t),n=(0,e$.useDispatch)(),{search:l}=(0,eF.TH)(),r=(0,eK.Z)(),[o]=(0,cs.D)(eed),i=egf({canDrop:ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.taskast"===t)return t;return null},[]),onDrop:ev.useCallback(async(e,a)=>{let l;if("application/vnd.taskade.taskast"!==a.dropType)return;let i=e.dataTransfer.getData("application/vnd.taskade.taskast");try{l=JSON.parse(i)}catch(e){uT(e,_I,{extras:{fragmentString:i}});return}if(null==l)return;let s=l.project?.id;if(null==s)return;null!=l.project&&delete l.project;let d=l.children.reduce((e,t)=>[...e,t.id],[]);(0,lr.replaceIDs)(l);let c=(0,ld.Z)(),{data:m,errors:u}=await o({variables:{input:{clientMutationId:c,documentID:t.id,nodeID:null,placement:"beforeend",type:"application/vnd.taskade.taskast",content:l,action:"move"}}});if(null!=(m?.projectNodesImport?.document??null))n(mS(s,d));else if(null!=u){let e=`nodeids-moved-${c}`,t=r.formatMessage({id:"general.move_error",defaultMessage:"An error occurred during moving."});n((0,l3.error)({position:"br",autoDismiss:5,dismissible:!1,uid:e,message:t}))}},[n,t,r,o])}),s=i.state.counter>0;return ev.createElement("div",i.props,ev.createElement(sC.OL,{to:`/d/${t.id}${l}`,onClick:()=>n(sx()),className:s?"active":void 0},ev.createElement(egp,{iconSlot:ev.createElement(ep8,null,a?ev.createElement(egh,null,a):ev.createElement(tn.Icon,{width:"16",height:"16",icon:"dd_project"}))},t.is_unread&&ev.createElement(ega,null),ev.createElement(ep9,{className:"notranslate",$isUnread:t.is_unread},t.info.title||"Untitled"))))}),egb=()=>{let e,t,a;let n=(0,eF.$B)("/d/:documentID"),l=(0,e$.useSelector)(t7),r=n?.params?.documentID,{data:o}=(0,eB.a)(Nq,null!=r?{variables:{documentID:r}}:{skip:!0}),i=o?.document,s=i?.space?.id,{search:d}=(0,eF.TH)(),{from:c}=tL.parse(d),m=egi(d,20);switch(c){case"starred":e=egr,t=m;break;case"recent":{let a=ego(d);e=egl,t={...m,...a};break}case"shared":e=egl,t={...m,filterby:{member:"project-only"}};break;default:if(null!=i&&null==i.space&&null!=l){e=egl,t={...m,filterby:{member:"project-only"}};break}e=pP,t=pU(s,de,d,null,null)}let{data:u}=(0,eB.a)(e,{variables:t,fetchPolicy:"cache-and-network",nextFetchPolicy:"network-only",skip:e===pP&&null==s});switch(c){case"starred":a=u?.starredProjects?.edges??[];break;case"recent":case"shared":a=u?.recentProjects?.edges??[];break;default:a=e===egl?u?.recentProjects?.edges??[]:u?.membership?.space?.documents_v2?.edges??[]}let p=a.map(e=>e.node).filter(e=>null!=e),g=null,f=u?.membership?.space;return Eu({role:i?.role?.workspace,action:"create_project"})&&null!=f&&null!=l?g=`/spaces/${f.id}/new`:null==l&&(g="/new"),l?ev.createElement(ev.Fragment,null,ev.createElement(egc,{doc:i,user:l,routerSpace:f}),null!=i&&g&&ev.createElement("div",{className:"mt-5"},ev.createElement(sC.rU,{to:g},ev.createElement(egp,{iconSlot:ev.createElement(ep8,null,ev.createElement(tn.Icon,{icon:"plus_invite"}))},ev.createElement(eY.Z,{id:"general.new_project",defaultMessage:"New Project"})))),0!==p.length&&ev.createElement(ev.Fragment,null,ev.createElement(ep7,null,ev.createElement(eY.Z,{id:"general.projects",defaultMessage:"Projects"})),p.map(e=>ev.createElement(egy,{key:e.id,document:e})))):null},egv=(0,la.ZP)` + query IsSidebarClosedQuery { + me { + id + preferences { + isDownloadAppsClosed + } + } + } +`,egk=(0,la.ZP)` + mutation UpdateDownloadAppsClosedMutation($input: UserInput!) { + updateMe(input: $input) { + id + preferences { + isDownloadAppsClosed + } + } + } +`,egE=()=>{let{data:e}=(0,eB.a)(egv),t=e?.me?.preferences?.isDownloadAppsClosed??!1,[a]=(0,cs.D)(egk);return t?null:ev.createElement("a",{className:"group relative mx-2 mb-3 rounded-xl px-4 py-2 transition-colors duration-150 hover:bg-appcolor-100",href:"/downloads",target:"_blank",rel:"noopener noreferrer"},ev.createElement(e1.Overline,{className:"text-appcolor-100"},ev.createElement(eY.Z,{id:"general.download_apps",defaultMessage:"Download apps"})),ev.createElement("button",{className:"z-1 absolute -right-1 -top-1 flex h-6 w-6 scale-90 transform items-center justify-center rounded-full bg-appcolor-300 text-appcolor-500 opacity-0 transition-all duration-150 hover:scale-100 hover:bg-appcolor-400 hover:text-appcolor-500 group-hover:opacity-100",onClick:()=>{null!=e&&null!=e.me&&a({variables:{input:{preferences:{isDownloadAppsClosed:!t}}},optimisticResponse:{__typename:"Mutation",updateMe:{__typename:"CurrentUser",id:e.me.id,preferences:{__typename:"CurrentUserPreferences",isDownloadAppsClosed:!t}}}})}},ev.createElement(tn.Icon,{icon:"modal_close"})),ev.createElement("div",{className:"flex gap-x-1 py-1 text-appcolor-500"},ev.createElement(tn.Icon,{className:"scale-75",icon:"logo_apple"}),ev.createElement(tn.Icon,{className:"scale-75",icon:"logo_chrome"}),ev.createElement(tn.Icon,{className:"scale-75",icon:"logo_windows_marketplace"}),ev.createElement(tn.Icon,{className:"scale-75",icon:"logo_app_store"}),ev.createElement(tn.Icon,{className:"scale-75",icon:"logo_google_play"})))},egx=(0,eL.default)(eI.Shortcut.Combo).withConfig({displayName:"MePanel__StyledCombo",componentId:"sc-8fde6722-0"})` + display: flex; + margin-left: auto; + + > ${eI.Shortcut.Key} { + padding: 0; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.sm}; + background: transparent; + } +`,eg_=()=>{let e=(0,e$.useDispatch)(),t=ev.useCallback(()=>e(sx()),[e]);return ev.createElement(ev.Fragment,null,ev.createElement(sC.OL,{to:eZ.recentIndex,isActive:(e,t)=>!!e&&[eZ.recentIndex,eZ.calendarIndex,eZ.starredIndex,eZ.myTasks].includes(t.pathname),onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_home"})},ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"}))),ev.createElement(sC.OL,{to:"/search",onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"dd_search"})},ev.createElement(eY.Z,{id:"general.search",defaultMessage:"Search"}),ev.createElement(egx,null,ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(eI.Shortcut.Key,null,"K")))),ev.createElement(sC.OL,{to:eZ.activityIndex,exact:!0,onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"dd_mention"})},ev.createElement(eY.Z,{id:"general.activity",defaultMessage:"Activity"}))))},egw={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentSpacePlanQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlan"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"state"}},{kind:"Field",name:{kind:"Name",value:"usage"}}]}}]}}]}}]}}]},egN=function(e){let{type:t,usage:a}=e.taskadePlan,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"top",visible:n}),m=ev.useCallback(()=>{l(!0)},[]),u=ev.useCallback(()=>{l(!1)},[]),p=fR.Vl.getFeature("ai.generation.fair-use").plans[t],g=IP(a["ai.generation.fair-use"]??0,p);return ev.createElement("a",{className:"mb-4 flex flex-col gap-2",href:"https://help.taskade.com/hc/en-us/articles/17024327971603",target:"_blank",rel:"noopener noreferrer"},ev.createElement("div",{className:"flex text-xs text-appcolor-500"},ev.createElement("button",{...c,onMouseEnter:m,onMouseLeave:u,className:"flex w-full hover:animate-color-rainbow"},ev.createElement("div",{className:"mr-auto border-b border-dashed border-appcolor-400"},ev.createElement(eY.Z,{id:"general.ai_credits",defaultMessage:"AI Credits"})),"unlimited"===g.limit?ev.createElement("div",{className:"ml-auto border-b border-dashed border-appcolor-400"},ev.createElement(eY.Z,{id:"general.unlimited",defaultMessage:"Unlimited"})):ev.createElement("div",{className:"ml-auto border-b border-dashed border-appcolor-400 "},g.remaining," ",ev.createElement(eY.Z,{id:"general.remaining",defaultMessage:"Remaining"})),n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement("div",{className:"max-w-[180px] text-center text-xs"},ev.createElement(eY.Z,{id:"general.ai_credits_reset_notice",defaultMessage:"AI credits reset each month. Upgrade to go unlimited!"}))))),ev.createElement("div",{className:"flex h-1 overflow-clip rounded-full bg-appcolor-200"},ev.createElement("div",{className:"flex rounded-full bg-gradient-rainbow-270deg",style:{width:`${100*g.percentage}%`}})))},egC=e=>{let{spaceId:t}=e,{data:a,loading:n}=(0,eB.a)(egw,t?{variables:{spaceID:t}}:{skip:!0}),{data:l}=(0,eB.a)(ED),r=l?.me?.appSumo,o=r?.taskadePlanType??"free";if(n)return null;let i=a?.membership;if(null==i)return null;let s=e0(),d=i.space.taskadePlan,c=d.type,m=i.role;return"mac_app_store"===s||"windows_app_store"===s||"owner"!==m||"free"!==c?null:ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"mx-2 mb-3 mt-0 flex flex-col rounded-xl p-4"},ev.createElement("a",{href:"/features",target:"_blank",rel:"noopener noreferrer",className:"mb-3 flex items-end gap-x-1 text-sm"},ev.createElement(tn.Icon,{className:"mr-1 scale-90",icon:"dd_ai"}),ev.createElement(eY.Z,{id:"general.taskade_ai",defaultMessage:"Taskade AI"})),ev.createElement(egN,{taskadePlan:d}),"free"!==o?ev.createElement(sC.rU,{to:"/settings/plans",className:"flex cursor-pointer items-center justify-center gap-x-1.5 rounded-full bg-upgrade py-1.5 text-sm font-medium text-[#0c0500] hover:bg-upgrade/75"},ev.createElement(tn.Icon,{icon:"upgrade_filled"}),ev.createElement(eY.Z,{id:"general.activate_plan",defaultMessage:"Activate Plan"})):ev.createElement(EI,null)))},egM=(0,la.ZP)` + query OrganizationQuery { + organization { + id + name + scim_token + spaces { + edges { + node { + id + name + color + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + peopleGroups { + edges { + node { + id + name + spaceVisibilities { + edges { + node { + id + role + space { + id + name + } + } + } + } + peopleGroupMembers { + edges { + node { + id + people { + id + user { + id + handle + display_name + } + } + } + } + } + } + } + } + } + } +`,egS=function(){let{data:e,loading:t,error:a}=(0,eB.a)(egM);if(t)return ev.createElement(eI.Spinner,null);if(null!=a&&"Not Found"!==a.message)return ev.createElement("div",{className:"flex px-[0.375rem] py-[1.875rem]"},"Error loading organization.");let n=e?.organization;return ev.createElement("div",{className:"flex flex-col"},ev.createElement(ep7,null,ev.createElement(eY.Z,{id:"general.organization",defaultMessage:"Organization"})),null==n&&ev.createElement(sC.OL,{to:"/settings/organizations/new"},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"plus_invite"})},"Create organization")),null!=n&&ev.createElement(sC.OL,{to:`/settings/organizations/${n.id}/overview`},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_security"})},n.name)))},egI=(0,la.ZP)` + query MyWorkspaceMembershipsQuery { + me { + id + memberships(filterby: { actions: "manage_billing", is_subspace: false }) { + id + role + space { + id + color + name + type + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + } +`,egD=eL.default.div.withConfig({displayName:"SettingsWorkspaceBilling__Workspaces",componentId:"sc-ebca9533-0"})` + display: flex; + flex-direction: column; +`,egT=eL.default.div.withConfig({displayName:"SettingsWorkspaceBilling__Note",componentId:"sc-ebca9533-1"})` + display: flex; + padding: 6px 30px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; +`,eg$=function(){let{data:e,error:t,loading:a}=(0,eB.a)(egI,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),n=(0,e$.useDispatch)();if(a)return ev.createElement(egD,null,ev.createElement(eI.Spinner,null));if(null!=t)return ev.createElement(egT,null,"Error loading billable workspace.");let l=e?.me?.memberships??[];return ts()(l)?ev.createElement(egT,null,"No billable workspaces."):ev.createElement(egD,null,ev.createElement(ep7,null,ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"})),l.map(e=>{let{space:t}=e,{id:a,name:l}=t;return ev.createElement(sC.OL,{key:a,to:`/settings/billing/${a}`,onClick:()=>n(sx())},ev.createElement(egp,{iconSlot:ev.createElement(pJ,{space:t,size:"small"})},l))}))},egP=(0,la.ZP)` + query MySpacesQuery { + me { + id + memberships { + id + space { + id + type + name + color + is_subspace + parent_membership { + id + space { + id + } + } + preferences { + avatars { + small { + hdpi { + url + } + } + } + } + } + } + } + } +`,egF=eL.default.div.withConfig({displayName:"SettingsPanel__Container",componentId:"sc-75aaab6f-0"})` + ${tS} +`,egA=(0,eL.default)(sC.OL).withConfig({displayName:"SettingsPanel__SubNavLink",componentId:"sc-75aaab6f-1"})` + display: flex; + width: 100%; + min-height: 34px; + color: ${e=>e.theme.appColors.hex(40)}; + align-items: center; + border-radius: 0.625rem; + padding: 0.25rem 0.625rem; + padding-left: 46px; + margin-bottom: 0.25rem; + position: relative; + ${e1.UiTypography.sm}; + + &:focus { + outline: none; + } + + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + &.active { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } +`,egR=()=>{let e=(0,e$.useDispatch)(),t=ev.useCallback(()=>e(sx()),[e]),{data:a}=(0,eB.a)(ED),n=a?.me?.appSumo?.taskadePlanType??"free",l=fR.Vl.getFeature("organization.create").plans[n],{data:r}=(0,eB.a)(egP),o=ev.useMemo(()=>r?.me?.memberships?.map(e=>e.space)?.some(e=>"unlimited"===e.type)??!1,[r]),i=d6()&&!o,s=d6(),d=()=>{e(d4())};return ev.createElement(egF,null,ev.createElement(sC.OL,{to:"/settings",isActive:(e,t)=>!!e&&["/settings","/settings/password","/settings/sessions","/settings/sso"].includes(t.pathname),onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_general"})},ev.createElement(eY.Z,{id:"general.general",defaultMessage:"General"}))),d6()&&ev.createElement(ev.Fragment,null,("free"===n||"v2.unlimited"===n)&&ev.createElement(sC.OL,{to:"/settings/billing",exact:!0,onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_billing"})},ev.createElement(eY.Z,{id:"general.billing",defaultMessage:"Billing"})))),"free"!==n&&"v2.unlimited"!==n?ev.createElement(sC.OL,{to:"/settings/plans",onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"dd_upgrade"})},ev.createElement(eY.Z,{id:"general.plans-billing",defaultMessage:"Billing"}))):null,ev.createElement(sC.OL,{to:"/settings/credits",exact:!0,onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_referral"})},ev.createElement(eY.Z,{id:"general.credits",defaultMessage:"Credits"}))),ev.createElement(sC.OL,{exact:!0,to:"/settings/integrations",onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_integrations"})},ev.createElement(eY.Z,{id:"general.integrations",defaultMessage:"Integrations"}))),ev.createElement(egA,{to:"/settings/integrations/calendar-feed",onClick:t},ev.createElement(eY.Z,{id:"general.feed",defaultMessage:"Calendar Feed"})),(s||"free"!==n)&&ev.createElement(ev.Fragment,null,ev.createElement(egA,{to:"/settings/integrations/google-calendar",onClick:t},ev.createElement(eY.Z,{id:"general.gcal",defaultMessage:"Google Calendar"}),i&&ev.createElement(e1.UpgradeBadge,{className:"ml-auto",onClick:d})),ev.createElement(egA,{to:"/settings/integrations/zapier",onClick:t},ev.createElement(eY.Z,{id:"general.zapier",defaultMessage:"Zapier"}),ev.createElement(SV,{date:"2022-09-30"}),i&&ev.createElement(e1.UpgradeBadge,{className:"ml-auto",onClick:d}))),ev.createElement(sC.OL,{to:"/settings/notifications",onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_notification"})},ev.createElement(eY.Z,{id:"general.notifications",defaultMessage:"Notifications"}))),ev.createElement(sC.OL,{to:"/settings/archives",onClick:t},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_archive"})},ev.createElement(eY.Z,{id:"general.archives",defaultMessage:"Archives"}))),l&&ev.createElement(egS,null),d6()&&ev.createElement(eg$,null))};var egj=a(58091);let egO=function(e){let{children:t,coordinates:a,close:n}=e,l=ev.useContext(eI.LayersContext),r=l?.overlay??("undefined"!=typeof document?document.body:void 0);return null==r?null:ep.createPortal(ev.createElement("div",{className:"pointer-events-auto fixed bottom-0 left-0 right-0 top-0",onClick:n},ev.createElement("div",{className:"absolute",style:{top:a.y,left:a.x}},t)),r)},egU=function(e){let{name:t,value:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,name:t,value:a});return ev.createElement("div",{className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:cursor-pointer",{"bg-appcolor-300":r.navigated}),...r.props},n)},egZ={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"DocumentUnreadFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Document"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}}]}}]},egL={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceMarkAsReadMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMarkAsReadInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceMarkAsRead"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}}]}}]}}]}}]},egB=dw.z.object({__typename:dw.z.literal("DocumentConnection"),edges:dw.z.array(dw.z.object({node:dw.z.union([dw.z.object({__typename:dw.z.literal("Document"),id:dw.z.string()}),dw.z.object({__ref:dw.z.string()})])}))}),egz=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)(),[n]=(0,cs.D)(egL),l=ev.useCallback(e=>{if("Activate"===e.type)switch(e.payload.name){case"mark_as_read":n({variables:{input:{clientMutationId:(0,ld.Z)(),spaceID:t}},update(e){e.modify({id:e.identify({__typename:"Space",id:t}),fields:{documents_v2(t,a){let{readField:n}=a;if(!egB.safeParse(t).success)return t;for(let a of t.edges){let t=n("id",a.node),l=e.readFragment({fragment:egZ,id:e.identify({__typename:"Document",id:t})});null!=l&&e.writeFragment({fragment:egZ,id:e.identify({__typename:"Document",id:t}),data:(0,es.ZP)(l,e=>{e.is_unread=!1})})}return t}}})}});break;case"move_folder":a(_l.actions.toggleMoveFolderDialog(t))}},[a,t,n]);return ev.createElement(eI.Menu,null,ev.createElement("div",{className:"w-64 rounded-lg border-[1px] border-appcolor-300 bg-appcolor-0 py-2 shadow-md"},ev.createElement(eI.MenuGroupContext.Provider,{value:l},ev.createElement("div",{className:"flex flex-col"},ev.createElement(egU,{name:"mark_as_read"},ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"activity.mark_as_read",defaultMessage:"Mark as Read"})),ev.createElement(egU,{name:"move_folder"},ev.createElement(tn.Icon,{icon:"dd_move"}),ev.createElement(eY.Z,{id:"activity.move_folder",defaultMessage:"Move Folder"}))))))},egV=ev.memo(function(e){let{space:t,subspace:a}=e,n=(0,e$.useDispatch)(),[l,r]=ev.useState(!1),o=ev.useRef(null),i=ev.useRef(null),s=ev.useRef(null),{arrowProps:d,popperProps:c,referenceProps:m}=(0,eI.useControlledTooltip)({referenceElementRef:o,arrowElementRef:i,popperElementRef:s,placement:"right",visible:l}),u=(0,ev.useMemo)(()=>null!=t&&null!=a?`/spaces/${t.id}/subspaces/${a.id}`:`/subspaces/${a?.id}`,[a,t]),[p,g]=ev.useState(null),f=ev.useCallback(()=>{g(null)},[]);return null==a?null:ev.createElement(ev.Fragment,null,ev.createElement(sC.OL,{to:u,onClick:()=>n(sx()),onContextMenu:e=>{e.preventDefault(),g({x:e.clientX,y:e.clientY})}},ev.createElement(egp,{iconSlot:ev.createElement(pJ,{space:a,size:"small"})},a.is_unread&&ev.createElement(ega,null),ev.createElement(ep9,{className:"notranslate",$isUnread:a.is_unread},a.name),null!=t&&null==a.visibility&&ev.createElement(ege,{...m,onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)}},ev.createElement(tn.Icon,{icon:"access_invite"}),l&&ev.createElement(eI.Tooltip,{arrowProps:d,popperProps:c},ev.createElement(eY.Z,{id:"general.only_visible_to_you_and_people_you_invite",defaultMessage:"Only visible to you and people you invite"}))))),null!=p&&ev.createElement(egO,{coordinates:p,close:f},ev.createElement(egz,{spaceId:a.id})))}),egq={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MembershipsReorderMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"clientMutationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"space_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membershipsReorder"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"clientMutationId"},value:{kind:"Variable",name:{kind:"Name",value:"clientMutationId"}}},{kind:"ObjectField",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"space_id"}}},{kind:"ObjectField",name:{kind:"Name",value:"order"},value:{kind:"Variable",name:{kind:"Name",value:"order"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}}]}}]}}]}}]},egW=()=>{let e={filterby:{membershipType:"shared"}},{data:t,error:a,loading:n}=(0,eB.a)(lu,{variables:e}),[l]=(0,cs.D)(egq);if(n||null!=a)return ev.createElement(eI.Spinner,{marginBottom:20});let r=t?.memberships?.edges??[],o=t?.memberships?.totalCount??0;return ev.createElement(ev.Fragment,null,ev.createElement(sC.OL,{to:"/shared",exact:!0},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_home"})},ev.createElement(eY.Z,{id:"general.projects",defaultMessage:"Projects"}))),0!==o?ev.createElement(ep7,null,ev.createElement(eY.Z,{id:"space.folders",defaultMessage:"Folders"})):null,ev.createElement(egj.Z5,{nonce:"undefined"!=typeof window?window.__webpack_nonce__:void 0,onDragEnd:t=>{let{destination:a,source:n}=t;if(null==a)return;let{index:o}=a,{index:i}=n;if(null==i||null==o||i===o)return;let s=r[i].node.space.id,d=r[o].node.order,c=r.splice(i,1)[0];r.splice(o,0,c);let m=r.map(e=>({__typename:"Membership",id:e.node.id,order:e.node.order})),u=(0,ld.Z)();l({variables:{clientMutationId:u,space_id:s,order:d},optimisticResponse:{__typename:"Mutation",membershipsReorder:{__typename:"MembershipsReorderPayload",clientMutationId:u,memberships:m}},update:(t,a)=>{let{data:n,errors:l}=a;if(null!=l||null==n)return;let o=n.membershipsReorder.memberships,i=aR()(o,"id"),s=t.readQuery({query:lu,variables:e});null!=s&&null!=s.memberships&&t.writeQuery({query:lu,variables:e,data:{...s,memberships:{...s.memberships,edges:r.map(e=>({...e,node:{...e.node,order:i[e.node.id].order}}))}}})}})}},ev.createElement(egj.bK,{droppableId:"sharedspaces",type:"sharedspaces"},e=>{let{innerRef:t,droppableProps:a,placeholder:n}=e;return ev.createElement("div",{ref:t,...a},r.map((e,t)=>ev.createElement(egj._l,{key:e.node.id,draggableId:e.node.id,index:t},t=>ev.createElement("div",{ref:t.innerRef,...t.draggableProps,...t.dragHandleProps},ev.createElement(egV,{subspace:e.node.space})))),n)})))},egH=eL.default.div.withConfig({displayName:"OnboardTooltip__Container",componentId:"sc-355a8824-0"})` + display: flex; + position: absolute; + z-index: 10; + background: none; + border: 0; + + top: -2px; + right: 40px; + + &:focus { + outline: none; + } +`,egG=eL.default.div.withConfig({displayName:"OnboardTooltip__Beacon",componentId:"sc-355a8824-1"})` + display: flex; + width: 40px; + height: 40px; + position: absolute; + top: 0; + left: -10px; + cursor: pointer; + + opacity: 0; + animation: fadein 3s; + animation-fill-mode: forwards; + animation-delay: 2s; + + & > .beacon-dot { + display: flex; + width: 10px; + height: 10px; + background: ${e=>e.theme.primaryColorScheme?.base}; + border-radius: 50px; + position: absolute; + left: 50%; + top: 50%; + + transform: translateX(-50%) translateY(-50%); + } + & > .beacon-pulse { + display: flex; + width: 10px; + height: 10px; + border-radius: 50px; + background: ${e=>e.theme.primaryColorScheme?.alpha30}; + border: 1px solid ${e=>e.theme.primaryColorScheme?.base}; + + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + + animation: onboard-hotspot-pulse 2s infinite; + animation-fill-mode: forwards; + animation-delay: 3s; + } + + @keyframes onboard-hotspot-pulse { + 0% { + width: 10px; + height: 10px; + } + 100% { + width: 40px; + height: 40px; + opacity: 0; + } + } +`,egK=eL.default.div.withConfig({displayName:"OnboardTooltip__Button",componentId:"sc-355a8824-2"})` + display: flex; + align-self: center; + padding: 4px 18px; + margin: 20px 0 0; + cursor: pointer; + color: ${e=>e.theme.primaryColorScheme?.base}; + background-color: rgba(255, 255, 255, 1); + border-radius: 12px; + transition: background-color ease-in-out 200ms; + ${e1.UiTypography.md}; + font-weight: 500; + + &:hover { + background-color: rgba(255, 255, 255, 0.8); + } +`,egY=eL.default.div.withConfig({displayName:"OnboardTooltip__Card",componentId:"sc-355a8824-3"})` + display: ${e=>e.$show?"flex":"none"}; + flex-direction: column; + width: 234px; + white-space: normal; + padding: 14px 10px; + position: absolute; + border-radius: 12px; + color: #fff; + background: ${e=>e.theme.primaryColorScheme?.base}; + + top: 40px; + right: -40px; + + & > .caret { + width: 0; + height: 0; + + position: absolute; + right: 22px; + top: -6px; + background: none; + + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-bottom: 8px solid ${e=>e.theme.primaryColorScheme?.base}; + } +`,egQ=function(e){let{legacyKey:t,seen:a,tooltipActionLabel:n,tooltipDescription:l,updateUserPreferences:r,userPreferencesKey:o}=e,[i,s]=ev.useState(!1),[d,c]=ev.useState(a),m=ev.useCallback(()=>{!1===i&&s(!i)},[i]),u=ev.useCallback(e=>{e.preventDefault(),s(!1),c(!0),r&&r(o,!0,t)},[t,r,o]);return d?null:ev.createElement(egH,{onClick:u},ev.createElement(egG,{onMouseOver:m,onClick:u},ev.createElement("div",{className:"beacon-dot"}),ev.createElement("div",{className:"beacon-pulse"})),ev.createElement(egY,{className:"text-sm",$show:i},ev.createElement("span",{className:"caret"}),l,ev.createElement(egK,null,n)))},egJ=(0,e$.connect)(function(e){return{seenOnboardInvite0001:UJ(e)}}),egX=ev.memo(egJ(function(e){let{membership:t,seenOnboardInvite0001:a}=e,{role:n,space:l}=t,r=Eu({role:n,action:"create_subspace"}),o=(0,e$.useDispatch)(),i=(0,eK.Z)(),s=r&&!l.is_subspace,d=ev.useCallback((e,t,a)=>{o(cE(e,t,a))},[o]);return s?ev.createElement(egp,{as:"button",iconSlot:ev.createElement(ep8,null,ev.createElement(tn.Icon,{icon:"plus_invite"})),onClick:e=>{e.preventDefault(),s&&o(gL(l.id,l.name,l.type,l.taskadePlanType))}},ev.createElement(eY.Z,{id:"general.new_folder",defaultMessage:"New folder"}),ev.createElement(egQ,{tooltipDescription:i.formatMessage({id:"general.create_folder_description",defaultMessage:"Create a folder to organize your projects and teams."}),tooltipActionLabel:"Got it",seen:a,updateUserPreferences:d,userPreferencesKey:"onboardInvite0001",legacyKey:"onboard-invite-0001"})):null})),eg0=(0,la.ZP)` + mutation moveDocumentV2($id: ID!, $spaceID: ID) { + moveDocumentV2(id: $id, spaceID: $spaceID) { + id + space { + id + } + } + } +`,eg1=function(e){let{spaceId:t,currentListingMembership:a,space:n}=e,l=(0,e$.useDispatch)(),{query:r,variables:o}=pZ((0,eF.TH)(),null),[i]=(0,cs.D)(eg0),s=ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.project"===t)return t;return null},[]),d=ev.useCallback(async e=>{null!=n&&t!==a?.space.id&&(await i({variables:{id:e,spaceID:t},update:t=>{if(r&&o){let a=t.readQuery({query:r,variables:o}),n=(0,es.ZP)(a,t=>(t.membership.space.documents_v2.edges=t.membership.space.documents_v2.edges.filter(t=>t.node.id!==e),t.membership.space.documents_v2.totalCount>0&&(t.membership.space.documents_v2.totalCount-=1),t));t.writeQuery({query:r,data:n,variables:o})}},optimisticResponse:{__typename:"Mutation",moveDocumentV2:{__typename:"Document",id:e,space:{__typename:"Space",id:t}}}}),l(xx(e)))},[a?.space.id,l,i,r,o,n,t]),c=egf({canDrop:s,onDrop:ev.useCallback(e=>{let t=e.dataTransfer.getData("application/vnd.taskade.project");0!==t.length&&d(t)},[d])}),m=c.state.counter>0,[u,p]=ev.useState(null),g=ev.useCallback(()=>{p(null)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...c.props,className:og()("rounded-md",{"bg-appcolor-200":m}),onContextMenu:e=>{e.preventDefault(),p({x:e.clientX,y:e.clientY})}},ev.createElement(sC.OL,{to:`/spaces/${t}`,isActive:(e,a)=>!!e&&a.pathname.includes(`/spaces/${t}`)&&!a.pathname.includes(`/spaces/${t}/subspaces`)},ev.createElement(egp,{iconSlot:ev.createElement(tn.Icon,{icon:"sidebar_home"}),className:og()({"color-textcolor-100 bg-appcolor-200":null!=u})},n.is_unread&&ev.createElement(ega,null),ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"})))),null!=u&&ev.createElement(egO,{coordinates:u,close:g},ev.createElement(egz,{spaceId:t})))},eg2=ev.memo(function(e){let{space:t,subspace:a,currentListingMembership:n}=e,l=(0,e$.useDispatch)(),r=(0,eF.TH)(),[o,i]=ev.useState(!1),s=ev.useRef(null),d=ev.useRef(null),c=ev.useRef(null),{arrowProps:m,popperProps:u,referenceProps:p}=(0,eI.useControlledTooltip)({referenceElementRef:s,arrowElementRef:d,popperElementRef:c,placement:"right",visible:o}),{query:g,variables:f}=pZ(r,null),[h]=(0,cs.D)(eg0),y=ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.project"===t)return t;return null},[]),b=ev.useCallback(async e=>{a?.id!=null&&a?.id!==n?.space.id&&(await h({variables:{id:e,spaceID:a?.id},update:t=>{if(g&&f){let a=t.readQuery({query:g,variables:f}),n=(0,es.ZP)(a,t=>(t.membership.space.documents_v2.edges=t.membership.space.documents_v2.edges.filter(t=>t.node.id!==e),t.membership.space.documents_v2.totalCount>0&&(t.membership.space.documents_v2.totalCount-=1),t));t.writeQuery({query:g,data:n,variables:f})}},optimisticResponse:{__typename:"Mutation",moveDocumentV2:{__typename:"Document",id:e,space:{__typename:"Space",id:a.id}}}}),l(xx(e)))},[n?.space.id,l,h,g,f,a]),v=egf({canDrop:y,onDrop:ev.useCallback(e=>{let t=e.dataTransfer.getData("application/vnd.taskade.project");0!==t.length&&b(t)},[b])}),k=(0,ev.useMemo)(()=>null!=t&&null!=a?`/spaces/${t.id}/subspaces/${a.id}`:`/subspaces/${a?.id}`,[a,t]),[E,x]=ev.useState(null),_=ev.useCallback(()=>{x(null)},[]);if(null==a)return null;let w=v.state.counter>0;return ev.createElement(ev.Fragment,null,ev.createElement("div",{...v.props,onContextMenu:e=>{e.preventDefault(),x({x:e.clientX,y:e.clientY})},className:og()("rounded-md",{"bg-appcolor-200":w})},ev.createElement(sC.OL,{to:k,onClick:()=>l(sx())},ev.createElement(egp,{iconSlot:ev.createElement(pJ,{space:a,size:"small"}),className:og()({"color-textcolor-100 bg-appcolor-200":null!=E})},a.is_unread&&ev.createElement(ega,null),ev.createElement(ep9,{className:"notranslate",$isUnread:a.is_unread},a.name),null!=t&&null==a.visibility&&ev.createElement(ege,{...p,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)}},ev.createElement(tn.Icon,{icon:"access_invite"}),o&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},ev.createElement(eY.Z,{id:"general.only_visible_to_you_and_people_you_invite",defaultMessage:"Only visible to you and people you invite"})))))),null!=E&&ev.createElement(egO,{coordinates:E,close:_},ev.createElement(egz,{spaceId:a.id})))}),eg5=ev.memo(function(e){let{parentSpaceId:t,subspace:a}=e,n=(0,e$.useDispatch)(),l=(0,ev.useMemo)(()=>null==a?`/spaces/${t}`:`/spaces/${t}/subspaces/${a.id}/join`,[t,a]);return null==a?null:ev.createElement(sC.OL,{to:l,onClick:()=>n(sx())},ev.createElement(egp,{iconSlot:ev.createElement(nA,{space:a,size:"sm"})},ev.createElement(ep9,{className:"notranslate",$isUnread:a.is_unread},a.name),ev.createElement(egt,null,ev.createElement(eY.Z,{id:"general.join",defaultMessage:"Join"}))))}),eg3=e=>{let{spaceId:t}=e,{data:a,error:n,loading:l}=(0,eB.a)(kg,{variables:{spaceID:t,first:1e3,filterby:{archived:!1,hasMembership:!1,visibility:"public"}},skip:null==t}),r=a?.membership?.space.folders.edges??[],o=a?.membership?.space.folders.totalCount??0;return l?ev.createElement(eI.Spinner,{marginBottom:18}):null!=n?ev.createElement(eI.Spinner,{marginBottom:20}):ev.createElement(ev.Fragment,null,0!==o&&ev.createElement(ep7,null,ev.createElement(eY.Z,{id:"space.join_folders",defaultMessage:"Join Folders"})),r.map(e=>ev.createElement(eg5,{key:e.node.id,parentSpaceId:t,subspace:e.node})))},eg4=(0,la.ZP)` + mutation ($input: MembershipCreateInput!) { + membershipCreate(input: $input) { + clientMutationId + membership { + id + space { + id + } + } + } + } +`,eg6=(0,la.ZP)` + query VisibleSpaces($filterby: SpaceFiltering!) { + spaces(filterby: $filterby) { + edges { + node { + id + name + type + color + is_unread + preferences { + trialEndedAt + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + spacePeopleGroupVisibilities { + id + role + } + } + } + } + } +`,eg8=e=>{let{spaceId:t}=e,a=(0,eF.k6)(),[n]=(0,cs.D)(eg4),{data:l,error:r,loading:o}=(0,eB.a)(eg6,{variables:{filterby:{hasMembership:!1,isVisibleToPeopleGroup:!0,parentSpaceId:t}}}),i=async e=>{if(null==e)return;let l=(0,ld.Z)(),r=await n({variables:{input:{clientMutationId:l,spaceId:e,isFromOrganization:!0}},refetchQueries:[{query:eg6,variables:{filterby:{hasMembership:!1,isVisibleToPeopleGroup:!0,parentSpaceId:t}}},{query:x1,variables:{workspaceId:t}}]});r.data?.membershipCreate?.membership?.id!=null&&a.push(`/spaces/${t}/subspaces/${e}`)};if(o)return ev.createElement(eI.Spinner,{marginBottom:18});if(null!=r)return ev.createElement(eI.Spinner,{marginBottom:20});let s=l?.spaces?.edges??[];return ev.createElement(ev.Fragment,null,0!==s.length&&ev.createElement(ep7,null,ev.createElement(eY.Z,{id:"space.join_folders",defaultMessage:"Join Folders"})),s.map(e=>ev.createElement(egp,{key:e?.node?.id,onClick:()=>i(e?.node?.id),iconSlot:ev.createElement(nA,{space:e?.node,size:"sm"})},ev.createElement(ep9,{className:"notranslate",$isUnread:e?.node?.is_unread??!1},e?.node?.name),ev.createElement(egt,null,ev.createElement(eY.Z,{id:"general.join",defaultMessage:"Join"})))))},eg7=e=>{let{match:t}=e,a=t?.params?.spaceId??"",{data:n}=(0,eB.a)(ZX,a?{variables:{spaceID:a}}:{skip:!0}),l=n?.membership??null,r=l?.space,{data:o,error:i,loading:s}=(0,eB.a)(x1,a?{variables:{workspaceId:a}}:{skip:!0}),[d]=(0,cs.D)(egq),c=Eu({role:l?.role,action:"create_subspace"});if(s)return ev.createElement(eI.Spinner,{marginBottom:18});if(null!=i)return ev.createElement(eI.Spinner,{marginBottom:20});let m=o?.memberships?.edges??[];o?.memberships?.totalCount;let u=t?.params?.subspaceId??t?.params?.spaceId??"",p=u===a?l:m.find(e=>e.node.space.id===u)?.node;return ev.createElement(ev.Fragment,null,null!=r&&ev.createElement(eg1,{spaceId:a,currentListingMembership:p,space:r}),ev.createElement(egj.Z5,{nonce:"undefined"!=typeof window?window.__webpack_nonce__:void 0,onDragEnd:e=>{let{destination:t,source:n}=e;if(null==t)return;let{index:l}=t,{index:r}=n;if(null==r||null==l||r===l)return;let o=m[r].node.space.id,i=[...m],s=i[l].node.order,c=i.splice(r,1)[0];i.splice(l,0,c);let u=i.map(e=>({__typename:"Membership",id:e.node.id,order:e.node.order})),p=(0,ld.Z)();d({variables:{clientMutationId:p,space_id:o,order:s},optimisticResponse:{__typename:"Mutation",membershipsReorder:{__typename:"MembershipsReorderPayload",clientMutationId:p,memberships:u}},update:(e,t)=>{let{data:n,errors:l}=t;if(null!=l||null==n||!a)return;let r=n.membershipsReorder.memberships,o=aR()(r,"id"),s=e.readQuery({query:x1,variables:{workspaceId:a}});null!=s&&null!=s.memberships&&e.writeQuery({query:x1,variables:{workspaceId:a},data:{...s,memberships:{...s.memberships,edges:i.map(e=>({...e,node:{...e.node,order:o[e.node.id].order}}))}}})}})}},ev.createElement(egj.bK,{droppableId:"subspaces",type:"subspaces"},e=>{let{innerRef:t,droppableProps:a,placeholder:n}=e;return ev.createElement("div",{ref:t,...a},m.map((e,t)=>ev.createElement(egj._l,{key:e.node.id,draggableId:e.node.id,index:t},t=>ev.createElement("div",{ref:t.innerRef,...t.draggableProps,...t.dragHandleProps},ev.createElement(eg2,{space:r,subspace:e.node.space,currentListingMembership:p})))),n)})),c&&null!=l&&ev.createElement(egX,{membership:l}),ev.createElement(eg3,{spaceId:a}),ev.createElement(eg8,{spaceId:a}))},eg9=eL.default.button.withConfig({displayName:"BarButton__StyledButton",componentId:"sc-81649346-0"})` + display: flex; + width: 2.25rem; + height: 2.25rem; + align-items: center; + justify-content: center; + padding: 0; + box-shadow: none; + cursor: pointer; + border: 0; + position: relative; + border-radius: 0.875rem; + color: ${e=>e.theme.textColors.hex(10)}; + transition: background-color ease-in-out 0.2s; + background: transparent; + + &:focus { + outline: 0; + } + + &.active { + background: ${e=>e.theme.appColors.hex(70)}; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(10)}; + } +`,efe=e=>{let t;let{icon:a,tooltipContent:n,to:l,...r}=e,[o,i]=ev.useState(!1),s=ev.useRef(null),d=ev.useRef(null),c=ev.useRef(null),{arrowProps:m,popperProps:u,referenceProps:p}=(0,eI.useControlledTooltip)({referenceElementRef:s,arrowElementRef:d,popperElementRef:c,placement:"right",visible:o});return l&&(t={to:l,as:sC.OL}),ev.createElement(eg9,{...p,...t,...n?{onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)}}:void 0,...r},ev.createElement(tn.Icon,{icon:a}),o&&ev.createElement(eI.Tooltip,{arrowProps:m,popperProps:u},n))},eft={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUserPlanQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"appSumo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"state"}}]}},{kind:"Field",name:{kind:"Name",value:"subscriptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"active"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"membershipType"},value:{kind:"EnumValue",value:"space"}},{kind:"ObjectField",name:{kind:"Name",value:"role"},value:{kind:"StringValue",value:"owner",block:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]},efa=function(e){let{name:t,value:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,name:t,value:a});return ev.createElement("div",{className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:cursor-pointer",{"bg-appcolor-300":r.navigated}),...r.props},n)},efn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"DocumentUnreadFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Document"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}}]}}]},efl={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"WorkspaceMarkEverythingAsReadMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"WorkspaceMarkEverythingAsReadInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workspaceMarkEverythingAsRead"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"spaces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}}]}}]}}]}}]},efr=dw.z.object({__typename:dw.z.literal("DocumentConnection"),edges:dw.z.array(dw.z.object({node:dw.z.union([dw.z.object({__typename:dw.z.literal("Document"),id:dw.z.string()}),dw.z.object({__ref:dw.z.string()})])}))}),efo=function(e){let{spaceId:t}=e,[a]=(0,cs.D)(efl),n=ev.useCallback(e=>{"Activate"===e.type&&"mark_as_read"===e.payload.name&&a({variables:{input:{clientMutationId:(0,ld.Z)(),workspaceID:t}},update(e){function a(t){e.modify({id:e.identify({__typename:"Space",id:t}),fields:{documents_v2(t,a){let{readField:n}=a;if(!efr.safeParse(t).success)return t;for(let a of t.edges){let t=n("id",a.node),l=e.readFragment({fragment:efn,id:e.identify({__typename:"Document",id:t})});null!=l&&e.writeFragment({fragment:efn,id:e.identify({__typename:"Document",id:t}),data:(0,es.ZP)(l,e=>{e.is_unread=!1})})}return t}}})}a(t);let n=e.readQuery({query:x1,variables:{workspaceId:t}});if(null!=n)for(let e of n.memberships?.edges??[])a(e.node.id)}})},[t,a]);return ev.createElement(eI.Menu,null,ev.createElement("div",{className:"w-64 rounded-lg border-[1px] border-appcolor-300 bg-appcolor-0 py-2 shadow-md"},ev.createElement(eI.MenuGroupContext.Provider,{value:n},ev.createElement("div",{className:"flex flex-col"},ev.createElement(efa,{name:"mark_as_read"},ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"general.mark_all_as_read",defaultMessage:"Mark all as Read"}))))))},efi=(0,eL.default)(pJ).withConfig({displayName:"BarWorkspaceButton__StyledSpaceAvatar",componentId:"sc-6c0fe32d-0"})` + height: 36px; + width: 36px; + border-radius: 14px; + font-size: 18px; + + img { + height: 36px; + width: 36px; + } +`,efs=(0,eL.default)(sC.rU).withConfig({displayName:"BarWorkspaceButton__StyledNavLink",componentId:"sc-6c0fe32d-1"})` + display: flex; + align-items: center; + justify-content: center; + position: relative; + + &::before { + content: ''; + position: absolute; + width: 40px; + height: 40px; + box-shadow: 0 0 0 3px + ${e=>e.theme.isNightMode?"rgba(255, 255, 255, 0)":"rgba(248,248,248, 0)"}; + border-radius: 15px; + transform: scale(0.3); + transition: box-shadow ease-in-out 0.2s, transform ease-in-out 0.2s; + } + + &:hover::before { + box-shadow: 0 0 0 3px + ${e=>e.theme.isNightMode?"rgba(255, 255, 255, 0.5)":"rgba(229,229,229,1)"}; + transform: scale(1); + } + &.active::before { + box-shadow: 0 0 0 3px + ${e=>e.theme.isNightMode?"rgba(255, 255, 255, 1)":"rgba(204,204,204,1)"}; + transform: scale(1); + } +`,efd=eL.default.div.withConfig({displayName:"BarWorkspaceButton__UnreadBadge",componentId:"sc-6c0fe32d-2"})` + width: 14px; + height: 14px; + border: 3px solid ${e=>e.theme.isNightMode?"#1c1c1c":"#fff"}; + border-radius: 16px; + position: absolute; + top: -3px; + right: -5px; + background: ${e=>e.theme.primaryColorScheme?.base}; + z-index: 1; +`,efc=ev.memo(function(e){let{space:t,tooltip:a,activeSpaceId:n,query:l,queryVariables:r,isNotJoined:o}=e,i=(0,e$.useDispatch)(),s=(0,ll.x)(),d=(0,eF.k6)(),{arrowProps:c,popperProps:m,referenceProps:u,setVisible:p,visible:g}=(0,eI.useTooltip)({placement:"right"}),[f]=(0,cs.D)(eg0),h=ev.useCallback(async e=>{if(null==t)return;let a=t.id;a!==n&&(await f({variables:{id:e,spaceID:a},update:t=>{if(l&&r){let a=t.readQuery({query:l,variables:r}),n=(0,es.ZP)(a,t=>(t.membership.space.documents_v2.edges=t.membership.space.documents_v2.edges.filter(t=>t.node.id!==e),t.membership.space.documents_v2.totalCount>0&&(t.membership.space.documents_v2.totalCount-=1),t));t.writeQuery({query:l,data:n,variables:r})}},optimisticResponse:{__typename:"Mutation",moveDocumentV2:{__typename:"Document",id:e,space:{__typename:"Space",id:a}}}}),i(xx(e)))},[n,i,f,l,r,t]),y=ev.useCallback(e=>{for(let t of e.dataTransfer.types)if("application/vnd.taskade.project"===t)return t;return null},[]),b=ev.useCallback(e=>{let t=e.dataTransfer.getData("application/vnd.taskade.project");0!==t.length&&h(t)},[h]),v=ev.useCallback(async()=>{if(!o)return;let e=(0,ld.Z)();try{let a=await s.mutate({mutation:eg4,variables:{input:{clientMutationId:e,spaceId:t.id,isFromOrganization:!0}}});a.data?.membershipCreate?.membership?.id!=null&&d.push({pathname:`/spaces/${t.id}`})}catch(e){er.Tb(e)}},[s,d,o,t.id]),k=egf({canDrop:y,onDrop:b}),E=n===t.id,x=k.state.counter>0,[_,w]=ev.useState(null),N=ev.useCallback(()=>{w(null)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...k.props,onContextMenu:e=>{e.preventDefault(),w({x:e.clientX,y:e.clientY})}},ev.createElement(efs,{to:`/spaces/${t.id}`,className:E||x||null!=_?"active":void 0,...u,onMouseEnter:()=>{p(!0)},onMouseLeave:()=>{p(!1)},onClick:v},t.is_unread&&ev.createElement(efd,null),ev.createElement(efi,{space:t,size:"small"}),g&&a&&ev.createElement(eI.Tooltip,{arrowProps:c,popperProps:m},t.name))),null!=_&&ev.createElement(egO,{coordinates:_,close:N},ev.createElement(efo,{spaceId:t.id})))}),efm=eL.default.div.withConfig({displayName:"BarWorkspaceList__WorkspaceItemDraggable",componentId:"sc-b4f91c55-0"})` + margin-bottom: 15px; +`,efu=function(e){let{activeSpaceId:t}=e,a=(0,e$.useDispatch)(),n=(0,eF.TH)(),l=d6(),r={filterby:{membershipType:"space",archived:!1}},{data:o,error:i,loading:s}=(0,eB.a)(kf),{data:d,error:c,loading:m}=(0,eB.a)(eg6,{variables:{filterby:{hasMembership:!1,isVisibleToPeopleGroup:!0}}}),{data:u}=(0,eB.a)(eft,{fetchPolicy:"cache-first"}),p=ev.useMemo(()=>{if(null==u)return!1;let{me:e,memberships:t}=u;if(null==e)return!1;let a=e.appSumo?.taskadePlanType??"free",n=fR.Vl.getFeature("workspace.limit").plans[a];return"unlimited"===n||(t?.totalCount??0){let{destination:t,source:a}=e;if(null==t)return;let{index:n}=t,{index:l}=a;if(null==l||null==n||l===n)return;let o=f[l].node.space.id,i=[...f],s=i[n].node.order,d=i.splice(l,1)[0];i.splice(n,0,d);let c=i.map(e=>({__typename:"Membership",id:e.node.id,order:e.node.order})),m=(0,ld.Z)();g({variables:{clientMutationId:m,space_id:o,order:s},optimisticResponse:{__typename:"Mutation",membershipsReorder:{__typename:"MembershipsReorderPayload",clientMutationId:m,memberships:c}},update:(e,t)=>{let{data:a,errors:n}=t;if(null!=n||null==a)return;let l=a.membershipsReorder.memberships,o=aR()(l,"id"),s=e.readQuery({query:lu,variables:r});null!=s&&null!=s.memberships&&e.writeQuery({query:lu,variables:r,data:{...s,memberships:{...s.memberships,edges:i.map(e=>({...e,node:{...e.node,order:o[e.node.id].order}}))}}})}})}},ev.createElement(egj.bK,{droppableId:"spaces",type:"spaces"},e=>{let{innerRef:a,droppableProps:n,placeholder:l}=e;return ev.createElement("div",{ref:a,...n},f.map((e,a)=>ev.createElement(egj._l,{key:e.node.id,draggableId:`spaces.${e.node.id}`,index:a},(a,n)=>ev.createElement(efm,{ref:a.innerRef,...a.draggableProps,...a.dragHandleProps,className:"workspace-item"},ev.createElement(efc,{space:e.node.space,tooltip:!0,activeSpaceId:t,query:h,queryVariables:y})))),l)})),(l||p)&&ev.createElement(efe,{icon:"dd_newtemplate",tooltipContent:ev.createElement(eY.Z,{id:"general.new_workspace",defaultMessage:"New workspace"}),onClick:()=>{a(gL(null))}}),(d?.spaces.edges??[]).map(e=>ev.createElement("div",{className:"my-2",key:e.node.id},ev.createElement(efc,{space:e.node,tooltip:!0,activeSpaceId:t,query:h,queryVariables:y,isNotJoined:!0}))))},efp=function(e){let{value:t,name:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,value:t,name:a});return ev.createElement("button",{className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",...r.props},n)},efg=function(){let e=ev.useRef(null),t=ev.useRef(null),a=(0,e$.useDispatch)(),n=d6(),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),o=(0,eI.usePopup)({referenceElementRef:e,popupElementRef:t,state:l,placement:"right-end"}),i=(0,eI.useMenuButton)({ref:e,state:l,dispatch:r}),s=ev.useCallback(e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"upgrade":window.open("/upgrade","_blank","noopener,noreferrer");break;case"referral":window.open("https://partners.taskade.com/","_blank","noopener,noreferrer");break;case"help_center":window.open("https://help.taskade.com","_blank","noopener,noreferrer");break;case"keyboard_shortcuts":a(_c()),r({type:"Collapse"});break;case"whats_new":window.open("https://www.taskade.com/blog/updates/","_blank","noopener,noreferrer");break;case"ai_prompt_templates":a(co.actions.toggleAiPromptTemplatesDialog()),r({type:"Collapse"});break;case"contact":window.open("/contact","_blank","noopener,noreferrer")}}},[a]);return ev.createElement("div",null,ev.createElement("button",{...i.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),l.expanded?r({type:"Collapse"}):r({type:"Expand"})},className:"flex h-9 w-9 items-center justify-center rounded-xl hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"dd_help"})),l.expanded&&ev.createElement(eI.Popup,{...o.props,dispatch:r,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:s},ev.createElement(eI.Menu,{className:"flex w-64 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",initialFocus:o.initialFocus,loop:!0},n&&ev.createElement(efp,{name:"upgrade"},ev.createElement(tn.Icon,{icon:"sidebar_upgrade",className:"scale-80 text-upgrade"}),ev.createElement("span",{className:"!overflow-visible text-upgrade"},ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))),ev.createElement(efp,{name:"referral"},ev.createElement(tn.Icon,{icon:"dd_referral",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.refer_and_earn",defaultMessage:"Refer and earn"})),ev.createElement(efp,{name:"ai_prompt_templates"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.ai_prompt_templates",defaultMessage:"AI Prompt Templates"})),ev.createElement(efp,{name:"keyboard_shortcuts"},ev.createElement(tn.Icon,{icon:"dd_shortcuts",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.trips_and_tricks",defaultMessage:"Tips & Tricks"})),ev.createElement(efp,{name:"help_center"},ev.createElement(tn.Icon,{icon:"dd_help",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.documentation",defaultMessage:"Documentation"})),ev.createElement(efp,{name:"whats_new"},ev.createElement(tn.Icon,{icon:"dd_whatsnew",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.whats_new",defaultMessage:"What's new"})),ev.createElement(efp,{name:"contact"},ev.createElement(tn.Icon,{icon:"dd_contact",className:"scale-80"}),ev.createElement(eY.Z,{id:"general.contact",defaultMessage:"Contact"}))))))},eff="4.25rem",efh=eL.default.div.withConfig({displayName:"UniversalBar__Container",componentId:"sc-a35e5426-0"})` + width: ${eff}; + display: flex; + flex-direction: column; + box-shadow: 1px 0 0 0 ${e=>e.theme.appColors.hex(80)}; + padding: 9px 0; + position: relative; + height: 100vh; + align-items: flex-end; + //transition: width 300ms cubic-bezier(0.22, 0.61, 0.36, 1); +`,efy=eL.default.div.withConfig({displayName:"UniversalBar__Top",componentId:"sc-a35e5426-1"})` + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 168px; + overflow-y: scroll; + width: ${eff}; + &::-webkit-scrollbar { + display: none; + } +`,efb=eL.default.div.withConfig({displayName:"UniversalBar__Shortcuts",componentId:"sc-a35e5426-2"})` + margin-bottom: 20px; + display: flex; + flex-direction: column; + gap: 0.25rem; +`,efv=eL.default.div.withConfig({displayName:"UniversalBar__Bottom",componentId:"sc-a35e5426-3"})` + display: flex; + flex-direction: column; + align-items: center; + margin: auto 0 0; + padding: 1.5rem 0; + position: absolute; + bottom: 0; + width: ${eff}; + gap: 1rem; + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.1)":"rgba(255,255,255,0.1)"}; + z-index: 2; +`,efk=e=>{let{activeSpaceId:t}=e,{data:a}=(0,eB.a)(sW);return ev.createElement(efh,null,ev.createElement(efy,null,a?.me?ev.createElement(ev.Fragment,null,ev.createElement(efb,null,ev.createElement(efe,{exact:!0,to:eZ.recentIndex,icon:"sidebar_recent",tooltipContent:ev.createElement(eY.Z,{id:"general.recent",defaultMessage:"Recent"})}),ev.createElement(efe,{exact:!0,to:eZ.myTasks,icon:"sidebar_mytasks",tooltipContent:ev.createElement(eY.Z,{id:"general.my_tasks",defaultMessage:"My Tasks"})}),ev.createElement(efe,{exact:!0,to:eZ.calendarIndex,icon:"sidebar_calendar",tooltipContent:ev.createElement(eY.Z,{id:"general.calendar",defaultMessage:"Calendar"})}),ev.createElement(efe,{exact:!0,to:eZ.starredIndex,icon:"sidebar_starred",tooltipContent:ev.createElement(eY.Z,{id:"general.starred",defaultMessage:"Starred"})}),ev.createElement(efe,{exact:!0,to:eZ.shared,icon:"sidebar_shared",tooltipContent:ev.createElement(eY.Z,{id:"general.shared_with_me",defaultMessage:"Shared with me"})})),ev.createElement(efu,{activeSpaceId:t})):ev.createElement(sC.OL,{to:"/"},"logo")),ev.createElement(efv,null,ev.createElement(efe,{to:"/search",icon:"sidebar_search",tooltipContent:ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.search",defaultMessage:"Search"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"K")))}),ev.createElement(efe,{to:"/settings",icon:"dd_settings",tooltipContent:ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"})}),ev.createElement(efg,null)))},efE="16rem",efx=eL.default.div.withConfig({displayName:"Sidebar__Container",componentId:"sc-aae784b1-0"})` + display: flex; + align-items: stretch; + position: sticky; + top: 0; + height: 100vh; + justify-content: flex-end; + z-index: 1; + user-select: none; + + backdrop-filter: blur(10px); + background: ${e=>e.theme.isNightMode?"rgba(23,25,28, 0.92)":"rgba(255,255,255,0.92)"}; + + /* Mobile: Display as floating sidebar */ + @media screen and (${e=>e.$editorView?"max-width: 991px":"max-width: 992px"}) { + position: fixed; + left: 0; + height: 100vh; + transform: translateX(${e=>e.$mobileVisible?"0":"-100%"}); + transition: background-color ease-in-out 200ms; + z-index: 6; + } + + /* Desktop: Display as fixed sidebar */ + @media screen and (${e=>e.$editorView?"min-width: 991px":"min-width: 992px"}) { + width: ${e=>e.$desktopClosed?"0":e.$slim?"4.25rem":"20.25rem"}; + transition: width 300ms cubic-bezier(0.22, 0.61, 0.36, 1); + } + + @media print { + display: none; + } +`,ef_=eL.default.div.withConfig({displayName:"Sidebar__PanelContainer",componentId:"sc-aae784b1-1"})` + height: 100%; + min-width: ${efE}; + padding: 0.625rem; + overflow-y: auto; + ${tS} +`,efw=eL.default.div.withConfig({displayName:"Sidebar__SlidingContainer",componentId:"sc-aae784b1-2"})` + display: flex; + flex-direction: column; + width: ${efE}; + overflow: hidden; + transition: width 300ms cubic-bezier(0.22, 0.61, 0.36, 1); + display: flex; + flex-shrink: 0; + ${e=>!e.visible&&"width: 0px;"} + border-right: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,efN=ev.memo(e=>{let t;let{editorView:a=!1,activeSpaceId:n}=e,l=(0,e$.useDispatch)(),r=(0,eF.TH)(),o=(0,eF.$B)("/:type(spaces|subspaces|shared|settings)/:spaceId?/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents)?"),i=a&&r.pathname.startsWith("/embed/"),s=o?.params?.type??null,d=o?.params?.spaceId??"",c=s?["spaces","subspaces","shared","settings"].includes(s):a||!1,m=(0,e$.useSelector)(_A),{data:u}=(0,eB.a)(I_),p=u?.me?.preferences?.isSidebarClosed??!1,g=a&&(i||p);c&&(t=function(){if(a)return ev.createElement(egb,null);switch(s){case"spaces":return ev.createElement(eg7,{match:o});case"shared":case"subspaces":return ev.createElement(egW,null);case"settings":return ev.createElement(egR,null);default:return ev.createElement(eg_,null)}}());let f=UZ(t);ev.useEffect(()=>()=>{l(sE(!1))},[r,l]);let h=e0();return ev.createElement(ev.Fragment,null,ev.createElement(egn,{isActive:m,onClick:()=>{l(sE())}}),ev.createElement(efx,{$mobileVisible:m,$desktopClosed:g,$slim:!c,$editorView:a,className:"space-step2"},ev.createElement(efk,{activeSpaceId:n||d}),ev.createElement(efw,{visible:c},ev.createElement(ef_,null,c?t:f),(null==h||"standalone"===h)&&ev.createElement(egE,null),!0===a&&null!=n&&ev.createElement(egC,{spaceId:n}),"spaces"===s&&ev.createElement(egC,{spaceId:d}))))});function efC(e){let t=(0,eF.LX)(e,{path:eZ.editor});if(t?.params?.isEmbedded==="embed")return!0;let a=(0,eF.LX)(e,{path:eZ.embed});return a?.path===eZ.embed}var efM=a(65435);let efS={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OnboardEditorTourMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CurrentUserPreferencesUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserPreferencesUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onboardEditorTour"}}]}}]}}]}}]}}]},efI=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-3 text-lg font-bold text-appcolor-800"},"Welcome to Taskade \uD83D\uDC4B"),ev.createElement("br",null),ev.createElement("div",{className:"relative",style:{paddingTop:"56.25%"}},ev.createElement("iframe",{className:"absolute left-0 top-0 h-full w-full",src:"https://www.youtube-nocookie.com/embed/9kAoOotszug?rel=0&controls=1",title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})),ev.createElement("br",null),ev.createElement("p",{className:"text-sm"},"Say hello to a dynamic, visual playground for all your tasks, notes, and ideas. Get ready to revolutionize your productivity!"))},efD=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-3 text-lg font-bold text-appcolor-800"},"Toggle Project Views"),ev.createElement("br",null),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"You can edit and visualize your project in multiple forms without altering its core."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"✍️ List View (Outline)"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Capture ideas from top to bottom. This view is ideal for tasks, agendas, and note-taking."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCCB Board View (Kanban)"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Manage project phases in columns. This view is perfect for development sprints and planning."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDDD3 Calendar View"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Track tasks and deadlines in a calendar layout. It's ideal for managing deadlines and scheduling."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCCA Action View (Table)"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Display tasks in a customizable table. This view is best for project status tracking."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83E\uDDE0 Mind Map View (Flow Chart)"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Visualize complex ideas and workflows. It's excellent for brainstorming and processes."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"▲ Org Chart View"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"See the bigger picture in a hierarchical structure. Ideal for team onboarding and workflow optimization."))},efT=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Edit Project Details"),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83C\uDFA8 Project Icon"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Choose an emoji to make your project stand out."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"✍️ Project Title"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Give your project a meaningful name."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"⏰ Project Due Date"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Set a due date or range to keep the team on track."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDC65 Project Assignees"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Assign team members to the project."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDD16 Project Tags"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Use tags to group similar projects together."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"⚡️ Automation"),ev.createElement("p",{className:"mb-3 leading-5 text-appcolor-600"},"Automate anything, integrate your favorite apps, and utilize AI and AI Agents to streamline your workflows and tasks."))},ef$=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-3 text-lg font-bold text-appcolor-800"},"Craft Your First Project"),ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83C\uDF33 Tasks & Sub-Tasks"),ev.createElement("p",{className:"mb-3"},"Tasks are the core of your project. Use the Tab key to create sub-tasks for easy organization. You can fold and unfold nested tasks for easier navigation."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83C\uDF9A️ Format & Manage Tasks"),ev.createElement("p",{className:"mb-3"},"Drag the ⠟ icon to reorder tasks. Click ⠟ and ✚ for more options like formatting, duplication, move, and more."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCC6 Due Dates & Reminders"),ev.createElement("p",{className:"mb-3"},"Type ",ev.createElement("strong",null,"/")," to add due dates, assign tasks, and much more. For example,"," ",ev.createElement("strong",null,"/tomorrow 7am")," for reminders."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83E\uDD16 Taskade AI Assistant"),ev.createElement("p",{className:"mb-3"},"Type /ai to add a touch of magic to your project. Try commands like"," ",ev.createElement("strong",null,"/brainstorm")," and ",ev.createElement("strong",null,"/research"),"."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"✨ Chat with Your Docs"),ev.createElement("p",{className:"mb-3"},"Upload documents and consult AI for insights, all within your project."))},efP=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Share & Personalize"),ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDD17 Share & Embed"),ev.createElement("p",{className:"mb-3"},"Easily invite your team and clients, and control who can view or edit your projects. You can also embed projects on your website or dashboard."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDD70️ Version History"),ev.createElement("p",{className:"mb-3"},"Access past versions and track activity to ensure you never lose work and always stay in the loop."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83C\uDFDE️ Background & Layout"),ev.createElement("p",{className:"mb-3"},"Upload and customize wallpapers, select layouts, and much more in the Project Settings."))},efF=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Chat & Collaborate"),ev.createElement("br",null),ev.createElement("div",{className:"relative",style:{paddingTop:"56.25%"}},ev.createElement("iframe",{className:"absolute left-0 top-0 h-full w-full",src:"https://www.youtube-nocookie.com/embed/R-l2k70K3pY?rel=0&controls=1",title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})),ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"✨ Chat With Your Projects"),ev.createElement("p",{className:"mb-3"},"Choose the Ask Project option to ask AI anything about your project."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83E\uDD16 Ask an AI Agent"),ev.createElement("p",{className:"mb-3"},"Leverage your virtual workforce by chatting with your AI Agents. Ask your virtual team member anything you want."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCAC Collaborate With Your Team"),ev.createElement("p",{className:"mb-3"},"Chat with your team or hop on a video chat for a quick meeting. Collaborate in real-time on the same page."))},efA=function(e){let[t,a]=ev.useState(!0),[n,l]=ev.useState("Next →"),[r]=ev.useState(0),o=ev.useRef(null),i=(0,ll.x)(),s=async()=>{a(!1);let t=(0,ld.Z)();await i.mutate({mutation:efS,variables:{input:{clientMutationId:t,onboardEditorTour:!1}},optimisticResponse:{__typename:"Mutation",currentUserPreferencesUpdate:{__typename:"CurrentUserPreferencesUpdatePayload",clientMutationId:t,currentUser:{id:e.currentUserId,preferences:{__typename:"CurrentUserPreferences",onboardEditorTour:!1}}}}})},d=[{element:"body",intro:ev.createElement(efI,null),tooltipClass:og()("introjs-forcedOverlay bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full max-w-md")},{element:".project-title",intro:ev.createElement(efT,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full max-w-md")},{element:".title",intro:ev.createElement(ef$,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full max-w-md")},{element:".step2",intro:ev.createElement(efD,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full min-w-fit")},{element:".step4",intro:ev.createElement(efP,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full min-w-fit")},{element:".step3",intro:ev.createElement(efF,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full min-w-fit")}];return ev.createElement(efM.R,{enabled:t,ref:o,steps:d,initialStep:r,onBeforeChange:e=>{if(null!=e&&null!=o.current)try{o.current.updateStepElement(e)}catch(t){er.$e(a=>{a.setExtra("nextStepIndex",e),a.setExtra("introjs details",o.current?.introJs?._options?.steps),er.Tb(t)})}},onAfterChange:e=>{null!=e&&null!=o.current&&o.current.updateStepElement(e);let t=document.querySelector("body");null!=t&&t.classList.add("overflow-hidden")},onExit:s,onChange:e=>{l(0===e?"Start Tour →":"Next →");let t=document.querySelector("body");null!=t&&t.classList.add("overflow-hidden")},options:{nextLabel:n,showButtons:!0,showStepNumbers:!1,keyboardNavigation:!0,showBullets:!0,overlayOpacity:.7,disableInteraction:!1}})},efR=eL.default.div.withConfig({displayName:"editor__MainLeft",componentId:"sc-e7e561d4-0"})` + display: none; + + @media (min-width: 768px) { + display: flex; + flex-direction: column; + flex: 0 0 auto; + overflow-y: auto; + padding: 12px 0 0; + ${tM}; + position: relative; + z-index: 2; + + width: 300px; + background: ${e=>e.theme.appColors.hex(90)}; + border-right: 1px solid ${e=>e.theme.appColors.hex(70)}; + -webkit-transform: translate3d(0, 0, 1px); + } +`,efj=eL.default.div.withConfig({displayName:"editor__MainRight",componentId:"sc-e7e561d4-1"})` + flex: 1 1 auto; + min-width: 0; + display: flex; + flex-direction: column; + position: relative; + background: ${e=>e.theme.appColors.hex(100)}; +`,efO=(0,e$.connect)(function(e){return{conference:dZ(e),doc:dV(e),fetchResult:function(e){let{session:t}=e;return t.fetchResult}(e),fetchStatus:Cm(e),headMetas:dG(e),syncState:dR(e),title:dz(e),isLoggedIn:t9(e),sideDrawerIsOpen:_A(e)}})(function(e){let{conference:t,doc:a,fetchResult:n,fetchStatus:l,headMetas:r,isNewBorn:o,location:i,match:s,syncState:d,title:c,editorId:m,rootId:u,siteId:p,isLoggedIn:g,sideDrawerIsOpen:f}=e,{documentPathType:h,documentViewOrEditID:y,documentID:b,isNewDocument:v}=s.params,k=ev.useMemo(()=>{let e=og()({"taskade-embed":efC(i.pathname)});if(e)return e},[i.pathname]),E=(0,ev.useMemo)(()=>null==h||null==y?null:`/${h}/${y}`,[h,y]),{search:x,pathname:_}=(0,eF.TH)(),w=s4(x),N=(0,ev.useCallback)(e=>e.pathname===_&&e.hash.length>0||(t?"You have a conference in progress, are you sure you want to leave?":!!(d===Ng||d===Nf||o&&Nv(s)&&(e.pathname===`/d/${a?.id}`||e.pathname===a?.editPath))||"You have unsaved changes. Do you want to leave this page and discard your changes?"),[t,_,a?.editPath,a?.id,o,s,d]),[C,M]=(0,ev.useMemo)(()=>null!=b?[Cp,{variables:{id:b,shareToken:w}}]:[Cu,null!=E?{variables:{path:E}}:{skip:!0}],[b,E,w]),{data:S}=(0,eB.a)(sW),I=S?.me,D=I?.preferences.isSidebarClosed??!0,{data:T}=(0,eB.a)(C,M),$=(0,ev.useMemo)(()=>{if(null==b)return jB;let e=new URLSearchParams(x);if("gallery"===e.get("from"))return jB;if(T?.document==null)return jL;let t=(0,es.ZP)(T.document.shared_preferences,t=>{let a=e.get("coverImageType");if(null==a)return;let n=hq.validate(a);null==n.error&&(t.coverImageType=n.value)}),a=hG.validate(t);return null!=a.error?(uT(a.error,uI),console.warn(a.error),jL):function(e){let t="none"===e.coverImageType?{type:"default",data:{value:"bg-none"}}:null==e.background?{type:"default",data:{value:"bg-random"}}:e.background,a=function(e){let t=e.background;return null==e.coverImageType?null!=t&&"default"===t.type&&"bg-none"===t.data.value?"none":"banner":e.coverImageType}(e);return{start:null,end:null,avatar:null,chatMode:R.ENABLED,commentsMode:j.ENABLED,view:"list",...e,background:t,coverImageType:a}}(a.value)},[b,T,x]),P=T?.document?.space?.id??s.params.spaceID??null,{data:F}=(0,eB.a)(ep6,null!=P?{variables:{spaceID:P}}:{skip:!0}),A=F?.membership?.space,O=F?.membership?.space?.color||T?.document?.color||null,U=(0,ev.useMemo)(()=>null==O?void 0:{primaryColor:O},[O]),Z=ev.useMemo(()=>{if(null!=O)try{let[e,t,a]=gW()(O).rgb();return{"--color-primary":`${e} ${t} ${a}`}}catch(e){uT(e,uI),console.warn(e);return}},[O]),L=F?.membership?.space?.type??T?.document?.space?.type??T?.document?.space_type??null,B=F?.membership?.space?.is_subspace??T?.document?.space?.is_subspace??null,z=F?.membership?.space?.taskadePlanType??T?.document?.space?.taskadePlanType??null,V=function(e){let{documentId:t}=e,a=(0,e$.useDispatch)();return ev.useCallback(e=>{e.preventDefault(),null!=t&&a(Mk.actions.togglePrintDialog({projectId:t}))},[a,t])}({documentId:b});if(ev.useEffect(()=>(Mousetrap.bind("mod+p",V),()=>{Mousetrap.unbind("mod+p")}),[V]),l===ux){if(n?.get("code")==="PROJECT_UNAVAILABLE")return ev.createElement(sB,{errorCode:"PROJECT_UNAVAILABLE"});let e=n?.get("code")??418,t=n?.get("text")??"Error",a=n?.get("header")??t,l=n?.get("subheader")??"Looks like an error occurred processing your request, please try again later.",r=n?.get("windowTitle")??`${e} ${t} - Taskade`;return ev.createElement(sK,{imageUrl:401===e||403===e||e>=500?"/images/403.svg":404===e?"/images/404.svg":void 0,windowTitle:r,header:a,subheader:l})}return ev.createElement(eI.ThemeProvider,{theme:U},ev.createElement(U2.Provider,{value:T?.document?.role??U1},ev.createElement(jz.Provider,{value:$},ev.createElement(gz,{spaceId:P,spaceType:L,spaceIsSubspace:B,spaceTaskadePlanType:z},null!=I&&I.preferences.onboardEditorTour&&ev.createElement(efA,{currentUserId:I.id}),ev.createElement(Uv,null),ev.createElement(eF.NL,{message:N}),ev.createElement(eT.ql,{meta:r},null!=c&&ev.createElement("title",null,c),ev.createElement("body",{className:k})),ev.createElement("div",{className:"step1 flex h-screen w-screen",style:Z},(!D||f)&&null==v&&I&&ev.createElement(efN,{editorView:!0,activeSpaceId:P,space:A}),null!=v&&ev.createElement(efR,null,ev.createElement(U0,{location:i,match:s,space:A,document:a})),ev.createElement(efj,null,ev.createElement(IL,{match:s,newDoc:null!=v,userLoggedIn:null!=I,location:i,membership:F?.membership}),ev.createElement(euw,{editorId:m,rootId:u,siteId:p,fetchStatus:l,isNewBorn:o,location:i,match:s,spaceId:P}))),null!=a&&ev.createElement($f,{doc:a}),ev.createElement(Zr,null),ev.createElement(jf,null),g&&ev.createElement(UO,{role:a?.role,action:{project:"edit"}},ev.createElement(jo,null)),ev.createElement(O5,null),ev.createElement(ZR,null),ev.createElement(PN,null),ev.createElement(jp,null),ev.createElement(TX,null),ev.createElement(euL,null),ev.createElement(epf,null),ev.createElement(Ub,null),null!=A&&ev.createElement(ep4,{space:A})))))}),efU=(0,e$.connect)(function(e){let t=dV(e),a=t?.id,n=iR(e),l=_$(e);return{isNewBorn:ec()(e,["meta","newborn"],!1),editorId:a,rootId:n,siteId:l}},function(e){return(0,ek.DE)({editorDidMount:rs,editorDidUnmount:rd},e)});class efZ extends ev.Component{componentDidMount(){this.props.editorDidMount(this.props.match)}componentDidUpdate(e){bW()(e.match,this.props.match)||Nv(e.match)&&this.props.isNewBorn||(0,e$.batch)(()=>{this.props.editorDidUnmount(e.match),this.props.editorDidMount(this.props.match)})}componentWillUnmount(){this.props.editorDidUnmount(this.props.match)}render(){let{location:e,match:t,editorId:a,rootId:n,siteId:l,isNewBorn:r}=this.props;return ev.createElement(efO,{location:e,match:t,editorId:a,rootId:n,siteId:l,isNewBorn:r})}}let efL=efU(efZ),efB=function(e){let t=e.className,a=e.imageURL??"/images/404.svg",n=e.message??"An error occurred. Please try again.";return ev.createElement("div",{className:og()("load-error-wrapper",t)},ev.createElement("img",{src:a}),ev.createElement("span",null,n))},efz=function(){let e;let t=(0,eK.Z)(),{documentPathType:a,documentViewOrEditID:n,isEmbedded:l}=(0,eF.UO)(),r=(0,eF.TH)(),{loading:o,error:i,data:s}=(0,eB.a)(Cu,{variables:{path:`/${a}/${n}`}});if(o)return ev.createElement(eI.Spinner,null);if(null!=i)return ev.createElement(efB,{message:t.formatMessage({id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."})});let d=s?.document?.id;if(null==d)return ev.createElement(efB,{message:t.formatMessage({id:"general.errors.project_not_found",defaultMessage:"Project not found."})});switch(a){case"v":e="view";break;case"e":e="edit";break;default:return ev.createElement(efB,{message:t.formatMessage({id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."})})}let c=r.search?tL.parse(r.search):{};c.share=e,c[e]=n;let m=`?${tL.stringify(c)}`;return ev.createElement(eF.l_,{to:{pathname:l?`/embed/${d}`:`/d/${d}`,search:m,hash:r.hash}})},efV=e=>null!=e.dates&&e.dates.total>0||null!=e.assignees&&e.assignees.total>0,efq=eL.default.button.withConfig({displayName:"styled__AssigneesButton",componentId:"sc-d4c39bc8-0"})` + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + & img { + filter: grayscale(1); + } + `} +`,efW=function(e){let{assignees:t,nodeCompleted:a}=e,n=t.attachments,l=ev.useMemo(()=>{let e=[],t=[];for(let a of n){let n=a.assignee;e.push(n.handle),t.push(ev.createElement(e1.UserAvatar,{className:"-ml-3 first:ml-0",size:"xs",shape:"circle",key:a.id,src:n.avatars_v2.small.mdpi.url,alt:n.handle}))}return ev.createElement(ev.Fragment,null,t,ev.createElement("span",{className:"mx-1.5 whitespace-nowrap"},e.join(", ")))},[n]);return 0===t.attachments.length?null:ev.createElement(ev.Fragment,null,ev.createElement("div",null,ev.createElement(efq,{className:"flex items-center self-center rounded-2xl border border-solid border-applight-300 bg-applight-200 px-1 py-[1px] text-xs text-applight-900",$nodeCompleted:a},l)))};!function(e){e[e.HasStarted=0]="HasStarted",e[e.HasEnded=1]="HasEnded",e[e.Upcoming=2]="Upcoming",e[e.Completed=3]="Completed"}(X||(X={}));let efH=eL.default.button.withConfig({displayName:"styled__DueDateButton",componentId:"sc-ac4615e4-0"})` + ${e=>{let t;switch(e.$state){case X.HasEnded:t=(0,eI.getColorScheme)(eI.ThemeColors.danger);break;case X.Completed:return(0,eL.css)` + color: ${e.theme.textColors.hex(60)}; + background: none; + `}return null!=t?(0,eL.css)` + border-color: ${t?.alpha50}; + background-color: ${e.$active?t?.alpha20:t?.alpha10}; + color: ${t?.base}; + `:null}} +`,efG=function(e){let{icon:t,text:a,state:n,active:l}=e;return ev.createElement("div",null,ev.createElement(efH,{$state:n,$active:l,disabled:!0,className:"flex items-center gap-1 self-center rounded-2xl border border-solid border-applight-300 bg-applight-200 px-2 py-[1px] text-xs text-applight-900 hover:cursor-pointer"},ev.createElement(tn.Icon,{className:"flex-shrink-0",icon:t}),ev.createElement("span",{className:"text-xs"},a)))},efK=function(e){let{dueDate:t,nodeCompleted:a}=e,n=t.attachments[0],l="recurrence"in n.addonDate,r=ev.useMemo(()=>{if(null==n)return{text:"",state:X.Upcoming};let{start:e,end:t}=n.addonDate,l=ez.DateDuration.fromDateRangeDesc({start:e,end:t}),r=X.Upcoming;switch(l.toRelativeStatus()){case"has_ended":r=X.HasEnded;break;case"has_started":r=X.HasStarted}return a&&(r=X.Completed),{text:l.toReadableFormat(),state:r}},[n,a]);return ev.createElement("div",null,ev.createElement(efG,{icon:l?"addon_date_repeat":"addon_date",text:r.text,state:r.state,active:!1}))},efY=(0,e$.connect)(function(e,t){return{attachments:iA(e,{nodeID:t.node.id})}})(function(e){let{node:t,attachments:a}=e;return null!=a&&efV(a)?ev.createElement("div",{className:"mt-0.5 flex gap-1"},null!=a.assignees&&ev.createElement(efW,{assignees:a.assignees,nodeCompleted:t.completed}),null!=a.dates&&ev.createElement(efK,{dueDate:a.dates,nodeCompleted:t.completed})):null}),efQ=(0,eL.css)` + &:after { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + white-space: nowrap; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } +`,efJ=(0,eL.css)` + ${efQ} + + &:after { + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,efX=(0,eL.css)` + ${efQ}; + + &:after { + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,ef0=(0,eL.css)` + ${efQ} + + &:after { + margin-top: 2px; + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + border-radius: 6px; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected3.svg":"/../images/check_hover3.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected3.svg'); + } + } +`,ef1=(0,eL.css)` + ${ef0} + + &:after { + border-radius: 25px; + } +`,ef2=(0,eL.css)` + ${efQ} + + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_heart2.svg'); + margin-top: 5px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_heart2.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_heart_selected2.svg'); + opacity: 1; + transform: scale(1); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_heart_selected2.svg'); + } +`,ef5=(0,eL.css)` + ${efQ} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border-radius: 25px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,ef3=(0,eL.css)` + ${efQ} + + &:after { + border-radius: 25px; + content: ''; + } + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_triangle.svg'); + margin-left: -2px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_triangle.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_triangle.svg'); + opacity: 1; + transform: scale(1.4); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_triangle_selected.svg'); + } +`,ef4=(0,eL.css)` + ${efQ} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + border-radius: 1px; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,ef6=eL.default.div.withConfig({displayName:"NodeBullet__Wrapper",componentId:"sc-4a43d7-0"})` + display: flex; + margin-right: 8px; + margin-left: 2px; + + ${e=>{switch(e.$format){case li.FORMAT_HEADING1:case li.FORMAT_HEADING2:case li.FORMAT_TEXT:return(0,eL.css)` + display: none; + `}}} +`,ef8=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"NodeBullet__Checkbox",componentId:"sc-4a43d7-1"})` + width: 1.125rem; + height: 1.125rem; + -webkit-appearance: none; + + ${e=>e.$format===li.FORMAT_ALPHA&&efX} + ${e=>e.$format===li.FORMAT_NUMBER&&efJ} + ${e=>e.$format===li.FORMAT_CHECKBOX&&ef0} + ${e=>e.$format===li.FORMAT_CIRCLE_CHECK&&ef1} + ${e=>e.$format===li.FORMAT_HEART&&ef2} + ${e=>e.$format===li.FORMAT_BULLET&&ef5} + ${e=>e.$format===li.FORMAT_TRIANGLE&&ef3} + ${e=>e.$format===li.FORMAT_SQUARE&&ef4} + + ${e=>e.$format===li.FORMAT_ALPHA&&(0,eL.css)` + &:after { + counter-increment: ${e.$nodeCounterName}; + content: counter(${e.$nodeCounterName}, lower-alpha) '.'; + } + `} + + ${e=>e.$format===li.FORMAT_NUMBER&&(0,eL.css)` + &:after { + counter-increment: ${e.$nodeCounterName}; + content: counter(${e.$nodeCounterName}, decimal) '.'; + } + `} +`,ef7=function(e){let{nodeID:t,nodeFormat:a,completed:n,nodeCounterName:l}=e,r=(0,e$.useDispatch)(),o=ev.useCallback(()=>{r(P0(t))},[r,t]);return a===li.FORMAT_TEXT?null:ev.createElement(ef6,{$format:a},ev.createElement(ef8,{$format:a,$nodeCounterName:l,id:`checkbox-${t}`,className:"left",checked:n,onClick:o}))},ef9=(0,eL.default)(eiK).withConfig({displayName:"StyledSlateEditor",componentId:"sc-4277085c-0"})` + ${RK}; + + &.node-format-h1, + &.node-format-h2 { + margin-left: 0; + } +`,ehe=eL.default.tr.withConfig({displayName:"ProjectNode__Container",componentId:"sc-65940bf2-0"})` + // NOTE: (andrew@taskade.com) To force browsers to print the css in the bullet points. Default behaviour omits the printing of pure css elements. + print-color-adjust: exact; + -webkit-print-color-adjust: exact; + -moz-print-color-adjust: exact; + + ${e=>e.$shouldResetNodeCounter&&(0,eL.css)` + counter-reset: ${e.$nodeCounterName}; + `} +`,eht=(0,e$.connect)(function(e,t){let{node:a,ancestors:n,indexOfNode:l}=t,r=iL(e);return{childNodes:a.children.map(e=>r.findNodeByID(e)),previousNodeFormat:iJ(e,{ancestors:n,indexOfNode:l})}})(function(e){let{node:t,childNodes:a,ancestors:n,legacyParentChildrenNodeFormat:l,indexOfNode:r,previousNodeFormat:o,parentFormat:i,previousIndentationLevel:s}=e,d=t.format?.node??l??li.FORMAT_CHECKBOX,c=1===n.length?0:i===li.FORMAT_HEADING1||i===li.FORMAT_HEADING2?s:s+1,m=ev.useMemo(()=>[...n,t.id],[t.id,n]),u=d===li.FORMAT_HEADING1||d===li.FORMAT_HEADING2,p=()=>u?24*c:24*c+28,g=n[n.length-1],f=0===n.length?"nodeCounter":`nodeCounter-${g}`,h=ev.useMemo(()=>0===r||(d===li.FORMAT_NUMBER||d===li.FORMAT_ALPHA)&&(o===li.FORMAT_NUMBER||o===li.FORMAT_ALPHA)&&d!==o,[r,d,o]);return ev.createElement(ev.Fragment,null,ev.createElement("tr",{className:og()("w-full",{"h-2":u,"h-0.5":!u})}),ev.createElement(ehe,{$shouldResetNodeCounter:h,$nodeCounterName:f,className:"break-before-auto break-inside-avoid"},ev.createElement("td",null,ev.createElement("div",{className:"flex"},ev.createElement("div",{style:{width:`${24*c}px`}}),ev.createElement("div",null,ev.createElement(ef7,{nodeID:t.id,nodeFormat:d,completed:t.completed,nodeCounterName:f})),ev.createElement(ef9,{className:og()("text-appcolor-100",`node-format-${d}`),readOnly:!0,delta:t.text})),ev.createElement("div",{style:{marginLeft:`${p()}px`},className:"text-sm text-textcolor-500"},ev.createElement(X1,{nodeId:t.id,ancestors:n})),ev.createElement("div",{style:{marginLeft:`${p()}px`},className:"flex"},ev.createElement(efY,{node:t})))),a.map((e,a)=>ev.createElement(eht,{key:e.id,node:e,legacyParentChildrenNodeFormat:t.format?.children,ancestors:m,indexOfNode:a,parentFormat:d,previousIndentationLevel:c})),ev.createElement("tr",{className:og()("w-full",{"h-4":u,"h-0.5":!u})}))}),eha=function(e){let{node:t}=e;return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex flex-col"},ev.createElement(eiK,{className:"text-[22px] font-medium text-appcolor-100",readOnly:!0,delta:t.text})))},ehn=eL.default.div.withConfig({displayName:"DocumentContent__Container",componentId:"sc-a631d712-0"})` + counter-reset: nodeCounter; +`,ehl=(0,e$.connect)(function(e){let t=iL(e),a=t.rootNode.children.map(e=>t.findNodeByID(e));return{contents:t,rootNodeChildNodes:a,percentCompleted:dY(e)}})(function(e){let{contents:t,rootNodeChildNodes:a,percentCompleted:n}=e,l=ev.useMemo(()=>[t.rootID],[t.rootID]);return ev.createElement(ehn,{className:"flex flex-col bg-white"},ev.createElement("div",{className:"mb-4 mt-8 flex"},ev.createElement(Kd,{readOnly:!0}),ev.createElement("div",{className:"flex flex-col"},ev.createElement(eha,{node:t.rootNode}),ev.createElement("div",{className:"mt-1"},ev.createElement(pl,{percentCompleted:n,showTooltip:!0})))),ev.createElement("table",null,a.map((e,a)=>ev.createElement(eht,{key:e.id,node:e,legacyParentChildrenNodeFormat:t.rootNode.format?.children,ancestors:l,indexOfNode:a,parentFormat:e.format?.node,previousIndentationLevel:0}))))}),ehr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DocumentThemeQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"color"}}]}}]}}]}}]},eho=function(){let e=(0,eF.$B)("/print/:documentID"),{data:t,loading:a}=(0,eB.a)(ehr,{variables:{id:e.params.documentID},skip:null==e}),n=ev.useMemo(()=>({primaryColor:t?.document?.space?.color??void 0,isNightMode:!1}),[t]),l=ev.useCallback(()=>{try{document.execCommand("print",!1,null)||window.print()}catch{window.print()}},[]);return(ev.useLayoutEffect(()=>{if(a)return;l();let e=e=>{e.data===q.PRINT&&l()};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[a,l]),null==e)?ev.createElement(eI.Spinner,null):ev.createElement(eI.ThemeProvider,{theme:n},ev.createElement("div",{className:"flex flex-col"},ev.createElement(ehl,{projectId:e.params.documentID})))},ehi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PublicProjectQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicProject"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"documentId"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"addons"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dates"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeId"}},{kind:"Field",name:{kind:"Name",value:"author"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"addonDate"}}]}},{kind:"Field",name:{kind:"Name",value:"countdowns"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"last_used_duration"}},{kind:"Field",name:{kind:"Name",value:"creator"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"states"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"end"}},{kind:"Field",name:{kind:"Name",value:"actor"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"removed"}}]}},{kind:"Field",name:{kind:"Name",value:"reactionCollections"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"emojis"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"users"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"skin"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preferences"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},ehs="@@taskade/documentPreferences/SET_HIDE_COMPLETED";function ehd(e){return{type:ehs,payload:{hideCompleted:e}}}let ehc={"bg-color-1":"#ffb2b9","bg-color-2":"#ffdfb8","bg-color-3":"#b8ffc7","bg-color-4":"#b9e1ff","bg-color-5":"#FC5C65","bg-color-6":"#FD9644","bg-color-7":"#FED330","bg-color-8":"#26DE81","bg-color-9":"#2BCBBA","bg-color-10":"#45AAF2","bg-color-11":"#4B7BEC","bg-color-12":"#A55EEA","bg-color-13":"#D1D8E0","bg-color-14":"#778CA3","bg-color-15":"#333333","bg-color-16":"#F6C647","bg-color-17":"#CBE45A","bg-color-18":"#5EC8C3","bg-color-19":"#F1ABDC","bg-color-20":"#DB586A","bg-color-21":"#EBA342","bg-color-22":"#ABCA53","bg-color-23":"#3F87A4","bg-color-24":"#CD84F3","bg-color-25":"#A73E70","bg-color-26":"#DD6437","bg-color-27":"#419240","bg-color-28":"#2151D5","bg-color-29":"#9581F3","bg-color-30":"#7A396E","bg-color-31":"#D73934","bg-color-32":"#296165","bg-color-33":"#1A1460","bg-color-34":"#5758B5","bg-color-35":"#66244F","bg-color-36":"#F1A886","bg-color-37":"#61C9F3","bg-color-38":"#E2B759","bg-color-39":"#80E3C3","bg-color-40":"#CCD3C9","bg-color-41":"#E9865C","bg-color-42":"#499AF5","bg-color-43":"#F7F0C0","bg-color-44":"#6FAFA0","bg-color-45":"#2F3A46","bg-color-46":"#A54170","bg-color-47":"#3B3B93","bg-color-48":"#EC7A77","bg-color-49":"#ADEADC","bg-color-50":"#CEA4E4","bg-color-51":"#65274E","bg-color-52":"#1D2C5E","bg-color-53":"#E9537C","bg-color-54":"#BFC589","bg-color-55":"#7C5A9B","bg-color-56":"#84ECC7","bg-color-57":"#9CEAEB","bg-color-58":"#84B7F9","bg-color-59":"#A19BF7","bg-color-60":"#E0E6E9","bg-color-61":"#53B596","bg-color-62":"#5DCBC8","bg-color-63":"#3A82DC","bg-color-64":"#6A5DDF","bg-color-65":"#B4BEC3","bg-color-66":"#FCEBAF","bg-color-67":"#EFB4A4","bg-color-68":"#EE7E79","bg-color-69":"#ED81A7","bg-color-70":"#656E72","bg-color-71":"#F5CD7C","bg-color-72":"#D3765C","bg-color-73":"#C5403A","bg-color-74":"#D65191","bg-color-75":"#2E3436","bg-color-76":"#F2A4EF","bg-color-77":"#F6CC6B","bg-color-78":"#ED7470","bg-color-79":"#76D8F7","bg-color-80":"#63CEA4","bg-color-81":"#E271DB","bg-color-82":"#F2A456","bg-color-83":"#DD5D59","bg-color-84":"#55BADF","bg-color-85":"#4FAA87","bg-color-86":"#5FCFD2","bg-color-87":"#669EF8","bg-color-88":"#582BC5","bg-color-89":"#CBD6E4","bg-color-90":"#5A6573","bg-color-91":"#49A1A3","bg-color-92":"#4784D8","bg-color-93":"#312091","bg-color-94":"#8795A5","bg-color-95":"#252F3D","bg-color-96":"#DE6279","bg-color-97":"#595FC8","bg-color-98":"#72CCF6","bg-color-99":"#73E4E3","bg-color-100":"#6BE58B","bg-color-101":"#E24C5C","bg-color-102":"#3C40BF","bg-color-103":"#55B9F4","bg-color-104":"#62D5D5","bg-color-105":"#59C174","bg-color-106":"#F6C35F","bg-color-107":"#FADE70","bg-color-108":"#ED695E","bg-color-109":"#D4DAE1","bg-color-110":"#4B545F","bg-color-111":"#F3AC3D","bg-color-112":"#F8D553","bg-color-113":"#EB5141","bg-color-114":"#838E9A","bg-color-115":"#20272D"},ehm=new Map(Object.entries(ehc)),ehu=eL.default.div.withConfig({displayName:"styled__Background",componentId:"sc-af75b872-0"})` + width: 100%; + flex: 0 0 220px; + pointer-events: none; + border-bottom: 1px solid ${e=>e.theme.primaryColorScheme?.alpha10}; + background: ${e=>e.theme.appColors.hex(90)} no-repeat center; + background-size: cover; + + ${e=>{switch(e.$backgroundState.type){case"image":return` + background-image: url("${e.$backgroundState.value}"); + `;case"color":if(e.$backgroundState.value in ehc)return` + background-image: none; + background-color: ${ehm.get(e.$backgroundState.value)}; + `;return` + margin-top: 12px; + `;case"none":return` + flex: 0 0 0px; + margin-bottom: 60px; + background: ${e.theme.appColors.hex(100)}; + border: none; + `;default:return` + //margin-top: 12px; + `}}} + + ${e=>"background"===e.$coverImageType&&(0,eL.css)` + @media (min-width: 992px) { + position: fixed; + height: 100%; + top: 0; + left: 0; + z-index: 0; + } + `}; + + ${e=>"banner"===e.$coverImageType&&(0,eL.css)` + @media (min-width: 992px) { + position: sticky; + left: 0; + z-index: 0; + } + `}; + + ${e=>"none"===e.$coverImageType&&(0,eL.css)` + @media (min-width: 992px) { + display: none; + } + `}; +`;(0,eL.default)(eiK).withConfig({displayName:"styled__StyledSlateEditor",componentId:"sc-af75b872-1"})` + div { + max-width: 200px; + overflow: hidden; + white-space: nowrap !important; + text-overflow: ellipsis; + + @media (min-width: 992px) { + max-width: 400px; + } + } +`;let ehp=(0,e$.connect)(function(e,t){return{attachments:iA(e,{nodeID:t.node.id})}})(function(e){let{attachments:t}=e,a=(0,e$.useDispatch)(),n=ev.useMemo(()=>{let e=t?.media?.attachments??[],a=t?.media?.uploadingAttachments??[],n=uz()(a,12),l=uz()(e,12-n.length);return[...n,...l]},[t]),l=ev.useCallback((e,t)=>{a(Z$.actions.toggleMediaDialog({media:n,index:t}))},[a,n]);return ev.createElement(eau,{currentUserId:null,media:n,hasFileDeletePermission:!1,readOnly:!0,onDelete:()=>{},onSelect:l})}),ehg=e=>null!=e.dates&&e.dates.total>0||null!=e.assignees&&e.assignees.total>0||null!=e.comments&&e.comments.total>0||null!=e.countdowns&&e.countdowns.total>0||null!=e.reactionCollections&&e.reactionCollections.total>0,ehf=eL.default.button.withConfig({displayName:"styled__AssigneesButton",componentId:"sc-d4c39bc8-0"})` + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + & img { + filter: grayscale(1); + } + `} +`,ehh=function(e){let{assignees:t,nodeCompleted:a}=e,n=t.attachments,l=ev.useMemo(()=>{let e=[],t=[];for(let a of n){let n=a.assignee;e.push(n.handle),t.push(ev.createElement(e1.UserAvatar,{className:"-ml-3 first:ml-0",size:"xs",shape:"circle",key:a.id,src:n.avatars_v2.small?.mdpi.url,alt:n.handle}))}return ev.createElement(ev.Fragment,null,t,ev.createElement("span",{className:"mx-1.5 whitespace-nowrap"},e.join(", ")))},[n]);return 0===t.attachments.length?null:ev.createElement("div",{className:"mb-[5px]"},ev.createElement(ehf,{className:"flex cursor-default items-center self-center rounded-2xl border border-solid border-appcolor-300 bg-appcolor-200 px-1 py-[1px] text-xs text-textcolor-900",$nodeCompleted:a},l))},ehy=function(e){let{comments:t,nodeCompleted:a,nodeId:n,projectId:l}=e;return 0===t.total?null:ev.createElement("div",{className:"flex items-center self-center"},ev.createElement(et3,{documentID:l,nodeID:n,numberOfComments:t.total,readOnly:!0,nodeCompleted:a}))},ehb=(0,eL.default)(tn.Icon).attrs({icon:"addon_timer"}).withConfig({displayName:"NodeAddonCountdownsButton__CountdownIcon",componentId:"sc-db6ab9fe-0"})` + color: ${e=>e.$accentColor??e.theme.textColors.hex(20)}; +`,ehv=function(e){let{countdowns:t,nodeCompleted:a}=e,n=t.attachments[0],l=eaH(ev.useMemo(()=>null==n?null:ea0(n),[n]));return 0===t.total?null:ev.createElement("div",{className:"mb-[5px] flex items-center self-center rounded-2xl border border-solid border-appcolor-300 bg-appcolor-200 px-1 py-[1px] text-xs text-textcolor-900"},ev.createElement(ehb,{$accentColor:l.accentColor,$nodeCompleted:a}),l.timeRemaining&&ev.createElement("span",{className:"ml-1",style:{color:`${l.accentColor}`}},ez.IsoDurationHelpers.unstable_formatToShortDuration(l.timeRemaining)))};!function(e){e[e.HasStarted=0]="HasStarted",e[e.HasEnded=1]="HasEnded",e[e.Upcoming=2]="Upcoming",e[e.Completed=3]="Completed"}(ee||(ee={}));let ehk=eL.default.button.withConfig({displayName:"styled__DueDateButton",componentId:"sc-ac4615e4-0"})` + ${e=>{let t;switch(e.$state){case ee.HasEnded:t=(0,eI.getColorScheme)(eI.ThemeColors.danger);break;case ee.Completed:return(0,eL.css)` + color: ${e.theme.textColors.hex(60)}; + background: none; + `}return null!=t?(0,eL.css)` + border-color: ${t?.alpha50}; + background-color: ${e.$active?t?.alpha20:t?.alpha10}; + color: ${t?.base}; + `:null}} +`,ehE=function(e){let{icon:t,text:a,state:n,active:l}=e;return ev.createElement("div",null,ev.createElement(ehk,{$state:n,$active:l,disabled:!0,className:"flex cursor-default items-center gap-1 self-center rounded-2xl border border-solid border-appcolor-300 bg-appcolor-200 px-2 py-[1px] text-xs text-textcolor-900"},ev.createElement(tn.Icon,{className:"flex-shrink-0",icon:t}),ev.createElement("span",{className:"text-xs"},a)))},ehx=function(e){let{dueDate:t,nodeCompleted:a}=e,n=t.attachments[0],l=null!=n.addonDate&&"recurrence"in n,r=ev.useMemo(()=>{if(null==n)return{text:"",state:ee.Upcoming};let{start:e,end:t}=n.addonDate,l=ez.DateDuration.fromDateRangeDesc({start:e,end:t}),r=ee.Upcoming;switch(l.toRelativeStatus()){case"has_ended":r=ee.HasEnded;break;case"has_started":r=ee.HasStarted}return a&&(r=ee.Completed),{text:l.toReadableFormat(),state:r}},[n,a]);return ev.createElement("div",{className:"mb-[5px]"},ev.createElement(ehE,{icon:l?"addon_date_repeat":"addon_date",text:r.text,state:r.state,active:!1}))},eh_=eL.default.button.withConfig({displayName:"styled__MediaButton",componentId:"sc-15b54bb9-0"})` + ${e=>e.$nodeCompleted&&(0,eL.css)` + background-color: transparent; + color: ${e.theme.appColors.hex(50)}; + + & img { + filter: grayscale(1); + } + `} +`,ehw=(0,eL.default)(tn.Icon).attrs({icon:"addon_upload"}).withConfig({displayName:"styled__UploadIcon",componentId:"sc-15b54bb9-1"})` + flex-shrink: 0; +`,ehN=eL.default.span.withConfig({displayName:"styled__Counter",componentId:"sc-15b54bb9-2"})` + ${e=>e.$nodeCompleted&&(0,eL.css)``} + + margin-left: 5px; +`,ehC=function(e){let{media:t,nodeCompleted:a}=e,n=t?.total??0,l=0===n?null:n;return ev.createElement("div",{className:"mb-[5px]"},ev.createElement(eh_,{className:"flex cursor-default items-center self-center rounded-2xl border border-solid border-appcolor-300 bg-appcolor-200 px-1 py-[1px] text-xs text-textcolor-900",$nodeCompleted:a},ev.createElement("label",null,ev.createElement(ehw,{$nodeCompleted:a}),null!=l&&ev.createElement(ehN,{$nodeCompleted:a},l))))},ehM=function(e){let{reactionCollections:t,nodeCompleted:a,projectId:n,nodeId:l}=e,[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1});return ev.createElement("div",{className:"flex items-center self-center text-xs text-textcolor-900"},ev.createElement(eaL,{projectId:n,nodeId:l,popupState:r,popupDispatch:o,nodeCompleted:a,reactionCollections:t,showAlways:!0}))},ehS=(0,e$.connect)(function(e,t){return{attachments:iA(e,{nodeID:t.node.id}),projectId:dP(e)??"",documentSharedPreferences:dF(e)}})(function(e){let{node:t,attachments:a,projectId:n,documentSharedPreferences:l}=e;return null!=a&&ehg(a)?ev.createElement("div",{className:"mt-0.5 flex gap-1"},null!=a.dates&&ev.createElement(ehx,{dueDate:a.dates,nodeCompleted:t.completed}),null!=a.assignees&&ev.createElement(ehh,{assignees:a.assignees,nodeCompleted:t.completed}),null!=a.comments&&l?.commentsMode==="enabled"&&ev.createElement(ehy,{comments:a.comments,nodeCompleted:t.completed,projectId:n,nodeId:t.id}),null!=a.countdowns&&ev.createElement(ehv,{countdowns:a.countdowns,nodeCompleted:t.completed}),null!=a.reactionCollections&&ev.createElement(ehM,{reactionCollections:a.reactionCollections,nodeCompleted:t.completed,projectId:n,nodeId:t.id}),null!=a.media&&ev.createElement(ehC,{media:a.media,nodeCompleted:t.completed})):null}),ehI=(0,eL.css)` + &:after { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + white-space: nowrap; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } +`,ehD=(0,eL.css)` + ${ehI} + + &:after { + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,ehT=(0,eL.css)` + ${ehI}; + + &:after { + color: ${e=>e.theme.appColors.hex(50)}; + font-size: 0.9375rem; + padding-top: 0.325rem; + } + + &:hover { + &:after { + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + } + } +`,eh$=(0,eL.css)` + ${ehI} + + &:after { + margin-top: 2px; + border: 1px solid ${e=>e.theme.isNightMode?"#666666":"#ccc"}; + border-radius: 6px; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected3.svg":"/../images/check_hover3.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected3.svg'); + } + } +`,ehP=(0,eL.css)` + ${eh$} + + &:after { + border-radius: 25px; + } +`,ehF=(0,eL.css)` + ${ehI} + + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_heart2.svg'); + margin-top: 5px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_heart2.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_heart_selected2.svg'); + opacity: 1; + transform: scale(1); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_heart_selected2.svg'); + } +`,ehA=(0,eL.css)` + ${ehI} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border-radius: 25px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,ehR=(0,eL.css)` + ${ehI} + + &:after { + border-radius: 25px; + content: ''; + } + /* Checkbox Icon: Check Icon */ + &:not(:checked):after, + &:checked:after { + content: url('/../images/check_triangle.svg'); + margin-left: -2px; + } + /* Checkbox Icon: Not Checked */ + &:not(:checked):after { + opacity: 1; + transform: scale(1); + content: url('/../images/check_triangle.svg'); + } + /* Checkbox Icon: Not Checked Hover */ + &:not(:checked):hover:after { + content: url('/../images/check_triangle.svg'); + opacity: 1; + transform: scale(1.4); + } + /* Checkbox Icon: Checked */ + &:checked:after { + opacity: ${e=>e.theme.isNightMode?"0.4":"1"}; + transform: scale(1); + content: url('/../images/check_triangle_selected.svg'); + } +`,ehj=(0,eL.css)` + ${ehI} + + &:after { + width: 8px; + height: 8px; + margin: 8px 0 0 5px; + border: 1px solid ${e=>e.theme.isNightMode?"#999":"#ccc"}; + border-radius: 1px; + background: ${e=>e.theme.isNightMode?"#999":"#ccc"}; + content: ''; + } + /* Not Checked: Hover */ + &:not(:checked):hover:after { + transform: scale(1.6); + } + /* Checked Style */ + &:checked:after { + border: 1px solid ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + background: ${e=>e.theme.isNightMode?"#666":"#e5e5e5"}; + } + /* Checked: Hover */ + &:checked:hover:after { + transform: scale(1.6); + } +`,ehO=eL.default.div.withConfig({displayName:"NodeBullet__Wrapper",componentId:"sc-c4250762-0"})` + display: flex; + margin-right: 8px; + margin-left: 2px; + + ${e=>{switch(e.$format){case li.FORMAT_HEADING1:case li.FORMAT_HEADING2:case li.FORMAT_TEXT:return(0,eL.css)` + display: none; + `}}} +`,ehU=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"NodeBullet__Checkbox",componentId:"sc-c4250762-1"})` + width: 1.125rem; + height: 1.125rem; + -webkit-appearance: none; + + ${e=>e.$format===li.FORMAT_ALPHA&&ehT} + ${e=>e.$format===li.FORMAT_NUMBER&&ehD} + ${e=>e.$format===li.FORMAT_CHECKBOX&&eh$} + ${e=>e.$format===li.FORMAT_CIRCLE_CHECK&&ehP} + ${e=>e.$format===li.FORMAT_HEART&&ehF} + ${e=>e.$format===li.FORMAT_BULLET&&ehA} + ${e=>e.$format===li.FORMAT_TRIANGLE&&ehR} + ${e=>e.$format===li.FORMAT_SQUARE&&ehj} + + ${e=>e.$format===li.FORMAT_ALPHA&&(0,eL.css)` + &:after { + counter-increment: ${e.$nodeCounterName}; + content: counter(${e.$nodeCounterName}, lower-alpha) '.'; + } + `} + + ${e=>e.$format===li.FORMAT_NUMBER&&(0,eL.css)` + &:after { + counter-increment: ${e.$nodeCounterName}; + content: counter(${e.$nodeCounterName}, decimal) '.'; + } + `} +`,ehZ=function(e){let{nodeID:t,nodeFormat:a,completed:n,nodeCounterName:l}=e;return a===li.FORMAT_TEXT?null:ev.createElement(ehO,{$format:a},ev.createElement(ehU,{$format:a,$nodeCounterName:l,id:`checkbox-${t}`,className:"left",checked:n}))},ehL=(0,eL.default)(eiK).withConfig({displayName:"StyledSlateEditor",componentId:"sc-c19c9550-0"})` + ${RK}; + + &.node-format-h1, + &.node-format-h2 { + margin-left: 0; + } + ${e=>e.$isCompleted&&(0,eL.css)` + a { + color: #6c7370 !important; + } + a:hover { + color: #ff2d60 !important; + } + `} +`,ehB=eL.default.div.withConfig({displayName:"ProjectNode__NodeWrapper",componentId:"sc-5732c182-0"})` + ${e=>e.$isParentNode&&(0,eL.css)` + margin-top: 30px; + + :first-child { + margin-top: 0px; + } + `} + + ${e=>e.$shouldResetNodeCounter&&(0,eL.css)` + counter-reset: ${e.$nodeCounterName}; + `} +`,ehz=eL.default.div.withConfig({displayName:"ProjectNode__NodeTitleRight",componentId:"sc-5732c182-1"})` + ${e=>e.$showFoldLine&&(0,eL.css)` + :before { + display: flex; + content: ' '; + height: calc(100% - 1.75rem); + width: 0.0625rem; + position: absolute; + z-index: 1; + left: 0.5rem; + margin-left: ${30*e.$indentationLevel}px; + top: 1.75rem; + background: ${e.theme.appColors.hex(60)}; + } + `} +`,ehV=(0,e$.connect)(function(e,t){let{ancestors:a,indexOfNode:n}=t,l=iL(e),r=iG(e);return{previousNodeFormat:iJ(e,{ancestors:a,indexOfNode:n}),contents:l,documentPreferences:r}})(function(e){let{node:t,ancestors:a,legacyParentChildrenNodeFormat:n,indexOfNode:l,previousNodeFormat:r,parentFormat:o,previousIndentationLevel:i,contents:s,documentPreferences:d}=e,c=ev.useMemo(()=>t.children.filter(e=>d.isNodeIDVisible(e)),[d,t.children]).map(e=>s.findNodeByID(e)),m=t.format?.node??n??li.FORMAT_CHECKBOX,u=1===a.length?0:o===li.FORMAT_HEADING1||o===li.FORMAT_HEADING2?i:i+1,p=ev.useMemo(()=>[...a,t.id],[t.id,a]),g=a[a.length-1],f=0===a.length?"nodeCounter":`nodeCounter-${g}`,h=ev.useMemo(()=>0===l||(m===li.FORMAT_NUMBER||m===li.FORMAT_ALPHA)&&(r===li.FORMAT_NUMBER||r===li.FORMAT_ALPHA)&&m!==r,[l,m,r]),y=t.collapsed,b=ev.useMemo(()=>!!t.hasChild,[t]),v=b||a.length>1&&b;return ev.createElement(ehB,{$isParentNode:1===a.length&&(m===li.FORMAT_HEADING1||m===li.FORMAT_HEADING2),$nodeCounterName:f,$shouldResetNodeCounter:h,className:"relative"},ev.createElement("div",{className:"flex grow break-before-auto break-inside-avoid rounded-[10px]"},ev.createElement("div",{style:{width:`${30*u}px`,flexShrink:0}}),ev.createElement("div",{className:"flex h-7 w-7 justify-end pr-[0.625rem]"},b?ev.createElement(emT,{nodeId:t.id,collapsed:y}):ev.createElement("div",{className:"w-5 shrink-0"})),ev.createElement(ehZ,{nodeID:t.id,nodeFormat:m,completed:t.completed,nodeCounterName:f}),ev.createElement(ehz,{$showFoldLine:v,$indentationLevel:u,className:"flex w-full flex-1 flex-col"},ev.createElement(ehL,{className:og()("text-textcolor-900",`node-format-${m}`,"!pb-0",`${t.completed&&"!text-textcolor-400 line-through hover:no-underline"}`),readOnly:!0,delta:t.text,$isCompleted:t.completed}),ev.createElement("div",{className:"text-sm text-textcolor-500"},ev.createElement(X1,{nodeId:t.id,ancestors:a})),ev.createElement("div",{className:"text-sm text-textcolor-500"},ev.createElement(G1,{className:"attachment-wrapper"},ev.createElement(ehp,{node:t}))),ev.createElement(ehS,{node:t}))),!y&&c.map((e,a)=>ev.createElement(ehV,{key:e.id,node:e,legacyParentChildrenNodeFormat:t.format?.children,ancestors:p,indexOfNode:a,parentFormat:m,previousIndentationLevel:u})))}),ehq=function(e){let{node:t}=e;return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex flex-col"},ev.createElement(eiK,{className:"text-[22px]",readOnly:!0,delta:t.text})))},ehW=eL.default.div.withConfig({displayName:"Content__Container",componentId:"sc-494f8494-0"})` + counter-reset: nodeCounter; +`,ehH=(0,e$.connect)(function(e){let t=iL(e),a=iG(e);return{contents:t,percentCompleted:dY(e),documentSharedPreferences:dF(e),status:dL(e)??{createdBy:"Guest",updatedAt:cc().now(),updatedBy:"Guest"},documentPreferences:a}})(function(e){let{contents:t,percentCompleted:a,documentSharedPreferences:n,status:l,coverImageType:r,documentPreferences:o}=e,i=ev.useMemo(()=>t.rootNode.children.filter(e=>o.isNodeIDVisible(e)),[t.rootNode.children,o]).map(e=>t.findNodeByID(e)),{createdBy:s,updatedAt:d,updatedBy:c}=l,m=ev.useMemo(()=>[t.rootID],[t.rootID]);return ev.createElement(ehW,{className:`mb-20 flex w-full flex-col items-center bg-appcolor-0 ${"background"===r&&"lg:mt-[30px] lg:w-[800px] lg:rounded-2xl xl:w-[1200px]"} `},ev.createElement("div",{className:"px-10 lg:w-[800px] lg:px-[60px] xl:w-[1200px]"},ev.createElement("div",{className:`-mt-8 mb-4 flex flex-col px-[26px] lg:mt-[40px] lg:flex-row ${"banner"===r&&"lg:!-mt-8 lg:flex-col"}`},ev.createElement("div",{className:"mb-5 mr-4 cursor-default"},ev.createElement(Ka,null,n?.avatar?.type==="emoji"?n.avatar.value:ev.createElement(Kt,null))),ev.createElement("div",{className:"flex flex-col"},ev.createElement(ehq,{node:t.rootNode}),ev.createElement("div",{className:"mt-1 hidden lg:block"},ev.createElement(pl,{percentCompleted:a,showTooltip:!0})))),ev.createElement("div",null,i.map((e,a)=>ev.createElement(ehV,{key:e.id,node:e,legacyParentChildrenNodeFormat:t.rootNode.format?.children,ancestors:m,indexOfNode:a,parentFormat:e.format?.node,previousIndentationLevel:0}))),ev.createElement("div",{className:"my-10 flex max-w-[1000px] justify-center text-xs text-textcolor-500"},"Created by ",s," · Updated by ",c," ",cc()(d).fromNow())),ev.createElement("a",{href:"https://www.taskade.com",className:"text-moving-rainbow relative -bottom-10 text-sm"},"Powered by Taskade"))}),ehG=(0,e$.connect)(function(e){let t=iL(e);return{projectId:dP(e)??"",documentSharedPreferences:dF(e),contents:t}})(function(e){let{documentSharedPreferences:t,contents:a,projectId:n}=e,l=(0,e$.useDispatch)(),r=(0,eF.TH)(),o=(0,eF.$B)("/p/:publicDocumentIdWithSlug"),i=o?.params.publicDocumentIdWithSlug,s=i?.split("-").pop()??null,{data:d}=(0,eB.a)(ehi,{variables:{documentId:n}}),c=ev.useMemo(()=>(function(e){if(null==e)return{background:{type:"default",data:{value:"bg-random"}},type:"image",value:"/images/wallpaper"};switch(e.type){case"custom":{let{file:t}=e.data;if(!["image/jpeg","image/png"].includes(t.mimetype))return{background:{type:"default",data:{value:"bg-none"}},type:"none"};let a=jO(e.data.file,"h_200,w_200","xhdpi");return{background:e,type:"image",value:a.view}}case"default":{let t=e.data.value;if("bg-random"===t)return{background:e,type:"image",value:"/images/wallpaper"};if("bg-none"===t)return{background:e,type:"none"};if(t.startsWith("bg-color"))return{background:e,type:"color",value:t};if(t.startsWith("gradient")){if(/^gradient-\d{4}$/.test(t))return{background:e,type:"image",value:`/images/gradients/gradient-${t.slice(-4)}.png`};return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}else if(t.startsWith("art")){if(/^art-\d{4}$/.test(t))return{background:e,type:"image",value:`/images/artwork/art-${t.slice(-4)}.jpg`};return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}else{if(/^bg-\d{4}$/.test(t))return{background:e,type:"image",value:`/images/wallpapers/${t.slice(-4)}.jpg`};return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}}default:return{background:{type:"default",data:{value:"bg-none"}},type:"none"}}})(t?.background),[t?.background]),m=ev.useMemo(()=>d?.publicProject?.preferences?.coverImageType==null?t?.coverImageType??jZ:d?.publicProject?.preferences?.coverImageType,[t?.coverImageType,d?.publicProject?.preferences?.coverImageType]);ev.useEffect(()=>{d?.publicProject?.preferences?.hideCompleted!=null&&l(ehd(d?.publicProject?.preferences?.hideCompleted))},[l,d?.publicProject?.preferences?.hideCompleted]);let u=d?.publicProject?.document?.addons?.dates;ev.useEffect(()=>{null!=u&&l(x_(u))},[u,l]);let p=d?.publicProject?.document?.addons?.countdowns;ev.useEffect(()=>{null!=p&&l(xw(p))},[p,l]);let g=d?.publicProject?.document?.addons?.reactionCollections;if(ev.useEffect(()=>{null!=g&&l(xN(g))},[g,l]),ev.useEffect(()=>{""===n&&"undefined"!=typeof window&&window.location.reload()},[r,n]),null==o||null==s||""===n)return ev.createElement("div",{className:"grid h-screen place-items-center"},ev.createElement(eI.Spinner,null));let f=eL.default.a.withConfig({displayName:"ListView__RainbowButton",componentId:"sc-3272cf30-0"})` + position: relative; + margin-left: 12px; + background-color: transparent; + border-radius: 20px; + text-decoration: none; + font-weight: 600; + padding: 8px 18px; + display: flex; + align-items: center; + justify-content: center; + transition: + background-color 0.3s, + color 0.3s; + + &:before { + content: ''; + position: absolute; + inset: -1px; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(0deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + will-change: filter; + } + + &:hover { + background-color: rgba(255, 255, 255, 0.1); + color: #fff; + } + `;return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"sticky top-0 z-20 flex min-h-[52px] w-full items-center justify-between border-b border-solid border-appcolor-300 bg-appcolor-0"},ev.createElement("h1",{className:"ml-4 cursor-default truncate"},t?.avatar?.type==="emoji"&&t.avatar.value," ",a.rootNode.textString),ev.createElement(f,{href:"https://www.taskade.com",className:"mr-4 flex h-7 items-center whitespace-nowrap rounded-7 px-3 text-sm font-medium transition duration-200 ease-in-out"},ev.createElement("span",{className:"text-moving-rainbow"},"Sign up for free"))),ev.createElement("div",{className:"flex flex-col items-center"},ev.createElement(ehu,{$backgroundState:c,$coverImageType:m,className:"sticky left-0 z-0 lg:fixed lg:top-0 lg:h-[100%]"}),ev.createElement("div",{className:"z-10 flex w-[100%] flex-col items-center"},ev.createElement(ehH,{coverImageType:m}))))}),ehK=function(e){let{projectId:t}=e,a=(0,eF.k6)(),n=(0,eF.TH)(),{replace:l}=a,{data:r}=(0,eB.a)(ehi,{variables:{documentId:t}});ev.useEffect(()=>{if(0!==n.search.length)return;let e=r?.publicProject?.preferences?.isDarkMode;if(null==e)return;let t=new URLSearchParams;!0===e?t.append("theme","dark"):t.append("theme","light"),l({pathname:n.pathname,search:t.toString()})},[n,r?.publicProject?.preferences,l]);let o=ev.useMemo(()=>({[di]:ehG,[dl]:ehG,[dr]:ehG,[dn]:ehG,[ds]:ehG,[dd]:ehG,[dc]:ehG}),[])[dn]??ehG;return ev.createElement(gz,{spaceId:null,spaceType:null,spaceIsSubspace:null,spaceTaskadePlanType:null},ev.createElement(o,null),ev.createElement(ZR,null),ev.createElement(YA,null))},ehY=(0,e$.connect)(function(e){return{projectId:dP(e)??null}})(function(e){let{projectId:t}=e;return null==t?null:ev.createElement(ehK,{projectId:t})});var ehQ=a(25332);let ehJ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FlowQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flow"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"space_id"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"trigger"}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"color"}}]}}]}}]}}]},ehX={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PiecesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"logoUrl"}},{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"disclaimer"}},{kind:"Field",name:{kind:"Name",value:"authDesc"}},{kind:"Field",name:{kind:"Name",value:"actions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"expectedOutput"}}]}},{kind:"Field",name:{kind:"Name",value:"triggers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},eh0=function(e){let{flowId:t}=e,a=(0,eB.a)(ehJ,{variables:{id:t}}),n=(0,eB.a)(ehX),l=a.data?.flow.space.color,r=ev.useMemo(()=>{if(null!=l)return{primaryColor:l}},[l]),o=ev.useMemo(()=>{if(null!=l)return{"--color-primary":gW()(l??eI.Colors.BRAND).rgb().join(" ")}},[l]),i=a.loading||n.loading,s=a.error||n.error,d=ev.useMemo(()=>{if(null==a.data||null==n.data)return null;let{flow:e}=a.data,{pieces:t}=n.data;return{flow:e,pieces:t}},[a.data,n.data]);return i?ev.createElement("div",{className:"flex h-screen w-screen items-center justify-center"},ev.createElement(eI.Spinner,null)):null!=s?ev.createElement("div",{className:"flex h-screen w-screen items-center justify-center"},ev.createElement("span",null,s.message)):null==d?ev.createElement("div",{className:"flex h-screen w-screen items-center justify-center"},ev.createElement("span",null,ev.createElement(eY.Z,{id:"flow.error.missing_context",defaultMessage:"Missing Context"}))):ev.createElement("div",{className:"flex h-screen flex-col overflow-hidden",style:o},ev.createElement(eI.ThemeProvider,{theme:r},ev.createElement(ehQ.j3,{context:d})))};var eh1=a(55667);a(30218);var eh2=a(59819),eh5=a(70173),eh3=a(92474),eh4=a(91739);let eh6=(0,eh5.Z)().nodeSize([200,150]).separation(()=>1),eh8={duration:300},eh7=e=>e.nodeInternals.size,eh9=function(){let e=ev.useRef(!0),t=(0,eh1.oR)(eh7),a=(0,eh1.B)({includeHiddenNodes:!1}),{getNodes:n,getNode:l,setNodes:r,setEdges:o,getEdges:i,fitView:s}=(0,eh1._K)();ev.useEffect(()=>{if(!a)return;let t=n(),o=i(),d=(0===t.length?[]:eh6((0,eh3.Z)().id(e=>e.id).parentId(e=>o.find(t=>t.target===e.id)?.source)(t)).descendants().map(e=>({...e.data,position:{x:e.x,y:e.y}}))).map(e=>({id:e.id,from:l(e.id)?.position||e.position,to:e.position,node:e})),c=(0,eh4.HT)(t=>{let a=t/eh8.duration;r(d.map(e=>{let{node:t,from:n,to:l}=e;return{id:t.id,position:{x:n.x+(l.x-n.x)*a,y:n.y+(l.y-n.y)*a},height:t.height,width:t.width,data:{...t.data},type:t.type}})),t>eh8.duration&&(r(d.map(e=>{let{node:t,to:a}=e;return{id:t.id,position:{x:a.x,y:a.y},height:t.height,width:t.width,data:{...t.data},type:t.type}})),c.stop(),e.current||s({duration:200,padding:.2}),e.current=!1)});return()=>{c.stop()}},[t,i,n,l,r,s,o,a])},eye=ev.createContext(void 0),eyt=function(e){let{children:t,value:a}=e;return ev.createElement(eye.Provider,{value:a},t)};function eya(){let e=ev.useContext(eye);return(0,ei.assert)(null!=e),e}let eyn="@taskade/automade-internalpiece-openai",eyl=new Set(["@taskade/automade-internalpiece-taskade",eyn]),eyr=new Set(["@taskade/automade-piece-surveymonkey"]),eyo=new Set(["@taskade/automade-piece-gmail"]),eyi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PiecesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"logoUrl"}},{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"authDesc"}},{kind:"Field",name:{kind:"Name",value:"actions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}}]}},{kind:"Field",name:{kind:"Name",value:"triggers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},eys=function(e){return ev.createElement("div",{className:"text-moving-rainbow mb-1 mt-4 px-4 text-2xs uppercase"},e.label)},eyd=function(e){let{morseChildProps:t}=e,{data:a}=t,{piece:n}=a,l=eyr.has(n.name)&&!0,r=eyo.has(n.name);return ev.createElement("button",{className:og()("flex w-full items-center gap-2 px-4 py-1.5 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":t.focused}),onMouseEnter:t.focus,onClick:t.activate},n.logoUrl.length>0&&ev.createElement("img",{className:"h-5 w-5",src:n.logoUrl}),a.displayName,l&&ev.createElement("span",{className:"ml-auto rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"automation.coming_soon",defaultMessage:"Coming soon"})),!l&&r&&ev.createElement("span",{className:"ml-auto rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"general.new",defaultMessage:"New"})))},eyc="PieceActionMenuItem",eym="TaskadeAISection",eyu={[eyc]:e=>ev.createElement(eyd,{morseChildProps:e})},eyp={[eym]:e=>ev.createElement(eys,e)},eyg=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),eyf=function(e){let{popupDispatch:t,onSelectAction:a}=e,[n,l]=ev.useState(""),r=(0,eK.Z)(),o=(0,eB.a)(eyi),[i,s]=ev.useState(null),d=ev.useRef(null),c=ev.useCallback(e=>{eyr.has(e.data.piece.name)||a(e.data)},[a]),m=ev.useMemo(()=>null==o.data?null:o.data.pieces.filter(e=>null!=e.actions&&e.actions.length>0),[o.data]),u=ev.useMemo(()=>{let e=[];if(null==m)return[];for(let t of m){let a=t.actions;if(null==a)continue;let n={type:"section",label:t.displayName,render:"@taskade/automade-internalpiece-openai"===t.name?eym:void 0,items:a.map(e=>({label:e.displayName,itemType:"piece_action",values:[e.displayName,t.displayName],data:{...e,piece:t},render:eyc}))};e.push(n)}return e},[m]);return(ev.useLayoutEffect(()=>{if(null==i)return;let e=requestAnimationFrame(()=>{i.focus()});return()=>{cancelAnimationFrame(e)}},[i]),o.loading)?ev.createElement("div",{className:"w-80 bg-appcolor-100 px-4 py-2 shadow"},ev.createElement(eI.Spinner,null)):ev.createElement("div",{className:"mr-8 w-80 overflow-y-auto overflow-x-hidden rounded-xl border border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement("div",{className:"flex border-b border-solid border-appcolor-300"},ev.createElement("input",{ref:s,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:t({type:"Collapse"});return;case eI.KeyboardKeys.Space:break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),d.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),d.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:d.current?.activateCurrentItem()}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onChange:e=>{l(e.target.value)},className:"w-full bg-transparent px-4 pb-3 pt-2 text-sm",placeholder:r.formatMessage({id:"automation.search_actions",defaultMessage:"Search actions..."})})),ev.createElement(tT,{ref:d,term:n,data:u,search:eyg,renderMap:eyu,sectionRenderMap:eyp,onActivate:c,renderEmptyState:ev.createElement("div",{className:"p-4 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}))}))},eyh={placeholder:function(e){let{id:t,sourceX:a,sourceY:n,targetX:l,targetY:r,sourcePosition:o,targetPosition:i,style:s,markerEnd:d}=e,[c]=(0,eh1.OQ)({sourceX:a,sourceY:n,sourcePosition:o,targetX:l,targetY:r,targetPosition:i});return ev.createElement("path",{id:t,style:s,className:"fill-none stroke-appcolor-300 stroke-1",strokeDasharray:"3 3",d:c,markerEnd:d})},workflow:function(e){let{id:t,sourceX:a,sourceY:n,targetX:l,targetY:r,sourcePosition:o,targetPosition:i,style:s,markerEnd:d}=e,{getEdge:c,getNode:m,setNodes:u,setEdges:p}=(0,eh1._K)(),{onSelectAction:g}=eya(),f=ev.useRef(null),h=ev.useRef(null),[y,b]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),v=(0,eI.usePopup)({referenceElementRef:f,popupElementRef:h,state:y,placement:"bottom"}),k=(0,eI.useMenuButton)({ref:f,state:y,dispatch:b}),E=ev.useCallback(e=>{let a=c(t);if(!a)return;let n=m(a.target);if(!n)return;let l=(0,ld.Z)(),{piece:r,name:o}=e,i=r.authDesc?.type!=="NONE",s=r.actions?.find(e=>e.name===o);if(null==s)throw Error("piece action should not be null");let d=Object.values(s.props).some(e=>e.required),f={id:l,position:{x:n.position.x,y:n.position.y},type:"action",data:{displayName:e.displayName,name:(0,ld.Z)(),type:"PIECE",valid:!i&&!d,settings:{input:{},inputUiInfo:{customizedInputs:{}},pieceName:r.name,pieceVersion:r.version,actionName:o}}},h={id:`${a.source}->${l}`,source:a.source,target:l,type:"workflow"},y={id:`${l}->${a.target}`,source:l,target:a.target,type:"workflow"};p(e=>e.filter(e=>e.id!==t).concat([h,y])),u(e=>{let t=e.findIndex(e=>e.id===a.target);return[...e.slice(0,t),f,...e.slice(t,e.length)]}),g?.(l)},[c,m,t,g,p,u]),[x,_,w]=(0,eh1.OQ)({sourceX:a,sourceY:n,sourcePosition:o,targetX:l,targetY:r,targetPosition:i});return ev.createElement(ev.Fragment,null,ev.createElement("path",{id:t,style:s,className:"fill-none stroke-appcolor-300 stroke-1",strokeDasharray:"3 3",d:x,markerEnd:d}),ev.createElement("g",{...k.props,transform:`translate(${_}, ${w})`,className:"group"},ev.createElement("rect",{onClick:()=>{if(!c(t))return},width:29,height:29,x:-15,y:-20,className:"pointer-events-auto cursor-pointer fill-applight-400 hover:fill-appcolor-400 dark:fill-appcolor-300",rx:7.5}),ev.createElement("rect",{width:29,height:29,x:-15,y:-20,className:"fill-1 fill-appcolor-200 transition duration-150 ease-in-out group-hover:fill-appcolor-300",rx:7.5}),ev.createElement("path",{className:"fill-1 fill-appcolor-500 transition duration-150 ease-in-out group-hover:fill-appcolor-800",transform:"translate(-15.5, -20.5)",fillRule:"evenodd",d:"M15.25 9a.75.75 0 0 1 .75.75V14h4.25a.75.75 0 0 1 0 1.5H16v4.25a.75.75 0 0 1-1.5 0V15.5h-4.25a.75.75 0 0 1 0-1.5h4.25V9.75a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"})),y.expanded&&ev.createElement(eI.Popup,{...v.props,dispatch:b,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),b({type:"Collapse"})}},ev.createElement(eyf,{popupDispatch:b,onSelectAction:E})))},invisible:function(){return null}},eyy=function(e){let{value:t,name:a,children:n,$warning:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a});return ev.createElement("button",{...o.props,className:og()("flex w-full items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-200",{"text-danger":l})},n)},eyb=function(e){let{nodeId:t,isTrigger:a}=e,n=ev.useRef(null),l=ev.useRef(null),{onSelectAction:r,recomputeTriggerExpectedOutput:o}=eya(),{setNodes:i,setEdges:s,getEdges:d,getNode:c}=(0,eh1._K)(),[m,u]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),p=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:m,placement:"bottom"}),g=(0,eI.useMenuButton)({ref:n,state:m,dispatch:u}),f=ev.useCallback(()=>{let e=c(t);if(null==e)throw Error("current node should not be null");if(r?.(null),"trigger"===e.data.name){let a=(0,es.ZP)(e,e=>{e.data.type="EMPTY",e.data.displayName="New Flow",e.data.settings={},e.data.valid=!1});i(e=>e.map(e=>e.id!==t?e:a)),o(a.data);return}let a=d(),n=a.find(e=>e.target===t),l=a.find(e=>e.source===t);if(null==n)throw Error("target edge should not be null");if(null==l)throw Error("source edge should not be null");let m=n.source;s(e=>e.filter(e=>e.id!==n.id).map(e=>{if(e.id!==l.id)return e;let t=c(m);return null==t?e:"trigger"===t.data.name?{...e,source:m,type:"invisible"}:{...e,source:m}})),i(e=>e.filter(e=>e.id!==t))},[t,d,c,r,o,s,i]),h=ev.useCallback(()=>{let e=c(t);if(null==e)throw Error("Current node should not be null");let a=d().find(e=>e.source===t);if(null==a)throw Error("Source edge should not be null");let n=c(a.target);if(null==n)throw Error("Direct sibling below should not be null");let l=(0,ld.Z)(),o=(0,es.ZP)(e.data,e=>{e.name=(0,ld.Z)(),e.displayName=`${e.displayName} (Copy)`}),m={id:l,position:{x:n.position.x,y:n.position.y},type:"action",data:o};i(e=>{let t=e.findIndex(e=>e.id===a.target);return[...e.slice(0,t),m,...e.slice(t,e.length)]});let u={id:`${a.source}->${l}`,source:a.source,target:l,type:"workflow"},p={id:`${l}->${a.target}`,source:l,target:a.target,type:a.type};s(e=>e.filter(e=>e.id!==a.id).concat([u,p])),r?.(l)},[d,c,t,r,s,i]),y=ev.useCallback(e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"delete":f();break;case"duplicate":h()}}u({type:"Collapse"})},[f,h]);return ev.createElement("div",null,ev.createElement("button",{...g.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),m.expanded?u({type:"Collapse"}):u({type:"Expand"})},className:"text-appcolor-500 hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"automate_menu"})),m.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:u,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:y},ev.createElement(eI.Menu,{loop:!0,className:"flex w-52 flex-col gap-px rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-2"},!a&&ev.createElement(eyy,{name:"duplicate"},ev.createElement(tn.Icon,{icon:"dd_duplicate"}),ev.createElement(eY.Z,{id:"general.duplicate",defaultMessage:"Duplicate"})),ev.createElement(eyy,{name:"delete",$warning:!0},ev.createElement(tn.Icon,{icon:"agent_delete"}),ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))))},eyv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PiecesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"logoUrl"}},{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"authDesc"}},{kind:"Field",name:{kind:"Name",value:"actions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}}]}},{kind:"Field",name:{kind:"Name",value:"triggers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},eyk=function(e){let{morseChildProps:t}=e,{data:a}=t;return ev.createElement("button",{className:og()("flex w-full items-center gap-2 px-4 py-1.5 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":t.focused}),onMouseEnter:t.focus,onClick:t.activate},ev.createElement("img",{className:"h-5 w-5",src:"https://assets.taskade.com/taskade.png"}),a.displayName,ev.createElement("span",{className:"ml-auto rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"automation.instant",defaultMessage:"Instant"})))};var eyE=a(94394);let eyx=function(e){let{morseChildProps:t}=e,{data:a}=t,{piece:n}=a,l=a.type!==eyE.X8.POLLING,r=eyr.has(n.name)&&!0,o=eyo.has(n.name);return ev.createElement("button",{className:og()("flex w-full items-center gap-2 px-4 py-1.5 text-sm hover:bg-appcolor-300",{"bg-appcolor-300":t.focused}),onMouseEnter:t.focus,onClick:t.activate},n.logoUrl.length>0&&ev.createElement("img",{className:"h-5 w-5",src:n.logoUrl}),a.displayName,!r&&l&&ev.createElement("span",{className:"ml-auto rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"automation.instant",defaultMessage:"Instant"})),r&&ev.createElement("span",{className:"ml-auto rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"automation.coming_soon",defaultMessage:"Coming soon"})),!r&&o&&ev.createElement("span",{className:"ml-auto rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"general.new",defaultMessage:"New"})))},ey_="PieceOptionMenuItem",eyw="DefaultOptionMenuItem",eyN={[ey_]:e=>ev.createElement(eyx,{morseChildProps:e}),[eyw]:e=>ev.createElement(eyk,{morseChildProps:e})},eyC=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),eyM=function(e){let{id:t,popupDispatch:a}=e,n=(0,eK.Z)(),[l,r]=ev.useState(""),{getNode:o,setNodes:i}=(0,eh1._K)(),{onSelectAction:s}=eya(),[d,c]=ev.useState(null),m=ev.useRef(null),u=(0,eB.a)(eyv),p=ev.useMemo(()=>null==u.data?null:u.data.pieces.filter(e=>null!=e.triggers&&e.triggers.length>0),[u.data]),g=ev.useCallback(e=>{let a=o(t);if(null!=a){switch(e.itemType){case"webhook_option":i(e=>e.map(e=>e.id!==a.id?e:(0,es.ZP)(e,e=>{e.data.type="WEBHOOK",e.data.displayName="Webhook Trigger",e.data.valid=!0,e.data.settings={inputUiInfo:{}}})));break;case"piece_option":{let{piece:t,displayName:n,name:l}=e.data;if(eyr.has(t.name))return;let r=t.authDesc?.type!=="NONE",o=t.triggers?.find(e=>e.name===l);if(null==o)throw Error("piece trigger should not be null");let s=Object.values(o.props).some(e=>e.required);i(e=>e.map(e=>e.id!==a.id?e:(0,es.ZP)(e,e=>{e.data.type="PIECE_TRIGGER",e.data.displayName=n,e.data.valid=!r&&!s,e.data.settings={pieceName:t.name,pieceVersion:t.version,triggerName:l,input:{},inputUiInfo:{}}})));break}default:throw Error("Not implemented")}s?.(a.id)}},[o,t,s,i]),f=ev.useMemo(()=>{let e=n.formatMessage({id:"general.webhook",defaultMessage:"Webhook"}),t=[{type:"section",label:n.formatMessage({id:"general.general",defaultMessage:"General"}),items:[{label:e,itemType:"webhook_option",values:["webhook",e],data:{displayName:e,iconName:""},render:eyw}]}];if(null==p)return[];for(let e of p){let a=e.triggers;if(null==a)continue;let n={type:"section",label:e.displayName,items:a.map(t=>({label:t.displayName,itemType:"piece_option",values:[t.displayName,e.displayName],data:{...t,piece:e},render:ey_}))};t.push(n)}return t},[n,p]);return(ev.useLayoutEffect(()=>{if(null==d)return;let e=requestAnimationFrame(()=>{d.focus()});return()=>{cancelAnimationFrame(e)}},[d]),u.loading)?ev.createElement("div",{className:"w-80 bg-appcolor-100 px-4 py-2 shadow"},ev.createElement(eI.Spinner,null)):null==p?ev.createElement("div",null,"Error loading data"):ev.createElement("div",{className:"mr-8 w-80 overflow-y-auto overflow-x-hidden rounded-xl border border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement("div",{className:"flex border-b border-solid border-appcolor-300"},ev.createElement("input",{ref:c,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:a({type:"Collapse"});return;case eI.KeyboardKeys.Space:break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),m.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),m.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:m.current?.activateCurrentItem()}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onChange:e=>{r(e.target.value)},className:"w-full bg-transparent px-4 pb-3 pt-2 text-sm",placeholder:n.formatMessage({id:"automation.search_triggers",defaultMessage:"Search triggers..."})})),ev.createElement(tT,{ref:m,term:l,data:f,search:eyC,renderMap:eyN,onActivate:g,renderEmptyState:ev.createElement("div",{className:"p-4 text-appcolor-500"},ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}))}))},eyS=function(e){let{id:t}=e,a=ev.useRef(null),n=ev.useRef(null),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),o=(0,eI.usePopup)({referenceElementRef:a,popupElementRef:n,state:l,placement:"bottom"}),i=(0,eI.useMenuButton)({ref:a,state:l,dispatch:r});return ev.createElement("div",{className:"relative"},ev.createElement("div",{className:"pointer-events-none absolute -top-10 flex w-full"},ev.createElement("div",{className:"mx-auto mt-2 flex w-fit rounded-full bg-appcolor-200 px-4 py-1 text-2xs text-appcolor-600"},ev.createElement(eY.Z,{id:"automation.when_this_happens",defaultMessage:"When this happens..."}))),ev.createElement("div",{className:"pointer-events-none absolute mt-1 flex w-full"},ev.createElement("div",{className:"mx-auto mt-28 flex w-fit rounded-full bg-appcolor-200 px-4 py-1 text-2xs text-appcolor-600"},ev.createElement(eY.Z,{id:"automation.do_this",defaultMessage:"Do this..."}))),ev.createElement("button",{...i.props,className:"flex w-96 flex-col"},ev.createElement("div",{className:"group relative flex w-full cursor-pointer items-center rounded-xl border border-dashed border-appcolor-400 bg-appcolor-100 p-3 text-center text-xs text-appcolor-500 transition duration-150 ease-in-out hover:border-appcolor-500"},ev.createElement("div",{className:"m-auto flex flex-row items-center gap-x-1 text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"automate_project_add"}),ev.createElement("p",{className:"w-full whitespace-normal text-sm"},ev.createElement(eY.Z,{id:"automation.add_trigger",defaultMessage:"Add Trigger"})))),ev.createElement(eh1.HH,{className:"invisible",type:"target",position:eh1.Ly.Top,isConnectable:!1}),ev.createElement(eh1.HH,{className:"invisible",type:"source",position:eh1.Ly.Bottom,isConnectable:!1})),l.expanded&&ev.createElement(eI.Popup,{...o.props,dispatch:r,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r({type:"Collapse"})}},ev.createElement(eyM,{id:t,popupDispatch:r})))},eyI=function(){let e=ev.useRef(null),t=ev.useRef(null),a=ev.useRef(null),[n,l]=ev.useState(!1),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:e,arrowElementRef:t,popperElementRef:a,placement:"bottom",visible:n}),s=ev.useCallback(()=>{l(!0)},[]),d=ev.useCallback(()=>{l(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...i,onMouseEnter:s,onMouseLeave:d,className:"flex items-center"},ev.createElement(tn.Icon,{className:"mt-1 h-4 w-4 shrink-0 text-danger",icon:"automate_warning"})),n&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement(eY.Z,{id:"automation.complete_all_required_fields",defaultMessage:"Please complete all required fields."})))},eyD={action:function(e){let{id:t,data:a,selected:n}=e,{onSelectAction:l,getPiece:r}=eya(),o=r(a.settings.pieceName);if("EMPTY"===a.type)return ev.createElement(eyS,e);let i=o?.logoUrl!=null&&o.logoUrl.length>0?o.logoUrl:"https://assets.taskade.com/taskade.png";return ev.createElement("div",{className:"relative"},("PIECE_TRIGGER"===a.type||"WEBHOOK"===a.type)&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"pointer-events-none absolute -top-10 flex w-full"},ev.createElement("div",{className:"mx-auto mt-2 flex w-fit rounded-full bg-appcolor-200 px-4 py-1 text-2xs text-appcolor-600"},ev.createElement(eY.Z,{id:"automation.when_this_happens",defaultMessage:"When this happens..."}))),ev.createElement("div",{className:"pointer-events-none absolute mt-1 flex w-full"},ev.createElement("div",{className:"mx-auto mt-28 flex w-fit rounded-full bg-appcolor-200 px-4 py-1 text-2xs text-appcolor-600"},ev.createElement(eY.Z,{id:"automation.do_this",defaultMessage:"Do this..."})))),ev.createElement("div",{onClick:()=>{l?.(t)},title:"Menu",className:"flex w-96 flex-col"},ev.createElement("div",{className:og()("flex w-96 cursor-pointer items-center justify-between rounded-xl border border-appcolor-200 bg-appcolor-100 px-4 py-4 transition duration-150 ease-in-out hover:border-appcolor-400 hover:shadow",n&&"border-primary shadow hover:border-primary")},ev.createElement("div",{className:"flex w-full items-center gap-4 pr-3"},ev.createElement("img",{className:"h-6 w-6",src:i}),ev.createElement("div",{className:"flex flex-col gap-0.5"},o?.displayName!=null&&ev.createElement("p",{className:og()("text-2xs",o.name===eyn?"text-moving-rainbow":"text-appcolor-500")},o.displayName),"WEBHOOK"===a.type&&ev.createElement("p",{className:"text-2xs text-appcolor-500"},"Taskade"),ev.createElement("p",{className:"line-clamp-3 max-w-60 whitespace-normal break-all text-sm"},a.displayName)),ev.createElement("div",{className:"ml-auto flex items-center justify-center gap-3"},!a.valid&&ev.createElement(eyI,null),ev.createElement(eyb,{nodeId:t,isTrigger:"PIECE_TRIGGER"===a.type||"WEBHOOK"===a.type})))),ev.createElement(ev.Fragment,null,ev.createElement(eh1.HH,{className:"invisible",type:"target",position:eh1.Ly.Top,isConnectable:!1}),ev.createElement(eh1.HH,{className:"invisible",type:"source",position:eh1.Ly.Bottom,isConnectable:!1}))))},placeholder:function(e){let{id:t,data:a}=e,n=ev.useRef(null),l=ev.useRef(null),{getNode:r,setNodes:o,setEdges:i}=(0,eh1._K)(),{onSelectAction:s}=eya(),[d,c]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),m=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:d,placement:"top"}),u=(0,eI.useMenuButton)({ref:n,state:d,dispatch:c}),p=ev.useCallback(e=>{let a=r(t);if(null==a)return;let n=(0,ld.Z)(),l={id:n,position:{x:a.position.x,y:a.position.y},type:"placeholder",data:{displayName:"Add Step"}},d={id:`${a.id}=>${n}`,source:a.id,target:n,type:"placeholder"},{piece:c,name:m}=e,u=c.authDesc?.type!=="NONE",p=c.actions?.find(e=>e.name===m);if(null==p)throw Error("piece action should not be null");let g=Object.values(p.props).some(e=>e.required);o(a=>a.map(a=>a.id!==t?a:{...a,type:"action",selected:!1,data:{displayName:e.displayName,name:(0,ld.Z)(),type:"PIECE",valid:!u&&!g,settings:{input:{},inputUiInfo:{customizedInputs:{}},pieceName:c.name,pieceVersion:c.version,actionName:m}}}).concat([l])),i(e=>e.map(e=>{if(e.target!==t)return e;let a=r(e.source);return null==a||"trigger"===a.data.name?e:{...e,type:"workflow"}}).concat([d])),s?.(t)},[r,t,s,i,o]);return ev.createElement("div",null,ev.createElement("button",{...u.props,className:"flex w-96 flex-col"},ev.createElement("div",{className:"group relative flex w-full cursor-pointer items-center rounded-xl border border-dashed border-appcolor-400 bg-appcolor-100 p-3 text-center text-xs text-appcolor-500 transition duration-150 ease-in-out hover:border-appcolor-500"},ev.createElement("div",{className:"m-auto flex flex-row items-center gap-x-1 text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"dd_new"}),ev.createElement("p",{className:"w-full whitespace-normal text-sm"},a.displayName))),ev.createElement(eh1.HH,{className:"invisible",type:"target",position:eh1.Ly.Top,isConnectable:!1}),ev.createElement(eh1.HH,{className:"invisible",type:"source",position:eh1.Ly.Bottom,isConnectable:!1})),d.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:c,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),c({type:"Collapse"})}},ev.createElement(eyf,{popupDispatch:c,onSelectAction:p})))}},eyT={account:"paid-pro",hideAttribution:!0},ey$=function(e){let{className:t,style:a,edges:n,nodes:l}=e;return eh9(),ev.createElement("div",{className:og()("relative flex",t),style:a},ev.createElement(eh1.x$,{defaultNodes:l,defaultEdges:n,proOptions:eyT,fitView:!0,nodeTypes:eyD,edgeTypes:eyh,fitViewOptions:{padding:.95},minZoom:1,maxZoom:1.2,nodesDraggable:!1,nodesConnectable:!1,zoomOnDoubleClick:!1,deleteKeyCode:null},ev.createElement(eh2.A,{color:"#484D51",variant:eh2.T.Dots})),ev.createElement("a",{href:"https://taskade.canny.io/automations",target:"_blank",rel:"noopener noreferrer",className:"absolute bottom-5 left-5 flex flex items-center gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-appcolor-500 hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"automate_feedback"}),ev.createElement(eY.Z,{id:"automation.feedback",defaultMessage:"Feedback"})))},eyP={p:e=>ev.createElement("p",{...e,className:"mb-2 break-words pl-2 text-sm text-appcolor-500"},e.children)},eyF=function(){let[e,t]=ev.useState(!1),a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:e});return ev.createElement("div",{className:"cursor-help text-danger"},ev.createElement("span",{onMouseEnter:()=>{t(!0)},onMouseLeave:()=>{t(!1)},...i,className:"ml-1"},ev.createElement(tn.Icon,{icon:"automate_warning"})),e&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement(eY.Z,{id:"automate.field_required",defaultMessage:"This field is required."})))},eyA=function(e){let{morseChildProps:t}=e;return ev.createElement("button",{onClick:t.activate,onMouseEnter:t.focus,className:og()("flex min-h-8 w-full items-center justify-between gap-x-2 px-4 py-1 text-left text-sm hover:bg-appcolor-200 focus:bg-appcolor-200",{"bg-appcolor-200":t.focused})},ev.createElement("span",{className:"truncate"},t.data.label),null!=t.data.externalUrl&&ev.createElement("a",{href:t.data.externalUrl,className:"ml-auto flex items-center gap-x-1 rounded-xl text-sm text-appcolor-500 hover:bg-appcolor-300 hover:text-appcolor-800",target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()}},ev.createElement(tn.Icon,{icon:"embed_open"})))},eyR="dropdownOption",eyj={[eyR]:e=>ev.createElement(eyA,{morseChildProps:e})},eyO={all:()=>ev.createElement(ev.Fragment,null)},eyU=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),eyZ=function(e){let{flowCredentialsRef:t,piece:a,options:n,onSelect:l,missingDependencies:r,action:o,queryError:i,close:s}=e,d=(0,eK.Z)(),c=ev.useRef(null),[m,u]=ev.useState(""),[p,g]=ev.useState(null),f=ev.useMemo(()=>[{type:"section",label:o.displayName,items:(n??[]).filter(e=>!e.disabled).map(e=>({label:e.label,itemType:"dropdownOption",values:[e.label],data:e,render:eyR})),render:"all"}],[o.displayName,n]),h=ev.useCallback(e=>{l(e.data)},[l]);ev.useLayoutEffect(()=>{if(null==p)return;let e=requestAnimationFrame(()=>{p.focus()});return()=>{cancelAnimationFrame(e)}},[p]);let y=a.authDesc?.type!=="NONE";if(null==t&&y)return ev.createElement("p",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.connect_to_service_account",defaultMessage:"Please connect your {service} account.",values:{service:a.displayName}}));if(null!=i)return ev.createElement("p",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-appcolor-500"},i.message);if(r.length>0){let e=o.props[r[0]]?.displayName;return ev.createElement("p",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automate.failed_to_load_data",defaultMessage:"Failed to load data. {prop} is required.",values:{prop:e??r[0]}}))}return null==n?ev.createElement("div",{className:"flex items-center justify-center rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm"},ev.createElement(eI.Spinner,null)):0===n.length?ev.createElement("div",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"automate.no_results",defaultMessage:"No results."})):ev.createElement("div",{className:"flex max-h-96 flex-col gap-px overflow-y-auto rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement("div",{className:"flex items-center px-3 py-1"},ev.createElement("input",{type:"text",ref:g,value:m,onChange:e=>{u(e.target.value)},className:"w-full rounded-lg border border-appcolor-300 bg-appcolor-100 px-3 py-1 text-sm focus:border-appcolor-400",placeholder:d.formatMessage({id:"general.search",defaultMessage:"Search"}),onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:s();break;case eI.KeyboardKeys.Space:break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),c.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),c.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:c.current?.activateCurrentItem()}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}})),ev.createElement(tT,{ref:c,term:m,data:f,renderMap:eyj,sectionRenderMap:eyO,search:eyU,onActivate:h,renderEmptyState:ev.createElement("span",{className:"px-4 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}))}))},eyL={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PieceDropdownOptionsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PieceDropdownOptionsFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"currentPropsValues"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PieceDropdownState"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieceDropdownOptions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"currentPropsValues"},value:{kind:"Variable",name:{kind:"Name",value:"currentPropsValues"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"options"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"value"}},{kind:"Field",name:{kind:"Name",value:"label"}},{kind:"Field",name:{kind:"Name",value:"externalUrl"}},{kind:"Field",name:{kind:"Name",value:"disabled"}}]}}]}}]}}]},eyB=(0,eL.default)(eI.Popup).withConfig({displayName:"ActionDynamicDropdown__StyledPopup",componentId:"sc-ac02673a-0"})` + width: ${e=>e.$calculatedWidth?e.$calculatedWidth+"px":"auto"}; +`,eyz=function(e){let{title:t,placeholder:a,flowId:n,piece:l,action:r,propertyName:o,currentValue:i,onSelect:s,flowCredentialsRef:d,currentProps:c,dependsOn:m,description:u}=e,p=r.name,g=m.filter(e=>null==c[e]),f=l.authDesc?.type!=="NONE"&&null==d,h=0===g.length,[y,b]=ev.useState(!1),v=ev.useRef(null),k=ev.useRef(null),E=ev.useRef(null),x=e.isRequired??!1,_=(0,eB.a)(eyL,{skip:!h||f,variables:{filterby:{flowId:n,pieceName:l.name,actionName:p,propertyName:o,flowCredentialsRef:d},currentPropsValues:{currentProps:c}}}),w=ev.useMemo(()=>{if(null==_.error)return null;let e=bH(_.error,["pieceDropdownOptions"]);return null==e?new ei.HttpError({code:"UNKNOWN_ERROR"},{cause:_.error}):new ei.TaskadeError(e,{cause:_.error})},[_.error]),N=ev.useMemo(()=>null==_.loading||null==_.data?null:_.data.pieceDropdownOptions.options.map(e=>({label:e.label,value:e.value,externalUrl:e.externalUrl??void 0,disabled:e.disabled??void 0})),[_.data,_.loading]),[C,M]=ev.useReducer(eI.popupReducer,{expanded:!1}),S=ev.useRef(null),I=ev.useRef(null),D=(0,eI.usePopup)({referenceElementRef:S,popupElementRef:I,state:C,placement:"bottom-start"}),T=(0,eI.useMenuButton)({dispatch:M,ref:S,state:C}),$=ev.useMemo(()=>{if(null==i||null==N)return null;let e=N.find(e=>e.value===i);return null==e?null:e.label},[i,N]),{arrowProps:P,popperProps:F,referenceProps:A}=(0,eI.useControlledTooltip)({referenceElementRef:v,arrowElementRef:k,popperElementRef:E,placement:"top",visible:y}),R=ev.useCallback(()=>{M({type:"Collapse"})},[]),j=ev.useCallback(e=>{s(e),R()},[R,s]);return ev.createElement("div",{className:"flex w-full flex-col"},ev.createElement("div",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},x&&ev.createElement("span",{className:"mr-1 font-medium"},"*"),t,x&&ev.createElement("span",{className:"ml-px flex"},ev.createElement(eY.Z,{id:"automation.required",defaultMessage:"(Required)"})),null!=u&&ev.createElement("div",{onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},...A,className:"ml-1.5"},ev.createElement(tn.Icon,{icon:"dd_help",className:"h-4 w-4"})),y&&ev.createElement(eI.Tooltip,{arrowProps:P,popperProps:F},u),_.loading&&ev.createElement("div",{className:"ml-1"},ev.createElement(eI.Spinner,{size:12,width:12}))),ev.createElement("button",{...T.props,className:"flex items-center justify-between rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-2 text-sm transition duration-150 ease-in-out hover:border-appcolor-400"},ev.createElement("div",{className:"flex w-full items-center"},null!=$?ev.createElement("p",{className:"line-clamp-2 whitespace-normal pr-2 text-left"},$):ev.createElement(ev.Fragment,null,ev.createElement("p",{className:"text-appcolor-500"},a," "),x&&ev.createElement("div",{className:"ml-auto mr-2"},ev.createElement(eyF,null)))),ev.createElement(tn.Icon,{icon:"caret_down",className:"shrink-0 text-appcolor-500"})),C.expanded&&ev.createElement(eyB,{...D.props,dispatch:M,modal:!0,$calculatedWidth:S?.current?.offsetWidth??null},ev.createElement(eyZ,{flowCredentialsRef:d,piece:l,options:N,onSelect:j,missingDependencies:g,action:r,queryError:w,close:R})))};var eyV=a(11356),eyq=a(4506),eyW=a(41374);let eyH=function(e){let{text:t}=e;return ev.createElement("span",{className:"rounded-md border border-danger leading-6 text-danger"},ev.createElement(tn.Icon,{icon:"automate_warning",className:"mx-1.5 h-4 w-4 shrink-0 pb-0.75"}),ev.createElement("span",{className:"pr-1.5"},t))};class eyG extends XV.DecoratorNode{__text;static getType(){return"invalid"}getText(){return this.__text}setText(e){this.getWritable().__text=e}static clone(e){return new eyG(e.__text)}constructor(e,t){super(t),this.__text=e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}createDOM(){return document.createElement("span")}updateDOM(){return!1}decorate(){return ev.createElement(eyH,{text:this.__text})}exportJSON(){return{text:this.getText(),type:"invalid",version:1}}static importJSON(e){return new eyG(e.text)}}let eyK=function(e){let{text:t,pieceName:a}=e,{getPiece:n}=eya(),l=n(a);return ev.createElement("span",{className:"mr-1.5 overflow-hidden rounded-md border border-appcolor-400 py-0.5 text-xs leading-6"},ev.createElement("span",{className:"rounded-l-md bg-appcolor-300"},null==l?ev.createElement(tn.Icon,{icon:"automate_flow",className:"mx-1.5 h-4 w-4 pb-0.75 text-appcolor-900"}):ev.createElement("img",{src:l.logoUrl,className:"mx-1.5 inline h-4 w-4 object-contain pb-0.75 text-appcolor-900"})),ev.createElement("span",{className:"border-l border-appcolor-400"}),ev.createElement("span",{className:"leading-1 px-1.5 text-appcolor-600"},t))};class eyY extends XV.DecoratorNode{__text;__prefix;__path;__pieceName;static getType(){return"mapped"}getText(){return this.__text}setText(e){this.getWritable().__text=e}getPrefix(){return this.__prefix}setPrefix(e){this.getWritable().__prefix=e}getPath(){return this.__path}setPath(e){this.getWritable().__path=e}getPieceName(){return this.__pieceName}setPieceName(e){this.getWritable().__pieceName=e}static clone(e){return new eyY(e.__text,e.__prefix,e.__path,e.__pieceName,e.__key)}constructor(e,t,a,n,l){super(l),this.__text=e,this.__prefix=t,this.__path=a,this.__pieceName=n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}createDOM(){return document.createElement("span")}updateDOM(){return!1}decorate(){return ev.createElement(eyK,{text:this.__text,pieceName:this.__pieceName})}exportJSON(){return{text:this.getText(),prefix:this.getPrefix(),path:this.getPath(),pieceName:this.getPieceName(),type:"mapped",version:1}}static importJSON(e){return eyQ(e.text,e.prefix,e.path,e.pieceName)}}function eyQ(e,t,a,n){return new eyY(e,t??"",a??"",n)}function eyJ(e){let t=(0,XV.$getRoot)();t.clear();let a=(0,XV.$createParagraphNode)();for(let t of e.ops){let e;"string"==typeof t.insert&&("\n"!==t.insert||t.attributes?.paragraph!==!0)&&(e="string"==typeof t.insert&&"string"==typeof t.attributes?.prefix&&"string"==typeof t.attributes?.path&&"string"==typeof t.attributes?.pieceName?eyQ(t.insert,t.attributes?.prefix,t.attributes?.path,t.attributes?.pieceName):"string"==typeof t.insert&&t.attributes?.type==="INVALID"?new eyG(t.insert):(0,XV.$createTextNode)(t.insert),a.append(e))}t.append(a)}function eyX(){let e=(0,XV.$getRoot)().getChildren(),t=new(CI())({ops:[]});for(let a of e){for(let e of((0,ei.assert)((0,XV.$isParagraphNode)(a),"expecting all child to be ParagraphNode"),a.getChildren())){let a;let n={insert:e.getTextContent()};e instanceof eyY?(a={type:"MAPPED",prefix:e.getPrefix(),path:e.getPath(),pieceName:e.getPieceName()},n.insert={type:"mapped-value"}):e instanceof eyG?a={type:"INVALID"}:(0,XV.$isTextNode)(e)&&(a={type:"TEXT"}),null!=a&&(n.attributes=a),t=t.concat(new(CI())({ops:[n]}))}t=t.concat(new(CI())({ops:[{insert:"\n",attributes:{paragraph:!0}}]}))}return t}let ey0=ev.forwardRef(function(e,t){let{onChange:a}=e,[n]=(0,XW.useLexicalComposerContext)();return ev.useImperativeHandle(t,()=>({rewrite(e){n.update(()=>{let t=(0,XV.$getSelection)();if((0,XV.$isRangeSelection)(t)){let a=eyX().diff(e),l=(0,XG.$createOffsetView)(n),[r,o]=l.getOffsetsFromSelection(t);r=a.transformPosition(r),o=a.transformPosition(o),eyJ(e);let i=(l=(0,XG.$createOffsetView)(n)).createSelectionFromOffsets(r,o);(0,XV.$setSelection)(i)}else eyJ(e),(0,XV.$setSelection)(null)},{tag:"external-update"})}}),[n]),ev.useLayoutEffect(()=>n.registerUpdateListener(e=>{let{dirtyElements:t,dirtyLeaves:n,editorState:l,tags:r}=e;!(r.has("external-update")||r.has("history-merge"))&&(0!==t.size||0!==n.size)&&l.read(()=>{let e=eyX();a?.(e)})}),[n,a]),null}),ey1=ev.forwardRef(function(e,t){let[a]=(0,XW.useLexicalComposerContext)();return ev.useImperativeHandle(t,()=>({insertMentionNode(e,t,n,l){a.update(()=>{let a=eyQ(e,t,n,l);(0,XV.$insertNodes)([a])})}}),[a]),null});var ey2=a(12541),ey5=a(50185),ey3=a(76969);let ey4=function(e){let{children:t,onClick:a,isSelected:n,onMouseEnter:l,iconName:r}=e,o=ev.useRef(null);return ev.useEffect(()=>{n&&o.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[n]),ev.createElement("button",{ref:o,className:og()("flex w-full items-center gap-2 px-3 py-1.5 text-sm",{"bg-appcolor-200":n}),onClick:a,onMouseEnter:l,"data-typeaheadoption":"mappedValueOption"},ev.createElement(tn.Icon,{className:"mr-1 h-4 w-4 shrink-0 text-appcolor-500",icon:r}),ev.createElement("span",{className:"text-md whitespace-normal break-all text-left text-textcolor-600"},t))},ey6=function(e){let{selectedIndex:t,setHighlightedIndex:a,selectOptionAndCleanUp:n,category:l,startIndex:r}=e;return 0===l.menuContent.length?null:ev.createElement("div",{className:"flex flex-col border-b border-solid border-appcolor-300 pb-2"},ev.createElement("div",{className:"mt-2 flex w-full items-start gap-4 px-3 py-1 text-sm font-medium text-appcolor-800 first:mt-2"},l.header,ev.createElement("img",{src:l.icon,className:"ml-auto h-5 w-5"})),l.menuContent.map((e,l)=>ev.createElement(ey4,{key:e.key,onClick:()=>{a(r+l),n(e)},onMouseEnter:()=>{a(r+l)},isSelected:t===r+l,iconName:e.dropdownIcon},e.insert)))};function ey8(){return[ey2.Z,{name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn(e){let{state:t}=e,{height:a}=t.modifiersData.maxSize;t.styles.popper.maxHeight=`${a}px`}},{name:"flip"}]}let ey7=ev.forwardRef(function(e,t){let{children:a}=e,n=ev.useRef(null);(0,ei.assert)("object"==typeof t&&null!=t&&null!=t.current);let l=ev.useContext(eI.LayersContext),r=l?.overlay??document.body,o=(0,eI.usePopper)({referenceElementRef:t,popperElementRef:n,visible:!0,placement:"bottom-start",strategy:"absolute",name:"popup",computeModifiersCallback:ey8}),i=ev.useMemo(()=>{if(null==o.state)return{ref:n,style:{visibility:"hidden"}};let{attributes:e,styles:t}=o.state;return{...e.popper,style:t.popper}},[o.state,n]);return ep.createPortal(ev.createElement("div",{className:"pointer-events-auto absolute flex",...i,ref:n},a),r)}),ey9={search(e,t,a){let n=[];e.forEach(e=>{let a=e.menuContent.filter(e=>e.displayText.toLocaleLowerCase().includes(t.toLowerCase()));n.push({header:e.header,icon:e.icon,menuContent:a})}),a(n)}};class ebe extends ey5.MenuOption{insert;prefix;path;dropdownIcon;pieceName;constructor(e,t,a,n,l){super(e),this.insert=e,this.prefix=t,this.path=a,this.dropdownIcon=n,this.pieceName=l}}let ebt=function(e){let{availableMenu:t}=e,[a]=(0,XW.useLexicalComposerContext)(),[n,l]=(0,ev.useState)(null),r=ev.useRef(null),o=(0,ey5.useBasicTypeaheadTriggerMatch)("@",{minLength:0}),i=function(e,t){let[a,n]=(0,ev.useState)([]);return(0,ev.useEffect)(()=>{if(null==e){n([]);return}ey9.search(t,e,e=>{n(e)})},[t,e]),a}(n,t),s=(0,ev.useMemo)(()=>{let e=[];return i.forEach(t=>{let a=t.menuContent.map(e=>new ebe(e.displayText,e.nodeId,e.path,"header_sidebar",e.pieceName));a.length>0&&e.push({header:t.header,icon:t.icon,menuContent:a})}),e},[i]),d=(0,ev.useCallback)((e,t,n)=>{a.update(()=>{let a=eyQ(e.insert,e.prefix,e.path,e.pieceName);t&&t.replace(a),n()})},[a]),c=ev.useMemo(()=>s.flatMap(e=>e.menuContent),[s]),[m,u]=ev.useState(!0);return ev.useEffect(()=>(0,ey3.mergeRegister)(a.registerCommand(XV.FOCUS_COMMAND,()=>(u(!0),!0),XV.COMMAND_PRIORITY_EDITOR),a.registerCommand(XV.BLUR_COMMAND,e=>(e.relatedTarget===a.getRootElement()||e.relatedTarget===r.current||e.relatedTarget?.dataset.typeaheadoption==="mappedValueOption"?a.focus():u(!1),!0),XV.COMMAND_PRIORITY_EDITOR)),[a]),ev.createElement(ey5.LexicalTypeaheadMenuPlugin,{onQueryChange:l,onSelectOption:d,triggerFn:o,options:c,menuRenderFn:(e,t)=>{let{selectedIndex:a,selectOptionAndCleanUp:n,setHighlightedIndex:l}=t;return null==e.current?null:ev.createElement(ey7,{ref:e,setShowMenu:u,showMenu:m},ev.createElement("div",{ref:r,tabIndex:-1},m&&ev.createElement("div",{className:"mr-8 w-80 overflow-y-auto overflow-x-hidden rounded-xl border border-appcolor-300 bg-appcolor-100 py-2"},0===c.length&&ev.createElement("span",{className:"px-3 py-1.5 text-sm text-textcolor-500"},"There are no results."),s.map((e,t)=>ev.createElement(ey6,{key:`${e.header}-${t}`,setHighlightedIndex:l,selectOptionAndCleanUp:n,selectedIndex:a,category:e,startIndex:s.slice(0,t).flatMap(e=>e.menuContent).length})))))}})},eba=function(e){let{children:t,onClick:a,name:n,value:l,iconName:r}=e,o=ev.useRef(null),i=(0,eI.useMenuItem)({onClick:a,stopRef:o,name:n,value:l});return ev.createElement("button",{className:"flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-appcolor-200",...i.props},ev.createElement(tn.Icon,{className:"mr-1 h-4 w-4 shrink-0 text-appcolor-500",icon:r}),ev.createElement("span",{className:"text-md whitespace-normal break-all text-left text-textcolor-600"},t))},ebn=function(e){let{category:t}=e,[a]=(0,XW.useLexicalComposerContext)(),n=ev.useCallback(e=>{a.update(()=>{let t=eyQ(e.insert,e.prefix,e.path,e.pieceName);(0,XV.$insertNodes)([t])})},[a]);return 0===t.menuContent.length?null:ev.createElement("div",{className:"flex flex-col border-b border-solid border-appcolor-300 pb-2"},ev.createElement("div",{className:"mt-2 flex w-full items-start gap-4 px-3 py-1 text-sm font-medium text-appcolor-800 first:mt-2"},t.header,ev.createElement("img",{src:t.icon,className:"ml-auto h-5 w-5"})),t.menuContent.map(e=>ev.createElement(eba,{key:e.key,onClick:()=>n(e),name:t.header,value:e.insert,iconName:e.dropdownIcon},e.insert)))},ebl={search(e,t,a){let n=[];e.forEach(e=>{let a=e.menuContent.filter(e=>e.displayText.toLocaleLowerCase().includes(t.toLowerCase()));a.length>0&&n.push({header:e.header,icon:e.icon,menuContent:a})}),a(n)}},ebr=function(e){let{availableMenu:t}=e,[a,n]=ev.useState(null),l=(0,eK.Z)(),r=function(e,t){let[a,n]=ev.useState([]);return ev.useEffect(()=>{if(null==e){n(t);return}ebl.search(t,e,e=>{n(e)})},[t,e]),a}(a,t),o=ev.useMemo(()=>{let e=[];return r.forEach(t=>{let a=t.menuContent.map(e=>new ebe(e.displayText,e.nodeId,e.path,"header_sidebar",e.pieceName));e.push({header:t.header,icon:t.icon,menuContent:a})}),e},[r]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex w-80 flex-col overflow-y-auto overflow-x-hidden rounded-xl border border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement("div",{className:"flex border-b border-solid border-appcolor-300"},ev.createElement("input",{className:"w-full bg-transparent px-4 pb-3 pt-2 text-sm",onChange:e=>n(e.target.value),value:a??"",placeholder:l.formatMessage({id:"automation.search_placeholder",defaultMessage:"Search..."})})),o.map((e,t)=>ev.createElement(ebn,{key:`${e.header}-${t}`,category:e})),0===o.length&&ev.createElement("div",{className:"p-4 text-sm"},ev.createElement(eY.Z,{id:"automation.empty_menu_text",defaultMessage:"No data found from previous steps"}))))};function ebo(){return[ey2.Z,{name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn(e){let{state:t}=e,{height:a}=t.modifiersData.maxSize;t.styles.popper.maxHeight=`${a}px`}},{name:"flip",options:{fallbackPlacements:["top-end"]}}]}let ebi=function(e){let{availableMenu:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useState(!1),[s,d]=ev.useReducer(eI.popupReducer,{expanded:!1}),c=ev.useCallback(()=>{a?.current?.focus()},[]);(0,eI.usePopupEvents)({state:s,onCollapse:c});let m=(0,eI.usePopup)({referenceElementRef:a,popupElementRef:r,state:s,placement:"bottom-end",computeModifiersCallback:ebo}),u=(0,eI.useMenuButton)({dispatch:d,ref:a,state:s}),p=ev.useCallback(e=>{switch(e.type){case"Activate":case"Dismiss":d({type:"Collapse"})}},[]),{arrowProps:g,popperProps:f,referenceProps:h}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:o});return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"absolute bottom-2 right-2 flex"},ev.createElement("button",{...h,...u.props,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},tabIndex:-1,className:"ml-auto flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 text-sm text-appcolor-800 transition duration-150 ease-in-out hover:border-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"automate_add",className:"scale-90"}))),o&&ev.createElement(eI.Tooltip,{arrowProps:g,popperProps:f},ev.createElement(eY.Z,{id:"automate_add.data",defaultMessage:'Click "+" or type "@" to add data.'})),s.expanded&&ev.createElement(eI.Popup,{...m.props,modal:!0,dispatch:d,className:"flex"},ev.createElement(eI.MenuGroupContext.Provider,{value:p},ev.createElement(eI.Menu,{initialFocus:m.initialFocus,className:"flex"},ev.createElement(ebr,{availableMenu:t})))))};var ebs=a(70559);let ebd=function(e){let{placeholder:t}=e,[a]=(0,XW.useLexicalComposerContext)(),n=(0,ebs.useLexicalIsTextContentEmpty)(a);return ev.useEffect(()=>{let e=a.getRootElement();null!=e&&(n&&null!=t?e.setAttribute("placeholder",t):e.removeAttribute("placeholder"))},[a,n,t]),null},ebc=ev.forwardRef(function(e,t){let[a]=(0,XW.useLexicalComposerContext)();return ev.useImperativeHandle(t,()=>({promptReplace(e){a.dispatchCommand(XV.CLEAR_EDITOR_COMMAND,a),a.update(()=>{let t=(0,XV.$createTextNode)(e);(0,XV.$insertNodes)([t]),t.select()})}}),[a]),null}),ebm=function(){let[e]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>{e.registerCommand(XV.SELECT_ALL_COMMAND,()=>((0,XV.$selectAll)(),!0),XV.COMMAND_PRIORITY_HIGH)}),null},ebu=eL.default.div.withConfig({displayName:"LexicalEditor__Container",componentId:"sc-f7681011-0"})` + ${RQ}; +`,ebp=ev.forwardRef(function(e,t){let{initialDelta:a,className:n,isReadOnly:l,onChange:r,onInlineMarkClick:o,placeholder:i,availableMenu:s,contentEditableClassName:d}=e,[c]=ev.useState(a),m=ev.useMemo(()=>({editorState:()=>{eyJ(c)},namespace:"LexicalEditor",theme:{text:{italic:"italic",bold:"font-bold",underline:"underline"},link:"hover:cursor-pointer hover:underline text-primary",paragraph:"text-sm"},onError:console.error,editable:!l,nodes:[eyY,eyG]}),[c,l]),u=ev.useCallback((e,t,a)=>{t.update(()=>{let e=(0,XV.$getNodeByKey)(a);e instanceof eyY?o?.({type:"mapped",value:e.getValue()}):e instanceof eyG&&e.remove()})},[o]),p=ev.useRef(null),g=ev.useRef(null),f=ev.useRef(null);return ev.useImperativeHandle(t,()=>({promptReplace(e){g.current?.promptReplace(e)},insertMentionNode(e,t,a,n){f.current?.insertMentionNode(e,t,a,n)}}),[]),ev.createElement(ebu,{className:n},ev.createElement(Xj.LexicalComposer,{initialConfig:m},ev.createElement(XL.RichTextPlugin,{contentEditable:ev.createElement(XO.ContentEditable,{className:og()("max-h-[400px] overflow-y-scroll text-sm leading-5 before:absolute before:text-appcolor-500 before:content-[attr(placeholder)]",d&&d)}),placeholder:ev.createElement("div",{className:"pointer-events-none absolute left-3 top-3.5 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"automation_text.placeholder",defaultMessage:"Type @ to insert data..."})),ErrorBoundary:XZ()}),ev.createElement(ebm,null),ev.createElement(ey0,{ref:p,onChange:r}),ev.createElement(eyq.HistoryPlugin,null),ev.createElement(ebd,{placeholder:i}),ev.createElement(eyW.NodeEventPlugin,{nodeType:eyG,eventType:"click",eventListener:u}),ev.createElement(ebt,{availableMenu:s}),ev.createElement(ebi,{availableMenu:s}),ev.createElement(eyV.ClearEditorPlugin,null),ev.createElement(ebc,{ref:g}),ev.createElement(ey1,{ref:f})))});var ebg=a(26620);function ebf(e){let t="";for(let a of e.ops){if(a.attributes?.paragraph===!0)continue;let e=a.insert?.toString(),n=eyE.iS.safeParse(a.attributes);n.success?e=`{{${n.data.prefix}.${n.data.path}}} `:a.attributes?.type==="INVALID"&&(e="{{Invalid Parameter}} "),t=t.concat(e??"")}return t}function ebh(e,t){let a=new(CI())({ops:[]}),n=t.flatMap(e=>e.menuContent),l=new ebg.d2(e);try{for(let t of l.readTopLevelTokens())if(ebg.c5.isOutputToken(t)){let e=t.content.split(".")[0],l=t.content.substring(e.length+1),r=n.filter(t=>t.nodeId===e&&t.path===l);if(null!=r[0]){let t={insert:r[0].displayText,attributes:{type:"MAPPED",prefix:e,path:l,pieceName:r[0].pieceName}};a=a.concat(new(CI())({ops:[t]}))}else{let e={insert:"Missing",attributes:{type:"INVALID"}};a=a.concat(new(CI())({ops:[e]}))}}else if(ebg.c5.isHTMLToken(t)){let n={insert:e.substring(t.begin,t.end),attributes:{type:"TEXT"}};a=a.concat(new(CI())({ops:[n]}))}}catch(t){a=a.concat(new(CI())({ops:[{insert:e,attributes:{type:"TEXT"}}]}))}return a}let eby=[{id:"general",emoji:"✍️",name:(0,te.Em)({id:"flow.category_general",defaultMessage:"General"}),default:!0},{id:"content_creation",emoji:"\uD83D\uDCDD",name:(0,te.Em)({id:"flow.category_content_creation",defaultMessage:"Content Creation"})},{id:"project_planning",emoji:"\uD83D\uDCC5",name:(0,te.Em)({id:"flow.category_project_planning",defaultMessage:"Project Planning"})},{id:"documentation",emoji:"\uD83D\uDCC4",name:(0,te.Em)({id:"flow.category_documentation",defaultMessage:"Documentation"})},{id:"marketing_strategies",emoji:"\uD83D\uDCC8",name:(0,te.Em)({id:"flow.category_marketing_strategies",defaultMessage:"Marketing Strategies"})},{id:"learning_and_development",emoji:"\uD83D\uDCDA",name:(0,te.Em)({id:"flow.category_learning_and_development",defaultMessage:"Learning and Development"})}],ebb=[{category:"general",title:(0,te.Em)({id:"flow.prompt.create_workflow",defaultMessage:"Create Workflow"}),value:(0,te.Em)({id:"flow.prompt_create_workflow_prompt",defaultMessage:"Create a comprehensive task list based on the details provided in this [input source: email, message, document]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.mind_map_creation",defaultMessage:"Mind Map Creation"}),value:(0,te.Em)({id:"flow.prompt_mind_map_creation_prompt",defaultMessage:"Generate a structured mind map to brainstorm ideas for [project/topic]. Include key concepts, connections, and categories to organize thoughts effectively."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.brainstorming_session",defaultMessage:"Brainstorming Session"}),value:(0,te.Em)({id:"flow.prompt_brainstorming_session_prompt",defaultMessage:"Conduct a virtual brainstorming session on [topic]. Generate a list of creative ideas and solutions, encouraging innovative thinking."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.use_case_development",defaultMessage:"Use Case Development"}),value:(0,te.Em)({id:"flow.prompt_use_case_development_prompt",defaultMessage:"Create use cases for [product/service] to illustrate how it can benefit potential users. Include scenarios, benefits, and real-world examples."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.daily_summary_generation",defaultMessage:"Daily Summary Generation"}),value:(0,te.Em)({id:"flow.prompt_daily_summary_generation_prompt",defaultMessage:"Generate a daily summary of completed and pending tasks, highlighting accomplishments and priorities for the next day."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.priority_task_identification",defaultMessage:"Priority Task Identification"}),value:(0,te.Em)({id:"flow.prompt_priority_task_identification_prompt",defaultMessage:"Identify and list high-priority tasks based on urgency and importance, assisting in effective daily planning."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.article_generation",defaultMessage:"Article Generation"}),value:(0,te.Em)({id:"flow.prompt_article_generation_prompt",defaultMessage:"Generate a well-researched and engaging article on [specific topic or keyword], ensuring it's suitable for [blog, website, social media]. Specify the desired article length and tone."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.social_media_post_creation",defaultMessage:"Social Media Post Creation"}),value:(0,te.Em)({id:"flow.prompt_social_media_post_creation_prompt",defaultMessage:"Create attention-grabbing social media posts for [platform: Facebook, Twitter, Instagram] based on the latest industry trends. Include relevant hashtags and compelling captions."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.blog_post_ideas",defaultMessage:"Blog Post Ideas"}),value:(0,te.Em)({id:"flow.prompt_blog_post_ideas_prompt",defaultMessage:"Generate a list of creative blog post ideas related to [industry/niche]. Ensure that the topics are current and likely to resonate with the target audience."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.email_newsletter_content",defaultMessage:"Email Newsletter Content"}),value:(0,te.Em)({id:"flow.prompt_email_newsletter_content_prompt",defaultMessage:"Generate engaging content for your email newsletter, including headlines, body text, and a compelling call-to-action. Ensure that the content aligns with your newsletter's theme and goals."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.product_descriptions",defaultMessage:"Product Descriptions"}),value:(0,te.Em)({id:"flow.prompt_product_descriptions_prompt",defaultMessage:"Create product descriptions for your e-commerce website. Include key product features, benefits, and persuasive language to attract potential buyers."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.social_media_ad_copy",defaultMessage:"Social Media Ad Copy"}),value:(0,te.Em)({id:"flow.prompt_social_media_ad_copy_prompt",defaultMessage:"Generate attention-grabbing ad copy for your social media advertising campaigns. Specify the target audience, platform, and advertising goals to tailor the ad copy accordingly."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.content_review_feedback",defaultMessage:"Content Review and Feedback"}),value:(0,te.Em)({id:"flow.prompt_content_review_feedback_prompt",defaultMessage:"Review written content and provide constructive feedback for improvements, focusing on clarity, tone, and engagement."})},{category:"content_creation",title:(0,te.Em)({id:"flow.prompt.quick_content_brainstorming",defaultMessage:"Quick Content Brainstorming"}),value:(0,te.Em)({id:"flow.prompt_quick_content_brainstorming_prompt",defaultMessage:"Brainstorm and suggest content ideas for specified themes or topics, aiding in creative content generation."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.task_list_creation",defaultMessage:"Task List Creation"}),value:(0,te.Em)({id:"flow.prompt_task_list_creation_prompt",defaultMessage:"Generate a comprehensive task list for [project name]. Include task descriptions, priority levels, and assignees to streamline project execution."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.project_kickoff_meeting_agenda",defaultMessage:"Project Kickoff Meeting Agenda"}),value:(0,te.Em)({id:"flow.prompt_project_kickoff_meeting_agenda_prompt",defaultMessage:"Create an agenda for the project kickoff meeting for [project name]. Outline the meeting objectives, topics for discussion, and expected outcomes."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.project_timeline",defaultMessage:"Project Timeline"}),value:(0,te.Em)({id:"flow.prompt_project_timeline_prompt",defaultMessage:"Generate a detailed project timeline for [project name]. Include milestones, deadlines, and dependencies to facilitate effective project management."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.risk_assessment_mitigation",defaultMessage:"Risk Assessment and Mitigation"}),value:(0,te.Em)({id:"flow.prompt_risk_assessment_mitigation_prompt",defaultMessage:"Generate a comprehensive risk assessment for your project, identifying potential risks and their impact. Provide mitigation strategies to minimize project disruptions."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.project_status_report",defaultMessage:"Project Status Report"}),value:(0,te.Em)({id:"flow.prompt_project_status_report_prompt",defaultMessage:"Create a project status report that summarizes key project metrics, accomplishments, and upcoming milestones. Include visual representations, such as charts and graphs, for clarity."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.project_progress_analysis",defaultMessage:"Project Progress Analysis"}),value:(0,te.Em)({id:"flow.prompt_project_progress_analysis_prompt",defaultMessage:"Analyze current project progress against milestones and deliverables, highlighting areas needing attention or acceleration."})},{category:"project_planning",title:(0,te.Em)({id:"flow.prompt.stakeholder_update_preparation",defaultMessage:"Stakeholder Update Preparation"}),value:(0,te.Em)({id:"flow.prompt_stakeholder_update_preparation_prompt",defaultMessage:"Prepare concise updates for stakeholders, summarizing project status, achievements, and next steps."})},{category:"documentation",title:(0,te.Em)({id:"flow.prompt.user_manual_generation",defaultMessage:"User Manual Generation"}),value:(0,te.Em)({id:"flow.prompt_user_manual_generation_prompt",defaultMessage:"Generate a user manual for [product/software name]. Include step-by-step instructions, screenshots, and troubleshooting tips to assist users."})},{category:"documentation",title:(0,te.Em)({id:"flow.prompt.technical_documentation",defaultMessage:"Technical Documentation"}),value:(0,te.Em)({id:"flow.prompt_technical_documentation_prompt",defaultMessage:"Create technical documentation for [software/application name]. Include API references, code samples, and architecture diagrams for developers and IT professionals."})},{category:"documentation",title:(0,te.Em)({id:"flow.prompt.product_documentation_updates",defaultMessage:"Product Documentation Updates"}),value:(0,te.Em)({id:"flow.prompt_product_documentation_updates_prompt",defaultMessage:"Generate updates and revisions for the product documentation of [product name]. Ensure that it reflects the latest features and improvements."})},{category:"documentation",title:(0,te.Em)({id:"flow.prompt.compliance_documentation",defaultMessage:"Compliance Documentation"}),value:(0,te.Em)({id:"flow.prompt_compliance_documentation_prompt",defaultMessage:"Generate compliance documentation for your organization, ensuring adherence to industry regulations and standards. Customize the documentation to your specific industry."})},{category:"documentation",title:(0,te.Em)({id:"flow.prompt.training_manuals",defaultMessage:"Training Manuals"}),value:(0,te.Em)({id:"flow.prompt_training_manuals_prompt",defaultMessage:"Create training manuals for employees, covering various aspects of job roles and responsibilities. Include training modules, assessments, and progress tracking."})},{category:"documentation",title:(0,te.Em)({id:"flow.prompt.legal_document_drafting",defaultMessage:"Legal Document Drafting"}),value:(0,te.Em)({id:"flow.prompt_legal_document_drafting_prompt",defaultMessage:"Generate draft legal documents, such as contracts, agreements, and terms of service, customized to your business needs. Ensure legal accuracy and compliance."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.brand_awareness_campaign",defaultMessage:"Brand Awareness Campaign"}),value:(0,te.Em)({id:"flow.prompt_brand_awareness_campaign_prompt",defaultMessage:"Design a brand awareness campaign for [product/service], outlining target audience, channels, and key messages."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.social_media_strategy",defaultMessage:"Social Media Strategy"}),value:(0,te.Em)({id:"flow.prompt_social_media_strategy_prompt",defaultMessage:"Create a comprehensive social media strategy for [product/service], including content calendar and engagement tactics."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.email_marketing_plan",defaultMessage:"Email Marketing Plan"}),value:(0,te.Em)({id:"flow.prompt_email_marketing_plan_prompt",defaultMessage:"Develop an email marketing plan targeting [specific audience], with strategies for list building and content creation."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.digital_advertising",defaultMessage:"Digital Advertising Campaign"}),value:(0,te.Em)({id:"flow.prompt_digital_advertising_prompt",defaultMessage:"Plan a digital advertising campaign for [product/service], focusing on PPC, display ads, and retargeting strategies."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.influencer_collaboration",defaultMessage:"Influencer Collaboration"}),value:(0,te.Em)({id:"flow.prompt_influencer_collaboration_prompt",defaultMessage:"Propose a strategy for influencer collaboration to promote [product/service], identifying potential influencers and engagement terms."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.develop_branding_strategy",defaultMessage:"Develop Branding Strategy"}),value:(0,te.Em)({id:"flow.prompt_develop_branding_strategy_prompt",defaultMessage:"Create a comprehensive branding strategy [strategy specifics] to enhance brand identity and appeal to [target audience]."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.launch_product_campaign",defaultMessage:"Launch Product Campaign"}),value:(0,te.Em)({id:"flow.prompt_launch_product_campaign_prompt",defaultMessage:"Design and plan a product launch campaign [campaign details] to maximize market impact and customer engagement."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.target_audience_analysis",defaultMessage:"Target Audience Analysis"}),value:(0,te.Em)({id:"flow.prompt_target_audience_analysis_prompt",defaultMessage:"Analyze and define the target audience for a specific marketing campaign, detailing demographics, interests, and behavior patterns."})},{category:"marketing_strategies",title:(0,te.Em)({id:"flow.prompt.marketing_message_refinement",defaultMessage:"Marketing Message Refinement"}),value:(0,te.Em)({id:"flow.prompt_marketing_message_refinement_prompt",defaultMessage:"Refine marketing messages to ensure alignment with brand voice and target audience appeal."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.role_specific_training",defaultMessage:"Role-specific Training Program"}),value:(0,te.Em)({id:"flow.prompt_role_specific_training_prompt",defaultMessage:"Develop a training program for [specific role], including relevant skills development, courses, and assessments."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.leadership_development",defaultMessage:"Leadership Development Plan"}),value:(0,te.Em)({id:"flow.prompt_leadership_development_prompt",defaultMessage:"Create a leadership development plan for mid-level managers, focusing on skills enhancement and career progression."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.soft_skills_training",defaultMessage:"Soft Skills Training"}),value:(0,te.Em)({id:"flow.prompt_soft_skills_training_prompt",defaultMessage:"Outline a soft skills training program covering communication, teamwork, and problem-solving for all employees."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.technical_skills_upgrade",defaultMessage:"Technical Skills Upgrade"}),value:(0,te.Em)({id:"flow.prompt_technical_skills_upgrade_prompt",defaultMessage:"Design a technical skills upgrade course for [specific department/technology], including latest industry practices."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.onboarding_training",defaultMessage:"Onboarding Training Curriculum"}),value:(0,te.Em)({id:"flow.prompt_onboarding_training_prompt",defaultMessage:"Develop an onboarding training curriculum for new hires, encompassing company culture, policies, and role-specific skills."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.training_effectiveness_evaluation",defaultMessage:"Training Effectiveness Evaluation"}),value:(0,te.Em)({id:"flow.prompt_training_effectiveness_evaluation_prompt",defaultMessage:"Evaluate the effectiveness of current training programs and suggest improvements for increased engagement and learning outcomes."})},{category:"learning_and_development",title:(0,te.Em)({id:"flow.prompt.skill_gap_analysis",defaultMessage:"Skill Gap Analysis"}),value:(0,te.Em)({id:"flow.prompt_skill_gap_analysis_prompt",defaultMessage:"Conduct a skill gap analysis for [specific department/team] to identify training needs and recommend suitable development programs."})}],ebv=[{id:"general",emoji:"✍️",name:(0,te.Em)({id:"flow.category_general",defaultMessage:"General"}),default:!0},{id:"market_research",emoji:"\uD83D\uDCCA",name:(0,te.Em)({id:"flow.category_market_research",defaultMessage:"Market Research"})},{id:"customer_feedback_analysis",emoji:"\uD83D\uDDE3️",name:(0,te.Em)({id:"flow.category_customer_feedback_analysis",defaultMessage:"Customer Feedback Analysis"})},{id:"competitor_analysis",emoji:"\uD83D\uDD75️",name:(0,te.Em)({id:"flow.category_competitor_analysis",defaultMessage:"Competitor Analysis"})},{id:"strategic_planning",emoji:"\uD83C\uDF10",name:(0,te.Em)({id:"flow.category_strategic_planning",defaultMessage:"Strategic Planning"})},{id:"process_optimization",emoji:"⚙️",name:(0,te.Em)({id:"flow.category_process_optimization",defaultMessage:"Process Optimization"})}],ebk=[{category:"general",title:(0,te.Em)({id:"flow.prompt_find_insights",defaultMessage:"Find Insights"}),value:(0,te.Em)({id:"flow.prompt_find_insights_prompt",defaultMessage:"Research and provide detailed insights on [specific query/topic] using information from [input source: database, online query]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt_create_action_plan",defaultMessage:"Create Action Plan"}),value:(0,te.Em)({id:"flow.prompt_create_action_plan_prompt",defaultMessage:"Generate an action plan based on the information provided in [input source: meeting notes, communication], outlining steps and responsibilities."})},{category:"general",title:(0,te.Em)({id:"flow.prompt_identify_opportunities",defaultMessage:"Identify Opportunities"}),value:(0,te.Em)({id:"flow.prompt_identify_opportunities_prompt",defaultMessage:"Identify growth opportunities and potential areas for improvement based on data analysis from [input source: market data, customer feedback]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.quick_client_feedback_analysis",defaultMessage:"Quick Client Feedback Analysis"}),value:(0,te.Em)({id:"flow.prompt_quick_client_feedback_analysis_prompt",defaultMessage:"Analyze recent client feedback [feedback details] to identify key takeaways [takeaway points] and suggest immediate improvements [improvement suggestions]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.simple_project_overview_creation",defaultMessage:"Simple Project Overview Creation"}),value:(0,te.Em)({id:"flow.prompt_simple_project_overview_creation_prompt",defaultMessage:"Generate a concise project overview [project details] suitable for quick team briefings [briefing format] and client updates [update specifics]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.team_collaboration_ideas",defaultMessage:"Team Collaboration Ideas"}),value:(0,te.Em)({id:"flow.prompt_team_collaboration_ideas_prompt",defaultMessage:"Suggest creative ideas [idea concepts] for enhancing team collaboration and communication in a remote working environment [remote work specifics]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.quick_event_response_planning",defaultMessage:"Quick Event Response Planning"}),value:(0,te.Em)({id:"flow.prompt_quick_event_response_planning_prompt",defaultMessage:"Create a rapid response plan [plan specifics] for upcoming events [event details] to ensure seamless coordination and execution [execution strategy]."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.effective_meeting_summarization",defaultMessage:"Effective Meeting Summarization"}),value:(0,te.Em)({id:"flow.prompt_effective_meeting_summarization_prompt",defaultMessage:"Summarize key points [key points details] and action items [action items list] from recent meetings [meeting context] for team alignment and follow-up."})},{category:"general",title:(0,te.Em)({id:"flow.prompt.innovative_marketing_ideas_generation",defaultMessage:"Innovative Marketing Ideas Generation"}),value:(0,te.Em)({id:"flow.prompt_innovative_marketing_ideas_generation_prompt",defaultMessage:"Brainstorm creative and innovative marketing ideas [idea specifics] tailored for [target audience] to enhance brand presence and engagement [engagement strategy]."})},{category:"market_research",title:(0,te.Em)({id:"flow.prompt_market_research",defaultMessage:"Market Research"}),value:(0,te.Em)({id:"flow.prompt_market_research_prompt",defaultMessage:"Research and provide detailed insights on [specific industry/topic] using information from [input source: database, online query]."})},{category:"market_research",title:(0,te.Em)({id:"flow.prompt_industry_trends",defaultMessage:"Industry Trends"}),value:(0,te.Em)({id:"flow.prompt_industry_trends_prompt",defaultMessage:"Analyze industry trends and provide insights based on data collected from [input source: database, online query]."})},{category:"market_research",title:(0,te.Em)({id:"flow.prompt_consumer_behavior_insights",defaultMessage:"Consumer Behavior Insights"}),value:(0,te.Em)({id:"flow.prompt_consumer_behavior_insights_prompt",defaultMessage:"Provide insights into consumer behavior and preferences in the [specific industry], utilizing data gathered from [input source: surveys, online behavior]."})},{category:"market_research",title:(0,te.Em)({id:"flow.prompt_product_demand_forecast",defaultMessage:"Product Demand Forecast"}),value:(0,te.Em)({id:"flow.prompt_product_demand_forecast_prompt",defaultMessage:"Forecast the demand for a new product or service in the [specific industry] based on historical data and market trends."})},{category:"market_research",title:(0,te.Em)({id:"flow.prompt_competitive_analysis_report",defaultMessage:"Competitive Analysis Report"}),value:(0,te.Em)({id:"flow.prompt_competitive_analysis_report_prompt",defaultMessage:"Produce a comprehensive competitive analysis report that includes market share, pricing, and product comparisons in the [specific industry]."})},{category:"customer_feedback_analysis",title:(0,te.Em)({id:"flow.prompt_customer_feedback_analysis",defaultMessage:"Customer Feedback Analysis"}),value:(0,te.Em)({id:"flow.prompt_customer_feedback_analysis_prompt",defaultMessage:"Analyze customer feedback data and identify trends, key issues, and potential improvements in our products/services."})},{category:"customer_feedback_analysis",title:(0,te.Em)({id:"flow.prompt_identify_key_issues",defaultMessage:"Identify Key Issues"}),value:(0,te.Em)({id:"flow.prompt_identify_key_issues_prompt",defaultMessage:"Identify key issues and areas of improvement from customer feedback data using AI analysis."})},{category:"customer_feedback_analysis",title:(0,te.Em)({id:"flow.prompt_product_improvement_suggestions",defaultMessage:"Product Improvement Suggestions"}),value:(0,te.Em)({id:"flow.prompt_product_improvement_suggestions_prompt",defaultMessage:"Generate product improvement suggestions based on analysis of customer feedback data."})},{category:"customer_feedback_analysis",title:(0,te.Em)({id:"flow.prompt_identify_customer_trends",defaultMessage:"Identify Customer Trends"}),value:(0,te.Em)({id:"flow.prompt_identify_customer_trends_prompt",defaultMessage:"Identify emerging customer trends and preferences from customer feedback data to guide product/service development."})},{category:"customer_feedback_analysis",title:(0,te.Em)({id:"flow.prompt_customer_sentiment_analysis",defaultMessage:"Customer Sentiment Analysis"}),value:(0,te.Em)({id:"flow.prompt_customer_sentiment_analysis_prompt",defaultMessage:"Perform sentiment analysis on customer feedback data to gauge overall customer sentiment and satisfaction levels."})},{category:"competitor_analysis",title:(0,te.Em)({id:"flow.prompt_competitor_analysis",defaultMessage:"Competitor Analysis"}),value:(0,te.Em)({id:"flow.prompt_competitor_analysis_prompt",defaultMessage:"Gather and analyze data on our competitors, including market share, products, and customer reviews, to gain insights for our strategy."})},{category:"competitor_analysis",title:(0,te.Em)({id:"flow.prompt_identify_market_share",defaultMessage:"Identify Market Share"}),value:(0,te.Em)({id:"flow.prompt_identify_market_share_prompt",defaultMessage:"Use AI to identify the market share of our competitors in specific industries or markets."})},{category:"competitor_analysis",title:(0,te.Em)({id:"flow.prompt_analyze_customer_reviews",defaultMessage:"Analyze Customer Reviews"}),value:(0,te.Em)({id:"flow.prompt_analyze_customer_reviews_prompt",defaultMessage:"Analyze customer reviews of competitors to identify strengths, weaknesses, and areas where we can excel."})},{category:"competitor_analysis",title:(0,te.Em)({id:"flow.prompt_competitor_product_analysis",defaultMessage:"Competitor Product Analysis"}),value:(0,te.Em)({id:"flow.prompt_competitor_product_analysis_prompt",defaultMessage:"Conduct a detailed analysis of competitor products, including features, pricing, and customer feedback."})},{category:"competitor_analysis",title:(0,te.Em)({id:"flow.prompt_compare_product_features",defaultMessage:"Compare Product Features"}),value:(0,te.Em)({id:"flow.prompt_compare_product_features_prompt",defaultMessage:"Compare the features and capabilities of our products/services with those of our competitors to identify strengths and weaknesses."})},{category:"strategic_planning",title:(0,te.Em)({id:"flow.prompt.long_term_strategy",defaultMessage:"Long-term Strategy Development"}),value:(0,te.Em)({id:"flow.prompt_long_term_strategy_prompt",defaultMessage:"Develop a long-term strategic plan for achieving [specific business goal], considering market dynamics and internal strengths."})},{category:"strategic_planning",title:(0,te.Em)({id:"flow.prompt.competitive_strategy",defaultMessage:"Competitive Strategy Formulation"}),value:(0,te.Em)({id:"flow.prompt_competitive_strategy_prompt",defaultMessage:"Formulate a competitive strategy to enhance market position against key competitors in [industry/market]."})},{category:"strategic_planning",title:(0,te.Em)({id:"flow.prompt.growth_opportunities",defaultMessage:"Growth Opportunities Identification"}),value:(0,te.Em)({id:"flow.prompt_growth_opportunities_prompt",defaultMessage:"Identify potential growth opportunities in [specific market/sector] and propose strategies for expansion."})},{category:"strategic_planning",title:(0,te.Em)({id:"flow.prompt.business_model_innovation",defaultMessage:"Business Model Innovation"}),value:(0,te.Em)({id:"flow.prompt_business_model_innovation_prompt",defaultMessage:"Suggest innovative business models for [product/service] that can disrupt the current market trends."})},{category:"strategic_planning",title:(0,te.Em)({id:"flow.prompt.risk_management_strategy",defaultMessage:"Risk Management Strategy"}),value:(0,te.Em)({id:"flow.prompt_risk_management_strategy_prompt",defaultMessage:"Develop a comprehensive risk management strategy for [specific project/business initiative]."})},{category:"process_optimization",title:(0,te.Em)({id:"flow.prompt.workflow_improvement",defaultMessage:"Workflow Improvement Analysis"}),value:(0,te.Em)({id:"flow.prompt_workflow_improvement_prompt",defaultMessage:"Analyze and suggest improvements for the current workflow in [department/process], aiming for higher efficiency."})},{category:"process_optimization",title:(0,te.Em)({id:"flow.prompt.automation_opportunities",defaultMessage:"Automation Opportunities"}),value:(0,te.Em)({id:"flow.prompt_automation_opportunities_prompt",defaultMessage:"Identify processes in [business area] that can be automated to save time and reduce errors."})},{category:"process_optimization",title:(0,te.Em)({id:"flow.prompt.cost_reduction_strategies",defaultMessage:"Cost Reduction Strategies"}),value:(0,te.Em)({id:"flow.prompt_cost_reduction_strategies_prompt",defaultMessage:"Propose strategies for cost reduction in [specific process/operation] without compromising on quality."})},{category:"process_optimization",title:(0,te.Em)({id:"flow.prompt.efficiency_metrics",defaultMessage:"Efficiency Metrics Establishment"}),value:(0,te.Em)({id:"flow.prompt_efficiency_metrics_prompt",defaultMessage:"Establish key efficiency metrics for [business process] to monitor and improve operational performance."})},{category:"process_optimization",title:(0,te.Em)({id:"flow.prompt.resource_optimization",defaultMessage:"Resource Optimization"}),value:(0,te.Em)({id:"flow.prompt_resource_optimization_prompt",defaultMessage:"Suggest ways to optimize resource allocation and utilization in [specific project or department]."})}],ebE=[{id:"general",emoji:"✍️",name:(0,te.Em)({id:"flow.category_general",defaultMessage:"General"}),default:!0},{id:"customer_support",emoji:"\uD83D\uDEE0️",name:(0,te.Em)({id:"flow.category_customer_support",defaultMessage:"Customer Support"})},{id:"sales_outreach",emoji:"\uD83D\uDCBC",name:(0,te.Em)({id:"flow.category_sales_outreach",defaultMessage:"Sales Outreach"})},{id:"meeting_summaries",emoji:"\uD83D\uDCCA",name:(0,te.Em)({id:"flow.category_meeting_summaries",defaultMessage:"Meeting Summaries"})},{id:"hr_queries",emoji:"\uD83D\uDC65",name:(0,te.Em)({id:"flow.category_hr_queries",defaultMessage:"HR Queries"})},{id:"it_support",emoji:"\uD83D\uDCBB",name:(0,te.Em)({id:"flow.category_it_support",defaultMessage:"IT Support"})}],ebx=[{category:"general",title:(0,te.Em)({id:"flow.prompt_draft_actionable_agenda",defaultMessage:"Draft Actionable Agenda"}),value:(0,te.Em)({id:"flow.prompt_draft_actionable_agenda_prompt",defaultMessage:"Generate an actionable agenda based on the content of this [input source: meeting invite, communication], outlining key discussion points and tasks to be addressed."})},{category:"general",title:(0,te.Em)({id:"flow.prompt_create_follow-up_tasks",defaultMessage:"Create Follow-up Tasks"}),value:(0,te.Em)({id:"flow.prompt_create_follow-up_tasks_prompt",defaultMessage:"Generate follow-up tasks and action items from this [input source: communication, event], ensuring nothing is missed in the next steps."})},{category:"general",title:(0,te.Em)({id:"flow.prompt_generate_summary_report",defaultMessage:"Generate Summary Report"}),value:(0,te.Em)({id:"flow.prompt_generate_summary_report_prompt",defaultMessage:"Produce a concise summary report summarizing key points and decisions made during this [input source: discussion, communication], making it easy for stakeholders to stay informed."})},{category:"general",title:(0,te.Em)({id:"flow.prompt_reply_to_email",defaultMessage:"Reply to Email"}),value:(0,te.Em)({id:"flow.prompt_reply_to_email_prompt",defaultMessage:"Generate a detailed and contextually relevant reply to this email [input source: customer inquiry, business communication], addressing all queries and aligning with our communication style."})},{category:"general",title:(0,te.Em)({id:"flow.prompt_draft_actionable_agenda",defaultMessage:"Draft Actionable Agenda"}),value:(0,te.Em)({id:"flow.prompt_draft_actionable_agenda_prompt",defaultMessage:"Generate an actionable agenda based on the content of this [input source: meeting invite, communication], outlining key discussion points and tasks to be addressed."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt_customer_support",defaultMessage:"Customer Support"}),value:(0,te.Em)({id:"flow.prompt_customer_support_prompt",defaultMessage:"Provide a personalized and helpful response to [customer inquiry/issue], addressing all queries and concerns."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt_respond_to_ticket",defaultMessage:"Respond to Support Ticket"}),value:(0,te.Em)({id:"flow.prompt_respond_to_ticket_prompt",defaultMessage:"Provide a quick and efficient response to this support ticket, addressing the user's issue and offering a solution."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt_resolve_customer_issue",defaultMessage:"Resolve Customer Issue"}),value:(0,te.Em)({id:"flow.prompt_resolve_customer_issue_prompt",defaultMessage:"Provide a step-by-step solution to resolve this customer's issue, ensuring their satisfaction and loyalty."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt_resolve_customer_complaint",defaultMessage:"Resolve Customer Complaint"}),value:(0,te.Em)({id:"flow.prompt_resolve_customer_complaint_prompt",defaultMessage:"Address and resolve a customer complaint regarding [specific issue/product], ensuring their satisfaction."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt_provide_technical_assistance",defaultMessage:"Provide Technical Assistance"}),value:(0,te.Em)({id:"flow.prompt_provide_technical_assistance_prompt",defaultMessage:"Offer technical support and guidance to a customer experiencing issues with [specific product/technology]."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt.provide_customer_care_solutions",defaultMessage:"Provide Customer Care Solutions"}),value:(0,te.Em)({id:"flow.prompt_provide_customer_care_solutions_prompt",defaultMessage:"Offer tailored solutions to customer care inquiries, focusing on empathetic communication and effective problem-solving."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt.implement_feedback_improvements",defaultMessage:"Implement Feedback Improvements"}),value:(0,te.Em)({id:"flow.prompt_implement_feedback_improvements_prompt",defaultMessage:"Analyze customer feedback to implement improvements in services/products, enhancing customer satisfaction and loyalty."})},{category:"customer_support",title:(0,te.Em)({id:"flow.prompt.develop_support_strategies",defaultMessage:"Develop Support Strategies"}),value:(0,te.Em)({id:"flow.prompt_develop_support_strategies_prompt",defaultMessage:"Develop comprehensive support strategies that address common customer issues, streamline support processes, and reduce response times."})},{category:"sales_outreach",title:(0,te.Em)({id:"flow.prompt_sales_outreach",defaultMessage:"Sales Outreach"}),value:(0,te.Em)({id:"flow.prompt_sales_outreach_prompt",defaultMessage:"Craft a persuasive sales email to engage potential clients and highlight our products/services."})},{category:"sales_outreach",title:(0,te.Em)({id:"flow.prompt_follow_up_with_prospects",defaultMessage:"Follow Up with Prospects"}),value:(0,te.Em)({id:"flow.prompt_follow_up_with_prospects_prompt",defaultMessage:"Craft a follow-up email to potential clients who have shown interest in our products/services, and provide additional information to nurture the leads."})},{category:"sales_outreach",title:(0,te.Em)({id:"flow.prompt_product_presentation",defaultMessage:"Product Presentation"}),value:(0,te.Em)({id:"flow.prompt_product_presentation_prompt",defaultMessage:"Create a persuasive presentation highlighting the key features and benefits of our products/services for a client meeting."})},{category:"sales_outreach",title:(0,te.Em)({id:"flow.prompt_send_product_catalog",defaultMessage:"Send Product Catalog"}),value:(0,te.Em)({id:"flow.prompt_send_product_catalog_prompt",defaultMessage:"Share the latest product catalog with potential clients, highlighting key features and benefits."})},{category:"sales_outreach",title:(0,te.Em)({id:"flow.prompt_schedule_sales_call",defaultMessage:"Schedule Sales Call"}),value:(0,te.Em)({id:"flow.prompt_schedule_sales_call_prompt",defaultMessage:"Arrange a sales call with a potential client to discuss their needs and how our products/services can meet them."})},{category:"meeting_summaries",title:(0,te.Em)({id:"flow.prompt_meeting_summaries",defaultMessage:"Meeting Summaries"}),value:(0,te.Em)({id:"flow.prompt_meeting_summaries_prompt",defaultMessage:"Generate a concise summary of the recent team meeting, highlighting key points, action items, and deadlines."})},{category:"meeting_summaries",title:(0,te.Em)({id:"flow.prompt_project_status_update",defaultMessage:"Project Status Update"}),value:(0,te.Em)({id:"flow.prompt_project_status_update_prompt",defaultMessage:"Generate a project status update summary for the team, highlighting progress, challenges, and upcoming milestones."})},{category:"meeting_summaries",title:(0,te.Em)({id:"flow.prompt_sales_team_update",defaultMessage:"Sales Team Update"}),value:(0,te.Em)({id:"flow.prompt_sales_team_update_prompt",defaultMessage:"Generate an update on the sales team's performance, including sales figures, achievements, and goals for the upcoming quarter."})},{category:"meeting_summaries",title:(0,te.Em)({id:"flow.prompt_board_meeting_summary",defaultMessage:"Board Meeting Summary"}),value:(0,te.Em)({id:"flow.prompt_board_meeting_summary_prompt",defaultMessage:"Generate a comprehensive summary of the recent board meeting, including decisions made and action items assigned."})},{category:"meeting_summaries",title:(0,te.Em)({id:"flow.prompt_client_meeting_recap",defaultMessage:"Client Meeting Recap"}),value:(0,te.Em)({id:"flow.prompt_client_meeting_recap_prompt",defaultMessage:"Summarize the key points and outcomes of the recent client meeting, emphasizing next steps and follow-ups."})},{category:"hr_queries",title:(0,te.Em)({id:"flow.prompt.policy_explanation",defaultMessage:"Policy Explanation"}),value:(0,te.Em)({id:"flow.prompt_policy_explanation_prompt",defaultMessage:"Provide a detailed explanation of [specific HR policy] to clarify employee queries and concerns."})},{category:"hr_queries",title:(0,te.Em)({id:"flow.prompt.benefits_clarification",defaultMessage:"Benefits Clarification"}),value:(0,te.Em)({id:"flow.prompt_benefits_clarification_prompt",defaultMessage:"Clarify the details and eligibility criteria for [specific employee benefit], ensuring clear understanding."})},{category:"hr_queries",title:(0,te.Em)({id:"flow.prompt.leave_policy_query",defaultMessage:"Leave Policy Query"}),value:(0,te.Em)({id:"flow.prompt_leave_policy_query_prompt",defaultMessage:"Respond to inquiries about the company’s leave policy, outlining the process and provisions for [type of leave]."})},{category:"hr_queries",title:(0,te.Em)({id:"flow.prompt.performance_review_guidelines",defaultMessage:"Performance Review Guidelines"}),value:(0,te.Em)({id:"flow.prompt_performance_review_guidelines_prompt",defaultMessage:"Explain the guidelines and criteria for performance reviews, helping employees understand the evaluation process."})},{category:"hr_queries",title:(0,te.Em)({id:"flow.prompt.workplace_compliance",defaultMessage:"Workplace Compliance"}),value:(0,te.Em)({id:"flow.prompt_workplace_compliance_prompt",defaultMessage:"Address queries related to workplace compliance and ethical conduct, ensuring employees understand company policies."})},{category:"it_support",title:(0,te.Em)({id:"flow.prompt.connectivity_issue_resolution",defaultMessage:"Connectivity Issue Resolution"}),value:(0,te.Em)({id:"flow.prompt_connectivity_issue_resolution_prompt",defaultMessage:"Provide step-by-step solutions to resolve common connectivity issues experienced by employees."})},{category:"it_support",title:(0,te.Em)({id:"flow.prompt.software_glitch_fixes",defaultMessage:"Software Glitch Fixes"}),value:(0,te.Em)({id:"flow.prompt_software_glitch_fixes_prompt",defaultMessage:"Offer troubleshooting steps for typical software glitches reported in [specific software/application]."})},{category:"it_support",title:(0,te.Em)({id:"flow.prompt.hardware_troubleshooting",defaultMessage:"Hardware Troubleshooting"}),value:(0,te.Em)({id:"flow.prompt_hardware_troubleshooting_prompt",defaultMessage:"Guide users through diagnosing and resolving common hardware issues with [specific device/equipment]."})},{category:"it_support",title:(0,te.Em)({id:"flow.prompt.security_breach_protocol",defaultMessage:"Security Breach Protocol"}),value:(0,te.Em)({id:"flow.prompt_security_breach_protocol_prompt",defaultMessage:"Advise employees on steps to take in case of a suspected security breach or cyber threat."})},{category:"it_support",title:(0,te.Em)({id:"flow.prompt.data_backup_procedures",defaultMessage:"Data Backup Procedures"}),value:(0,te.Em)({id:"flow.prompt_data_backup_procedures_prompt",defaultMessage:"Explain the procedures and best practices for data backup to ensure data safety and recovery."})}],eb_=function(e){let{template:t}=e,a=(0,eK.Z)(),n=ev.useMemo(()=>a.formatMessage(t.value).split(/(\[[^\]]+\])/).filter(Boolean),[a,t.value]);return ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement("div",{className:"line-clamp-5"},n.map((e,t)=>e.startsWith("[")&&e.endsWith("]")?ev.createElement("span",{key:t,className:"inline text-primary"},`[${e.slice(1,-1)}]`):ev.createElement("span",{key:t},e))))},ebw=function(e){let{handleAiPromptClick:t,exit:a,action:n}=e,l=n.name,r=(0,eK.Z)(),[o,i]=ev.useState(null),[s,d]=ev.useState(""),c=ev.useMemo(()=>"ai.ask"===l?ebk:"ai.generate"===l?ebb:"ai.respond"===l?ebx:[],[l]),m=ev.useMemo(()=>"ai.ask"===l?ebv:"ai.generate"===l?eby:"ai.respond"===l?ebE:[],[l]),u=ev.useMemo(()=>new to.Z(c,{keys:["title.defaultMessage","value.defaultMessage"],threshold:.3}),[c]),p=ev.useMemo(()=>s?u.search(s).map(e=>e.item):c,[u,c,s]),g=ev.useMemo(()=>{let e=function(e){let t=e.map(e=>[e.id,{category:e,templates:[]}]);return new Map(t)}(m);for(let t of p){let a=e.get(t.category);null!=a&&a.templates.push(t)}return Array.from(e.values()).filter(e=>e.templates.length>0)},[p,m]);return ev.useEffect(()=>{let e=m.find(e=>e.default);null!=e&&i(e.id)},[m]),ev.createElement("div",{className:"flex h-[80vh] max-w-5xl flex-col"},ev.createElement("div",{className:"flex items-center border-b border-solid border-appcolor-300 p-4"},ev.createElement("div",{className:"text-md flex items-center"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"mr-2"}),ev.createElement(eY.Z,{id:"general.ai_prompt_templates",defaultMessage:"AI Prompt Templates"})),ev.createElement("div",{className:"ml-auto"},ev.createElement("input",{type:"search",id:"site-search",className:"rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm",placeholder:"Search templates...",name:"q",onChange:e=>{d(e.target.value)}}))),ev.createElement("div",{className:"flex overflow-auto"},g.length>0?ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"w-md sticky top-0 flex shrink-0 flex-col gap-px overflow-y-auto p-4"},g.map(e=>{let{category:t,templates:a}=e;return ev.createElement("button",{key:t.name.id,className:og()("flex w-full items-center rounded-lg px-3 py-1 text-sm transition duration-150 ease-out hover:bg-appcolor-200 hover:ease-in",o===t.id&&"bg-appcolor-200"),onClick:()=>i(t.id)},ev.createElement("span",{className:"mr-3"},t.emoji),ev.createElement("span",{className:"truncate"},ev.createElement(eY.Z,t.name)),ev.createElement("span",{className:"ml-1 flex rounded-full border border-solid border-appcolor-300 bg-appcolor-100 px-2 py-1 text-xs font-bold text-appcolor-800"},a.length))})),ev.createElement("div",{className:"flex-grow flex-col"},g.filter(e=>e.category.id===o).map(e=>{let{category:n,templates:l}=e;return ev.createElement("div",{key:n.name.id,className:"flex flex-col gap-2 p-4"},l.map((e,l)=>ev.createElement("div",{key:`${n.name}-${l}`,className:"group/delete relative flex cursor-pointer flex-col gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 p-3 py-3 pl-4 text-sm hover:border-appcolor-400 hover:bg-appcolor-200",onClick:()=>{t(r.formatMessage({...e.value})),a()}},ev.createElement("div",{className:"flex w-full flex-col gap-1"},ev.createElement("h3",{className:"w-3/4 font-medium text-appcolor-800"},ev.createElement(eY.Z,e.title))),ev.createElement("div",{className:"line-clamp-5 w-full text-left text-appcolor-500"},ev.createElement(eb_,{template:e})))))}))):ev.createElement("div",{className:"center-items flex flex-grow flex-col justify-center py-10"},ev.createElement("span",{className:"text-center text-appcolor-500"},ev.createElement(eY.Z,{id:"general.prompt_no_results",defaultMessage:"No results found for"}),`"${s}"`))))},ebN=function(e){let{isOpen:t,handleClose:a,handleAiPromptClick:n,action:l}=e;return t&&null!=l?ev.createElement(eI.ModalDialog,{className:"rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Opaque,disableBackground:!0,close:a,isOpen:t,autofocus:!1,dialogBackdropValue:"second"},e=>{let{exit:t}=e;return ev.createElement(ebw,{exit:t,handleAiPromptClick:n,action:l})}):null},ebC=function(e){let{propName:t,title:a,currentValue:n,availableMenu:l,onChange:r,isRequired:o,description:i,piece:s,action:d}=e,[c,m]=ev.useState(!1),[u,p]=ev.useState(!1),g=ev.useRef(null),f=ev.useRef(null),h=ev.useRef(null),y=ebh(n??"",l),{arrowProps:b,popperProps:v,referenceProps:k}=(0,eI.useControlledTooltip)({referenceElementRef:g,arrowElementRef:f,popperElementRef:h,placement:"top",visible:c}),E=ev.useMemo(()=>{let e=CP()(l);return null==e?null:e},[l]),x=ev.useRef(null),_=s.name===eyn&&"prompt"===t&&null!=d,w=o&&(null==n||0===n.length);return ev.createElement("div",null,ev.createElement("div",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},o&&ev.createElement("span",{className:"mr-1 font-medium"},"*"),ev.createElement("span",null,a),o&&ev.createElement("span",{className:"ml-px flex"},ev.createElement(eY.Z,{id:"automation.required",defaultMessage:"(Required)"})),null!=i&&ev.createElement("span",{onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},...k,className:"ml-1"},ev.createElement(tn.Icon,{icon:"dd_help",className:"h-4 w-4"})),c&&ev.createElement(eI.Tooltip,{arrowProps:b,popperProps:v},i)),ev.createElement("div",{className:"relative rounded-xl border border-appcolor-300 bg-appcolor-100 transition duration-150 ease-in-out focus-within:border-appcolor-400 hover:border-appcolor-400"},w&&ev.createElement("div",{className:"absolute right-3 top-2"},ev.createElement(eyF,null)),ev.createElement(ebp,{onChange:e=>{r(t,ebf(e))},isReadOnly:!1,initialDelta:y,availableMenu:l,contentEditableClassName:"min-h-[150px] px-3 py-3.5",ref:x}),ev.createElement("div",{className:"flex min-h-12 w-full flex-wrap gap-1 border-t border-solid border-appcolor-300 px-3 py-2 pr-14"},_&&ev.createElement("button",{type:"button",tabIndex:-1,onClick:()=>{p(!0)},className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-xs text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"automation.view_prompts",defaultMessage:"View prompts"})),!_&&null!=E&&ev.createElement(ev.Fragment,null,E.menuContent.slice(0,3).map((e,t)=>ev.createElement("button",{key:t,className:"w-fit max-w-fit gap-1 truncate rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-3 py-1.5 text-left text-xs text-appcolor-800 transition duration-150 ease-in-out hover:border-appcolor-500 hover:bg-appcolor-300",tabIndex:-1,onClick:()=>{x.current?.insertMentionNode(e.displayText,e.nodeId,e.path,e.pieceName)}},e.displayText))))),ev.createElement(ebN,{isOpen:u,handleClose:()=>{p(!1)},handleAiPromptClick:e=>{x?.current?.promptReplace(e)},action:d}))},ebM=function(e){let{children:t,name:a,value:n,onClick:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:l,stopRef:r,name:a,value:n});return ev.createElement("button",{...o.props,className:"flex min-h-8 w-full items-center gap-x-2 px-3 py-1 text-left text-sm hover:bg-appcolor-200",type:"button"},t)},ebS=(0,eL.default)(eI.Popup).withConfig({displayName:"StaticDropdown__StyledPopup",componentId:"sc-b2e0b0a7-0"})` + width: ${e=>e.$calculatedWidth?e.$calculatedWidth+"px":"auto"}; +`,ebI=function(e){let{title:t,placeholder:a,currentValue:n,options:l,onSelect:r,description:o}=e,[i,s]=ev.useState(!1),d=ev.useRef(null),c=ev.useRef(null),m=ev.useRef(null),u=e.isRequired??!1,p=e.shouldShowInstant??!1,[g,f]=ev.useReducer(eI.popupReducer,{expanded:!1}),h=ev.useRef(null),y=ev.useRef(null),b=(0,eI.usePopup)({referenceElementRef:h,popupElementRef:y,state:g,placement:"bottom-start"}),v=(0,eI.useMenuButton)({dispatch:f,ref:h,state:g}),k=ev.useMemo(()=>{if(null==n)return null;let e=l.find(e=>e.value===n);return null==e?null:e.label},[n,l]),E=ev.useMemo(()=>{if(!p||null==n)return!1;let e=l.find(e=>e.value===n);return null!=e&&e.triggerType!==eyE.X8.POLLING},[n,l,p]),x=ev.useCallback(e=>{"Activate"===e.type&&f({type:"Collapse"})},[]),{arrowProps:_,popperProps:w,referenceProps:N}=(0,eI.useControlledTooltip)({referenceElementRef:d,arrowElementRef:c,popperElementRef:m,placement:"top",visible:i});return ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},u&&ev.createElement("span",{className:"mr-1 font-medium"},"*"),t,u&&ev.createElement("span",{className:"ml-px flex"},ev.createElement(eY.Z,{id:"automation.required",defaultMessage:"(Required)"})),null!=o&&ev.createElement("div",{onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},...N,className:"ml-1"},ev.createElement(tn.Icon,{icon:"dd_help",className:"h-4 w-4"})),i&&ev.createElement(eI.Tooltip,{arrowProps:_,popperProps:w},o)),ev.createElement("button",{...v.props,className:"flex items-center justify-between rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-2 text-sm transition duration-150 ease-in-out hover:border-appcolor-400"},ev.createElement("div",{className:"flex w-full items-center"},null!=k?ev.createElement("div",{className:"flex items-center"},ev.createElement("p",null,k),E&&ev.createElement("span",{className:"ml-2 rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"automation.instant",defaultMessage:"Instant"}))):ev.createElement(ev.Fragment,null,ev.createElement("p",{className:"text-appcolor-500"},a," "),u&&ev.createElement("div",{className:"ml-auto mr-2"},ev.createElement(eyF,null)))),ev.createElement(tn.Icon,{icon:"caret_down",className:"text-appcolor-500"})),g.expanded&&ev.createElement(ebS,{...b.props,dispatch:f,modal:!0,$calculatedWidth:h?.current?.offsetWidth??null},ev.createElement(eI.MenuGroupContext.Provider,{value:x},ev.createElement(eI.Menu,{initialFocus:b.initialFocus,loop:!0,className:"flex flex-col gap-px rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-2"},l.map((e,t)=>{let a=e.triggerType!==eyE.X8.POLLING&&p;return ev.createElement(ebM,{key:t,onClick:()=>{r(e)}},ev.createElement("div",{className:"flex flex-col gap-1 text-left"},ev.createElement("div",{className:"flex items-center"},ev.createElement("div",null,e.label,a&&ev.createElement("span",{className:"ml-2 rounded-lg border border-solid border-appcolor-400 bg-appcolor-300 px-2 py-px text-2xs font-medium text-appcolor-700"},ev.createElement(eY.Z,{id:"automation.instant",defaultMessage:"Instant"})))),ev.createElement("div",{className:"whitespace-normal break-all text-appcolor-500"},e.description)))})))))},ebD=function(e){let{actionName:t,title:a,currentValue:n,availableMenu:l,onChange:r,isRequired:o,description:i}=e,[s,d]=ev.useState(!1),c=ev.useRef(null),m=ev.useRef(null),u=ev.useRef(null),p=ebh(n??"",l),{arrowProps:g,popperProps:f,referenceProps:h}=(0,eI.useControlledTooltip)({referenceElementRef:c,arrowElementRef:m,popperElementRef:u,placement:"top",visible:s}),y=o&&(null==n||0===n.length);return ev.createElement("div",null,ev.createElement("div",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},o&&ev.createElement("span",{className:"mr-1 font-medium"},"*"),ev.createElement("span",null,a),o&&ev.createElement("span",{className:"ml-px flex"},ev.createElement(eY.Z,{id:"automation.required",defaultMessage:"(Required)"})),null!=i&&ev.createElement("span",{onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},...h,className:"ml-1.5"},ev.createElement(tn.Icon,{icon:"dd_help",className:"h-4 w-4"})),s&&ev.createElement(eI.Tooltip,{arrowProps:g,popperProps:f},i)),ev.createElement("div",{className:"relative rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-3.5 pr-12 text-sm transition duration-150 ease-in-out hover:border-appcolor-400"},y&&ev.createElement("div",{className:"absolute right-14"},ev.createElement(eyF,null)),ev.createElement(ebp,{onChange:e=>{r(t,ebf(e))},isReadOnly:!1,initialDelta:p,availableMenu:l})))},ebT=function(e){let{flowId:t,piece:a,action:n,node:l,availableMenu:r,updateNode:o,currentProps:i,setCurrentProps:s}=e;if(null==n||l.data.settings.actionName!==n.name)return null;let d=l.data.settings.input,c=l.data.settings?.credentialsRef??null,m=Object.keys(n.props).map(e=>({key:e,value:n.props[e]})),u=[...m.filter(e=>!0===e.value.required),...m.filter(e=>!1===e.value.required||null==e.value.required)],p=(e,t)=>{o((0,es.ZP)(l,a=>{null==a.data.settings.input&&(a.data.settings.input={}),a.data.settings.input[e]=t}))},g=(e,t,a)=>{o((0,es.ZP)(l,n=>{null==n.data.settings.input&&(n.data.settings.input={}),null!=e.value?n.data.settings.input[t]=e.value:delete n.data.settings.input[t],null!=a&&(n.data.settings.input=eW().omit(n.data.settings.input,a))}));let n=Object.assign({},i,{[t]:e.value});null!=a&&(a.forEach(e=>{delete n[e]}),0!==a.length&&s(n))};return ev.createElement("div",null,ev.createElement("div",{className:"flex flex-col gap-y-4"},u.map(e=>"DYNAMIC_DROPDOWN"===e.value.type?ev.createElement(eyz,{key:`${l.data.name}-${e.key}`,title:e.value.displayName,placeholder:"Select option...",flowId:t,piece:a,action:n,propertyName:e.key,currentValue:d[e.key],flowCredentialsRef:c,onSelect:t=>{g(t,e.key,e.value.refreshers)},isRequired:e.value.required,currentProps:i,dependsOn:e.value.dependsOn??[],description:e.value.description??null}):"STATIC_DROPDOWN"===e.value.type?ev.createElement(ebI,{key:`${l.data.name}-${e.key}`,title:e.value.displayName,placeholder:"Select option...",options:e.value.options,currentValue:d[e.key],onSelect:t=>{g(t,e.key)},isRequired:e.value.required,description:e.value.description??null}):"LONG_TEXT"===e.value.type?ev.createElement(ebC,{key:`${l.data.name}-${n.name}-${e.key}`,propName:e.key,title:e.value.displayName,currentValue:d[e.key],onChange:p,isRequired:e.value.required,availableMenu:r,description:e.value.description??null,piece:a,action:n}):ev.createElement(ebD,{key:`${l.data.name}-${n.name}-${e.key}`,actionName:e.key,title:e.value.displayName,currentValue:d[e.key],availableMenu:r,isRequired:e.value.required,onChange:p,description:e.value.description??null}))))},eb$=function(e){let{value:t,name:a,children:n,className:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a});return ev.createElement("button",{className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300 focus:bg-appcolor-300",l),...o.props},n)},ebP=function(e){let{onMenuItemSelected:t}=e,[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),l=ev.useRef(null),r=ev.useRef(null),o=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:a,placement:"bottom-end"}),i=(0,eI.useMenuButton)({ref:l,state:a,dispatch:n}),s=ev.useCallback(e=>{if("Activate"===e.type){let{name:a,value:n}=e.payload;null!=a&&t(a,n)}n({type:"Collapse"})},[t]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"flex text-appcolor-500",...i.props},ev.createElement(tn.Icon,{icon:"automate_menu"})),a.expanded&&ev.createElement(eI.Popup,{...o.props,dispatch:n,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:s},ev.createElement(eI.Menu,{initialFocus:o.initialFocus,className:"flex w-52 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2"},ev.createElement(eb$,{name:"reconnect"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"automate_reconnect"}),ev.createElement(eY.Z,{id:"general.reconnect",defaultMessage:"Reconnect"})),ev.createElement(eb$,{name:"test"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"automate_test_connection"}),ev.createElement(eY.Z,{id:"general.test_connection",defaultMessage:"Test connection"}))))))},ebF="space_account",ebA={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAccountDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAccountDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAccountDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},ebR=function(e){let{morseChildProps:t}=e,a=t.data,[n,{loading:l,error:r}]=(0,cs.D)(ebA,{refetchQueries:["FlowSpaceAccountsQuery"],awaitRefetchQueries:!0,onQueryUpdated:e=>{if("FlowSpaceAccountsQuery"===e.queryName){if(null==e.variables)return!1;let t=e.variables;if(t.filterby.flowId!==a.flowId||t.filterby.pieceId!==a.piece_id)return!1}return!0}}),o=ev.useMemo(()=>cc()(a.updated_at).calendar(),[a.updated_at]);return ev.createElement("div",{className:og()("flex items-center px-4 py-1.5 text-textcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200",t.focused&&"bg-appcolor-200"),onClick:t.activate},ev.createElement("div",{className:"flex flex-col pr-3"},ev.createElement("span",{className:"w-full whitespace-normal break-all text-sm font-medium"},a.name),ev.createElement("span",{className:"w-full whitespace-normal break-all text-xs text-textcolor-500"},o)),a.isSelected&&ev.createElement(tn.Icon,{className:"ml-auto",icon:"dd_check"}),l?ev.createElement(eI.Spinner,{width:20,height:20}):null!=r?ev.createElement(HE.R,{className:"mx-auto w-fit",tooltipContent:ev.createElement("div",{className:"px-1 py-2 text-center"},(0,ei.getMessageFromError)(r)??ev.createElement(eY.Z,{id:"automation.an_error_occurred",defaultMessage:"An error occurred"}))},ev.createElement(tn.Icon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),n({variables:{input:{clientMutationId:(0,ld.Z)(),id:a.id}}})},className:"flex-none text-danger",icon:"automate_warning"})):ev.createElement(ev.Fragment,null))},ebj="ConnectionItem",ebO="HideSection",ebU={[ebj]:e=>ev.createElement(ebR,{morseChildProps:e})},ebZ={[ebO]:()=>ev.createElement(ev.Fragment,null)},ebL=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),ebB=function(e){let{flowId:t,connections:a,onConnectionSelect:n,credentialsRefId:l,onNewConnectionClick:r,onExit:o}=e,i=ev.useRef(null),[s,d]=ev.useState(null),[c,m]=ev.useState(""),u=(0,eK.Z)(),p=ev.useCallback(e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),i.current?.activateCurrentItem();break;case eI.KeyboardKeys.Space:return;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o()}},[o]),g=ev.useMemo(()=>[{type:"section",label:"",render:ebO,items:a.map(e=>({itemType:ebF,label:e.name,values:[e.name],render:ebj,data:{...e,flowId:t,isSelected:e.id===l}}))}],[a,l,t]),f=ev.useCallback(e=>{e.itemType===ebF&&(n(e.data.id),o())},[n,o]);return ev.useLayoutEffect(()=>{if(null==s)return;let e=requestAnimationFrame(()=>{s.focus()});return()=>{cancelAnimationFrame(e)}},[s]),ev.createElement("div",{className:"mr-8 w-full overflow-y-auto overflow-x-hidden rounded-xl border border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement("div",{className:"flex border-b border-solid border-appcolor-300"},ev.createElement("input",{ref:d,className:"w-full bg-transparent px-4 pb-3 pt-2 text-sm",value:c,onChange:e=>{let{value:t}=e.target;m(t)},onKeyDownCapture:p,placeholder:u.formatMessage({id:"automation.search_placeholder",defaultMessage:"Search..."})})),ev.createElement(tT,{ref:i,data:g,term:c,search:ebL,renderMap:ebU,sectionRenderMap:ebZ,onActivate:f,renderEmptyState:ev.createElement("div",{className:"p-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.no_connection_found",defaultMessage:"No connections found."}))}),ev.createElement("button",{onClick:r,className:"flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"automate_add",className:"mr-1 h-4 w-4 shrink-0 text-appcolor-500"}),ev.createElement("span",{className:"text-md whitespace-normal break-all text-left text-textcolor-600"},ev.createElement(eY.Z,{id:"automation.new_connection",defaultMessage:"Connect a new account"}))))},ebz=function(e){let{title:t,inputName:a,register:n}=e,l=e.isPassword??!1;return ev.createElement("div",null,ev.createElement("p",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},ev.createElement("span",{className:"mr-1 font-medium"},"*"),ev.createElement("span",null,t),ev.createElement("span",{className:"ml-px flex"},ev.createElement(eY.Z,{id:"automation.required",defaultMessage:"(Required)"}))),ev.createElement("input",{...n(a),className:"w-full rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-2 pr-12 text-sm transition duration-150 ease-in-out hover:border-appcolor-400 focus:border-appcolor-400",type:l?"password":"text"}))},ebV={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SavePieceBasicAuth"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SavePieceBasicAuthInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"savePieceBasicAuth"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"flowCredentialsRef"}}]}}]}}]},ebq=function(e){let{flowId:t,piece:a,onRefSet:n}=e;(0,ei.assert)("BASIC_AUTH"===a.authDesc.type);let[l]=(0,cs.D)(ebV),[r,o]=ev.useState(!1),i=ev.useMemo(()=>({username:"",password:""}),[]),{register:s,setError:d,formState:{errors:c},handleSubmit:m}=(0,sz.cI)({defaultValues:i}),u=async e=>{o(!0);try{let r=await l({variables:{input:{clientMutationId:(0,ld.Z)(),flowId:t,pieceName:a.name,username:e.username,password:e.password}}});o(!1);let i=r.data?.savePieceBasicAuth.flowCredentialsRef;if(null==i){d("root",{type:"custom",message:"flow credentials ref should not be empty"});return}n(i)}catch(e){d("root",{type:"custom",message:"Error saving credentials"}),o(!1)}},{username:p,password:g}=a.authDesc;if(null==p||null==g)throw Error("username or password cannot be null");return ev.createElement("div",{className:"rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 p-8"},ev.createElement("div",{className:"mb-8 flex items-center gap-x-3"},a.logoUrl.length>0?ev.createElement("img",{className:"size-6",src:a.logoUrl}):ev.createElement(tn.Icon,{icon:"automate_flow",className:"size-6"}),ev.createElement("h1",{className:"font-medium"},a.displayName)),c.root&&ev.createElement("label",{className:"mb-4 flex rounded-xl border border-solid border-danger bg-danger/20 px-3 py-2 text-sm text-danger"},c.root.message),ev.createElement("form",{onSubmit:m(u)},ev.createElement("div",{className:"flex flex-col gap-y-4"},ev.createElement(ebz,{title:p,inputName:"username",register:s}),ev.createElement(ebz,{title:g,inputName:"password",register:s,isPassword:!0})),ev.createElement("div",{className:"mb-2 mt-4"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-2 text-sm font-medium text-appcolor-600 decoration-white outline-0 transition duration-100 ease-in hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800 focus:outline-0 disabled:opacity-10",type:"submit",disabled:r},ev.createElement(eY.Z,{id:"automation.connect",defaultMessage:"Connect"})))))};var ebW=a(61860);let ebH={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SavePieceCustomAuth"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SavePieceCustomAuthInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"savePieceCustomAuth"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"flowCredentialsRef"}}]}}]}}]},ebG=function(e){let{flowId:t,piece:a,onRefSet:n}=e;(0,ei.assert)("CUSTOM_AUTH"===a.authDesc.type);let[l]=(0,cs.D)(ebH),[r,o]=ev.useState(!1),i=a.authDesc.props,s=ev.useMemo(()=>({username:"",password:"",websiteUrl:""}),[]),{register:d,setError:c,formState:{errors:m},handleSubmit:u}=(0,sz.cI)({defaultValues:s}),p=async e=>{o(!0);try{let r=await l({variables:{input:{clientMutationId:(0,ld.Z)(),flowId:t,pieceName:a.name,props:{...e}}}});o(!1);let i=r.data?.savePieceCustomAuth.flowCredentialsRef;if(null==i){c("root",{type:"custom",message:"flow credential ref should not be empty"});return}n(i)}catch(e){if(e instanceof Error||e instanceof ebW.__){let t=bH(e,"savePieceCustomAuth");c("root",{type:"custom",message:t?.message??"Error saving credentials"})}else c("root",{type:"custom",message:"Error saving credentials"});o(!1)}};if(null==i)throw Error("authProps should not be null");let g=[];for(let[e,t]of Object.entries(i))"object"==typeof t&&g.push({...t,key:e});return ev.createElement("div",{className:"rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 p-8"},ev.createElement("div",{className:"mb-8 flex items-center gap-x-3"},a.logoUrl.length>0?ev.createElement("img",{className:"h-6 w-6",src:a.logoUrl}):ev.createElement(tn.Icon,{icon:"automate_flow",className:"h-6 w-6"}),ev.createElement("h1",{className:"font-medium"},a.displayName)),m.root&&ev.createElement("label",{className:"mb-4 flex rounded-xl border border-solid border-danger bg-danger/20 px-3 py-2 text-sm text-danger"},m.root.message),ev.createElement("form",{onSubmit:u(p)},ev.createElement("div",{className:"flex flex-col gap-y-4"},g.map(e=>{if("SHORT_TEXT"===e.type)return ev.createElement(ebz,{key:e.key,title:e.displayName,inputName:e.key,register:d,isPassword:"password"===e.key})})),ev.createElement("div",{className:"mb-2 mt-4"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-2 text-sm font-medium text-appcolor-600 decoration-white outline-0 transition duration-100 ease-in hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800 focus:outline-0 disabled:opacity-10",type:"submit",disabled:r},ev.createElement(eY.Z,{id:"automation.connect",defaultMessage:"Connect"})))))},ebK=function(e){let{flowId:t,piece:a,onRefSet:n}=e;if((0,ei.assert)("CUSTOM_AUTH"===a.authDesc.type),"@taskade/automade-piece-wordpress"===a.name)return ev.createElement(ebG,{flowId:t,piece:a,onRefSet:n});throw Error("Not Implemented")},ebY=function(e){let{flowId:t,piece:a,onRefSet:n}=e,l=a.authDesc.type;if(l===eyE.id.Enum.OAUTH2)return null;if(l===eyE.id.Enum.CUSTOM_AUTH)return ev.createElement(ebK,{flowId:t,piece:a,onRefSet:n});if(l===eyE.id.Enum.BASIC_AUTH)return ev.createElement(ebq,{flowId:t,piece:a,onRefSet:n});throw Error("Not Implemented")},ebQ=function(e){let{flowId:t,piece:a,onRefSet:n,close:l}=e;return ev.createElement(eI.ModalDialog,{close:l,backdropOpacity:eI.ModalDialogOpacity.Translucent,isOpen:!0,autofocus:!0},()=>ev.createElement(ebY,{flowId:t,piece:a,onRefSet:n}))},ebJ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FlowSpaceAccountsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowSpaceAccountsFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowSpaceAccounts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"piece_id"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},ebX={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SpaceAccountConnectedSubscription"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAccountConnectedInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAccountConnected"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"payload"}}]}}]}}]},eb0={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAccountTestAuthMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAccountTestAuthInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAccountTestAuth"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eb1=(0,lb.C)({initial:"loading",schema:{context:{},events:{},services:{}},tsTypes:{},states:{loading:{id:"loading",invoke:{src:"loadSpaceAccounts",onDone:[{target:"idle.disconnected",cond:e=>null==e.credentialsRef,actions:(0,lv.assign)({spaceAccounts:(e,t)=>t.data})},{target:"idle.connected.active",cond:(e,t)=>{(0,ei.assert)(null!=e.credentialsRef);let a=t.data;return new Set(a.map(e=>e.id)).has(e.credentialsRef.id)},actions:(0,lv.assign)({spaceAccounts:(e,t)=>t.data})},{target:"idle.connected.invalidRef",actions:(0,lv.assign)({spaceAccounts:(e,t)=>t.data})}]}},idle:{id:"idle",states:{disconnected:{},connected:{states:{active:{on:{RECONNECT:{target:"#connecting.waiting",actions:(0,lv.assign)({testResult:()=>void 0})},TEST_SPACE_ACCOUNT:{target:"#testing",actions:(0,lv.assign)({testResult:()=>void 0})}}},invalidRef:{}}},handlingChosenSpaceAccount:{invoke:{src:"selectSpaceAccount",onDone:{target:"connected.active"}}}},on:{SELECT_SPACE_ACCOUNT:{target:"idle.handlingChosenSpaceAccount",actions:(0,lv.assign)({credentialsRef:(e,t)=>t.credentialsRef,testResult:()=>void 0})},CONNECT:{target:"connecting.waiting",actions:(0,lv.assign)({testResult:()=>void 0})},DISMISS_TEST_BANNER:{actions:(0,lv.assign)({testResult:()=>void 0})}}},connecting:{id:"connecting",states:{waiting:{initial:"picking",states:{picking:{always:[{target:"oauth2",cond:e=>"OAUTH2"===e.piece.authDesc.type},{target:"dialog"}]},oauth2:{initial:"openWindow",states:{openWindow:{invoke:{src:async(e,t)=>{let a=new URL("/auth/flow/oauth2","https://www.taskade.com");a.searchParams.set("spaceId",e.spaceId),a.searchParams.set("pieceId",e.piece.name),"CONNECT"===t.type&&!0!==t.newRef&&null!=e.credentialsRef&&a.searchParams.set("spaceAccountId",e.credentialsRef.id),window.open(a.toString(),"_blank","noopener,noreferrer,popup=true,width=500,height=600")},onDone:{target:"waiting"}}},waiting:{invoke:{src:"waitForSpaceAccount",onDone:{target:"#cleanup",actions:(0,lv.assign)({credentialsRef:(e,t)=>({type:"external",id:t.data.flowCredentialsRefId})})}}}}},dialog:{}},on:{CONNECT_CANCEL:{target:"#loading"},CONNECT_RECEIVE_CREDENTIALSREF:{target:"cleanup",actions:(0,lv.assign)({credentialsRef:(e,t)=>t.credentialsRef})}}},cleanup:{id:"cleanup",invoke:{src:"selectSpaceAccount",onDone:{target:"#loading"}}}}},testing:{id:"testing",invoke:{src:"testSpaceAccount",onDone:{target:"#loading",actions:(0,lv.assign)({testResult:(e,t)=>t.data})},onError:{target:"#loading",actions:(0,lv.assign)({testResult:(e,t)=>{let a;if(t.data instanceof Error){let e=bH(t.data,["spaceAccountTestAuth"]);a=e?.message??t.data.message}else a=`${t.data}`;return{ok:!1,error:a}}})}}}}}),eb2=(0,eL.default)(eI.Popup).withConfig({displayName:"AppConnection__StyledPopup",componentId:"sc-927124dc-0"})` + width: ${e=>e.$calculatedWidth?e.$calculatedWidth+"px":"auto"}; +`,eb5=function(e){let{flowId:t,credentialsRef:a,spaceId:n,piece:l,onConnectionSelect:r}=e,o=(0,ll.x)(),[i]=(0,cs.D)(eb0),[s,d]=(0,ls.e)(eb1,{context:{credentialsRef:a,spaceAccounts:[],spaceId:n,piece:l},services:{loadSpaceAccounts:async(e,a)=>(await o.query({query:ebJ,variables:{filterby:{flowId:t,pieceId:l.name}},fetchPolicy:"done.invoke.cleanup:invocation[0]"===a.type?"network-only":"cache-first"})).data.flowSpaceAccounts,async selectSpaceAccount(e){(0,ei.assert)(null!=e.credentialsRef),r(e.credentialsRef.id)},testSpaceAccount:async e=>((0,ei.assert)(null!=e.credentialsRef),await i({variables:{input:{clientMutationId:(0,ld.Z)(),id:e.credentialsRef.id}}}),{ok:!0}),async waitForSpaceAccount(e){let t=o.subscribe({query:ebX,variables:{input:{pieceId:e.piece.name}}});return await new Promise((e,a)=>{let n=t.subscribe(t=>{let{data:l,errors:r}=t;if(null!=r){n.unsubscribe(),a(r);return}(0,ei.assert)(null!=l);let o=l.spaceAccountConnected.payload;null!=o&&(n.unsubscribe(),e(o))})})}}}),[c,m]=ev.useReducer(eI.popupReducer,{expanded:!1}),u=ev.useRef(null),p=ev.useRef(null),g=(0,eI.usePopup)({referenceElementRef:u,popupElementRef:p,state:c,placement:"bottom-start"}),f=ev.useCallback(e=>{d({type:"CONNECT",newRef:e})},[d]),h=ev.useCallback(()=>{f(!0),m({type:"Collapse"})},[f]),y=ev.useCallback(e=>{d({type:"SELECT_SPACE_ACCOUNT",credentialsRef:{type:"external",id:e}})},[d]),b=ev.useCallback(e=>{switch(e){case"edit_name":break;case"reconnect":d({type:"RECONNECT"});break;case"test":d({type:"TEST_SPACE_ACCOUNT"})}},[d]),v=ev.useCallback(()=>{d({type:"CONNECT_CANCEL"})},[d]),k=ev.useCallback(e=>{d({type:"CONNECT_RECEIVE_CREDENTIALSREF",credentialsRef:e})},[d]);return ev.createElement("div",null,ev.createElement("div",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},ev.createElement("span",{className:"mr-1 font-medium"},"*"),ev.createElement("span",null,ev.createElement(eY.Z,{id:"automation.account_required",defaultMessage:"Account (Required)"}))),null!=s.context.testResult&&ev.createElement("div",{className:og()("mb-2 flex items-center justify-between rounded-xl border px-3 py-1.5",{"border-success bg-success/10 text-success":s.context.testResult.ok,"border-danger bg-danger/10 text-danger":!s.context.testResult.ok})},s.context.testResult.ok?ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.test_service_successful",defaultMessage:"Connection to {service} successful",values:{service:l.displayName}})):ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.test_service_failure",defaultMessage:"Connection to {service} failed",values:{service:l.displayName}})),ev.createElement("span",{className:"text-2xs"},s.context.testResult.error)),ev.createElement("button",{className:"flex",onClick:()=>{d({type:"DISMISS_TEST_BANNER"})}},ev.createElement(tn.Icon,{icon:"modal_close"}))),ev.createElement("div",{ref:u,className:"flex items-center justify-between gap-x-3 rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-3"},ev.createElement("div",{className:"flex items-center gap-3"},l?.logoUrl!=null&&l.logoUrl.length>0&&ev.createElement("img",{className:"h-6 w-6",src:l.logoUrl}),s.matches("loading")&&ev.createElement("p",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.loading",defaultMessage:"Loading…"})),s.matches("idle")&&ev.createElement(ev.Fragment,null,s.matches("idle.disconnected")&&ev.createElement("p",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.connect_to_service",defaultMessage:"Connect to {service}",values:{service:l.displayName}})),s.matches("idle.connected.active")&&ev.createElement("p",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.connected_to_service",defaultMessage:"Connected to {service}",values:{service:l.displayName}})),s.matches("idle.connected.invalidRef")&&ev.createElement("div",{className:"flex flex-col"},ev.createElement("p",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.connection_not_available",defaultMessage:"Connection Not Available"})),ev.createElement("p",{className:"text-xs text-textcolor-400"},ev.createElement(eY.Z,{id:"automation.please_reconnect",defaultMessage:"Please add or change the connection."})))),s.matches("connecting.waiting")&&ev.createElement("div",{className:"flex flex-col"},ev.createElement("p",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.connecting_to_service",defaultMessage:"Connecting to {service}",values:{service:l.displayName}})),ev.createElement("p",{className:"text-xs text-textcolor-400"},ev.createElement(eY.Z,{id:"automation.connecting_to_service_check_window",defaultMessage:"Check the popup window."}))),s.matches("testing")&&ev.createElement("p",{className:"text-sm"},ev.createElement(eY.Z,{id:"automation.testing_connection",defaultMessage:"Testing Connection..."}))),ev.createElement("div",{className:"flex items-center gap-x-3"},s.matches("loading")&&ev.createElement(eI.Spinner,{size:20}),s.matches("idle")&&ev.createElement(ev.Fragment,null,s.context.spaceAccounts.length>0?ev.createElement("button",{onClick:e=>{e.isDefaultPrevented()||(c.expanded?m({type:"Collapse"}):m({type:"Expand",payload:"first"}))},className:"rounded-xl border border-appcolor-400 px-4 py-2 text-sm text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-300"},s.matches("idle.disconnected")&&ev.createElement(eY.Z,{id:"general.choose",defaultMessage:"Choose"}),s.matches("idle.connected.active")&&ev.createElement(eY.Z,{id:"general.change",defaultMessage:"Change"}),s.matches("idle.connected.invalidRef")&&ev.createElement(eY.Z,{id:"general.use_another",defaultMessage:"Use another"})):ev.createElement("button",{onClick:()=>{f(s.matches("idle.connected.invalidRef"))},className:"rounded-xl border border-appcolor-400 px-4 py-2 text-sm font-medium text-appcolor-800 transition duration-150 ease-in-out hover:bg-appcolor-300"},ev.createElement(eY.Z,{id:"general.connect",defaultMessage:"Connect"})),s.matches("idle.connected.active")&&ev.createElement(ebP,{onMenuItemSelected:b})),s.matches("connecting.waiting")&&ev.createElement("div",{className:"flex"},ev.createElement("button",{className:"flex items-center gap-x-2 rounded-xl border border-danger bg-danger/10 px-4 py-1 text-sm text-danger hover:bg-appcolor-200 hover:shadow-md",onClick:()=>{d({type:"CONNECT_CANCEL"})}},ev.createElement("div",{className:"flex"},ev.createElement(eI.Spinner,{size:16,color:eI.ThemeColors.danger})),ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"}))),s.matches("testing")&&ev.createElement(eI.Spinner,{size:20}))),c.expanded&&ev.createElement(eb2,{...g.props,dispatch:m,modal:!0,$calculatedWidth:u?.current?.offsetWidth??null},ev.createElement(ebB,{flowId:t,connections:s.context.spaceAccounts,onConnectionSelect:y,credentialsRefId:a?.id,onNewConnectionClick:h,onExit:()=>{m({type:"Collapse"})}})),s.matches("connecting.waiting.dialog")&&ev.createElement(ebQ,{flowId:t,piece:l,close:v,onRefSet:k}))},eb3=function(e){let{flowId:t,spaceId:a,piece:n,node:l,availableMenu:r,updateNode:o}=e,[i,s]=ev.useState(l.data.settings.input),d=ev.useMemo(()=>{let e=l.data.settings.actionName;if(null==e||null==n.actions)return null;let t=n.actions.find(t=>t.name===e);return null==t?null:t},[l.data.settings.actionName,n.actions]),c=!eyl.has(n.name),m=null!=n.actions?n.actions.map(e=>({value:e.name,label:e.displayName,description:e.description})):[];return ev.createElement("div",{className:"flex w-full flex-col gap-y-4"},"NONE"!==n.authDesc.type&&ev.createElement(ev.Fragment,null,ev.createElement(eb5,{key:l.data.name,flowId:t,spaceId:a,piece:n,credentialsRef:l.data.settings.credentialsRef,onConnectionSelect:e=>{o((0,es.ZP)(l,t=>{t.data.settings.credentialsRef={type:"external",id:e}}))}}),(0,sX.isStringNotBlank)(n.disclaimer)&&ev.createElement("span",null,ev.createElement(DA,{value:n.disclaimer,renderMap:eyP})),c&&ev.createElement(DA,{value:`By clicking ‘Connect’, you agree to share specific data with ${n.displayName} as outlined in our [Privacy Policy](https://www.taskade.com/privacy).`,renderMap:eyP})),ev.createElement(ebI,{title:"Action",placeholder:"Select An Action",options:m,currentValue:l.data.settings.actionName,onSelect:e=>{o((0,es.ZP)(l,t=>{t.data.displayName=e.label,t.data.settings.actionName=e.value,t.data.settings.input={}})),s({})}}),null!=d&&ev.createElement(ebT,{flowId:t,piece:n,action:d,node:l,availableMenu:r,updateNode:o,currentProps:i,setCurrentProps:s}))},eb4=function(e){let{flow:t,pieces:a,spaceId:n,currentNode:l,updateNode:r,expectedOutput:o}=e,{getNodes:i}=(0,eh1._K)(),s=ev.useMemo(()=>{let e=[],t=i(),n=!1;return t.forEach(t=>{t.data.name===l.data.name&&(n=!0),n||e.push(t)}),function(e,t,a){let n=[];for(let l of e){let e=l.data.name,{pieceName:r,actionName:o}=l.data.settings,i=t.find(e=>e.name===r),s=[];if("trigger"===e){if("PIECE_TRIGGER"===l.data.type||"WEBHOOK"===l.data.type){if(null==a||0===Object.keys(a).length||((0,ei.assert)("object"===a.type),null==a.properties))continue;!function e(t,a,n,l){for(let r of Object.keys(a)){let o=r,i=a[r];if(null!=i.description&&(o=i.description),"object"===i.type&&null!=i.properties)e(t,i.properties,n,r);else{let e=r;null!=l&&(e=`${l}.${r}`),t.push({nodeId:"trigger",path:e,displayText:o,pieceName:n})}}}(s,a.properties,i?.name??"default")}}else{let t=i?.actions?.find(e=>e.name===o);if(null==t||((0,ei.assert)("object"===t.expectedOutput.type),null==t.expectedOutput.properties))continue;for(let a of Object.keys(t.expectedOutput.properties)){let n=a;null!=t.expectedOutput.properties[a].description&&(n=t.expectedOutput.properties[a].description),s.push({nodeId:e,path:a,displayText:n,pieceName:i?.name??"default"})}}if(s.length>0){let e=i?.logoUrl!=null&&i?.logoUrl.length>0?i?.logoUrl:"https://assets.taskade.com/taskade.png",t={header:l.data.displayName,menuContent:s,icon:e};n.push(t)}}return n}(e,a,o)},[l.data.name,o,i,a]),d=ev.useMemo(()=>{let e=l.data.settings.pieceName;return null==e?null:a.find(t=>t.name===e)},[l.data.settings.pieceName,a]);return null==d?null:ev.createElement(ev.Fragment,null,ev.createElement(eb3,{flowId:t.id,spaceId:n,piece:d,node:l,availableMenu:s,updateNode:r}))},eb6=function(e){let{morseChildProps:t}=e;return ev.createElement("button",{onClick:t.activate,onMouseEnter:t.focus,className:og()("flex min-h-8 w-full items-center justify-between gap-x-2 px-4 py-1 text-left text-sm hover:bg-appcolor-200 focus:bg-appcolor-200",{"bg-appcolor-200":t.focused})},ev.createElement("span",{className:"truncate"},t.data.label),null!=t.data.externalUrl&&ev.createElement("a",{href:t.data.externalUrl,className:"ml-auto flex items-center gap-x-1 rounded-xl text-sm text-appcolor-500 hover:bg-appcolor-300 hover:text-appcolor-800",target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()}},ev.createElement(tn.Icon,{icon:"embed_open"})))},eb8="dropdownOption",eb7={[eb8]:e=>ev.createElement(eb6,{morseChildProps:e})},eb9={all:()=>ev.createElement(ev.Fragment,null)},eve=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),evt=function(e){let{flowCredentialsRef:t,piece:a,options:n,onSelect:l,missingDependencies:r,trigger:o,queryError:i,close:s}=e,d=(0,eK.Z)(),c=ev.useRef(null),[m,u]=ev.useState(""),[p,g]=ev.useState(null),f=ev.useMemo(()=>[{type:"section",label:o.displayName,items:(n??[]).filter(e=>!e.disabled).map(e=>({label:e.label,itemType:"dropdownOption",values:[e.label],data:e,render:eb8})),render:"all"}],[n,o.displayName]),h=ev.useCallback(e=>{l(e.data)},[l]);ev.useLayoutEffect(()=>{if(null==p)return;let e=requestAnimationFrame(()=>{p.focus()});return()=>{cancelAnimationFrame(e)}},[p]);let y=a.authDesc?.type!=="NONE";if(null==t&&y)return ev.createElement("p",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.connect_to_service_account",defaultMessage:"Please connect your {service} account.",values:{service:a.displayName}}));if(null!=i)return ev.createElement("p",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 p-4 text-sm text-appcolor-500"},i.message);if(r.length>0){let e=o.props[r[0]]?.displayName;return ev.createElement("p",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automate.failed_to_load_data",defaultMessage:"Failed to load data. {prop} is required.",values:{prop:e??r[0]}}))}return null==n?ev.createElement("div",{className:"flex items-center justify-center rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2"},ev.createElement(eI.Spinner,null)):0===n.length?ev.createElement("div",{className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-textcolor-500"},ev.createElement(eY.Z,{id:"automate.no_results",defaultMessage:"No results."})):ev.createElement("div",{className:"flex max-h-96 flex-col gap-px overflow-y-auto rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-2"},ev.createElement("div",{className:"flex items-center px-3 py-1"},ev.createElement("input",{type:"text",ref:g,value:m,onChange:e=>{u(e.target.value)},className:"w-full rounded-lg border border-appcolor-300 bg-appcolor-100 px-3 py-1 text-sm focus:border-appcolor-400",placeholder:d.formatMessage({id:"general.search",defaultMessage:"Search"}),onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:s();break;case eI.KeyboardKeys.Space:break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),c.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),c.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:c.current?.activateCurrentItem()}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}})),ev.createElement(tT,{ref:c,term:m,data:f,renderMap:eb7,sectionRenderMap:eb9,search:eve,onActivate:h,renderEmptyState:ev.createElement("span",{className:"px-4 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}))}))},eva={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PieceTriggerDropdownOptionsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PieceTriggerDropdownOptionsFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"currentPropsValues"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PieceDropdownState"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieceTriggerDropdownOptions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"currentPropsValues"},value:{kind:"Variable",name:{kind:"Name",value:"currentPropsValues"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"options"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"value"}},{kind:"Field",name:{kind:"Name",value:"label"}},{kind:"Field",name:{kind:"Name",value:"externalUrl"}},{kind:"Field",name:{kind:"Name",value:"disabled"}}]}}]}}]}}]},evn=(0,eL.default)(eI.Popup).withConfig({displayName:"TriggerDynamicDropdown__StyledPopup",componentId:"sc-3e6103c2-0"})` + width: ${e=>e.$calculatedWidth?e.$calculatedWidth+"px":"auto"}; +`,evl=function(e){let{title:t,placeholder:a,flowId:n,piece:l,trigger:r,propertyName:o,currentValue:i,onSelect:s,flowCredentialsRef:d,currentProps:c,dependsOn:m,description:u}=e,p=r.name,g=m.filter(e=>null==c[e]),f=0===g.length,[h,y]=ev.useState(!1),b=ev.useRef(null),v=ev.useRef(null),k=ev.useRef(null),E=l.authDesc?.type!=="NONE"&&null==d,x=e.isRequired??!1,_=(0,eB.a)(eva,{skip:!f||E,variables:{filterby:{flowId:n,pieceName:l.name,triggerName:p,propertyName:o,flowCredentialsRef:d},currentPropsValues:{currentProps:c}}}),w=ev.useMemo(()=>{if(null==_.error)return null;let e=bH(_.error,["pieceTriggerDropdownOptions"]);return null==e?new ei.HttpError({code:"UNKNOWN_ERROR"},{cause:_.error}):new ei.TaskadeError(e,{cause:_.error})},[_.error]),N=ev.useMemo(()=>null==_.loading||null==_.data?null:[...e.defaultOptions??[],..._.data.pieceTriggerDropdownOptions.options.map(e=>({value:e.value,label:e.label,externalUrl:e.externalUrl??void 0,disabled:e.disabled??void 0}))],[e.defaultOptions,_.data,_.loading]),[C,M]=ev.useReducer(eI.popupReducer,{expanded:!1}),S=ev.useRef(null),I=ev.useRef(null),D=(0,eI.usePopup)({referenceElementRef:S,popupElementRef:I,state:C,placement:"bottom-start"}),T=(0,eI.useMenuButton)({dispatch:M,ref:S,state:C}),$=ev.useMemo(()=>{if(null==N)return null;let e=N.find(e=>e.value===i);return null==e?null:e.label},[i,N]),{arrowProps:P,popperProps:F,referenceProps:A}=(0,eI.useControlledTooltip)({referenceElementRef:b,arrowElementRef:v,popperElementRef:k,placement:"top",visible:h}),R=ev.useCallback(()=>{M({type:"Collapse"})},[]),j=ev.useCallback(e=>{s(e),R()},[R,s]);return ev.createElement("div",{className:"flex w-full flex-col"},ev.createElement("div",{className:"mb-2 flex items-center gap-px text-xs uppercase text-appcolor-500"},x&&ev.createElement("span",{className:"mr-1 font-medium"},"*"),t,x&&ev.createElement("span",{className:"ml-px flex"},ev.createElement(eY.Z,{id:"automation.required",defaultMessage:"(Required)"})),null!=u&&ev.createElement("div",{onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},...A,className:"ml-1"},ev.createElement(tn.Icon,{icon:"dd_help",className:"h-4 w-4"})),h&&ev.createElement(eI.Tooltip,{arrowProps:P,popperProps:F},u),_.loading&&ev.createElement("div",{className:"ml-1"},ev.createElement(eI.Spinner,{size:12,width:12}))),ev.createElement("button",{...T.props,className:"flex items-center justify-between rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-2 text-sm transition duration-150 ease-in-out hover:border-appcolor-400"},ev.createElement("div",{className:"flex w-full items-center text-left"},null!=$?ev.createElement("p",{className:"truncate whitespace-normal pr-2"},$):ev.createElement(ev.Fragment,null,ev.createElement("p",{className:"truncate whitespace-normal pr-2 text-appcolor-500"},a," "),x&&ev.createElement("div",{className:"ml-auto mr-2"},ev.createElement(eyF,null)))),ev.createElement(tn.Icon,{icon:"caret_down",className:"text-appcolor-500"})),C.expanded&&ev.createElement(evn,{...D.props,dispatch:M,modal:!0,$calculatedWidth:S?.current?.offsetWidth??null},ev.createElement(evt,{flowCredentialsRef:d,piece:l,options:N,onSelect:j,missingDependencies:g,trigger:r,queryError:w,close:R})))},evr=function(e){let{flowId:t,piece:a,trigger:n,node:l,updateNode:r,currentProps:o,setCurrentProps:i}=e;if(null==n||l.data.settings.triggerName!==n.name)return null;let s=l.data.settings.input,d=l.data.settings?.credentialsRef??null,c=Object.keys(n.props).map(e=>({key:e,value:n.props[e]})),m=[...c.filter(e=>!0===e.value.required),...c.filter(e=>!1===e.value.required||null==e.value.required)],u=(e,t)=>{r((0,es.ZP)(l,a=>{null==a.data.settings.input&&(a.data.settings.input={}),a.data.settings.input[e]=t}))},p=(e,t,a)=>{r((0,es.ZP)(l,n=>{null==n.data.settings.input&&(n.data.settings.input={}),null!=e.value?n.data.settings.input[t]=e.value:delete n.data.settings.input[t],null!=a&&(n.data.settings.input=eW().omit(n.data.settings.input,a))}));let n=Object.assign({},o,{[t]:e.value});null!=a&&(a.forEach(e=>{delete n[e]}),0!==a.length&&i(n))};return ev.createElement("div",null,ev.createElement("div",{className:"flex flex-col gap-y-2"},m.map(e=>{if("DYNAMIC_DROPDOWN"===e.value.type){var r;let i=(r=e.key,"@taskade/automade-internalpiece-taskade"!==a.name||"projectId"!==r?[]:[{label:"All Projects",value:void 0}]);return ev.createElement(evl,{key:`${l.data.name}-${e.key}`,title:e.value.displayName,placeholder:"Select option...",flowId:t,piece:a,trigger:n,propertyName:e.key,currentValue:s[e.key],flowCredentialsRef:d,onSelect:t=>{p(t,e.key,e.value.refreshers)},isRequired:e.value.required,currentProps:o,defaultOptions:i,dependsOn:e.value.dependsOn??[],description:e.value.description??null})}return"STATIC_DROPDOWN"===e.value.type?ev.createElement(ebI,{key:`${l.data.name}-${e.key}`,title:e.value.displayName,placeholder:"Select option...",options:e.value.options,currentValue:s[e.key],onSelect:t=>{p(t,e.key)},isRequired:e.value.required,description:e.value.description??null}):"LONG_TEXT"===e.value.type?ev.createElement(ebC,{key:`${l.data.name}-${n.name}-${e.key}`,propName:e.key,title:e.value.displayName,currentValue:s[e.key],onChange:u,isRequired:e.value.required,availableMenu:[],description:e.value.description??null,piece:a}):ev.createElement(ebD,{key:`${l.data.name}-${n.name}-${e.key}`,actionName:e.key,title:e.value.displayName,currentValue:s[e.key],onChange:u,isRequired:e.value.required,availableMenu:[],description:e.value.description??null})})))},evo=function(e){let{flowId:t,spaceId:a,piece:n,node:l,updateNode:r}=e,[o,i]=ev.useState(l.data.settings.input),s=ev.useMemo(()=>{let e=l.data.settings.triggerName;if(null==e||null==n.triggers)return null;let t=n.triggers.find(t=>t.name===e);return null==t?null:t},[l.data.settings.triggerName,n.triggers]),d=null!=n.triggers?n.triggers.map(e=>({value:e.name,label:e.displayName,description:e.description,triggerType:e.type})):[];return ev.createElement("div",{className:"flex w-full flex-col gap-y-4"},"NONE"!==n.authDesc.type&&ev.createElement(ev.Fragment,null,ev.createElement(eb5,{key:l.data.name,flowId:t,spaceId:a,piece:n,credentialsRef:l.data.settings.credentialsRef,onConnectionSelect:e=>{r((0,es.ZP)(l,t=>{t.data.settings.credentialsRef={type:"external",id:e}}))}}),(0,sX.isStringNotBlank)(n.disclaimer)&&ev.createElement(DA,{value:n.disclaimer,renderMap:eyP})),ev.createElement(ebI,{title:"Trigger",placeholder:"Select A Trigger",options:d,currentValue:l.data.settings.triggerName,onSelect:e=>{r((0,es.ZP)(l,t=>{t.data.displayName=e.label,t.data.settings.triggerName=e.value,t.data.settings.input={}})),i({})},shouldShowInstant:!0}),null!=s&&ev.createElement(evr,{flowId:t,piece:n,trigger:s,node:l,updateNode:r,currentProps:o,setCurrentProps:i}))},evi=function(e){let{flowId:t,spaceId:a,pieces:n,node:l,updateNode:r}=e,o=ev.useMemo(()=>{let e=l.data.settings.pieceName;return null==e?null:n.find(t=>t.name===e)},[l.data.settings.pieceName,n]);return null==o?null:ev.createElement(ev.Fragment,null,ev.createElement(evo,{flowId:t,piece:o,node:l,updateNode:r,spaceId:a}))},evs=function(e){let{node:t,updateNode:a}=e,{getPiece:n}=eya(),[l,r]=ev.useState(!1),[o,i]=ev.useState(t.data.displayName??""),s=n(t.data.settings.pieceName),d=()=>{r(!1),a((0,es.ZP)(t,e=>{if(o.length>0){e.data.displayName=o;return}let a=t.data.settings.actionName;if(null==a)return;let n=s?.actions?.find(e=>e.name===a);null!=n&&(e.data.displayName=n.displayName,i(n.displayName))}))},c=s?.logoUrl!=null&&s.logoUrl.length>0?s.logoUrl:"https://assets.taskade.com/taskade.png";return ev.createElement("div",{className:"flex items-center"},ev.createElement("div",{className:"flex w-full items-center gap-x-4"},ev.createElement("img",{className:"h-10 w-10",src:c}),ev.createElement("div",{className:"min-h-9 flex w-full flex-col gap-0.5 pr-2 text-xs"},s?.displayName!=null?ev.createElement("p",{className:og()(s.name===eyn?"text-moving-rainbow":"text-appcolor-500")},s.displayName):ev.createElement("p",{className:"text-appcolor-500"},"Taskade"),ev.createElement("div",{className:"group line-clamp-3 inline-block w-full cursor-text whitespace-normal break-all pr-2 text-sm font-medium"},l?ev.createElement("input",{className:"flex w-full bg-appcolor-0",autoFocus:!0,onBlur:d,value:o,onChange:e=>{i(e.target.value)},onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Enter:d();break;case eI.KeyboardKeys.Escape:r(!1)}}}):ev.createElement("div",{className:"w-fit",onClick:()=>{r(!0)}},t.data.displayName,ev.createElement(tn.Icon,{className:"size-4 -mt-1 ml-1 inline cursor-pointer text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800",icon:"automate_edit"}))))))},evd=function(){let e=ev.useRef(null),t=ev.useRef(null),a=ev.useRef(null),[n,l]=ev.useState(!1),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:e,arrowElementRef:t,popperElementRef:a,placement:"bottom",visible:n}),s=ev.useCallback(()=>{l(!0)},[]),d=ev.useCallback(()=>{l(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...i,onMouseEnter:s,onMouseLeave:d,className:"flex items-center"},ev.createElement(tn.Icon,{className:"h-5 w-5 text-danger",icon:"automate_warning"})),n&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement(eY.Z,{id:"automation.complete_all_required_fields",defaultMessage:"Please complete all required fields."})))},evc=function(e){let{index:t,parameter:a,handleInputChange:n,handleDeleteParameter:l}=e,r=(0,eK.Z)(),[o,i]=ev.useState(!1),s=e=>{i(e)};return ev.createElement("tr",{className:"w-full",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},ev.createElement("td",{className:"pr-4 pt-2"},ev.createElement("input",{onChange:e=>{n(e.target.value,t)},className:"w-full cursor-text rounded-lg border border-appcolor-300 bg-appcolor-100 p-1.5 px-2 text-sm text-appcolor-800 placeholder-appcolor-500 transition duration-150 ease-in-out hover:border-appcolor-400 focus:border-appcolor-400",value:a.key,placeholder:r.formatMessage({id:"automation.parameter_name_of_input",defaultMessage:"Name of input"})})),ev.createElement("td",{className:"pt-2 text-sm text-appcolor-500"},a.type),ev.createElement("td",{className:"pt-2 text-right"},ev.createElement("button",{onClick:()=>{l(t)},className:og()("mr-1 text-appcolor-500 transition duration-150 ease-in-out hover:text-danger",o?"opacity-100":"opacity-0")},ev.createElement(tn.Icon,{icon:"agent_delete"}))))},evm=function(){let e=ev.useRef(null),t=ev.useRef(null),a=ev.useRef(null),[n,l]=ev.useState(!1),{arrowProps:r,popperProps:o,referenceProps:i}=(0,eI.useControlledTooltip)({referenceElementRef:e,arrowElementRef:t,popperElementRef:a,placement:"bottom",visible:n}),s=ev.useCallback(()=>{l(!0)},[]),d=ev.useCallback(()=>{l(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...i,onMouseEnter:s,onMouseLeave:d,className:"flex items-center"},ev.createElement(tn.Icon,{className:"h-4 w-4 text-danger",icon:"automate_warning"})),n&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement(eY.Z,{id:"automation.automation_is_not_enabled",defaultMessage:"Automation is not enabled."})))},evu=function(e){let{flow:t,node:a,updateNode:n}=e,l=t.id,[r,o]=ev.useState(!1),i=`https://www.taskade.com/webhooks/flow/${l}`,[s,d]=ev.useState(null);ev.useEffect(()=>{if(null==s)return;let e=new(hF())(s);return e.on("success",()=>{o(!0)}),()=>{e.destroy()}},[s]);let c=(e,t)=>{n((0,es.ZP)(a,a=>{null!=a.data.settings.additionalParameters&&null!=a.data.settings.additionalParameters[t]&&(a.data.settings.additionalParameters[t].key=e,a.data.settings.additionalParameters[t].label=e)}))},m=e=>{n((0,es.ZP)(a,t=>{null!=t.data.settings.additionalParameters&&null!=t.data.settings.additionalParameters[e]&&(t.data.settings.additionalParameters=t.data.settings.additionalParameters.filter((t,a)=>a!==e))}))},u=a.data.settings?.additionalParameters??[];return ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"flex h-8 items-center gap-x-2 pb-2 text-xs font-normal uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.webhook_url",defaultMessage:"Webhook URL"}),!t.data.enabled&&ev.createElement(evm,null)),ev.createElement("div",{className:"flex items-center gap-2 text-sm"},ev.createElement("input",{className:"w-full cursor-text rounded-lg border border-appcolor-300 bg-appcolor-100 p-1.5 px-2 text-appcolor-800 transition duration-150 ease-in-out hover:border-appcolor-400",type:"text",value:i,disabled:!0}),ev.createElement("div",{ref:d,"data-clipboard-action":"copy","data-clipboard-text":i,onMouseOut:()=>{o(!1)},onBlur:()=>{o(!1)},className:"flex cursor-pointer whitespace-nowrap rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-3 py-1.5 text-appcolor-500 transition duration-150 ease-in-out hover:border-appcolor-400 hover:text-appcolor-800"},r?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"}))),ev.createElement("div",{className:"mt-5"},ev.createElement("table",{className:"w-full text-left"},ev.createElement("thead",{className:"mb-1 w-full border-b border-solid border-appcolor-300"},ev.createElement("tr",null,ev.createElement("th",{className:"w-3/5 pb-1 text-xs font-normal uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.parameter",defaultMessage:"Parameter"})),ev.createElement("th",{scope:"col",className:"pb-1 text-xs font-normal uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.parameter_type",defaultMessage:"Type"})),ev.createElement("th",{scope:"col",className:"pb-1 text-xs font-normal uppercase text-appcolor-500"}))),ev.createElement("tbody",null,u.map((e,t)=>ev.createElement(evc,{key:t,index:t,parameter:e,handleInputChange:c,handleDeleteParameter:m})))),ev.createElement("button",{onClick:()=>{n((0,es.ZP)(a,e=>{null==e.data.settings.additionalParameters&&(e.data.settings.additionalParameters=[]),e.data.settings.additionalParameters.push({label:"",key:"",type:"string"})}))},className:"mt-2 flex flex cursor-pointer items-center gap-1 rounded-lg border border-solid border-transparent px-2 py-1 text-sm text-appcolor-500 transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-100 hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"automate_add"}),ev.createElement(eY.Z,{id:"automation.add_parameter",defaultMessage:"Add parameter"}))))},evp=dw.z.string().min(1);function evg(e,t){if(!t.required)return!0;switch(t.type){case"NUMBER":if(isNaN(parseInt(e,10)))return!1;return!0;case"SHORT_TEXT":case"LONG_TEXT":case"STATIC_DROPDOWN":case"DYNAMIC_DROPDOWN":return evp.safeParse(e).success;default:throw new ei.TaskadeError({code:"UNSUPPORTED PROP",message:`${t.type} is not supported`})}}let evf=ev.forwardRef(function(e,t){let{flow:a,onClose:n,className:l,style:r,expectedOutput:o,pieces:i}=e,{selectedNodeId:s,recomputeTriggerExpectedOutput:d}=eya(),{getNode:c,setNodes:m}=(0,eh1._K)(),u=(0,eh1.B)({includeHiddenNodes:!1}),[p,g]=ev.useState(null);ev.useEffect(()=>{if(!u||null==s)return;let e=c(s);if(null==e){g(null);return}g({...e}),("PIECE_TRIGGER"===e.data.type||"WEBHOOK"===e.data.type)&&d(e.data)},[c,u,d,s]),ev.useEffect(()=>{if(!u||null==p)return;let e=(0,es.ZP)(p,e=>{e.data.valid="EMPTY"!==p.data.type&&("WEBHOOK"===p.data.type||("PIECE_TRIGGER"===p.data.type?function(e,t){let a=e.data.settings?.pieceName;if(null==a)return!1;let n=e.data.settings?.triggerName;if(null==n)return!1;let l=t.find(e=>e.name===a);if(null==l||l.authDesc?.type!=="NONE"&&e.data.settings?.credentialsRef==null)return!1;let r=l.triggers?.find(e=>e.name===n);if(null==r)return!1;let o=e.data.settings?.input??{};for(let[e,t]of Object.entries(r.props))if(t.required&&!evg(o[e],t))return!1;return!0}(p,i):"PIECE"===p.data.type&&function(e,t){let a=e.data.settings?.pieceName;if(null==a)return!1;let n=e.data.settings?.actionName;if(null==n)return!1;let l=t.find(e=>e.name===a);if(null==l||l.authDesc?.type!=="NONE"&&e.data.settings?.credentialsRef==null)return!1;let r=l.actions?.find(e=>e.name===n);if(null==r)return!1;let o=e.data.settings?.input??{};for(let[e,t]of Object.entries(r.props))if(t.required&&!evg(o[e],t))return!1;return!0}(p,i)))});p.data.valid!==e.data.valid&&g(e),m(t=>t.map(t=>t.id!==p.id?t:e))},[p,u,i,m]);let f=e=>{g({...e})},h=e=>{g({...e}),d(e.data)};return null==p?ev.createElement("div",{ref:t,className:og()(l,"flex flex-col p-4"),style:r},ev.createElement(eI.Spinner,null)):ev.createElement("div",{ref:t,className:og()(l),style:r},ev.createElement("div",{className:"sticky top-0 z-10 mb-4 flex items-center justify-between border-b border-appcolor-300 bg-appcolor-0 p-4"},ev.createElement("div",{className:"w-11/12"},null!=p&&ev.createElement(evs,{node:p,updateNode:f,key:p.id})),ev.createElement("div",{className:"flex items-center gap-x-2"},!p.data.valid&&ev.createElement(evd,null),ev.createElement(tn.Icon,{icon:"modal_close",onClick:()=>{n(),m(e=>e.map(e=>e.id!==s?e:(0,es.ZP)(e,e=>{e.selected=!1})))},className:"cursor-pointer"}))),ev.createElement("div",{className:"px-4"},"PIECE"===p.data.type&&ev.createElement(eb4,{pieces:i,flow:a,currentNode:p,updateNode:f,spaceId:a.space_id,expectedOutput:o}),"WEBHOOK"===p.data.type&&ev.createElement(evu,{flow:a,node:p,updateNode:h}),"PIECE_TRIGGER"===p.data.type&&ev.createElement(evi,{flowId:a.id,pieces:i,node:p,updateNode:h,spaceId:a.space_id})))});function evh(e,t){let a=e.find(e=>"0"===e.id);if(null==a)throw Error("Cannot find trigger node");let n={name:a.data.name,valid:a.data.valid,type:a.data.type,settings:{...a.data.settings},displayName:a.data.displayName},l=function e(t,a,n){let l=a.find(e=>e.source===n);if(null==l)return null;let r=l.target,o=t.find(e=>e.id===r);if(null==o)throw Error("Has edge but no target Node");if("placeholder"===o.type)return null;let i={...Vd()(o.data,"nextAction")},s=e(t,a,r);return null==s||(i.nextAction=s),i}(e,t,"0");return null!=l&&(n.nextAction=l),n}let evy=function(e){let{flow:t}=e,{getNodes:a,getEdges:n}=(0,eh1._K)(),l=(0,eK.Z)(),r=ev.useMemo(()=>l.formatMessage({id:"flow.you_have_unsaved_changes",defaultMessage:"You have unsaved changes, are you sure you want to leave?"}),[l]),o=ev.useCallback(()=>{let e=evh(a(),n());return!eW().isEqual(t.data.trigger,e)},[t.data,n,a]);return ev.useEffect(()=>{function e(e){o()&&e.preventDefault()}return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[o,r]),ev.createElement(eF.NL,{message:()=>!o()||r})},evb={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PieceTriggerExpectedOutputComputeQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PieceTriggerExpectedOutputFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"currentPropsValues"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieceTriggerExpectedOutput"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"currentPropsValues"},value:{kind:"Variable",name:{kind:"Name",value:"currentPropsValues"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expectedOutput"}}]}}]}}]};var evv=a(48583),evk=a(15103);let evE=(0,evk.cn)({isOpen:!1}),evx=function(){return ev.createElement("div",{className:"w-96 rounded-3xl bg-applight-0 dark:bg-appdark-0/60"},ev.createElement("div",{className:"w-full rounded-xl p-3"},ev.createElement("div",{className:"flex w-full flex-col gap-4 overflow-clip rounded-xl border border-appcolor-300 px-6 py-4"},ev.createElement("h4",{className:"flex items-center font-medium"},ev.createElement(tn.Icon,{icon:"dd_upgrade",className:"mr-1.5 shrink-0 pr-1"}),ev.createElement(eY.Z,{id:"automation.upgrade_header",defaultMessage:"Unlock Automations"})),ev.createElement("div",{className:"flex text-sm text-appcolor-800"},ev.createElement(eY.Z,{id:"automation.upgrade_copy",defaultMessage:"Activate your automations by upgrading your space. Unlock unlimited automation potential today!"})),ev.createElement("a",{className:"mt-3 flex w-full items-center justify-center rounded-full bg-upgrade py-2 text-sm font-bold text-textdark-100 transition duration-150 ease-in-out hover:bg-upgrade/75",href:"/upgrade",target:"_blank",rel:"noopener noreferrer"},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"mr-1"}),ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))))},ev_=function(){let[e,t]=(0,evv.KO)(evE);return e.isOpen?ev.createElement(eI.ModalDialog,{close:()=>{t({isOpen:!1})},backdropOpacity:eI.ModalDialogOpacity.Translucent,isOpen:e.isOpen,autofocus:!0},()=>ev.createElement(evx,null)):null},evw=(0,lb.C)({initial:"loading",schema:{context:{},events:{},services:{}},states:{loading:{invoke:{src:"recompute",onDone:{target:"idle",actions:(0,lv.assign)({expectedOutput:(e,t)=>t.data})},onError:{target:"error",actions:(0,lv.assign)({error:(e,t)=>t.data})}}},idle:{on:{RECOMPUTE:{target:"loading"}}},error:{on:{RECOMPUTE:{target:"loading",actions:(0,lv.assign)({error:(e,t)=>t.data})}}}}});function evN(){let e=(0,ehQ.bx)();return(0,ei.assert)(null!=e),e}let evC=function(e){let{checked:t,onChange:a,disabledTooltipMessage:n,spaceType:l}=e,r=(0,evv.b9)(evE),o=null!=n,i=ev.useRef(null),s=ev.useRef(null),d=ev.useRef(null),[c,m]=ev.useState(!1),{arrowProps:u,popperProps:p,referenceProps:g}=(0,eI.useControlledTooltip)({referenceElementRef:i,arrowElementRef:s,popperElementRef:d,placement:"bottom",visible:c}),f=ev.useCallback(()=>{o&&m(!0)},[o]),h=ev.useCallback(()=>{m(!1)},[]),y=ev.useCallback(()=>{hA(l)?a():r({isOpen:!0})},[a,r,l]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...g,onMouseEnter:f,onMouseLeave:h,className:"flex items-center"},ev.createElement(e1.Switch,{className:og()("cursor-pointer disabled:cursor-not-allowed",{"opacity-50":o}),checked:t,onChange:y,disabled:o})),c&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},n))},evM={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowDisableMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowDisableInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowDisable"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},evS={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowEnableMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowEnableInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowEnable"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},evI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FlowSpaceQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceId"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"default"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]},evD={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flow"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},evT=function(e){let t=e=>{let{isActive:t}=e;return og()("px-4 py-1.5",t?"bg-appcolor-300 text-appcolor-800":"text-appcolor-500 hover:text-appcolor-800")};return ev.createElement("div",{className:og()("flex w-fit overflow-clip rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 text-sm",e.className)},ev.createElement(eP.OL,{to:`/f/${e.flowId}`,end:!0,className:t},ev.createElement(eY.Z,{id:"automation.tabs.manage",defaultMessage:"Manage"})),ev.createElement(eP.OL,{to:`/f/${e.flowId}/runs`,className:t},ev.createElement(eY.Z,{id:"automation.tabs.runs",defaultMessage:"Runs"})))},ev$={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowNameUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowNameUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowNameUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"flow"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]},evP=function(e){let{flow:t}=e,[a,n]=ev.useState(t.name),[l,r]=ev.useState(null);ev.useLayoutEffect(()=>{if(null==l)return;let e=requestAnimationFrame(()=>{l.focus()});return()=>{cancelAnimationFrame(e)}},[l]);let[o]=(0,cs.D)(ev$),i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useReducer(eI.popupReducer,{expanded:!1}),m=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:d,placement:"bottom"}),u=(0,eI.useMenuButton)({ref:i,state:d,dispatch:c}),p=async()=>{"Untitled"!==a&&a!==t.name&&await o({variables:{input:{clientMutationId:(0,ld.Z)(),id:t.id,name:a}}})};return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"group flex items-center justify-center gap-x-2 text-sm text-appcolor-800 hover:text-appcolor-800",...u.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),d.expanded?c({type:"Collapse"}):c({type:"Expand"})}},ev.createElement("p",{className:"max-w-md truncate whitespace-nowrap"},a.length>0?a:ev.createElement(eY.Z,{id:"automation.untitled",defaultMessage:"Untitled"})),ev.createElement(tn.Icon,{className:"text-appcolor-500 group-hover:text-appcolor-800",icon:"automate_edit"})),d.expanded&&ev.createElement(eI.Popup,{...m.props,dispatch:c,modal:!0,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:case eI.KeyboardKeys.Enter:p(),c({type:"Collapse"});return}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),c({type:"Collapse"})}},ev.createElement("div",{className:"flex w-72 flex-col gap-y-2 rounded-xl border border-appcolor-200 bg-appcolor-0 p-3"},ev.createElement("input",{ref:r,value:a,onBlur:p,onChange:e=>n(e.target.value),className:"rounded-xl border border-appcolor-300 bg-appcolor-100 px-3 py-2 pr-12 text-sm transition duration-150 ease-in-out hover:border-appcolor-400",placeholder:"Untitled"}))))},evF=function(e){let{flow:t,className:a}=e,n=t.id,l=(0,eK.Z)(),r=(0,e$.useDispatch)(),o=(0,eB.a)(evI,{variables:{spaceId:t.space_id}}),i=ev.useMemo(()=>o.loading||null==o.data?null:o.data?.membership?.space??null,[o.data,o.loading]),[s,{loading:d}]=(0,cs.D)(evD),[c]=(0,cs.D)(evS),[m]=(0,cs.D)(evM),u=t.data.enabled,p=(0,eh1.SM)(),g=(0,eh1.Mi)(),f=async()=>{try{u?await m({variables:{input:{clientMutationId:(0,ld.Z)(),id:n}},refetchQueries:[ehJ]}):await c({variables:{input:{clientMutationId:(0,ld.Z)(),id:n}},refetchQueries:[ehJ]})}catch(t){let e=(0,ei.getMessageFromError)(t);r((0,l3.error)({uid:`flow-${(0,ld.Z)()}`,message:e,position:"bl",autoDismiss:3,dismissible:!1}))}},h=ev.useCallback(async()=>{if(!0===d||null==n)return;let e=evh(p,g);try{await s({variables:{input:{clientMutationId:(0,ld.Z)(),flowId:n,flowTrigger:e}}})}catch(t){let e=(0,ei.getMessageFromError)(t);r((0,l3.error)({uid:`flow-${(0,ld.Z)()}`,message:e,position:"bl",autoDismiss:3,dismissible:!1}))}},[r,g,n,d,p,s]),y=ev.useMemo(()=>{let e=p.filter(e=>"PIECE"===e.data.type),t=p.find(e=>"0"===e.id&&"EMPTY"!==e.data.type);return 0===e.length||null==t?l.formatMessage({id:"automation.you_are_required_to_have_at_least_one_trigger_and_one_action",defaultMessage:"You are required to have at least one trigger and one action."}):t?.data.valid!==!0?l.formatMessage({id:"automation.flow_trigger_incomplete",defaultMessage:"Trigger is incomplete."}):e.every(e=>e?.data.valid===!0)?null:l.formatMessage({id:"automation.at_least_one_action_is_incomplete",defaultMessage:"At least one action is incomplete."})},[l,p]),b=ev.useMemo(()=>{if(!0!==d&&null!=n)try{let e=evh(p,g);return!eW().isEqual(t.data.trigger,e)}catch(e){return!1}},[g,t.data.trigger,n,d,p]);return ev.createElement("div",{className:og()(a)},ev.createElement("div",{className:"flex w-fit gap-x-2"},ev.createElement(sC.rU,{to:`/spaces/${t.space_id}/flows`,className:"group flex basis-1/4 items-center gap-x-1 text-sm text-appcolor-900 hover:text-appcolor-800"},ev.createElement(tn.Icon,{className:"text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800",icon:"header_back"}),ev.createElement(tn.Icon,{className:"text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800",icon:"automate_flow"})),ev.createElement(evP,{flow:t})),ev.createElement(evT,{className:"mx-auto self-center",flowId:t.id}),ev.createElement("div",{className:"flex basis-1/4 items-center justify-end gap-x-2"},ev.createElement("div",{className:"flex h-8 items-center gap-x-3 text-sm"},u&&!y&&ev.createElement("p",{className:"whitespace-nowrap text-success"},ev.createElement(eY.Z,{id:"automation.active",defaultMessage:"Active"})),y&&ev.createElement(evd,null),ev.createElement(evC,{checked:u,onChange:f,disabledTooltipMessage:y,spaceType:i?.type??null}),b?ev.createElement("button",{className:"duration-250 flex h-8 cursor-pointer items-center gap-2 rounded-lg border border-solid border-primary bg-primary px-4 py-1.5 text-sm font-medium text-white transition ease-in-out hover:bg-primary/80",onClick:h},d?ev.createElement(ev.Fragment,null,ev.createElement(eI.Spinner,{size:20,height:20,width:20,color:"#fff"}),ev.createElement(eY.Z,{id:"automation.saving",defaultMessage:"Saving"})):ev.createElement(eY.Z,{id:"automation.save_changes",defaultMessage:"Save changes"})):ev.createElement("button",{className:"duration-250 flex h-8 cursor-default items-center gap-2 rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-1.5 text-sm font-medium text-appcolor-500",disabled:!0},ev.createElement(eY.Z,{id:"automation.save_changes",defaultMessage:"Save changes"})))))},evA=function(){let{flow:e,pieces:t}=evN(),a=(0,e$.useDispatch)(),n=e.data.trigger,l=ev.useCallback(e=>t.find(t=>t.name===e),[t]),[r,o]=ev.useState(null),{edges:i,nodes:s}=ev.useMemo(()=>(function(e){let t=[],a=[],n=e;for(;null!=n;){let e=n,l=`${t.length}`,r=`${t.length+1}`,o={id:l,data:e,position:{x:0,y:0},type:"action"};if(t.push(o),null!=(n=e.nextAction)){let t={id:`${l}->${r}`,source:l,target:r,type:"workflow"};"trigger"===e.name&&(t.type="invisible"),a.push(t)}}let l=CP()(t);if(null==l)return{nodes:t,edges:a};let r=`${t.length}`;return t.push({id:r,data:{displayName:"Add Step"},position:{x:0,y:150},type:"placeholder"}),2===t.length?a.push({id:`${l.id}->${r}`,source:`${l.id}`,target:r,type:"invisible"}):a.push({id:`${l.id}->${r}`,source:`${l.id}`,target:r,type:"placeholder"}),{nodes:t,edges:a}})(n),[n]),d=(0,ll.x)(),c=T_((0,eI.useTheme)()),[m,u]=(0,ls.e)(evw,{context:{expectedOutput:{type:"object"},flowTrigger:e.data.trigger},services:{async recompute(t,n){let l;(0,ei.assert)("RECOMPUTE"===n.type||"xstate.init"===n.type);let{type:r}=l=null!=n.flowTrigger?n.flowTrigger:t.flowTrigger;switch(r){case"EMPTY":return{};case"WEBHOOK":if(null==l.settings.additionalParameters)return{};return{type:"object",properties:{body:{type:"object",properties:l.settings.additionalParameters?.reduce((e,t)=>0===t.label.length?e:{...e,[t.label]:t.label},{})}}}}let o=e.id,{pieceName:i,triggerName:s,credentialsRef:c,input:m}=l.settings;try{let{data:e}=await d.query({query:evb,variables:{filterby:{flowId:o,pieceName:i,triggerName:s,flowCredentialsRef:c},currentPropsValues:m}});return e.pieceTriggerExpectedOutput.expectedOutput}catch(t){let e=(0,ei.getMessageFromError)(t);a((0,l3.error)({uid:`flow-${(0,ld.Z)()}`,message:e,position:"bl",autoDismiss:3,dismissible:!1}))}}}}),p=ev.useCallback(e=>{u({type:"RECOMPUTE",flowTrigger:e})},[u]),g=ev.useCallback(e=>{o(e)},[]),f=ev.useMemo(()=>({selectedNodeId:r,onSelectAction:g,recomputeTriggerExpectedOutput:p,getPiece:l}),[l,g,p,r]);return ev.createElement("div",{className:"flex h-screen flex-col overflow-hidden",style:c},ev.createElement(eh1.tV,null,ev.createElement(eyt,{value:f},ev.createElement(evF,{flow:e,className:"grid h-14 grid-cols-3 items-center border-b border-appcolor-300 px-5 py-3"}),ev.createElement("div",{className:"relative flex grow"},ev.createElement(ey$,{className:"w-full flex-initial",edges:i,nodes:s}),null!=r&&ev.createElement(evf,{flow:e,onClose:()=>{o(null)},className:"absolute inset-y-5 right-5 flex w-full max-w-md flex-none flex-col overflow-y-auto rounded-xl border border-appcolor-300 bg-appcolor-0 pb-4",expectedOutput:m.context.expectedOutput,pieces:t}))),ev.createElement(ev_,null),ev.createElement(evy,{flow:e})))};var evR=a(73828);let evj={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowRunRetryMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowRunRetryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowRunRetry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"flowRun"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}}]}}]},evO=function(e){let{flowRunId:t}=e,[a]=(0,cs.D)(evj),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useState(!1),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"top",visible:o});return ev.createElement(ev.Fragment,null,ev.createElement(evR.zx,{...c,onHoverStart:()=>{i(!0)},onHoverEnd:()=>{i(!1)},className:e=>{let{isPressed:t}=e;return og()("rounded-full p-1 hover:text-appcolor-800",t?"bg-appcolor-400 text-appcolor-800":"text-appcolor-500")},onPress:()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),flowRunId:t}}})}},ev.createElement(tn.Icon,{className:"scale-75",icon:"dd_restore"})),o&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"general.retry",defaultMessage:"Retry"})))},evU=function(e){let{flowRun:t,...a}=e,n=ev.useMemo(()=>elE.ou.fromISO(t.created_at),[t.created_at]),l=ev.useMemo(()=>(function(e){let{trigger:t,executionResultMap:a}=e,n=t,l=[];for(;null!=n;){let e=a[n.name]??null;l.push([n,e]),n=n.nextAction}return{executions:l}})(t.data),[t.data]),r=ev.useMemo(()=>{let e=l.executions.at(-1);if(null==e)return null;let[,t]=e;return null==t||"success"!==t.type?null:elE.ou.fromSeconds(t.endAt)},[l.executions]),o=ev.useMemo(()=>l.executions.reduce((e,t)=>{let[,a]=t;return null==a||"success"!==a.type?e:e+1},0)/l.executions.length,[l.executions]),i=(ev.useMemo(()=>{let e=l.executions.findIndex(e=>{let[,t]=e;if(null==t)return!0;t.type});return -1===e?l.executions.at(-1):l.executions[e]},[l.executions]),ev.useMemo(()=>{let{trigger:e,executionResultMap:a}=t.data,n=e;for(;null!=n;){let e=a[n.name]??null;if(null==e||"failed"!==e.type){n=n.nextAction;continue}return`${n.displayName} failed: ${e.errorDesc.message}`}return null},[t.data]));return ev.createElement(evR.X2,a,ev.createElement(evR.bL,{className:"px-4 py-2 text-xs capitalize text-appcolor-800"},null!=r&&r.toRelativeCalendar()),ev.createElement(evR.bL,{className:"px-4 py-2 text-xs capitalize text-appcolor-800"},ev.createElement(eY.Z,{id:"automation.flow_run.title",defaultMessage:"Run for {createdAt}",values:{createdAt:n.toFormat("f")}})),ev.createElement(evR.bL,{className:"px-4 py-2 text-xs capitalize text-appcolor-800"},ev.createElement("span",null,Math.round(100*o),"%")),ev.createElement(evR.bL,{className:"px-4 py-2 text-xs capitalize text-appcolor-800"},t.status," ",t.isRetryable&&ev.createElement(evO,{flowRunId:t.id})),ev.createElement(evR.bL,{className:"px-4 py-2 text-xs capitalize text-appcolor-800"},i),ev.createElement(evR.bL,{className:"px-4 py-2"},ev.createElement(evR.zx,{className:e=>{let{isPressed:t}=e;return og()("hover:text-appcolor-800",t?"text-appcolor-800":"text-appcolor-500")},onPress:()=>{R4()(t.id)}},ev.createElement(tn.Icon,{icon:"embed_copy"}))),ev.createElement(evR.bL,{className:"px-4 py-2"},ev.createElement(evR.zx,{className:e=>{let{isPressed:t}=e;return og()("hover:text-appcolor-800",t?"text-appcolor-800":"text-appcolor-500")},onPress:()=>{R4()(JSON.stringify(t))}},ev.createElement(tn.Icon,{icon:"embed_copy"}))))},evZ=function(e){let{flowRun:t,...a}=e,n=elE.ou.fromISO(t.created_at),l=elE.ou.fromISO(t.updated_at);return ev.createElement(evR.X2,a,ev.createElement(evR.bL,{className:"pt-2 text-xs capitalize text-appcolor-800"},t.id),ev.createElement(evR.bL,{className:"pt-2 text-xs capitalize text-appcolor-800"},l.toRelativeCalendar()),ev.createElement(evR.bL,{className:"pt-2 text-xs capitalize text-appcolor-800"},ev.createElement(eY.Z,{id:"automation.flow_run.title",defaultMessage:"Run for {createdAt}",values:{createdAt:n.toFormat("f")}})),ev.createElement(evR.bL,{className:"pt-2 text-xs capitalize text-appcolor-500"},"N/A"),ev.createElement(evR.bL,{className:"pt-2 text-xs capitalize text-appcolor-800"},t.status),ev.createElement(evR.bL,{className:"pt-2"},ev.createElement(evR.zx,{className:e=>{let{isPressed:t}=e;return og()("hover:text-appcolor-800",t?"text-appcolor-800":"text-appcolor-500")},onPress:()=>{R4()(JSON.stringify(t))}},ev.createElement(tn.Icon,{icon:"embed_copy"}))))},evL=function(e){let{flowRun:t,...a}=e;return 3===t.data.version?ev.createElement(evU,{flowRun:t,...a}):ev.createElement(evZ,{flowRun:t,...a})},evB=function(e){let{onLoadMoreCb:t}=e,a=ev.useRef(null),n=ev.useCallback(e=>{e[0].isIntersecting&&t()},[t]);return ev.useEffect(()=>{let e=a.current;if(null==e)return;let t=new IntersectionObserver(n);return t.observe(e),()=>{t.unobserve(e),t.disconnect()}},[n]),ev.createElement("div",{ref:a,className:"h-10"},ev.createElement(eI.Spinner,null))},evz={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FlowRunsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowRunFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"20"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowRuns"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"isRetryable"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]},evV=function(){let{flow:e}=evN(),{flowId:t}=(0,eF.$B)().params,{data:a,loading:n,error:l,fetchMore:r}=(0,eB.a)(evz,{variables:{filterby:{flowId:t}},fetchPolicy:"network-only"}),o=a?.flowRuns.pageInfo.hasNextPage??!1,i=a?.flowRuns.pageInfo.endCursor??null,s=ev.useCallback(()=>{r({variables:{after:i}})},[i,r]),d=a?.flowRuns.edges;return ev.createElement("div",{className:"flex h-screen flex-col"},ev.createElement("div",{className:"grid h-14 grid-cols-3 items-center border-b border-appcolor-300 px-5 py-3"},ev.createElement("div",{className:"flex w-fit gap-x-2"},ev.createElement(sC.rU,{to:`/spaces/${e.space_id}/flows`,className:"group flex basis-1/4 items-center gap-x-1 text-sm text-appcolor-900 hover:text-appcolor-800"},ev.createElement(tn.Icon,{className:"text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800",icon:"header_back"}),ev.createElement(tn.Icon,{className:"text-appcolor-500 transition duration-150 ease-in-out group-hover:text-appcolor-800",icon:"automate_flow"})),ev.createElement(evP,{flow:e})),ev.createElement(evT,{className:"mx-auto self-center",flowId:e.id}),ev.createElement("div",null)),ev.createElement(evR.fm,{className:"mx-auto w-full max-w-[88rem] overflow-auto"},ev.createElement(evR.iA,{"aria-label":"Flow Runs",className:"border-separate border-spacing-0"},ev.createElement(evR.xD,null,ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.completed_on",defaultMessage:"Completed on"}))),ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500",isRowHeader:!0,defaultWidth:"2fr"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.run",defaultMessage:"Scheduled on"}))),ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.progress",defaultMessage:"Progress"}))),ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.status",defaultMessage:"Status"}))),ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500",defaultWidth:"2fr"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.details",defaultMessage:"Details"}))),ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.run_id",defaultMessage:"Run Id"}))),ev.createElement(evR.sg,{className:"sticky top-0 border-b border-appcolor-300 bg-appcolor-0 pb-1 text-left text-xs font-normal uppercase text-appcolor-500"},ev.createElement("div",{className:"truncate px-4 py-2"},ev.createElement(eY.Z,{id:"automation.copy_data",defaultMessage:"Copy data"})))),ev.createElement(evR.RM,{items:d,renderEmptyState:()=>n?ev.createElement("div",{className:"flex items-center justify-center py-4"},ev.createElement(eI.Spinner,null)):(null!=l&&l.message,ev.createElement("div",{className:"flex py-4 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.there_are_no_runs",defaultMessage:"There are no run activities to display."})))},e=>{let{node:t}=e;return ev.createElement(evL,{id:t.id,flowRun:t,className:"even:bg-appcolor-100"})}))),o&&ev.createElement(evB,{onLoadMoreCb:s}))},evq=function(){let e=(0,ehQ.UO)();return(0,ei.assert)(null!=e.flowId),ev.createElement(ehQ.Z5,null,ev.createElement(ehQ.AW,{element:ev.createElement(eh0,{flowId:e.flowId})},ev.createElement(ehQ.AW,{index:!0,element:ev.createElement(evA,null)}),ev.createElement(ehQ.AW,{path:"runs",element:ev.createElement(evV,null)})))},evW=(0,la.ZP)` + query GettingStartedProjectQuery { + gettingStartedProject { + id + } + } +`,evH=function(){let{loading:e,data:t,error:a}=(0,eB.a)(evW),n=t?.gettingStartedProject?.id;return ev.createElement("div",{className:"flex h-screen items-center justify-center bg-applight-100 dark:bg-appdark-100"},e?ev.createElement("div",{className:"mx-auto text-textlight-400"},ev.createElement("div",{className:"mb-1.5"},ev.createElement(eY.Z,{id:"general.getting_started_ellipsis",defaultMessage:"Getting Started…"})),ev.createElement(eI.Spinner,null)):null!=a?ev.createElement(eF.l_,{to:"/"}):null!=n?ev.createElement(eF.l_,{to:`/d/${n}`}):ev.createElement(eF.l_,{to:"/"}))},evG=function(e){let{href:t}=e;return ev.useEffect(()=>{window.location.href=t},[t]),null},evK=function(){let{data:e,loading:t,error:a}=(0,eB.a)(gT),n=e?.me??null,l=n?.memberships??null,r=ev.useMemo(()=>pI(l),[l]),o=ev.useMemo(()=>t?null:eu()(a)?eu()(n)?new ei.HttpError({code:"UNAUTHORIZED"}):null:a,[t,n,a]);if(t)return ev.createElement(eI.Spinner,null);if(!eu()(o))return ev.createElement(evG,{href:"/"});let i=CT()(r)?.space.id;return eu()(i)?ev.createElement(eF.l_,{to:"/recent"}):ev.createElement(eF.l_,{to:`/spaces/${i}`})},evY=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-72ddb638-0"})` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(80)}; + height: 100vh; +`,evQ=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-72ddb638-1"})` + display: flex; + flex-direction: column; + width: 100%; + max-width: 500px; + margin: 0 20px; +`,evJ=eL.default.div.withConfig({displayName:"styled__Body",componentId:"sc-72ddb638-2"})` + display: flex; + flex-direction: column; + padding: 30px 50px; + + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 20px; + box-sizing: border-box; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); +`,evX=eL.default.button.withConfig({displayName:"styled__SubmitButton",componentId:"sc-72ddb638-3"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + width: 120px; + + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(0)}; + color: ${e=>e.theme.appColors.hex(100)}; + border: 0; + cursor: pointer; + margin-left: 10px; + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(30)}; + } +`,ev0=eL.default.div.withConfig({displayName:"styled__ButtonContainer",componentId:"sc-72ddb638-4"})` + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: flex-end; + + padding-bottom: 20px; + border-bottom: 1px solid; + border-color: ${e=>e.theme.appColors.hex(70)}; +`,ev1=eL.default.button.withConfig({displayName:"styled__CancelButton",componentId:"sc-72ddb638-5"})` + display: flex; + width: 100%; + align-items: center; + justify-content: center; + height: 42px; + width: 120px; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(0)}; + cursor: pointer; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,ev2=eL.default.div.withConfig({displayName:"styled__Heading",componentId:"sc-72ddb638-6"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; + align-items: center; +`,ev5=eL.default.div.withConfig({displayName:"styled__Title",componentId:"sc-72ddb638-7"})` + ${e1.ArticleTypography.heading3} + color: ${e=>e.theme.appColors.hex(0)}; + text-align: center; +`,ev3=eL.default.span.withConfig({displayName:"styled__TitleBold",componentId:"sc-72ddb638-8"})` + ${e1.ArticleTypography.heading3} + font-weight: bold; +`,ev4=(0,eL.default)(sC.rU).withConfig({displayName:"styled__StyledLink",componentId:"sc-72ddb638-9"})` + display: flex; + width: 100%; + height: 52px; + margin: 0px auto 20px; + justify-content: center; +`,ev6=(0,eL.default)(lT.nV).withConfig({displayName:"styled__Logo",componentId:"sc-72ddb638-10"})` + height: 52px; + width: 190px; +`,ev8=(0,eL.default)(lT.Ng).withConfig({displayName:"styled__DarkModeLogo",componentId:"sc-72ddb638-11"})` + height: 52px; + width: 190px; +`,ev7=eL.default.div.withConfig({displayName:"styled__ApplicationLogo",componentId:"sc-72ddb638-12"})` + height: 50px; + width: 50px; + border-radius 50%; + position: relative; + background-image: url("${e=>e.$logoUrl}"); + background-size: 50px; +`,ev9=eL.default.div.withConfig({displayName:"styled__HeaderImages",componentId:"sc-72ddb638-13"})` + display: flex; + margin-bottom: 30px; +`,eke=(0,eL.default)(lT.Nv).withConfig({displayName:"styled__SyncLogo",componentId:"sc-72ddb638-14"})` + height: 50px; + width: 50px; + margin-left: 20px; + margin-right: 20px; + color: ${e=>e.theme.appColors.hex(40)}; +`,ekt=eL.default.div.withConfig({displayName:"styled__BodyText",componentId:"sc-72ddb638-15"})` + display: block; + ${e1.UiTypography.md}; + color: ${e=>e.theme.textColors.hex(10)}; +`,eka=eL.default.span.withConfig({displayName:"styled__BoldText",componentId:"sc-72ddb638-16"})` + font-weight: bold; + ${e1.UiTypography.md}; +`,ekn=eL.default.ul.withConfig({displayName:"styled__StyledList",componentId:"sc-72ddb638-17"})` + margin-top: 10px; + margin-bottom: 40px; + ${e1.UiTypography.md}; +`,ekl=eL.default.li.withConfig({displayName:"styled__StyledListItem",componentId:"sc-72ddb638-18"})` + ${e1.UiTypography.md}; + line-height: 24px; +`,ekr=eL.default.span.withConfig({displayName:"styled__LoginIndicator",componentId:"sc-72ddb638-19"})` + margin-top: 20px; + text-align: center; + ${e1.UiTypography.md}; + color: ${e=>e.theme.appColors.hex(50)}; +`,eko=eL.default.span.withConfig({displayName:"styled__LoggedInUsername",componentId:"sc-72ddb638-20"})` + ${e1.UiTypography.md}; + font-weight: bold; + color: ${e=>e.theme.appColors.hex(0)}; +`,eki=(0,e$.connect)(function(e){return{oauth2State:e.oauth2}})(function(e){let{data:t,loading:a,error:n}=(0,eB.a)(sN),l=t?.me??null,{oauth2State:r}=e,{search:o}=(0,eF.TH)(),i=new URLSearchParams(o).get("state"),s=(0,eL.useTheme)(),[d,c]=ev.useState(!1),m=ev.useMemo(()=>({state:i,transaction_id:r?.transactionId}),[i,r?.transactionId]),{register:u}=(0,sz.cI)({defaultValues:m});return a?ev.createElement(evY,null,ev.createElement(eI.Spinner,{height:26})):null==l?ev.createElement(evY,null,ev.createElement(ekt,null,ev.createElement(eY.Z,{id:"general.errors.load_user_data",defaultMessage:"There was a problem loading your user data, please relogin."}))):null!=n?ev.createElement(evY,null,ev.createElement(ekt,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}))):ev.createElement(evY,null,ev.createElement(_2,{title:"Authorise access to your account",ogTitle:"Authorise access to your account"}),ev.createElement(evQ,null,ev.createElement(ev4,{to:"/"},s.isNightMode?ev.createElement(ev8,null):ev.createElement(ev6,null)),ev.createElement(evJ,null,ev.createElement("form",{method:"POST",action:"/oauth2/authorize",onSubmit:()=>{c(!0)}},ev.createElement(ev2,null,ev.createElement(ev9,null,ev.createElement(ao,{avatars_v2:l.avatars_v2,handle:l.handle,userID:parseInt(l.id),size:50,hidePresence:!0}),ev.createElement(eke,null),ev.createElement(ev7,{$logoUrl:r?.applicationLogo})),ev.createElement(ev5,null,ev.createElement(ev3,null,r?.applicationName)," is requesting access to your",ev.createElement(ev3,null," Taskade")," account")),ev.createElement(ekt,null,ev.createElement(eka,null,r?.applicationName," ")," will be able to",ev.createElement(ekn,null,ev.createElement(ekl,null,"Read your username, avatar, and e-mail address."),ev.createElement(ekl,null,"Access your tasks, projects and workspaces."),ev.createElement(ekl,null,"Create, update and delete tasks on your behalf."))),ev.createElement(ou,{...u("transaction_id"),type:"hidden",required:!0,readOnly:!0}),ev.createElement(ou,{...u("state"),type:"hidden",required:!0,readOnly:!0}),ev.createElement(ev0,null,ev.createElement(ev1,{onClick:()=>window.close(),type:"button"},"Cancel"),ev.createElement(evX,{disabled:d},d?ev.createElement(eI.Spinner,{color:"#ffffff",delay:0,height:26}):"Allow"))),ev.createElement(ekr,null,"You are logged in as ",ev.createElement(eko,null,l.handle)))))}),eks=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-cc9913e-0"})` + display: flex; + align-items: center; + flex-direction: column; +`,ekd=eL.default.div.withConfig({displayName:"styled__InvertContainer",componentId:"sc-cc9913e-1"})` + & > div span { + color: ${e=>e.theme.appColors.hex(10)}; + } + & a { + & > span:first-child { + background: ${e=>e.theme.appColors.hex(80)}; + } + &:hover { + color: ${e=>e.theme.appColors.hex(10)}; + } + } +`,ekc=eL.default.h1.withConfig({displayName:"styled__Title",componentId:"sc-cc9913e-2"})` + position: relative; + z-index: 2; + color: #fff; + + font-weight: 800; + font-size: 42px; + line-height: 100.02%; + letter-spacing: -0.02em; + text-align: center; + + width: ${e=>e.customWidth?e.customWidth+"%":"auto"}; + margin-bottom: ${e=>e.marginBottom?e.marginBottom+"px":"0px"}; +`,ekm=eL.default.p.withConfig({displayName:"styled__Subtitle",componentId:"sc-cc9913e-3"})` + color: ${e=>e.theme.textColors.hex(40)}; + + font-weight: 400; + font-size: 15px; + line-height: 18px; + + margin-bottom: ${e=>e.marginBottom?e.marginBottom+"px":"0px"}; +`,eku=eL.default.button.withConfig({displayName:"styled__ContinueButton",componentId:"sc-cc9913e-4"})` + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + + color: #fff; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + + padding: 10px 24px; + gap: 10px; + width: 360px; + + ${e1.UiBorderRadius.xl} + + &:hover { + background-color: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } + + &:disabled { + cursor: default; + background-color: ${e=>e.isSelected?e.theme?.primaryColorScheme?.base:e.theme.appColors.hex(70)}; + } + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; +`,ekp=(0,eL.default)(ekm).withConfig({displayName:"styled__Skip",componentId:"sc-cc9913e-5"})` + cursor: pointer; + margin-top: 20px; + margin: 0 auto; + position: relative; + z-index: 2; +`,ekg=eL.default.input.withConfig({displayName:"styled__Input",componentId:"sc-cc9913e-6"})` + color: #fff; + background-color: ${e=>e.theme.appColors.hex(90)}; + + width: 360px; + padding: 10px 12px; + border: 1px solid #2c3035; + ${e1.UiBorderRadius.xl} + + font-size: 16px; + font-weight: 500; + + &:focus-within { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; +`,ekf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateSidebarClosedMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateMe"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isSidebarClosed"}}]}}]}}]}}]},ekh={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectsCreateWithTaskastMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectsCreateWithTaskastInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectsCreateWithTaskast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"trees"}},{kind:"Field",name:{kind:"Name",value:"spaceId"}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]}}]}}]},eky="ActionItem",ekb="create_project",ekv=(0,eL.keyframes)` + 0% { background-position: 200% 0; } + 100% { background-position: -200% 0; } +`,ekk=eL.default.div.withConfig({displayName:"ActionItem__ActionButton",componentId:"sc-fef263cb-0"})` + position: relative; + padding: 0.5rem 1rem; + cursor: pointer; + border-radius: 10px; + + // Apply a subtle gradient background + background: linear-gradient( + 115deg, + rgba(79, 207, 112, 0.2), + rgba(250, 214, 72, 0.2), + rgba(167, 103, 229, 0.2), + rgba(18, 188, 254, 0.2), + rgba(68, 206, 123, 0.2) + ); + background-size: 200% 100%; + animation: ${ekv} 3s linear infinite; +`,ekE=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(ekk,{ref:a,onClick:t.activate,className:og()("mx-3 flex items-center text-sm hover:bg-appcolor-200",t.focused&&"bg-appcolor-200")},ev.createElement(tn.Icon,{className:"scale-90",icon:"dd_newtemplate"}),ev.createElement("span",{className:"pl-2.5"},t.label))},ekx={[eky]:e=>ev.createElement(ekE,{morseChildProps:e})},ek_=(e,t)=>new to.Z(t,{keys:["values"],threshold:.2}).search(e).map(e=>e.item),ekw=eL.default.div.withConfig({displayName:"Preview__InvertContainer",componentId:"sc-bb73d6f0-0"})` + & > div { + color: ${e=>e.theme.appColors.hex(10)}; + border-color: rgba(255, 255, 255, 0.1); + } + & > div:last-child > div > div:hover { + background-color: rgba(255, 255, 255, 0.1) !important; + } +`,ekN=function(e){let{outputType:t,persona:a,prompt:n,sourceMedias:l,spaceId:r,tone:o}=e,i=(0,eF.k6)(),s=ev.useRef(null),d=ev.useRef(null),{data:c}=(0,eB.a)(I_);ev.useEffect(()=>{s?.current?.focus()},[]);let[m,u]=ev.useState(null),p=ev.useCallback(e=>{let t=hR.kS.safeParse(e);t.success&&(u(t.data.text),null!=d.current&&(d.current.scrollTop=d.current.scrollHeight))},[]),[g,{data:f,loading:h}]=(0,cs.D)(ekh),[y]=(0,cs.D)(ekf),b=async()=>{if(null==m||null==c||null==c.me)return;let e=(0,lo.markdownTextToTaskastFragment)(m,{shouldRemoveCodeFence:!0}),t=JSON.stringify((0,lo.fragmentToRoot)(e)),a=Hn(n);await y({variables:{input:{preferences:{isSidebarClosed:!0}}},optimisticResponse:{__typename:"Mutation",updateMe:{__typename:"CurrentUser",id:c.me.id,preferences:{__typename:"CurrentUserPreferences",isSidebarClosed:!0}}}});let l=await g({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:r,trees:[t],defaultView:a}}}),o=l?.data?.projectsCreateWithTaskast?.documents.edges?.[0]?.node?.id;null!=o&&i.push(`/d/${o}`)},[v,{error:k}]=$N(p),E=ev.useRef(null),x=ev.useCallback(()=>{u("");let e=l.map(e=>({type:"spacemedia",id:e.id}));v("/web-api/ai/create-project",{method:"POST",credentials:"same-origin",body:JSON.stringify(hR.Mm.parse({input:{command:{type:"create-project",data:{type:"user-input",content:n,outputType:t??void 0,persona:a??void 0,tone:o??void 0,sources:e}}},spaceId:r})),headers:{"Content-Type":"application/json"}})},[v,t,a,n,l,r,o]);ev.useEffect(()=>{x()},[x]);let _=[{type:"section",label:"actions",items:[{label:"Create Project",itemType:ekb}].map(e=>{let{label:t,itemType:a}=e;return{label:t,values:[t],data:{action:e},itemType:a,render:eky}})}],w=ev.useCallback(async e=>{e.data.action.itemType===ekb&&await b()},[b]);return ev.createElement(ekw,{ref:s,onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),E.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),E.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),E.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},tabIndex:0},ev.createElement("div",{ref:d,className:"max-h-[60vh] overflow-y-auto border-b-2 border-appcolor-200 px-5 py-4"},null!=k?ev.createElement("div",{className:"flex w-full items-center justify-center text-base"},k.message):ev.createElement(DA,{value:m??"",shouldRemoveCodeFence:!0})),h&&ev.createElement("div",{className:"my-3"},ev.createElement(eI.Spinner,null)),!h&&null==f&&null==k&&ev.createElement("div",null,ev.createElement(tT,{ref:E,term:"",data:_,renderMap:ekx,onActivate:w,search:ek_})))},ekC=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement("div",{ref:a,onClick:t.activate,className:og()("mx-3 mb-[1px] flex h-9 items-center rounded-xl px-2 text-sm text-appcolor-500 hover:bg-opacity-25 hover:text-appcolor-800",t.focused&&"bg-white bg-opacity-25 text-appcolor-800 backdrop-blur-[7px]")},ev.createElement(tn.Icon,{icon:"dd_ai_spark"}),ev.createElement("span",{className:"pl-3"},t.label),t.focused&&ev.createElement(tn.Icon,{className:"ml-auto text-appcolor-500",icon:"dd_return"}))},ekM={PromptItem:e=>ev.createElement(ekC,{morseChildProps:e})},ekS={PromptSection:()=>ev.createElement(ev.Fragment,null)},ekI=(e,t)=>new to.Z(t,{keys:["values"],threshold:0}).search(e).map(e=>e.item),ekD=eL.default.div.withConfig({displayName:"PromptInput__InvertContainer",componentId:"sc-e71dd591-0"})` + & > div { + color: ${e=>e.theme.appColors.hex(10)}; + } + & > div:last-child > div > div { + color: ${e=>e.theme.appColors.hex(10)} !important; + } +`,ekT=function(e){var t;let{onDeleteMedia:a,onSelectMedia:n,onSelectOutput:l,onSelectPersona:r,onSelectTone:o,outputType:i,persona:s,sourceMedias:d,spaceId:c,submitPrompt:m,tone:u}=e,[p,g]=ev.useState(""),[f,h]=ev.useState([]),[y,b]=ev.useState({isOpen:!1}),[v,k]=ev.useState({isOpen:!1}),[E,x]=ev.useState({isOpen:!1}),_=(0,eK.Z)(),w=ev.useRef(null),N=ev.useRef(null),C=ev.useMemo(()=>[...Bn,...Bl].map(e=>`.${e}`).join(","),[]);ev.useEffect(()=>{w.current?.focus()},[]);let M=ev.useRef(null),S=HK(i??"workflow"),I=(t=e=>{g(e.value),w?.current?.focus()},ev.useCallback(e=>{t(e.data.prompt)},[t])),D=ev.useCallback(async e=>{if(null==e.currentTarget.files)return;let t=e.currentTarget.files[0];null!=t&&h(e=>Ml()(e,{$push:[{id:(0,ld.Z)(),spaceId:c,file:t}]}))},[c]),T=(e,t)=>{h(t=>{let a=t.findIndex(t=>t.id===e);return -1===a?t:Ml()(t,{$splice:[[a,1]]})}),n(t)},$=ev.useCallback(e=>{switch(e){case"add_media":b({isOpen:!0,spaceId:c});break;case"add_file":N.current?.click();break;case"add_link":k({isOpen:!0,spaceId:c});break;case"add_youtube":x({isOpen:!0,spaceId:c})}},[c]);return ev.createElement(ev.Fragment,null,ev.createElement(ekD,{onKeyDownCapture:e=>{switch(e.key){case eI.KeyboardKeys.ArrowUp:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),M.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),M.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:if(e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),M.current?.getVisibleItemCount()===0?m(p):M.current?.activateCurrentItem();break;case eI.KeyboardKeys.Escape:e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}},ev.createElement("div",{className:"flex items-center gap-x-3 px-5 py-2"},ev.createElement(tn.Icon,{icon:"dd_ai"}),ev.createElement("input",{type:"text",ref:w,className:"w-full bg-transparent",placeholder:_.formatMessage({id:"general.enter_your_goal_task_or_next_big_project",defaultMessage:"Enter your goal, task, or next big project ..."}),value:p,onChange:e=>{g(e.target.value)}}),ev.createElement("button",{className:"text-appcolor-500 transition-colors duration-500 hover:text-brand",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),M.current?.getVisibleItemCount()===0?m(p):M.current?.activateCurrentItem()}},ev.createElement(tn.Icon,{icon:"message_send"}))),ev.createElement("div",{className:"flex flex-wrap gap-1 px-3 py-3"},ev.createElement(HL,{selected:i,onSelectItem:e=>{l(e),w.current?.focus()}}),ev.createElement(HF,{selected:s,onSelectItem:e=>{r(e),w.current?.focus()}}),ev.createElement(HO,{selected:u,onSelectItem:e=>{o(e),w.current?.focus()}}),d.map(e=>ev.createElement(Hq,{key:e.id,media:e,onDeleteMedia:a})),f.map(e=>ev.createElement(HW,{key:e.id,pendingFileUpload:e,onMediaCreate:T})),ev.createElement(HR,{onMediaSelected:$}),ev.createElement("div",null,ev.createElement("input",{ref:N,accept:C,onChange:D,type:"file",title:"",disabled:f.length>0,className:"absolute h-0 w-0 cursor-pointer opacity-0"}))),ev.createElement("div",null,ev.createElement(tT,{ref:M,term:p,data:S,renderMap:ekM,onActivate:I,sectionRenderMap:ekS,search:ekI,renderEmptyState:ev.createElement("div",{className:"hidden py-4"})}))),ev.createElement(HD,{state:y,onClose:()=>{b({isOpen:!1})},onSelectMedia:n}),ev.createElement(Hv,{state:v,onClose:()=>{k({isOpen:!1})},onSelectMedia:n}),ev.createElement(H$,{state:E,onClose:()=>{x({isOpen:!1})},onSelectMedia:n}))},ek$=eL.default.div.withConfig({displayName:"AiCreateProject__Container",componentId:"sc-86c82ca-0"})` + position: relative; + z-index: 1; + border-radius: 20px; + background: rgba(0, 0, 0, 0.5); + box-shadow: rgba(255, 255, 255, 0.1) 0px 1px 4px, rgb(255, 255, 255, 0.1) 0px 0px 0px 1px; + z-index: 2; + + backdrop-filter: blur(7px); + + @media (min-width: 768px) { + width: 40rem; + } + + &.prompt-state { + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: rgba(255, 255, 255, 0.5); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + } + } + + &.preview-state { + &::before { + content: ''; + position: absolute; + inset: 0; + border-radius: 20px; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotate 3s linear infinite; + } + } + + @keyframes rotate { + 100% { + filter: hue-rotate(-360deg); + } + } +`,ekP=function(e){let{spaceId:t}=e,[a,n]=ev.useState(null),[l,r]=ev.useState(null),[o,i]=ev.useState(null),[s,d]=ev.useState(null),[c,m]=ev.useState([]),u=ev.useCallback(e=>{m(t=>t.filter(t=>t.id!==e.id))},[]),p=ev.useCallback(e=>{m(t=>{let a=t.findIndex(t=>t.id===e.id);return a>=0?Ml()(t,{[a]:{$set:e}}):[...t,e]})},[]);return ev.createElement(ek$,{className:og()("rounded-xl",null!=a&&a.trim().length>0?"preview-state":"default-state")},ev.createElement("div",{className:"w-full rounded-xl p-4"},ev.createElement("div",{className:"w-full overflow-clip rounded-xl border-appcolor-300"},null!=a&&a.trim().length>0?ev.createElement(ekN,{outputType:l,persona:o,prompt:a,sourceMedias:c,spaceId:t,tone:s}):ev.createElement(ekT,{onDeleteMedia:u,onSelectMedia:p,onSelectOutput:r,onSelectPersona:i,onSelectTone:d,outputType:l,persona:o,sourceMedias:c,spaceId:t,submitPrompt:e=>{n(e)},tone:s}))))},ekF=eL.default.div.withConfig({displayName:"CreateProject__Backdrop",componentId:"sc-a6de3e8f-0"})` + display: flex; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + pointer-events: none; + opacity: 0; + overflow: hidden; + z-index: 1; + + animation-name: fadeInA; + animation-duration: 1s; + animation-fill-mode: forwards; + animation-iteration-count: 1; + + @keyframes fadeInA { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } +`,ekA=eL.default.div.withConfig({displayName:"CreateProject__Orb",componentId:"sc-a6de3e8f-1"})` + position: absolute; + width: 334.06px; + height: 453.36px; + left: 50%; + top: 20%; + opacity: 0; + z-index: 2; + + background: radial-gradient( + 170.19% 109.67% at 50% 28.59%, + rgba(127, 8, 77, 0.46) 0%, + rgba(119, 8, 73, 0.46) 35.94%, + rgba(150, 31, 106, 0.46) 83.08% + ); + mix-blend-mode: lighten; + filter: blur(48px); + border-radius: 275.037px; + transform: rotate(14.35deg); + + animation-name: fadeInB, moveupdown; + animation-duration: 1s, 13s; + animation-fill-mode: forwards; + animation-iteration-count: 1, infinite; + + @keyframes fadeInB { + 0% { + opacity: 0; + } + + 100% { + opacity: 0.8; + } + } + + @keyframes moveupdown { + 0% { + transform: translateY(0) rotate(0); + } + 50% { + transform: translateY(200px) rotate(90deg); + } + 100% { + transform: translateY(0) rotate(0); + } + } +`,ekR=eL.default.div.withConfig({displayName:"CreateProject__OrbB",componentId:"sc-a6de3e8f-2"})` + position: absolute; + width: 329.11px; + height: 537.04px; + left: 30%; + top: 20%; + opacity: 0; + + background: radial-gradient( + 170.19% 109.67% at 50% 28.59%, + rgba(252, 170, 27, 0.74) 0%, + rgba(119, 8, 73, 0.74) 35.94%, + rgba(150, 31, 106, 0.74) 83.08% + ); + mix-blend-mode: lighten; + filter: blur(46.5px); + border-radius: 275.037px; + transform: rotate(20.58deg); + + animation-name: fadeInC, updown2; + animation-duration: 2s, 10s; + animation-fill-mode: forwards; + animation-iteration-count: 1, infinite; + animation-timing-function: ease-in-out; + + @keyframes fadeInC { + 0% { + opacity: 0; + } + + 100% { + opacity: 0.8; + } + } + + @keyframes updown2 { + 0% { + transform: translateY(0) rotate(45deg); + } + 50% { + transform: translateY(200px) rotate(0); + } + 100% { + transform: translateY(0) rotate(45deg); + } + } +`,ekj=eL.default.div.withConfig({displayName:"CreateProject__OrbC",componentId:"sc-a6de3e8f-3"})` + position: absolute; + width: 607.24px; + height: 555px; + left: 98.61px; + top: 219.21px; + opacity: 0; + + background: rgba(39, 6, 138, 0.75); + mix-blend-mode: lighten; + filter: blur(75.5px); + border-radius: 598.61px; + + animation-name: fadeInD; + animation-duration: 17s; + animation-fill-mode: forwards; + animation-iteration-count: infinite; + animation-delay: 1s; + + @keyframes fadeInD { + 0% { + opacity: 0; + } + 25% { + opacity: 1; + } + 50% { + opacity: 1; + } + 100% { + opacity: 0; + } + } +`,ekO=eL.default.div.withConfig({displayName:"CreateProject__OrbD",componentId:"sc-a6de3e8f-4"})` + position: absolute; + width: 607.24px; + height: 555px; + left: 279.61px; + top: 95.21px; + opacity: 0; + + background: rgba(39, 6, 138, 0.65); + mix-blend-mode: lighten; + filter: blur(88.1471px); + border-radius: 598.61px; + + animation-name: fadeIE; + animation-duration: 1s; + animation-fill-mode: forwards; + animation-iteration-count: 1; + + @keyframes fadeIE { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } +`,ekU=eL.default.div.withConfig({displayName:"CreateProject__OrbE",componentId:"sc-a6de3e8f-5"})` + position: absolute; + width: 633px; + height: 701px; + left: 685.61px; + top: 70.21px; + opacity: 0; + + background: #0e0429; + mix-blend-mode: lighten; + filter: blur(88.1471px); + border-radius: 598.61px; + + animation-name: fadeIF, oval; + animation-duration: 0.5s, 12s; + animation-fill-mode: forwards; + animation-iteration-count: 1, infinite; + animation-timing-function: ease-in-out; + + @keyframes fadeIF { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } + + @keyframes oval { + 0% { + transform: translateX(0); + } + 50% { + transform: translateX(100px); + } + 100% { + transform: translateX(0); + } + } +`,ekZ=function(e){let{state:t}=e,a=(0,eF.k6)();return null==t.spaceId?null:ev.createElement(eks,null,ev.createElement(ekc,{marginBottom:20},ev.createElement(eY.Z,{id:"general.generate_new_project_with_ai",defaultMessage:"Generate project with AI"})),ev.createElement("div",{className:"mb-20 mt-10 flex flex-col gap-y-10"},ev.createElement(ekP,{spaceId:t.spaceId}),ev.createElement(ekp,{className:"hover:text-textlight-300",onClick:()=>{if(null==t.spaceId){a.push("/");return}a.push("/")}},ev.createElement(eY.Z,{id:"general.go_to_homescreen",defaultMessage:"Go to homescreen"}))),ev.createElement(ekF,null,ev.createElement(ekA,null),ev.createElement(ekR,null),ev.createElement(ekj,null),ev.createElement(ekO,null),ev.createElement(ekU,null)))},ekL=function(e){let{dispatch:t}=e;return ev.createElement(eks,null,ev.createElement(ekc,{marginBottom:20},ev.createElement(eY.Z,{id:"general.download_apps_title",defaultMessage:"Download our apps"})),ev.createElement(ekd,{className:"mb-20 mt-10 flex flex-col gap-y-10"},ev.createElement("div",{className:"flex justify-center gap-x-10"},ev.createElement("div",{className:"flex flex-col gap-y-4"},ev.createElement("span",{className:"flex justify-center text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.download_desktop",defaultMessage:"Desktop"})),ev.createElement("div",{className:"flex gap-x-4"},ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://apps.taskade.com/updates/Taskade-4.3.3-universal.dmg",target:"_blank",rel:"noopener noreferrer"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_apple"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_mac",defaultMessage:"Mac"}))),ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://apps.taskade.com/updates/Taskade_Setup_4.3.3.exe",rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_windows_marketplace"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_windows",defaultMessage:"Windows"}))))),ev.createElement("div",{className:"flex flex-col gap-y-4"},ev.createElement("span",{className:"flex justify-center text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.download_mobile",defaultMessage:"Mobile"})),ev.createElement("div",{className:"flex gap-x-4"},ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://apps.apple.com/us/app/taskade-team-productivity/id1264713923",rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_apple"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_ios",defaultMessage:"iOS"}))),ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://play.google.com/store/apps/details?id=com.taskade.mobile",rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_android"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_android",defaultMessage:"Android"})))))),ev.createElement("div",{className:"flex flex-col gap-y-4"},ev.createElement("span",{className:"flex justify-center text-lg font-semibold"},"Extensions"),ev.createElement("div",{className:"flex justify-center gap-x-4"},ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://chrome.google.com/webstore/detail/taskade/hcobdfnjjaceclfdjpmmpiknimccjpmf?hl=en-US",rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_chrome"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_chrome",defaultMessage:"Chrome"}))),ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://addons.mozilla.org/en-US/firefox/addon/taskade-app/",rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_firefox"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_firefox",defaultMessage:"Firefox"}))),ev.createElement("a",{className:"group flex transform flex-col items-center gap-y-4 transition-transform duration-300 ease-in-out hover:scale-110",href:"https://microsoftedge.microsoft.com/addons/detail/oocnohmkpeeideflaepaogbgkgdggdic",rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",{className:"flex items-center rounded-3xl bg-appcolor-300 p-6"},ev.createElement(tn.Icon,{className:"scale-125",icon:"logo_edge"})),ev.createElement("span",{className:"text-sm text-appcolor-500 transition-colors"},ev.createElement(eY.Z,{id:"general.download_edge",defaultMessage:"Edge"})))))),ev.createElement(eku,{onClick:()=>{t({type:"next_step"})}},ev.createElement(eY.Z,{id:"general.get_started",defaultMessage:"Get started"}),ev.createElement(tn.Icon,{icon:"header_nav_forward"})))},ekB=(0,la.ZP)` + mutation WorkspaceMemberInviteMutation($input: WorkspaceMemberInviteInput!) { + workspaceMemberInvite(input: $input) { + clientMutationId + } + } +`,ekz={id:"collaborator",name:"Collaborator",value:"collaborator"},ekV={id:"viewer",name:"Viewer",value:"viewer"},ekq=[[ekz.id,ekz],[ekV.id,ekV]],ekW=new Map(ekq),ekH=eL.default.div.withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-e9319dca-0"})` + cursor: pointer; + outline: 0; + display: flex; + flex-direction: row; + padding: 6px; + + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + outline: 0; + } +`,ekG=function(e){let{name:t,value:a,children:n}=e,l=(0,ev.useRef)(null),r=(0,eI.useMenuItem)({name:t,value:a,stopRef:l});return ev.createElement(ekH,r.props,n)},ekK=(0,eL.default)(eI.Menu).withConfig({displayName:"WorkspaceRoleSelectMenu__StyledMenu",componentId:"sc-c8fb32af-0"})` + width: 270px; + padding: var(--menu-padding); + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: var(--menu-border-radius); + + background: ${e=>e.theme.appColors.hex(100)}; +`,ekY=eL.default.div.withConfig({displayName:"WorkspaceRoleSelectMenu__SelectedRole",componentId:"sc-c8fb32af-1"})` + display: flex; + min-width: 40px; + justify-content: center; +`,ekQ=eL.default.div.withConfig({displayName:"WorkspaceRoleSelectMenu__RoleContainer",componentId:"sc-c8fb32af-2"})` + display: flex; +`,ekJ=(0,eL.default)(lT.my).withConfig({displayName:"WorkspaceRoleSelectMenu__IconRoleSelected",componentId:"sc-c8fb32af-3"})` + & path { + stroke: ${e=>e.theme.isNightMode?"#ccc":"#333"}; + } +`,ekX=eL.default.div.withConfig({displayName:"WorkspaceRoleSelectMenu__RoleDescription",componentId:"sc-c8fb32af-4"})` + display: flex; + flex-direction: column; +`,ek0=function(e){let{value:t,initialFocus:a}=e,n=ekW.get(t);return ev.createElement(ekK,{loop:!0,initialFocus:a},ekq.map(e=>{let[t,a]=e;return ev.createElement(ekG,{key:t,value:a.value},ev.createElement(ekQ,null,ev.createElement(ekY,null,n?.value===a.value&&ev.createElement(ekJ,null)),ev.createElement(ekX,null,ev.createElement(bu,{role:a.value}),ev.createElement(bg,{role:a.value}))))}))},ek1=eL.default.div.withConfig({displayName:"RoleSelect__MenuButton",componentId:"sc-a279a2fc-0"})` + ${e1.UiTypography.sm} + + display: flex; + align-items: center; + user-select: none; + + color: ${e=>e.theme.textColors.hex(50)}; + + &:hover, + &[aria-expanded='true'] { + cursor: pointer; + color: ${e=>e.theme.textColors.hex(20)}; + } +`,ek2=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"RoleSelect__IconCaretDown",componentId:"sc-a279a2fc-1"})` + margin-left: 4px; +`,ek5=function(e){let{onChange:t,value:a}=e,n=ekW.get(a),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"bottom"}),d=(0,eI.useMenuButton)({ref:o,state:l,dispatch:r}),c=ev.useCallback(e=>{"Activate"===e.type&&(t(e.payload.value),r({type:"Collapse"}))},[t]);return ev.createElement(ev.Fragment,null,ev.createElement(ek1,{...d.props,tabIndex:-1},ev.createElement(bu,{role:n?.value||"collaborator"}),ev.createElement(ek2,null)),l.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:r,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:c},ev.createElement(ek0,{value:a,initialFocus:s.initialFocus}))))},ek3=eL.default.div.withConfig({displayName:"styled__ShareLinkContainer",componentId:"sc-70abd5d6-0"})` + display: flex; + flex-direction: column; + align-items: flex-start; + + width: 100%; + margin-bottom: 30px; +`,ek4=eL.default.div.withConfig({displayName:"styled__LinkContainer",componentId:"sc-70abd5d6-1"})` + display: flex; + align-items: flex-start; + + width: 360px; +`,ek6=(0,eL.default)(ekg).withConfig({displayName:"styled__LinkInput",componentId:"sc-70abd5d6-2"})` + border-radius: 0.75rem 0px 0px 0.75rem; +`,ek8=eL.default.button.withConfig({displayName:"styled__CopyButton",componentId:"sc-70abd5d6-3"})` + display: flex; + justify-content: center; + align-items: center; + border-radius: 0px 0.75rem 0.75rem 0px; + font-weight: 500; + padding: 11px 22px; + color: #fff; + transition: background-color 200ms ease-in; + background: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,ek7=eL.default.div.withConfig({displayName:"styled__TeammateEmailContainer",componentId:"sc-70abd5d6-4"})` + display: flex; + flex-direction: column; + align-items: flex-start; + + width: 100%; + margin-bottom: 30px; +`,ek9=(0,eL.default)(ekm).withConfig({displayName:"styled__Skip",componentId:"sc-70abd5d6-5"})` + cursor: pointer; + margin-top: 20px; +`,eEe=eL.default.div.withConfig({displayName:"styled__InputContainer",componentId:"sc-70abd5d6-6"})` + display: flex; + position: relative; + justify-content: space-between; + + width: 360px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + margin-bottom: 10px; + + background: ${e=>e.theme.appColors.hex(90)}; + overflow: clip; + + &:focus-within { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + & > :last-child { + padding: 0 8px; + &:hover, + &[aria-expanded='true'] { + color: ${e=>e.theme.textColors.hex(20)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; +`,eEt=(0,eL.default)(ekg).withConfig({displayName:"styled__EmailInput",componentId:"sc-70abd5d6-7"})` + width: auto; + flex: auto; + border: none; + + &:focus-within { + border: none; + } +`,eEa=function(e){let{url:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null);ev.useEffect(()=>{let e=new(hF())(l.current);return e.on("success",()=>{n(!0)}),()=>{e.destroy()}},[]);let r=()=>{n(!1)};return ev.createElement(ek4,null,ev.createElement(ek6,{className:"rounded-l-xl rounded-r-none",disabled:!0,value:t}),ev.createElement(ek8,{onMouseOut:r,onBlur:r,ref:l,"data-clipboard-action":"copy","data-clipboard-text":t},a?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"})))},eEn=function(e){let t=(0,eK.Z)(),{state:a,dispatch:n}=e,[l]=(0,cs.D)(ekB,{onError:()=>{}}),r=ev.useMemo(()=>{if(null==a.spaceId||null==a.spaceInviteToken)return null;let e=new URL(`/invites/${a.spaceId}`,"https://www.taskade.com");return e.searchParams.set("share","edit"),e.searchParams.set("edit",a.spaceInviteToken),e.href},[a.spaceId,a.spaceInviteToken]),o=(e,t)=>{n({type:"update_email_invite_address",value:e,index:t})},i=(e,t)=>{n({type:"update_email_invite_role",role:e,index:t})};return ev.createElement(eks,null,ev.createElement(ekc,{marginBottom:30},ev.createElement(eY.Z,{id:"general.onboarding_invite_teammates_copy",defaultMessage:"Invite Teammates"})),ev.createElement(ek3,null,ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.onboarding_invite_teammates_details",defaultMessage:"Copy this link and share in your work messenger:"})),null!=r&&ev.createElement(eEa,{url:r})),ev.createElement(ek7,null,ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.onboarding_invite_teammates_addresses",defaultMessage:"Email addresses"})),a.emailInvites.map((e,a)=>ev.createElement(eEe,{key:a},ev.createElement(eEt,{placeholder:t.formatMessage({id:"general.onboarding_invite_teammates_email_example",defaultMessage:"name@company.com"}),onChange:e=>{o(e.target.value,a)},value:e.email,autoFocus:0===a}),ev.createElement(ek5,{value:e.role,onChange:e=>{i(e,a)}})))),ev.createElement(eku,{onClick:()=>{let{spaceId:e,emailInvites:t}=a;if(null==e){n({type:"next_step"});return}for(let a of t)0!==a.email.length&&l({variables:{input:{clientMutationId:(0,ld.Z)(),invitee:a.email,spaceID:e,role:a.role}}});n({type:"next_step"})}},ev.createElement(eY.Z,{id:"general.onboarding_invite_continue",defaultMessage:"Invite & continue"}),ev.createElement(tn.Icon,{icon:"header_nav_forward"})),ev.createElement(ek9,{className:"hover:text-textlight-300",onClick:()=>{n({type:"next_step"})}},"Skip for now"))},eEl=eL.default.div.withConfig({displayName:"StepIndicator__StepContainer",componentId:"sc-9616c3d1-0"})` + display: flex; + bottom: 40px; + position: absolute; +`,eEr=eL.default.span.withConfig({displayName:"StepIndicator__StepCell",componentId:"sc-9616c3d1-1"})` + width: 33px; + height: 8px; + margin-right: 6px; + ${e1.UiBorderRadius.xl} + + background-color: ${e=>e.isActive?e.theme?.primaryColorScheme?.base:e.theme.appColors.hex(70)}; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; +`,eEo=function(e){let{currentStep:t,totalSteps:a=5}=e,n=[];for(let e=0;e{let{token:n,s3Policy:l,s3URL:r,awsUploadAPIBaseURL:o}=e.payload,{formData:i,s3ObjectKey:s}=uo(t,l,a),d=await fB(r,{},i);if(!d.ok)throw Error(d.statusText);return{payload:{awsUploadAPIBaseURL:o,s3ObjectKey:s,token:n}}},eEu=async(e,t)=>{let a=JSON.stringify({type:"avatar",includeS3Policy:"true",filename:e,filesize:t}),n=await fB("/web-api/uploads/request-data",{"Content-Type":"application/json"},a);if(!n.ok){let e=n.statusText;try{let t=await n.json();"object"==typeof t&&"string"==typeof t.message&&(e=t.message)}catch(e){}throw Error(e)}return n.json()},eEp=async e=>{let{token:t,s3ObjectKey:a,awsUploadAPIBaseURL:n}=e.payload,l=JSON.stringify({body:{s3ObjectKey:a}}),r=await fB(`${n}/uploads`,{"uploads-authorization-jwt":t,"Content-Type":"application/json"},l);if(!r.ok)throw Error(r.statusText);return r.json()},eEg=async(e,t,a)=>{let n=fH(t),l=fq(e),r=`avatar.${n}`,o=await eEu(r,a),i=await eEm(o,l,r);return await eEp(i)};function eEf(e){return{type:"IMAGE_LOAD_FAILURE",payload:{error:e}}}let eEh=(0,lb.C)({context:{image:null,error:null,scale:1},tsTypes:{},schema:{context:{},events:{},services:{}},id:"avatareditor",initial:"editing",states:{editing:{exit:"resetError",on:{SET_SCALE:{actions:"setScale",target:"#avatareditor.editing"},SET_IMAGE:{actions:["setImage","resetError"],target:"#avatareditor.editing"},IMAGE_LOAD_FAILURE:{actions:"imageLoadFailure",target:"#avatareditor.editing"},SAVE:{cond:"hasImage",target:"#avatareditor.saving"},DELETE:{cond:"hasAvatar",target:"#avatareditor.deleting"}}},saving:{invoke:{id:"saveAvatar",src:"saveAvatar",onDone:[{actions:"avatarSaved",target:"#avatareditor.editing"}],onError:[{actions:"saveAvatarFailed",target:"#avatareditor.editing"}]}},deleting:{invoke:{id:"deleteAvatar",src:"deleteAvatar",onDone:[{actions:"avatarDeleted",target:"#avatareditor.editing"}],onError:[{actions:"deleteAvatarFailed",target:"#avatareditor.editing"}]}}}},{guards:{hasImage:e=>null!=e.image},actions:{resetError:(0,lv.assign)(e=>(0,es.ZP)(e,e=>(e.error=null,e))),setImage:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.image=t.payload.image,e))),setScale:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.scale=t.payload.scale,e))),imageLoadFailure:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.payload.error,e.image=null,e)))}}),eEy=(0,eL.default)(lT.$F).withConfig({displayName:"AvatarEditorModalDialog__DisabledIconBin",componentId:"sc-95dcd3a4-0"})` + > path { + fill: ${e=>e.theme?.isNightMode?"#444":"#e5e5e5"}; + } +`,eEb=(0,eL.default)(lT.$F).withConfig({displayName:"AvatarEditorModalDialog__StyledIconBin",componentId:"sc-95dcd3a4-1"})` + > path { + fill: ${e=>e.theme?.primaryColorScheme?.base}; + } +`,eEv=(0,eL.default)(lT.y1).withConfig({displayName:"AvatarEditorModalDialog__DisabledIconCheckmark",componentId:"sc-95dcd3a4-2"})` + > path { + stroke: ${e=>e.theme?.isNightMode?"#444":"#e5e5e5"}; + } +`,eEk=(0,eL.default)(lT.y1).withConfig({displayName:"AvatarEditorModalDialog__StyledIconCheckmark",componentId:"sc-95dcd3a4-3"})` + > path { + stroke: #ffffff; + } +`,eEE=eL.default.div.withConfig({displayName:"AvatarEditorModalDialog__Container",componentId:"sc-95dcd3a4-4"})` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 30px 60px; +`,eEx=eL.default.span.withConfig({displayName:"AvatarEditorModalDialog__Header",componentId:"sc-95dcd3a4-5"})` + font-size: 24px; + color: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333333"}; +`,eE_=eL.default.div.withConfig({displayName:"AvatarEditorModalDialog__ErrorDiv",componentId:"sc-95dcd3a4-6"})` + margin-top: 20px; + padding: 10px 20px; + border-radius: 10px; + color: ${e=>e.theme?.primaryColorScheme?.base}; + background: ${e=>e.theme?.primaryColorScheme?.alpha10}; + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; +`,eEw=eL.default.div.withConfig({displayName:"AvatarEditorModalDialog__ImageContainer",componentId:"sc-95dcd3a4-7"})` + position: relative; + margin: 30px 0; + height: 300px; + width: 300px; + border-radius: 12px; + background: ${e=>e.theme.appColors.hex(90)}; + display: flex; + align-items: center; + justify-content: center; +`,eEN=eL.default.img.withConfig({displayName:"AvatarEditorModalDialog__Image",componentId:"sc-95dcd3a4-8"})` + position: absolute; + border-radius: 12px; + height: 300px; + width: 300px; + opacity: 0.3; +`,eEC=eL.default.div.withConfig({displayName:"AvatarEditorModalDialog__AvatarContainer",componentId:"sc-95dcd3a4-9"})` + margin: 30px 0 10px 0; +`,eEM=eL.default.div.withConfig({displayName:"AvatarEditorModalDialog__ButtonContainer",componentId:"sc-95dcd3a4-10"})` + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +`,eES=eL.default.button.withConfig({displayName:"AvatarEditorModalDialog__BaseCircleButton",componentId:"sc-95dcd3a4-11"})` + height: 50px; + width: 50px; + border: 0; + border-radius: 50%; + :focus { + outline: 0; + } +`,eEI=(0,eL.default)(eES).withConfig({displayName:"AvatarEditorModalDialog__DisabledBinCircleButton",componentId:"sc-95dcd3a4-12"})` + background: ${e=>e.theme.appColors.hex(80)}; +`,eED=(0,eL.default)(eEI).withConfig({displayName:"AvatarEditorModalDialog__BinCircleButton",componentId:"sc-95dcd3a4-13"})` + cursor: pointer; + &:hover { + background: ${e=>e.theme?.isNightMode?"#444":"#e5e5e5"}; + } +`,eET=(0,eL.default)(eES).withConfig({displayName:"AvatarEditorModalDialog__DisabledCheckCircleButton",componentId:"sc-95dcd3a4-14"})` + margin-left: 20px; + background: ${e=>e.theme.appColors.hex(80)}; +`,eE$=(0,eL.default)(eET).withConfig({displayName:"AvatarEditorModalDialog__CheckCircleButton",componentId:"sc-95dcd3a4-15"})` + cursor: pointer; + background: ${e=>e.theme?.primaryColorScheme?.base}; + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } +`,eEP=eL.default.input.withConfig({displayName:"AvatarEditorModalDialog__StyledInput",componentId:"sc-95dcd3a4-16"})` + display: none; +`,eEF=eL.default.label.withConfig({displayName:"AvatarEditorModalDialog__StyledLabel",componentId:"sc-95dcd3a4-17"})` + height: 38px; + width: 128px; + display: flex; + align-items: center; + justify-content: center; + border: 0; + border-radius: 5px; + cursor: pointer; + color: #ffffff; + background: ${e=>e.theme?.primaryColorScheme?.base}; + :focus { + outline: none; + } + z-index: 1; +`,eEA=eL.default.div.withConfig({displayName:"AvatarEditorModalDialog__InputRangeWrapper",componentId:"sc-95dcd3a4-18"})` + height: 30px; + + & > input { + -webkit-appearance: none; + height: 7px; + width: 128px; + border-radius: 20px; + background: ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; + outline: none; + + &::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 15px; + height: 15px; + cursor: pointer; + border-radius: 15px; + background: ${e=>e.theme?.primaryColorScheme?.base}; + } + + &::-moz-range-thumb { + width: 15px; + height: 15px; + cursor: pointer; + border-radius: 15px; + background: ${e=>e.theme?.primaryColorScheme?.base}; + } + } + margin-bottom: 10px; +`,eER=function(e){let t,a;let{isOpen:n,onToggle:l,avatarSrc:r,shouldShowAvatarInBackground:o}=e,i=(0,e$.useDispatch)(),s=ev.useMemo(()=>!r.includes("no-avatar")&&(null==o||o),[r,o]),d=ev.useCallback(()=>!r.includes("placeholder"),[r]),c=(0,ev.useRef)(null),[m]=(0,cs.D)(eEc),[u]=(0,cs.D)(eEd),[p,g]=(0,ls.e)(eEh,{actions:{avatarDeleted:(e,t)=>{i(ck({avatar:t.data.avatars.ldpi.url,avatars:t.data.avatars}))},deleteAvatarFailed:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>{e.error=t.data.message})),avatarSaved:(e,t)=>{i(ck({avatar:t.data.avatars.ldpi.url,avatars:t.data.avatars})),l(),i((0,l3.success)({uid:"upload-avatar-success",message:"Avatar uploaded!",position:"br",autoDismiss:1,dismissible:!1}))},saveAvatarFailed:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>{e.error=t.data.message}))},guards:{hasAvatar:()=>d()},services:{saveAvatar:async e=>{if(null==c.current)throw Error("Image Editor not ready");if(null==e.image)throw Error("No image selected");let t=e.image.type,a=e.image.size,n=document.createElement("canvas");n.width=400,n.height=400,n.getContext("2d")?.drawImage(c.current.getImage(),0,0,400,400);let l=n.toDataURL();n.getContext("2d")?.clearRect(0,0,400,400);let r=await eEg(l,t,`${a}`),o=await m({variables:{input:{clientMutationId:(0,ld.Z)(),data:{...r.data}}}}),i=o.data?.currentUserAvatarSave?.me;if(null==i)throw Error("No current user");return i},deleteAvatar:async()=>{let e=await u({variables:{input:{clientMutationId:(0,ld.Z)()}}}),t=e.data?.currentUserAvatarDelete?.me;if(null==t)throw Error("No current user");return t}}}),{error:f,image:h,scale:y}=p.context,b=(0,ev.useCallback)(e=>{g({type:"SET_SCALE",payload:{scale:parseFloat(e.target.value)}})},[g]),v=(0,ev.useCallback)(e=>{let t=e.target.files?.[0];null!=t&&g({type:"SET_IMAGE",payload:{image:t}})},[g]),k=(0,ev.useCallback)(()=>{g(eEf("Image failed to load. Please upload a valid jpg or png file."))},[g]),E=(0,ev.useCallback)(e=>{let{height:t,width:a}=e.resource;(t<400||a<400)&&g(eEf("Please upload an image that is at least 400x400 pixels."))},[g]),x=(0,ev.useCallback)(()=>{g({type:"SAVE"})},[g]),_=(0,ev.useCallback)(()=>{g({type:"DELETE"})},[g]);return t=h?ev.createElement(eEI,null,ev.createElement(eEy,null)):d()?p.matches("deleting")?ev.createElement(eEI,null,ev.createElement(eI.Spinner,{color:"#fff",height:20,width:20})):ev.createElement(eED,{onClick:_},ev.createElement(eEb,null)):ev.createElement(eEI,null,ev.createElement(eEy,null)),a=h?p.matches("saving")?ev.createElement(eET,null,ev.createElement(eI.Spinner,{color:"#fff",height:20,width:20})):ev.createElement(eE$,{onClick:x},ev.createElement(eEk,null)):ev.createElement(eET,null,ev.createElement(eEv,null)),ev.createElement(eI.ModalDialog,{isOpen:n,close:l},()=>ev.createElement(eEE,null,ev.createElement(eEx,null,ev.createElement(eY.Z,{id:"general.upload_photo",defaultMessage:"Upload Photo"})),null!=f&&ev.createElement(eE_,null,f),null!=h?ev.createElement(eEC,null,ev.createElement(eEs(),{ref:c,style:{width:"300px",height:"300px",borderRadius:"12px"},width:280,height:280,onLoadFailure:k,onLoadSuccess:E,image:h,scale:y})):ev.createElement(eEw,null,ev.createElement(eEF,{htmlFor:"avatar-editor-file"},ev.createElement(eEP,{id:"avatar-editor-file",type:"file",accept:".jpg,.jpeg,.png",onChange:v,disabled:!p.matches("editing")}),"Choose File"),s&&ev.createElement(eEN,{src:r,alt:"Profile"})),null!=h&&ev.createElement(eEA,null,ev.createElement("input",{type:"range",min:"1",max:"2",step:"0.01",defaultValue:"1",onChange:b,disabled:!p.matches("editing")})),ev.createElement(eEM,null,t,a)))},eEj=(0,la.ZP)` + mutation UserDisplayNameUpdateMutation($input: UserInput!) { + updateMe(input: $input) { + display_name + } + } +`,eEO=eL.default.div.withConfig({displayName:"styled__UploadAvatar",componentId:"sc-636a7913-0"})` + display: flex; + align-items: center; + justify-content: center; + + ${e1.UiBorderRadius["2xl"]} + height: 70px; + width: 70px; + margin-bottom: 24px; + + cursor: pointer; +`,eEU=eL.default.img.withConfig({displayName:"styled__AvatarImage",componentId:"sc-636a7913-1"})` + max-height: 100%; + max-width: 100%; +`,eEZ=eL.default.div.withConfig({displayName:"styled__NameInputContainer",componentId:"sc-636a7913-2"})` + display: flex; + flex-direction: column; + align-items: flex-start; + + margin-bottom: 30px; +`,eEL=(0,eL.default)(tn.Icon).withConfig({displayName:"styled__StyledPlaceholderIcon",componentId:"sc-636a7913-3"})` + color: #999999; + width: ${eI.UiSpacing.getPx(8)}; + height: ${eI.UiSpacing.getPx(8)}; +`,eEB=eL.default.div.withConfig({displayName:"styled__PlaceholderWrapper",componentId:"sc-636a7913-4"})` + display: flex; + align-items: center; + justify-content: center; + + background: ${e=>e.theme.appColors.hex(80)}; + height: 70px; + width: 70px; + + mask-image: url('../images/onboarding_profile_mask.png'); + -webkit-mask-image: url('../images/onboarding_profile_mask.png'); + -moz-mask-image: url('../images/onboarding_profile_mask.png'); + + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + -moz-mask-repeat: no-repeat; + + mask-position: center; + -webkit-mask-position: center; + -moz-mask-position: center; + + mask-size: contain; + -webkit-mask-size: contain; + -moz-mask-size: contain; +`,eEz=eL.default.div.withConfig({displayName:"styled__ProfileMask",componentId:"sc-636a7913-5"})` + mask-image: url('../images/onboarding_profile_mask.png'); + -webkit-mask-image: url('../images/onboarding_profile_mask.png'); + -moz-mask-image: url('../images/onboarding_profile_mask.png'); + + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + -moz-mask-repeat: no-repeat; + + mask-position: center; + -webkit-mask-position: center; + -moz-mask-position: center; + + mask-size: contain; + -webkit-mask-size: contain; + -moz-mask-size: contain; +`,eEV=function(e){let{currentUser:t,state:a,dispatch:n}=e,[l,r]=ev.useState(!1),o=(0,eK.Z)(),i=ev.useMemo(()=>{let e=t.avatars_v2.default?.mdpi.url;return null==e||!e.includes("no-avatar")&&"files.taskade.com"===new URL(e).hostname},[t.avatars_v2.default?.mdpi.url]),[s]=(0,cs.D)(eEj),d=ev.useCallback(()=>{r(e=>!e)},[]),c=()=>{null!=a.userDisplayName&&s({variables:{input:{display_name:a.userDisplayName}}}),n({type:"next_step"})};return ev.createElement(eks,null,ev.createElement(ekc,{marginBottom:30,customWidth:60},ev.createElement(eY.Z,{id:"general.onboarding_user_details_copy",defaultMessage:"Let's get you set up!"})),ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.onboarding_user_details_add_photo",defaultMessage:"Add photo"})),ev.createElement(eEO,{onClick:d},i?ev.createElement(eEz,null,ev.createElement(eEU,{src:t.avatars_v2.default?.mdpi.url,alt:"Profile"})):ev.createElement(eEB,null,ev.createElement(eEL,{icon:"dd_filter_assign"}))),l&&ev.createElement(eER,{isOpen:l,onToggle:d,avatarSrc:t.avatars_v2.default?.mdpi.url,shouldShowAvatarInBackground:i}),ev.createElement(eEZ,null,ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.your_name",defaultMessage:"Your name"})),ev.createElement(ekg,{placeholder:o.formatMessage({id:"general.onboarding_name_text_input_placeholder",defaultMessage:"John Doe"}),onChange:e=>{let{value:t}=e.target;n({type:"update_user_full_name",value:t})},onKeyPress:e=>{"Enter"===e.key&&c()},value:a.userDisplayName,autoFocus:!0})),ev.createElement(eku,{onClick:c},ev.createElement(eY.Z,{id:"general.continue",defaultMessage:"Continue"}),ev.createElement(tn.Icon,{icon:"header_nav_forward"})))},eEq=dw.z.enum(["work","education","personal"]),eEW=dw.z.enum(["marketing","product_and_design","sales_or_success","it_support","operations","hr_and_legal","project_management","engineering_or_development","creative_production","finance","manufacturing","customer_service","other","education"]),eEH=dw.z.enum(["executive","director","manager","team_member","freelancer","business_owner","other"]),eEG={education:(0,te.Em)({id:"general.onboarding_user_segment_education",defaultMessage:"For education"}),personal:(0,te.Em)({id:"general.onboarding_user_segment_personal_use",defaultMessage:"For personal use"}),work:(0,te.Em)({id:"general.onboarding_user_segment_work",defaultMessage:"For work"})},eEK={marketing:(0,te.Em)({id:"general.onboarding.user_segment.industry.marketing",defaultMessage:"Marketing"}),product_and_design:(0,te.Em)({id:"general.onboarding.user_segment.industry.product_and_design",defaultMessage:"Product & Design"}),sales_or_success:(0,te.Em)({id:"general.onboarding.user_segment.industry.sales_or_success",defaultMessage:"Sales / Success"}),it_support:(0,te.Em)({id:"general.onboarding.user_segment.industry.it_support",defaultMessage:"IT & Support"}),operations:(0,te.Em)({id:"general.onboarding.user_segment.industry.operations",defaultMessage:"Operations"}),hr_and_legal:(0,te.Em)({id:"general.onboarding.user_segment.industry.hr_and_legal",defaultMessage:"HR & Legal"}),project_management:(0,te.Em)({id:"general.onboarding.user_segment.industry.project_management",defaultMessage:"Project Management"}),engineering_or_development:(0,te.Em)({id:"general.onboarding.user_segment.industry.engineering_or_development",defaultMessage:"Engineering / Development"}),creative_production:(0,te.Em)({id:"general.onboarding.user_segment.industry.creative_production",defaultMessage:"Creative Production"}),finance:(0,te.Em)({id:"general.onboarding.user_segment.industry.finance",defaultMessage:"Finance"}),manufacturing:(0,te.Em)({id:"general.onboarding.user_segment.industry.manufacturing",defaultMessage:"Manufacturing"}),customer_service:(0,te.Em)({id:"general.onboarding.user_segment.industry.customer_service",defaultMessage:"Customer Service"}),other:(0,te.Em)({id:"general.onboarding.user_segment.industry.other",defaultMessage:"Other"}),education:(0,te.Em)({id:"general.onboarding.user_segment.industry.education",defaultMessage:"Education"})},eEY={executive:(0,te.Em)({id:"general.onboarding.user_segment.role.executive",defaultMessage:"Executive (e.g. VP or C-suite)"}),director:(0,te.Em)({id:"general.onboarding.user_segment.role.director",defaultMessage:"Director"}),manager:(0,te.Em)({id:"general.onboarding.user_segment.role.manager",defaultMessage:"Manager"}),team_member:(0,te.Em)({id:"general.onboarding.user_segment.role.team_member",defaultMessage:"Team member / Individual contributor"}),freelancer:(0,te.Em)({id:"general.onboarding.user_segment.role.freelancer",defaultMessage:"Freelancer"}),business_owner:(0,te.Em)({id:"general.onboarding.user_segment.role.business_owner",defaultMessage:"Business Owner"}),other:(0,te.Em)({id:"general.onboarding.user_segment.role.other",defaultMessage:"Other"})},eEQ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CurrentUserSegmentSubmitMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CurrentUserSegmentSubmitInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserSegmentSubmit"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eEJ=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-e0d7c8c2-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } + + ${ekm} { + padding: 5px 0; + color: #fff; + } +`,eEX=function(e){let{value:t,children:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({stopRef:n,value:t});return ev.createElement(eEJ,l.props,ev.createElement(ekm,null,a))},eE0=(0,eL.default)(eI.Menu).withConfig({displayName:"SegmentDropdownMenu__StyledMenu",componentId:"sc-4e5faaee-0"})` + padding: var(--menu-padding); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + overflow: auto; + max-height: 260px; +`,eE1=function(e){return ev.createElement(eE0,{loop:!0,initialFocus:e.initialFocus},eEW.options.map(e=>ev.createElement(eEX,{key:e,value:e},ev.createElement(eY.Z,eEK[e]))))},eE2=(0,eL.default)(tn.Icon).withConfig({displayName:"IndustryPicker__StyledIcon",componentId:"sc-b086a965-0"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,eE5=eL.default.button.withConfig({displayName:"IndustryPicker__Button",componentId:"sc-b086a965-1"})` + display: flex; + align-items: center; + justify-content: space-between; + + background-color: ${e=>e.theme.appColors.hex(90)}; + + width: 360px; + padding: 10px 12px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: var(--menu-border-radius); + + &:hover, + &[aria-expanded='true'] { + ${eE2} { + color: ${e=>e.theme.appColors.hex(20)}; + } + } +`,eE3=(0,eL.default)(ekm).withConfig({displayName:"IndustryPicker__PickerSubtitle",componentId:"sc-b086a965-2"})` + color: ${e=>e.isSelected?"#fff":e.theme.textColors.hex(40)}; +`,eE4=(0,eL.default)(eI.Popup).withConfig({displayName:"IndustryPicker__SegmentPopup",componentId:"sc-b086a965-3"})` + width: ${e=>e.calculatedWidth?e.calculatedWidth+"px":"auto"}; +`,eE6=function(e){let{state:t,dispatch:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{"Activate"===e.type&&(null!=e.payload.value&&a({type:"update_user_work_industry_segment",value:eEW.parse(e.payload.value)}),o({type:"Collapse"}))},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(eE5,{type:"button",...s.props},ev.createElement(eE3,{isSelected:null!=t.userIndustrySegment},null!=t.userIndustrySegment?ev.createElement(eY.Z,eEK[t.userIndustrySegment]):ev.createElement(eY.Z,{id:"general.onboarding.user_segment.industry.select_an_option",defaultMessage:"Select an option"})),ev.createElement(eE2,{icon:"caret_down"})),r.expanded&&ev.createElement(eE4,{calculatedWidth:n.current?.offsetWidth??null,...i.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(eE1,{initialFocus:i.initialFocus}))))},eE8=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-e0d7c8c2-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } + + ${ekm} { + padding: 5px 0; + color: #fff; + } +`,eE7=function(e){let{value:t,children:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({stopRef:n,value:t});return ev.createElement(eE8,l.props,ev.createElement(ekm,null,a))},eE9=(0,eL.default)(eI.Menu).withConfig({displayName:"SegmentDropdownMenu__StyledMenu",componentId:"sc-7e540902-0"})` + padding: var(--menu-padding); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); +`,exe=function(e){return ev.createElement(eE9,{loop:!0,initialFocus:e.initialFocus},eEH.options.map(e=>ev.createElement(eE7,{key:e,value:e},ev.createElement(eY.Z,eEY[e]))))},ext=(0,eL.default)(tn.Icon).withConfig({displayName:"RolePicker__StyledIcon",componentId:"sc-184358ac-0"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,exa=eL.default.button.withConfig({displayName:"RolePicker__Button",componentId:"sc-184358ac-1"})` + display: flex; + align-items: center; + justify-content: space-between; + + background-color: ${e=>e.theme.appColors.hex(90)}; + + width: 360px; + padding: 10px 12px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: var(--menu-border-radius); + + &:hover, + &[aria-expanded='true'] { + ${ext} { + color: ${e=>e.theme.appColors.hex(20)}; + } + } +`,exn=(0,eL.default)(ekm).withConfig({displayName:"RolePicker__PickerSubtitle",componentId:"sc-184358ac-2"})` + color: ${e=>e.isSelected?"#fff":e.theme.textColors.hex(40)}; +`,exl=(0,eL.default)(eI.Popup).withConfig({displayName:"RolePicker__SegmentPopup",componentId:"sc-184358ac-3"})` + width: ${e=>e.calculatedWidth?e.calculatedWidth+"px":"auto"}; +`,exr=function(e){let{state:t,dispatch:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{"Activate"===e.type&&(null!=e.payload.value&&a({type:"update_user_work_role_segment",value:eEH.parse(e.payload.value)}),o({type:"Collapse"}))},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(exa,{type:"button",...s.props},ev.createElement(exn,{isSelected:null!=t.userRoleSegment},null!=t.userRoleSegment?ev.createElement(eY.Z,eEY[t.userRoleSegment]):ev.createElement(eY.Z,{id:"general.onboarding.user_segment.role.select_an_option",defaultMessage:"Select an option"})),ev.createElement(ext,{icon:"caret_down"})),r.expanded&&ev.createElement(exl,{calculatedWidth:n.current?.offsetWidth??null,...i.props,dispatch:o,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(exe,{initialFocus:i.initialFocus}))))},exo=eL.default.div.withConfig({displayName:"UserSegment__RadioContainer",componentId:"sc-a6a015a7-0"})` + display: flex; + flex-direction: column; + align-items: flex-start; + + margin-bottom: 30px; +`,exi=eL.default.div.withConfig({displayName:"UserSegment__WorkContainer",componentId:"sc-a6a015a7-1"})` + display: flex; + flex-direction: column; + align-items: flex-start; +`,exs=eL.default.input.withConfig({displayName:"UserSegment__RadioInput",componentId:"sc-a6a015a7-2"})` + height: 25px; + width: 25px; + appearance: none; + position: relative; + + &:after { + height: 15px; + width: 15px; + content: ''; + position: absolute; + + border: 0; + border-radius: 100%; + + top: 5px; + left: 5px; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:before { + height: 25px; + width: 25px; + content: ''; + position: absolute; + + border: 2px solid ${e=>e.theme.textColors.hex(40)}; + border-radius: 100%; + } + + &:hover { + cursor: pointer; + } + + &:checked { + &:after { + z-index: 2; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + } + + &:before { + border: 2px solid ${e=>e.theme.primaryColorScheme?.base}; + } + } +`,exd=eL.default.label.withConfig({displayName:"UserSegment__Row",componentId:"sc-a6a015a7-3"})` + display: flex; + + padding: 10px 18px; + margin-bottom: 5px; + width: 360px; + ${e1.UiBorderRadius.xl} + + color:#fff; + background-color: ${e=>e.isActive?e.theme.primaryColorScheme?.alpha30:""}; + + &:hover { + cursor: pointer; + background-color: ${e=>e.isActive?e.theme.primaryColorScheme?.alpha30:e.theme.primaryColorScheme?.alpha10}; + } + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; +`,exc=function(e){let{state:t,dispatch:a}=e,n=(0,ll.x)(),l=e=>{let t=eEq.parse(e.target.value);switch(t){case"education":a({type:"select_education_segment",value:t});break;case"personal":a({type:"select_personal_segment",value:t});break;case"work":a({type:"select_work_segment",value:t})}};return ev.createElement(eks,null,ev.createElement(ekc,{marginBottom:20},ev.createElement(eY.Z,{id:"general.onboarding_user_segment_copy_split",defaultMessage:"How will you use Taskade?",values:{br:ev.createElement("br",null)}})),ev.createElement(ekm,{className:"text-center",marginBottom:30},ev.createElement(eY.Z,{id:"general.onboarding_user_segment_details",defaultMessage:"We use this information to personalize your experience."})),ev.createElement(exo,null,eEq.options.map(e=>ev.createElement(exd,{key:e,isActive:t.userSegment===e},ev.createElement(exs,{type:"checkbox",name:"purpose",value:e,onChange:l,checked:t.userSegment===e}),ev.createElement("span",{className:"ml-2"},ev.createElement(eY.Z,eEG[e]))))),t.isWorkSegmentSelected&&ev.createElement("div",{className:"mb-8 flex flex-col gap-4"},ev.createElement(exi,null,ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.onboarding_user_segment_work_role",defaultMessage:"What is your primary role?"})),ev.createElement(exr,{state:t,dispatch:a})),ev.createElement(exi,null,ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.onboarding_user_segment_work_dropdown",defaultMessage:"What team are you on?"})),ev.createElement(eE6,{state:t,dispatch:a}))),ev.createElement(eku,{disabled:null==t.userSegment,onClick:()=>{null!=t.userSegment&&n.mutate({mutation:eEQ,variables:{input:{clientMutationId:(0,ld.Z)(),purpose:t.userSegment,industry:t.userIndustrySegment,role:t.userRoleSegment}}}),a({type:"next_step"})}},ev.createElement(eY.Z,{id:"general.continue",defaultMessage:"Continue"}),ev.createElement(tn.Icon,{icon:"header_nav_forward"})))},exm=(0,la.ZP)` + mutation WorkspaceUpdateMutation($input: WorkspaceUpdateInput!) { + workspaceUpdate(input: $input) { + clientMutationId + } + } +`,exu=eL.default.div.withConfig({displayName:"WorkspaceCreator__WorkspaceNameContainer",componentId:"sc-b57e0389-0"})` + display: flex; + flex-direction: column; + align-items: flex-start; + + margin-bottom: 30px; +`,exp=eL.default.div.withConfig({displayName:"WorkspaceCreator__ColorInputContainer",componentId:"sc-b57e0389-1"})` + display: flex; + flex-direction: column; + align-items: flex-start; + margin-bottom: 30px; +`,exg=eL.default.p.withConfig({displayName:"WorkspaceCreator__ColorInputLabel",componentId:"sc-b57e0389-2"})` + align-self: start; + + color: ${e=>e.theme.textColors.hex(40)}; + + font-weight: 400; + font-size: 15px; + line-height: 18px; +`,exf=function(e){let{state:t,dispatch:a}=e,n=(0,eK.Z)(),[l]=(0,cs.D)(exm);return ev.createElement(eks,null,ev.createElement(ekc,{marginBottom:30},ev.createElement(eY.Z,{id:"general.onboarding_user_workspace_copy",defaultMessage:"Create a workspace"})),ev.createElement(exu,null,ev.createElement(ekm,{marginBottom:10},ev.createElement(eY.Z,{id:"general.onboarding_workspace_name",defaultMessage:"Workspace name"})),ev.createElement(ekg,{placeholder:n.formatMessage({id:"general.onboarding_workspace_name_text_input_placeholder",defaultMessage:"e.g. Acme Corp"}),onChange:e=>{let{value:t}=e.target;a({type:"update_workspace_name",value:t})},value:t.workspaceName,autoFocus:!0})),ev.createElement(exp,null,ev.createElement(exg,null,ev.createElement(eY.Z,{id:"general.color",defaultMessage:"Color"})),ev.createElement(fc,{value:t.theme?.primaryColor??"#fff",name:"color",onChange:e=>{a({type:"update_workspace_color",primaryColor:e})}})),ev.createElement(eku,{onClick:()=>{null!=t.spaceId&&l({variables:{input:{clientMutationId:(0,ld.Z)(),spaceID:t.spaceId,color:t.theme?.primaryColor??"#fff",name:t.workspaceName}}}),a({type:"next_step"})}},ev.createElement(eY.Z,{id:"general.continue",defaultMessage:"Continue"}),ev.createElement(tn.Icon,{icon:"header_nav_forward"})))},exh=eL.default.div.withConfig({displayName:"LeftScreen__Backdrop",componentId:"sc-959c9a81-0"})` + display: flex; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + pointer-events: none; + opacity: 0; + overflow: hidden; + z-index: 1; + + animation-name: fadeInA; + animation-duration: 1s; + animation-fill-mode: forwards; + animation-iteration-count: 1; + + @keyframes fadeInA { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } + } +`,exy=eL.default.div.withConfig({displayName:"LeftScreen__Orb",componentId:"sc-959c9a81-1"})` + position: absolute; + width: 334.06px; + height: 453.36px; + left: 50%; + top: 20%; + opacity: 0; + z-index: 2; + + background: radial-gradient( + 170.19% 109.67% at 50% 28.59%, + rgba(127, 8, 77, 0.46) 0%, + rgba(119, 8, 73, 0.46) 35.94%, + rgba(150, 31, 106, 0.46) 83.08% + ); + mix-blend-mode: lighten; + filter: blur(48px); + border-radius: 275.037px; + transform: rotate(14.35deg); + + animation-name: fadeInB, moveupdown; + animation-duration: 1s, 13s; + animation-fill-mode: forwards; + animation-iteration-count: 1, infinite; + + @keyframes fadeInB { + 0% { + opacity: 0; + } + + 100% { + opacity: 0.8; + } + } + + @keyframes moveupdown { + 0% { + transform: translateY(0) rotate(0); + } + 50% { + transform: translateY(200px) rotate(90deg); + } + 100% { + transform: translateY(0) rotate(0); + } + } +`,exb=function(e){let{state:t,dispatch:a,currentUser:n}=e;return ev.createElement(exv,null,ev.createElement(exk,null,ev.createElement(exx,null,ev.createElement(lT.nV,null)),ev.createElement(exE,null,(()=>{switch(t.currentStepNumber){case 1:return ev.createElement(eEV,{state:t,dispatch:a,currentUser:n});case 2:return ev.createElement(exc,{state:t,dispatch:a});case 3:return ev.createElement(exf,{state:t,dispatch:a});case 4:return ev.createElement(eEn,{state:t,dispatch:a});case 5:return ev.createElement(ekL,{state:t,dispatch:a});case 6:return ev.createElement(ekZ,{state:t,dispatch:a})}})()),6!==t.currentStepNumber&&ev.createElement(ev.Fragment,null,ev.createElement(eEo,{currentStep:t.currentStepNumber}),ev.createElement(exh,null,ev.createElement(exy,null)))))},exv=eL.default.div.withConfig({displayName:"LeftScreen__Container",componentId:"sc-959c9a81-2"})` + @media (max-width: 1200px) { + width: 100%; + } + + display: flex; + justify-content: center; + + min-height: 100vh; + width: 100%; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,exk=eL.default.div.withConfig({displayName:"LeftScreen__Wrapper",componentId:"sc-959c9a81-3"})` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + + width: 50%; + padding-bottom: 120px; +`,exE=eL.default.div.withConfig({displayName:"LeftScreen__StepWrapper",componentId:"sc-959c9a81-4"})``,exx=eL.default.div.withConfig({displayName:"LeftScreen__Logo",componentId:"sc-959c9a81-5"})` + position: relative; + margin: 20px 0 40px; + z-index: 2; + + & svg { + height: 37px; + } + + & svg path#taskade { + fill: ${e=>e.theme.appColors.hex(0)}; + } +`,ex_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnboardingAccountQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"default"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"myAccounts"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"google"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]},exw={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnboardingOwnerMembershipsQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"role"},value:{kind:"StringValue",value:"owner",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"membershipType"},value:{kind:"EnumValue",value:"space"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"invite_token"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edit"}}]}}]}}]}}]}}]}}]}}]},exN={currentStepNumber:1,isWorkSegmentSelected:!1,emailInvites:[{email:"",role:"collaborator"},{email:"",role:"collaborator"},{email:"",role:"collaborator"}],selectedTemplateDocumentIds:["SeeSGKPsb6ZS3rtS"]},exC=(e,t)=>{switch(t.type){case"next_step":return{...e,currentStepNumber:e.currentStepNumber+1};case"previous_step":return{...e,currentStepNumber:e.currentStepNumber-1};case"update_space_info":{let{spaceId:a,primaryColor:n,spaceInviteToken:l}=t;return{...e,spaceId:a,spaceInviteToken:l,theme:{primaryColor:n,isNightMode:!0}}}case"update_user_full_name":{let{value:a}=t;return{...e,userDisplayName:a}}case"select_education_segment":return{...e,userSegment:"education",isWorkSegmentSelected:!1};case"select_personal_segment":return{...e,userSegment:"personal",isWorkSegmentSelected:!1};case"select_work_segment":return{...e,userSegment:"work",isWorkSegmentSelected:!0};case"update_user_work_industry_segment":{let{value:a}=t;return{...e,userIndustrySegment:a}}case"update_user_work_role_segment":{let{value:a}=t;return{...e,userRoleSegment:a}}case"select_user_work_team_size_segment":{let{value:a}=t;return{...e,userTeamSizeSegment:a}}case"update_workspace_color":{let{primaryColor:a}=t;return{...e,theme:{primaryColor:a,isNightMode:!0}}}case"update_workspace_name":{let{value:a}=t;return{...e,workspaceName:a}}case"update_email_invite_address":{let{value:a,index:n}=t;return(0,es.ZP)(e,e=>{if(e.emailInvites?.[n]==null)return e;e.emailInvites[n].email=a})}case"update_email_invite_role":{let{role:a,index:n}=t;return(0,es.ZP)(e,e=>{if(e.emailInvites?.[n]==null)return e;e.emailInvites[n].role=a})}case"select_template":{let{documentId:a}=t,{selectedTemplateDocumentIds:n}=e;if(n.includes(a))return{...e,selectedTemplateDocumentIds:n.filter(e=>e!==a)};return{...e,selectedTemplateDocumentIds:[...n,a]}}}},exM=function(){let[e,t]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:exN;return ev.useReducer(exC,e)}(),a=(0,eF.k6)(),{data:n,loading:l,error:r}=(0,eB.a)(exw,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),{data:o,loading:i}=(0,eB.a)(ex_),s=o?.me,d=s?.email;return(ev.useEffect(()=>{null!=d&&void 0!==fpr&&fpr("referral",{email:d})},[d]),ev.useEffect(()=>{1===e.currentStepNumber&&o?.myAccounts?.google!=null&&t({type:"next_step"})},[o?.myAccounts?.google,t,e.currentStepNumber]),ev.useEffect(()=>{if(l||null==n||null==n.memberships||0===n.memberships.edges.length)return;let e=n.memberships.edges[0];null!=e&&t({type:"update_space_info",spaceId:e.node.space.id,primaryColor:e.node.space.color,spaceInviteToken:e.node.space?.invite_token?.edit})},[n,t,l]),null!=r)?(a.push("/"),null):i?ev.createElement(eI.Spinner,null):null==s?(a.push("/"),null):null==e.theme?ev.createElement(eI.Spinner,null):ev.createElement(eI.ThemeProvider,{theme:e.theme},ev.createElement("div",{className:"min-h-screen"},ev.createElement("div",{className:"flex h-full items-center justify-center"},ev.createElement(exb,{state:e,dispatch:t,currentUser:s}))))};class exS extends Error{description;constructor(e,t){super(e),this.description=t}}let exI=(0,te.Em)({id:"general.workspace_required",defaultMessage:"Workspace Required"}),exD=(0,te.Em)({id:"general.spaces.at_least_one_workspace_to_move_copy_save_agents",defaultMessage:"You must have at least one workspace with edit permission to copy, move or create agents."}),exT={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PublicSpaceAgentCopyMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PublicSpaceAgentCopyInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicSpaceAgentCopy"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"agent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]},ex$=(0,lb.C)({context:{publicSpaceAgentId:null,workspaceTrees:null,memberships:null,error:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"copydialog",initial:"loading",states:{loading:{invoke:{id:"loadWorkspaceTrees",src:"loadWorkspaceTrees",onDone:[{actions:"handleWorkspaceTreesLoaded",target:"#copydialog.loaded"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},loaded:{always:[{cond:"isCopying",target:"#copydialog.active"},{target:"#copydialog.erred"}]},active:{on:{COPY:{target:"#copydialog.copying"}}},copying:{invoke:{id:"copying",src:"copying",onDone:[{target:"#copydialog.end"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},erred:{},end:{entry:"exit"}}},{guards:{isCopying:e=>{let{publicSpaceAgentId:t}=e;return null!=t}},actions:{handleErred:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleWorkspaceTreesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.workspaceTrees=t.data.workspaceTrees,e.memberships=t.data.memberships,e)))}}),exP=function(e){let{publicSpaceAgentId:t,exit:a}=e,n=(0,e$.useDispatch)(),l=(0,eK.Z)(),r=ev.useMemo(()=>({publicSpaceAgentId:t}),[t]),o=(0,ll.x)(),[i]=(0,cs.D)(exT),[s,d]=(0,ls.e)(ex$,{actions:{exit:()=>{a()}},context:r,services:{copying:async(e,a)=>{let{memberships:l}=e,{spaceId:r}=a.payload;if(null==l)throw new ei.HttpError({code:"BAD_REQUEST",message:"Memberships required"});let o=l.find(e=>e.space.id===r);if(null==o)throw new ei.HttpError({code:"BAD_REQUEST",message:"Membership required"});if(null==t)throw new ei.HttpError({code:"BAD_REQUEST",message:"Public Space Agent ID required"});let s=(0,ld.Z)();await i({variables:{input:{clientMutationId:s,publicSpaceAgentId:t,spaceId:r}}});let d=function(e){let t=e.space;(0,ei.assert)(null!=t);let a=`agent-copied-to-${t.id}-${(0,ld.Z)()}`,n=e.space.parent_membership,l=`/spaces/${t.id}`;return null==n&&t.is_subspace&&(l=`/subspaces/${t.id}`),null!=n&&t.is_subspace&&(l=`/spaces/${n.space.id}/subspaces/${t.id}`),{uid:a,position:"br",autoDismiss:5,dismissible:!1,children:ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.copy_agent_success_notification",defaultMessage:"Agent has been copied to {toSpaceName}",values:{space:e=>ev.createElement(sC.rU,{to:`${l}/agents`},e),toSpaceName:t.name}}))}}(o);n((0,l3.success)(d))},loadWorkspaceTrees:async()=>{let e=await o.query({query:gT,fetchPolicy:"network-only"}),t=e.errors?.[0];if(null!=t)throw t;let a=e.data?.me?.memberships??[],n=[];for(let e of a)null!=e&&null==e.space.archived_at&&n.push(e);if(0===n.length)throw new exS(l.formatMessage(exI),l.formatMessage(exD));return{workspaceTrees:pI(n),memberships:n}}}}),c=ev.useCallback(()=>{a()},[a]),m=ev.useCallback(e=>{d({type:"COPY",payload:{spaceId:e.id,spaceName:e.name}})},[d]);if(s.matches("loading")||s.matches("end")||s.matches("copying"))return ev.createElement("div",{className:"p-16"},ev.createElement(eI.Spinner,{width:400}));if(s.matches("active"))return ev.createElement("div",{className:"flex max-h-96 w-full max-w-sm flex-col gap-4 rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 p-8"},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",null,ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.copy_agent",defaultMessage:"Copy Agent"})),ev.createElement("p",{className:"mb-5 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.copy_agent.description",defaultMessage:"Choose a workspace or folder to copy the agent to."}))),ev.createElement("div",{className:"mb-2"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.copy_to",defaultMessage:"Copy To"})))),ev.createElement(p3,{onSelect:m,workspacesTree:s.context.workspaceTrees??[]}));let u=s.context.error?.message??"Unknown Error",p=s.context.error instanceof exS?s.context.error.description:null;return ev.createElement("div",{className:"flex flex-col items-center p-16"},ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},u),null!=p&&ev.createElement("p",{className:"text-sm"},p),ev.createElement("button",{onClick:c,className:"mt-7 w-96 rounded-xl bg-primary p-3 font-semibold uppercase hover:bg-primary/90"},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})))},exF=function(e){let{state:t,onClose:a}=e;return t.isOpen?ev.createElement(eI.ModalDialog,{close:a,isOpen:t.isOpen},e=>{let{exit:a}=e;return ev.createElement(exP,{publicSpaceAgentId:t.publicSpaceAgentId,exit:a})}):null},exA=[{name:"general",messageDescriptor:{id:"general.general",defaultMessage:"General"},iconName:"agent_edit"},{name:"tools",messageDescriptor:{id:"general.tools",defaultMessage:"Tools"},iconName:"agent_tools"},{name:"knowledge",messageDescriptor:{id:"general.knowledge",defaultMessage:"Knowledge"},iconName:"agent_knowledge"},{name:"commands",messageDescriptor:{id:"general.commands",defaultMessage:"Commands"},iconName:"agent_commands"}],exR=function(e){let{selected:t,tab:a,role:n,onClick:l}=e;return ev.createElement("div",{role:n,onClick:l,className:og()("truncated flex cursor-pointer items-center justify-items-stretch gap-3 rounded-xl px-3 py-1.5 text-sm transition-colors duration-300 ease-in-out hover:bg-appcolor-300",t?"bg-appcolor-200 text-primary":"bg-appcolor-100 text-appcolor-800")},ev.createElement(tn.Icon,{icon:a.iconName,className:"flex-none"}),ev.createElement("span",{className:"w-full overflow-hidden text-ellipsis"},ev.createElement(eY.Z,a.messageDescriptor)))},exj=function(e){return ev.createElement(eI.TabList,{...e,className:"flex gap-1"},exA.map(e=>ev.createElement(exR,{key:e.name,tab:e,value:e.name})))},exO=function(e){let{agent:t}=e,a=t.data.commands;return ev.createElement("div",{className:"mt-10 flex flex-col gap-2"},a.map(e=>ev.createElement("button",{key:e.id,onClick:()=>window.open("/signup","_blank","noopener,noreferrer"),className:"group/delete flex items-center gap-4 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 pr-5 text-left text-left text-sm"},ev.createElement("div",{className:"flex w-full flex-col gap-1 py-3 pl-4 "},ev.createElement("h3",{className:"font-medium text-appcolor-800"},e.name),ev.createElement("p",{className:"line-clamp-1 flex-wrap whitespace-normal break-all text-left text-appcolor-500"},e.prompt),ev.createElement("div",{className:"mt-1 flex gap-1"},ev.createElement("div",{className:og()("flex items-center gap-1 rounded-full bg-appcolor-300 px-2 py-0.5 text-xs text-appcolor-600",{"opacity-50":!e.searchToolEnabled})},ev.createElement(tn.Icon,{className:"shrink-0 scale-90 text-success",icon:"agent_browsing"}),ev.createElement(eY.Z,{id:"agent.web_search",defaultMessage:"Web Search"})),ev.createElement("div",{className:og()("flex items-center gap-1 rounded-full bg-appcolor-300 px-2 py-0.5 text-xs text-appcolor-600",{"opacity-50":!e.isBackgroundJob})},ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"dd_check"}),ev.createElement(eY.Z,{id:"agent.background_task",defaultMessage:"Background Task"})),ev.createElement("div",{className:"flex items-center gap-1 rounded-full bg-appcolor-300 px-2 py-0.5 text-xs text-appcolor-600 opacity-50"},ev.createElement(tn.Icon,{className:"shrink-0 scale-90",icon:"agent_knowledge"}),ev.createElement(eY.Z,{id:"agent.knowledge",defaultMessage:"Knowledge"})))))))},exU=function(e){let{agent:t}=e,a=function(){let e=(0,eK.Z)();return[{value:"default",label:e.formatMessage({id:"default",defaultMessage:"Default"})},{value:"creative",label:e.formatMessage({id:"general.ai_chat_persona_creative",defaultMessage:"\uD83C\uDFA8 Creative"})},{value:"inspiring",label:e.formatMessage({id:"general.ai_chat_persona_inspiring",defaultMessage:"\uD83D\uDCA1 Inspiring"})},{value:"casual",label:e.formatMessage({id:"general.ai_chat_persona_casual",defaultMessage:"\uD83D\uDE0E Casual"})},{value:"confident",label:e.formatMessage({id:"general.ai_chat_tone_confident",defaultMessage:"\uD83D\uDCBC Confident"})},{value:"authoritative",label:e.formatMessage({id:"general.ai_chat_tone_authoritative",defaultMessage:"\uD83D\uDC51 Authoritative"})},{value:"friendly",label:e.formatMessage({id:"general.ai_chat_tone_friendly",defaultMessage:"\uD83D\uDE0A Friendly"})},{value:"empathetic",label:e.formatMessage({id:"general.ai_chat_tone_empathetic",defaultMessage:"\uD83D\uDC95 Empathetic"})},{value:"optimistic",label:e.formatMessage({id:"general.ai_chat_tone_optimistic",defaultMessage:"\uD83C\uDF08 Optimistic"})},{value:"formal",label:e.formatMessage({id:"general.ai_chat_tone_formal",defaultMessage:"\uD83D\uDC54 Formal"})},{value:"serious",label:e.formatMessage({id:"general.ai_chat_tone_serious",defaultMessage:"\uD83D\uDC69‍\uD83D\uDCBC Serious"})},{value:"warm",label:e.formatMessage({id:"general.ai_chat_tone_warm",defaultMessage:"\uD83D\uDD25 Warm"})},{value:"humourous",label:e.formatMessage({id:"general.ai_chat_tone_humourous",defaultMessage:"\uD83D\uDE02 Humourous"})},{value:"informal",label:e.formatMessage({id:"general.ai_chat_tone_informal",defaultMessage:"\uD83D\uDC5F Informal"})},{value:"clinical",label:e.formatMessage({id:"general.ai_chat_tone_clinical",defaultMessage:"\uD83D\uDC89 Clinical"})},{value:"playful",label:e.formatMessage({id:"general.ai_chat_tone_playful",defaultMessage:"\uD83C\uDF88 Playful"})},{value:"emotional",label:e.formatMessage({id:"general.ai_chat_tone_emotional",defaultMessage:"\uD83D\uDE2D Emotional"})},{value:"sympathetic",label:e.formatMessage({id:"general.ai_chat_tone_sympathetic",defaultMessage:"\uD83D\uDE22 Sympathetic"})},{value:"tentative",label:e.formatMessage({id:"general.ai_chat_tone_tentative",defaultMessage:"\uD83D\uDC63 Tentative"})},{value:"cold",label:e.formatMessage({id:"general.ai_chat_tone_cold",defaultMessage:"\uD83E\uDDCA Cold"})},{value:"cynical",label:e.formatMessage({id:"general.ai_chat_tone_cynical",defaultMessage:"\uD83D\uDE12 Cynical"})},{value:"ironic",label:e.formatMessage({id:"general.ai_chat_tone_ironic",defaultMessage:"\uD83D\uDE43 Ironic"})},{value:"sarcastic",label:e.formatMessage({id:"general.ai_chat_tone_sarcastic",defaultMessage:"\uD83D\uDE0F Sarcastic"})},{value:"pessimistic",label:e.formatMessage({id:"general.ai_chat_tone_pessimistic",defaultMessage:"☔ Pessimistic"})}]}(),n=ev.useMemo(()=>new Map(a.map(e=>[e.value,e])),[a]),l=t.data?.tone||null,r=null!=l?n.get(l):null;return ev.createElement("div",{className:"mt-8 flex w-full flex-col gap-4"},ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.name",defaultMessage:"Give your agent a distinct name for effortless recognition, especially useful in /ai slash commands within Taskade's Project Editor. A unique name simplifies interactions and personalizes your AI experience."}))},ev.createElement(eY.Z,{id:"agent.name",defaultMessage:"Name"})),ev.createElement("input",{className:"flex rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 px-3 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",type:"text",required:!0,value:t.name})),ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.instructions",defaultMessage:"Define the AI Agent's role, such as a Marketer, and desired response style. Detail tasks like understanding demographics, crafting campaigns, and optimizing strategies. Your guidance will shape the Agent's focus on data-driven initiatives for brand awareness, engagement, and lead generation, ensuring tailored and effective responses."}))},ev.createElement(eY.Z,{id:"agent.instructions",defaultMessage:"Instructions"})),ev.createElement("div",{className:"flex flex-col rounded-xl border border-solid border-appcolor-400 bg-appcolor-100 text-sm text-appcolor-700"},ev.createElement(Dx.Z,{className:"resize-vertical bg-transparent px-3 py-3 placeholder:text-appcolor-500",minRows:10,maxRows:16,value:t.data.description}))),l&&ev.createElement("div",{className:"mb-10 flex w-1/2 gap-2"},ev.createElement("div",{className:"flex w-full flex-col gap-2"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"max-w-xs"},ev.createElement(eY.Z,{id:"agent.tooltip.tone",defaultMessage:"Choose the tone of your agent's interactions, ranging from professional and formal to casual and friendly. This setting tailors the communication style to suit your audience and context, ensuring the agent's responses align with the desired approach."}))},ev.createElement(eY.Z,{id:"agent.tone",defaultMessage:"Tone"})),ev.createElement("div",{className:"flex cursor-pointer items-center rounded-lg border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-1 text-left text-sm"},r?.label))))},exZ=function(){return ev.createElement("div",{className:"mt-8 flex flex-col gap-2"},ev.createElement("div",{className:"overflow-x-auto"},ev.createElement("table",{className:"min-w-full table-auto"},ev.createElement("thead",{className:"border-b border-appcolor-300"},ev.createElement("tr",null,ev.createElement("th",{className:"w-10/12 py-3 text-left text-xs font-medium uppercase tracking-wider text-appcolor-500"},ev.createElement(Uc,{tooltipContent:ev.createElement("div",{className:"w-56"},ev.createElement(eY.Z,{id:"agent.tooltip.filename",defaultMessage:"Enhance your agent's knowledge with documents, links, or video transcripts."}))},ev.createElement(eY.Z,{id:"agent.filename",defaultMessage:"Filename"}))))),ev.createElement("tbody",null,ev.createElement("tr",{className:"border-b border-appcolor-300"},ev.createElement("td",{className:"w-full truncate whitespace-normal px-8 py-2 text-center text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.public.knowledge_description",defaultMessage:"Copy the agent to your workspace to add knowledge. Upload documents, spreadsheets or links to train your agent. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}})))))))},exL=function(){return ev.createElement("div",{className:"mt-10 flex flex-col gap-2"},ev.createElement("div",{className:"flex flex-col gap-2"},ev.createElement("button",{onClick:()=>window.open("/signup","_blank","noopener,noreferrer"),className:"flex items-center gap-4 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-3 text-left"},ev.createElement(tn.Icon,{className:"shrink-0 text-success",icon:"agent_browsing"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.web_search",defaultMessage:"Web Search"})),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.can_be_enabled_in_commands_to_access_information_from_the_web",defaultMessage:"Can be enabled with each commands to access information from the web."})))),ev.createElement("button",{onClick:()=>window.open("/signup","_blank","noopener,noreferrer"),className:"flex items-center gap-4 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-3 text-left"},ev.createElement(lT._d,{className:"shrink-0"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.wolfram_alpha",defaultMessage:"WolframAlpha"}),ev.createElement("span",{className:"ml-2 flex h-5 items-center rounded-full bg-appcolor-200 px-2 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"ai.coming_soon",defaultMessage:"Coming soon"}))),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.use_wolframalpha_state_of_the_art_computational_intelligence_engine",defaultMessage:"Use WolframAlpha's state-of-the-art computational intelligence engine."})))),ev.createElement("button",{onClick:()=>window.open("/signup","_blank","noopener,noreferrer"),className:"flex items-center gap-4 whitespace-normal rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-5 py-3 text-left"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"dd_date"}),ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",{className:"text-medium flex items-center text-sm"},ev.createElement(eY.Z,{id:"agent.addons",defaultMessage:"Add-ons"}),ev.createElement("span",{className:"ml-2 flex h-5 items-center rounded-full bg-appcolor-200 px-2 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"ai.coming_soon",defaultMessage:"Coming soon"}))),ev.createElement("div",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.use_natural_language_to_dynamically)add)dates_assign_tasks_and_other_addons",defaultMessage:"Use natural language to dynamically add dates, assign tasks, and other add-ons."}))))))},exB=eL.default.div.withConfig({displayName:"PublicSpaceAgent__LogoWrapper",componentId:"sc-cab1738e-0"})` + & svg { + & > path:last-child { + fill: ${e=>e.theme.appColors.hex(10)}; + } + } +`,exz=function(e){let{publicSpaceAgent:t}=e,a=(0,eK.Z)(),n=hR.Sx.safeParse(t.data),[l,r]=ev.useState("general"),[o,i]=ev.useState({isOpen:!1}),s=ev.useCallback(()=>{i({isOpen:!0,publicSpaceAgentId:t.id})},[t.id]),d=ev.useCallback(()=>{i({isOpen:!1})},[]);if(!n.success)return null;let c=n.data.commands;return ev.createElement("div",{className:"flex w-full flex-col items-center justify-center"},ev.createElement("div",{className:"flex w-full flex-grow gap-5 overflow-auto p-5"},ev.createElement("div",{className:"w-1/2 overflow-auto px-5 pt-10"},ev.createElement("div",{className:"mb-auto mt-auto flex flex-col items-center justify-center"},ev.createElement("div",{className:"flex h-10 min-h-fit w-10 min-w-fit scale-150 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(Tc,{agent:n,size:"lg"})),ev.createElement("h1",{className:"mt-6 text-lg font-bold text-appcolor-1000"},t.name)),ev.createElement("div",{className:"mx-auto mt-8 flex w-fit rounded-full border border-solid border-appcolor-300 bg-appcolor-100 p-1.5"},ev.createElement(exj,{value:l,onChange:r,className:"flex flex-col gap-y-1"})),ev.createElement(eI.TabPanelSwitch,{className:"flex w-8/12 flex-col gap-4 overflow-y-auto pr-5 pt-3",value:l},ev.createElement(exU,{value:"general",agent:t}),ev.createElement(exL,{value:"tools"}),ev.createElement(exO,{value:"commands",agent:t}),ev.createElement(exZ,{value:"knowledge"}))),ev.createElement("div",{className:"flex w-1/2 flex-col justify-end gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 p-5"},ev.createElement("div",{className:"m-auto flex max-w-sm flex-col items-center py-4 text-center"},ev.createElement(lT.fJ,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.start_conversation",defaultMessage:"Start a conversation"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agents.ask_question_to_get_insights_based_on_your_agents_description_persona_tone_and_access_to_knowledge",defaultMessage:"Ask questions to get insights based on your agent's description, persona, tone, and access to knowledge."}))),ev.createElement("div",{className:"grid w-full grid-cols-2 gap-2 pb-2"},c.map(e=>ev.createElement("button",{className:"flex items-start gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-3 text-sm text-appcolor-600 transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800",type:"button",key:e.id,onClick:()=>window.open("/signup","_blank","noopener,noreferrer")},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_commands"}),ev.createElement("div",{className:"flex flex-col gap-1 text-left"},ev.createElement("p",{className:"text-appcolor-1000"},e.name),ev.createElement("p",{className:"line-clamp-1 flex-wrap whitespace-normal break-all text-left text-appcolor-500"},e.prompt))))),ev.createElement("div",{className:"rounded-xl border border-solid border-appcolor-400 bg-appcolor-100"},ev.createElement("div",{className:"flex flex-col gap-1 text-sm text-appcolor-700"},ev.createElement("div",{className:"flex"},ev.createElement(Dx.Z,{className:"w-full bg-transparent p-4",placeholder:a.formatMessage({id:"agent.ask_me_anything",defaultMessage:"Ask me anything..."}),minRows:2,maxRows:5,onClick:()=>window.open("/signup","_blank","noopener,noreferrer")})),ev.createElement("div",{className:"flex px-4 pb-3"},ev.createElement("button",{type:"button",className:"flex items-center gap-1 rounded-full border border-solid border-appcolor-400 bg-appcolor-200 px-2 py-1 pr-3 text-sm text-appcolor-800 hover:border-appcolor-500 hover:bg-appcolor-300",onClick:()=>window.open("/signup","_blank","noopener,noreferrer")},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"scale-90"}),ev.createElement(eY.Z,{id:"agent.view_prompts",defaultMessage:"View prompts"})),ev.createElement("button",{className:"ml-auto flex items-center text-appcolor-500 hover:text-primary",onClick:()=>window.open("/signup","_blank","noopener,noreferrer")},ev.createElement(tn.Icon,{icon:"message_send"}))))))),ev.createElement("div",{className:"mt-auto flex w-full items-center justify-between border-t border-appcolor-300 px-5 py-4"},ev.createElement("a",{href:"https://www.taskade.com",rel:"noopener noreferrer",target:"_blank"},ev.createElement(exB,null,ev.createElement(lT.fl,null))),ev.createElement("button",{type:"button",className:"flex items-center whitespace-nowrap rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 px-4 py-2 text-sm font-medium transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-0",onClick:s},ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"agent.copy_agent",defaultMessage:"Copy agent"})))),ev.createElement(exF,{state:o,onClose:d}))},exV={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PublicSpaceAgentScreenQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PublicSpaceAgentFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicSpaceAgent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}}]},exq=function(){let{publicSpaceAgentIdWithSlug:e}=(0,eF.UO)(),t=ev.useMemo(()=>e.split("-").pop(),[e]),a=(0,eB.a)(exV,null!=t?{variables:{filterby:{publicSpaceAgentId:t}}}:{skip:null==t}),n=ev.useMemo(()=>a.loading||null==a.data?null:a.data.publicSpaceAgent,[a.data,a.loading]);return ev.createElement("div",{className:"flex h-screen"},null!=n&&ev.createElement(exz,{publicSpaceAgent:n}))},exW=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-a36fc5e4-0"})` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background: #000; + height: 100vh; +`,exH=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-a36fc5e4-1"})` + display: flex; + flex-direction: column; + width: 100%; + max-width: 500px; + margin: 0 20px; +`,exG=eL.default.div.withConfig({displayName:"styled__Body",componentId:"sc-a36fc5e4-2"})` + display: flex; + flex-direction: column; + padding: 30px 50px; + + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 20px; + box-sizing: border-box; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); +`,exK=eL.default.button.withConfig({displayName:"styled__SubmitButton",componentId:"sc-a36fc5e4-3"})` + display: flex; + width: 100%; + min-height: 38px; + align-items: center; + justify-content: center; + border-radius: 10px; + background: #ff2d60; + color: white; + margin-top: 20px; + font-weight: 500; + border: none; + cursor: pointer; + + &:hover { + color: white; + background: #ff5780; + } + + &:active { + outline: 0; + } +`,exY=eL.default.div.withConfig({displayName:"styled__ButtonContainer",componentId:"sc-a36fc5e4-4"})` + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: flex-end; + + padding-bottom: 20px; +`,exQ=eL.default.div.withConfig({displayName:"styled__Heading",componentId:"sc-a36fc5e4-5"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,exJ=eL.default.h1.withConfig({displayName:"styled__Title",componentId:"sc-a36fc5e4-6"})` + ${e1.ArticleTypography.heading3} + color: ${e=>e.theme.appColors.hex(10)}; + margin: 0 0 2px; +`,exX=eL.default.div.withConfig({displayName:"styled__Footer",componentId:"sc-a36fc5e4-7"})` + display: flex; + flex-direction: column; +`,ex0=eL.default.div.withConfig({displayName:"styled__NoAccount",componentId:"sc-a36fc5e4-8"})` + display: flex; + ${e1.UiTypography.sm}; + margin-top: 20px; + color: ${e=>e.theme.textColors.hex(50)}; + text-align: center; + justify-content: center; + padding-bottom: 20px; + + & > a { + padding: 0; + margin: 0 0 0 5px; + color: ${e=>e.theme.textColors.hex(10)}; + cursor: pointer; + border-bottom: 1px solid transparent; + + &:hover { + border-bottom: 1px solid ${e=>e.theme.appColors.hex(60)}; + } + + &:active { + outline: 0; + } + } +`,ex1=eL.default.div.withConfig({displayName:"styled__ErrorMessage",componentId:"sc-a36fc5e4-9"})` + display: flex; + ${e1.UiTypography.sm}; + /* todo (dionis@taskade.com) missing danger background color */ + background: ${e=>e.theme.isNightMode?"rgba(235, 100, 97, 0.10)":"#FAE5E5"}; + border: 1px solid ${eI.ThemeColors.danger}; + color: ${eI.ThemeColors.danger}; + padding: ${e=>e.$padding??"8px 12px"}; + line-height: 22px; + border-radius: 10px; + margin: ${e=>e.$margin??"0px"}; +`,ex2=function(){let[e,t]=ev.useState(!1),{search:a}=(0,eF.TH)(),n=new URLSearchParams(a).get("redirect")??null,l=ev.useMemo(()=>({email:"",redirect:n}),[n]),{register:r,setError:o,formState:{errors:i},handleSubmit:s}=(0,sz.cI)({defaultValues:l}),d=async(e,a)=>{if(null!=a){a.preventDefault(),t(!0);try{let a=await fetch("/saml/sso/login",{credentials:"same-origin",method:"POST",body:JSON.stringify({...e,redirect:n}),headers:{"Content-Type":"application/json",Accept:"application/json"}}),l=await a.json();l.ok||o("email",{type:"custom",message:l.details}),t(!1)}catch(e){a.target.submit()}}};return ev.createElement(exW,null,ev.createElement(_2,{title:"Sign in with Single Sign On",ogTitle:"Sign in with Single Sign On"}),ev.createElement(exH,null,ev.createElement(exG,null,ev.createElement(_1,{to:"/"}),ev.createElement("form",{method:"POST",action:"/saml/sso/login",onSubmit:s(d)},ev.createElement(exQ,null,ev.createElement(exJ,null,"Sign in with Single Sign On")),null!=i.email&&ev.createElement(ex1,null,i.email.message),ev.createElement(ou,{...r("email"),placeholder:"name@company.com",type:"email",required:!0}),ev.createElement("input",{...r("redirect"),type:"hidden"}),ev.createElement(exY,null,ev.createElement(exK,{disabled:e},e?ev.createElement(eI.Spinner,{color:"#ffffff",delay:0,height:26}):"Sign In")))),ev.createElement(exX,null,ev.createElement(ex0,null,ev.createElement(sC.rU,{to:"/login"},"Sign In without Single Sign On")))))},ex5=function(){let{pathname:e}=(0,eF.TH)();return(0,ev.useEffect)(()=>{window.scrollTo(0,0)},[e]),null},ex3=function(e){let{peopleGroupName:t,role:a}=e;switch(a){case"collaborator":return ev.createElement(eY.Z,{id:"general.everyone_in_people_group_can_edit",defaultMessage:"{peopleGroupName} can edit",values:{peopleGroupName:t}});case"participant":return ev.createElement(eY.Z,{id:"general.everyone_in_people_group_can_check",defaultMessage:"{peopleGroupName} can check",values:{peopleGroupName:t}});case"viewer":return ev.createElement(eY.Z,{id:"general.everyone_in_people_group_can_view",defaultMessage:"{peopleGroupName} can view",values:{peopleGroupName:t}});default:return null}},ex4=function(e){let{peopleGroupName:t,role:a}=e;switch(a){case"collaborator":return ev.createElement(eY.Z,{id:"general.everyone_in_people_group_can_edit",defaultMessage:"{peopleGroupName} can edit",values:{peopleGroupName:t}});case"participant":return ev.createElement(eY.Z,{id:"general.everyone_in_people_group_can_check",defaultMessage:"{peopleGroupName} can check",values:{peopleGroupName:t}});case"viewer":return ev.createElement(eY.Z,{id:"general.everyone_in_people_group_can_view",defaultMessage:"{peopleGroupName} can view",values:{peopleGroupName:t}});default:return ev.createElement(eY.Z,{id:"general.no_access",defaultMessage:"No access"})}},ex6=function(e){let{value:t,selected:a,peopleGroupName:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({name:"role",value:t??void 0,stopRef:l});return ev.createElement("div",{...r.props,className:"flex cursor-pointer px-1.5 py-2 text-sm text-textcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200"},ev.createElement("div",{className:"flex w-10 flex-none flex-col items-center justify-start"},a&&ev.createElement(tn.Icon,{icon:"dd_check",width:20,height:20})),ev.createElement("div",{className:"flex-auto flex-col"},ev.createElement("div",{className:"font-medium"},ev.createElement(ex4,{peopleGroupName:n,role:t})),ev.createElement("div",{className:"mt-0.5 text-xs text-textcolor-500"},ev.createElement(ex3,{peopleGroupName:n,role:t}))))},ex8=function(e){let{value:t,menuGroupDispatch:a,initialFocus:n,peopleGroupName:l}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{className:"max-w-xs rounded-lg border border-solid border-appcolor-300 bg-appcolor-0 py-2",initialFocus:n,loop:!0},ev.createElement(ex6,{value:null,selected:null==t,peopleGroupName:l}),ev.createElement(ex6,{value:"collaborator",selected:"collaborator"===t,peopleGroupName:l}),ev.createElement(ex6,{value:"participant",selected:"participant"===t,peopleGroupName:l}),ev.createElement(ex6,{value:"viewer",selected:"viewer"===t,peopleGroupName:l})))},ex7=function(e){let{peopleGroup:t,space:a,onChange:n,value:l}=e,r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=(0,eI.useMenuButton)({ref:r,state:i,dispatch:s}),c=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:i,placement:"bottom"}),m=ev.useCallback(e=>{"Activate"===e.type&&(n?.(a,t,e.payload.value??null),s({type:"Collapse"}))},[n,t,a]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...d.props,className:og()("flex flex-shrink-0 items-center justify-between gap-0.5 rounded-full border border-solid border-appcolor-300 py-1 pl-2.5 pr-1.5 text-xs hover:cursor-pointer hover:border-appcolor-400","inherited"===e.value?"bg-appcolor-200 text-textcolor-500":"bg-appcolor-200 text-textcolor-900")},ev.createElement("div",{className:"flex flex-auto items-center justify-center"},ev.createElement("span",{className:"text-center"},ev.createElement(ex4,{peopleGroupName:t.name,role:l}))),ev.createElement(tn.Icon,{icon:"caret_down",className:"h-3 w-3"})),i.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:s,modal:!0},ev.createElement(ex8,{value:l,menuGroupDispatch:m,initialFocus:c.initialFocus,peopleGroupName:t.name})))},ex9={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"scim_token"}},{kind:"Field",name:{kind:"Name",value:"preferences"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"spaces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"peopleGroups"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"spaceVisibilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"peopleGroupMembers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"people"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},e_e=(0,la.ZP)` + mutation SpaceVisibilityUpdateMutation($input: SpaceVisibilityUpdateInput!) { + spaceVisibilityUpdate(input: $input) { + clientMutationId + spaces { + id + } + } + } +`,e_t=function(e){let{peopleGroup:t}=e,a=(0,ll.x)(),{data:n}=(0,eB.a)(ex9),l=n?.organization,r=ev.useCallback((e,t,n)=>{let l=(0,ld.Z)();a.mutate({mutation:e_e,variables:{input:{clientMutationId:l,peopleGroupVisibilities:[{spaceId:e.id,peopleGroupId:t.id,role:n}]}},optimisticResponse:{spaceVisibilityUpdate:{clientMutationId:l,spaces:[e]}},update:(a,l)=>{let{data:r,errors:o}=l;if(null!=o||null==r)return;let i=a.readQuery({query:ex9});if(null==i||null==i.organization)return;let s=i.organization.peopleGroups?.edges.find(a=>a.node.id===`${t.id}`&&a.node.spaceVisibilities?.edges.find(t=>t.node.space.id===e.id));a.writeQuery({query:ex9,data:{...i,organization:{...i.organization,peopleGroups:{...i.organization.peopleGroups,edges:i.organization.peopleGroups?.edges.map(a=>({...a,node:{...a.node,spaceVisibilities:{...a.node.spaceVisibilities,edges:null==s&&a.node.id===`${t.id}`?[...a.node.spaceVisibilities?.edges??[],{node:{id:Date.now(),space:e,role:n??"invite_only"},cursor:`${Date.now()}`}]:a.node.spaceVisibilities?.edges.map(l=>l.node.space.id===e.id&&a.node.id===`${t.id}`?{...l,node:{...l.node,role:n??"invite_only"}}:{...l})}}}))}}}})}})},[a]),o=ev.useMemo(()=>{if(null==t||null==l)return null;let e=l.peopleGroups?.edges.find(e=>e.node.id===`${t.id}`);return null==e?null:new Map(e.node.spaceVisibilities?.edges.map(e=>[e.node.space.id,e]))},[l,t]);return null==t||null==l?null:ev.createElement("div",{className:"bg-appcolor-50 flex flex-col rounded-xl border border-solid border-appcolor-300 py-6 px-6"},ev.createElement("div",{className:"flex flex-col items-center text-center"},ev.createElement("div",{className:"text-md w-full truncate text-left font-medium text-textcolor-900"},t.name),ev.createElement("div",{className:"w-full truncate pb-6 text-left text-sm text-textcolor-600"},ev.createElement(eY.Z,{id:"general.manage_group_access",defaultMessage:"Manage group access."}))),ev.createElement("div",{className:"flex flex-col"},ev.createElement(e1.Overline,{className:"mb-2 w-full border-0 border-b border-solid border-appcolor-300 pb-2"},ev.createElement(eY.Z,{id:"general.members",defaultMessage:"Members"}),ev.createElement("span",{className:"pl-1"},"(",t.peopleGroupMembers.edges.length,")")),ev.createElement("div",{className:"flex max-h-60 flex-col overflow-y-auto"},0===t.peopleGroupMembers.edges.length&&ev.createElement("div",{className:"flex pt-2 text-sm text-appcolor-700"},ev.createElement(eY.Z,{id:"general.no_members_for_group",defaultMessage:"This group has no members."})),t.peopleGroupMembers.edges.map(e=>ev.createElement("div",{key:e.node.id,className:"flex items-center py-[0.3rem] text-sm"},ev.createElement(ao,{avatars_v2:e.node.people.user.avatars_v2,handle:e.node.people.user.handle,size:24,userID:parseInt(e.node.people.user.id,10)}),ev.createElement("div",{className:"flex flex-col pl-[1rem]"},ev.createElement("div",{className:"flex"},ev.createElement("div",{className:"font-bold"},e.node.people.user.handle),ev.createElement("div",{className:"pl-1 text-appcolor-500"},e.node.people.user.display_name)))))),null!=o&&ev.createElement(ev.Fragment,null,ev.createElement(e1.Overline,{className:"mt-5 mb-2 w-full border-0 border-b border-solid border-appcolor-300 pb-2"},ev.createElement(eY.Z,{id:"general.workspace_access",defaultMessage:"Workspace Access"})),ev.createElement("div",{className:"flex max-h-60 flex-col overflow-y-auto"},l.spaces?.edges?.length===0&&ev.createElement("div",{className:"flex pt-2 text-sm text-appcolor-700"},ev.createElement(eY.Z,{id:"general.at_least_one_workspace_in_org",defaultMessage:"You must have at least 1 workspace added to your organization in order to manage group access."})),ev.createElement("div",{className:"grid grid-cols-2"},l.spaces?.edges?.map(e=>ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-center py-[0.3rem] text-sm"},ev.createElement(nA,{space:e.node,size:"sm"}),ev.createElement("div",{className:"pl-[1rem] pr-[1rem]"},e.node.name)),ev.createElement("div",{className:"flex flex-col items-end self-center py-[0.3rem] text-sm"},ev.createElement(ex7,{value:o.get(e.node.id)?.node?.role??null,space:e.node,peopleGroup:t,onChange:r})))))))))},e_a=(0,d9.oM)({name:"dialogs.managePeopleGroup",initialState:{isOpen:!1},reducers:{toggleManagePeopleGroupDialog:(e,t)=>e.isOpen?{isOpen:!1}:null==t.payload?{isOpen:!0}:{...t.payload,isOpen:!0}}}),e_n=(0,e$.connect)(function(e){return e.dialogs.managePeopleGroup})(function(e){let{isOpen:t,peopleGroup:a}=e,n=(0,e$.useDispatch)(),l=ev.useCallback(()=>{n(e_a.actions.toggleManagePeopleGroupDialog())},[n]);return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:l,autofocus:!1},e=>{let{exit:t}=e;return ev.createElement(e_t,{exit:t,peopleGroup:a})}):null}),e_l=(0,la.ZP)` + mutation CurrentUserUpdateMutation($input: UserInput!) { + updateMe(input: $input) { + id + handle + display_name + timezone + locale + pendingEmail { + email + type + } + preferences { + dayOfWeek + timeFormat + } + } + } +`,e_r=eL.default.div.withConfig({displayName:"Styles__Integration",componentId:"sc-9b415bf9-0"})` + display: flex; + gap: ${eI.UiSpacing.getPx(5)}; + padding: 0 0 ${eI.UiSpacing.getPx(2)}; +`,e_o=eL.default.div.withConfig({displayName:"Styles__LeftCol",componentId:"sc-9b415bf9-1"})``,e_i=eL.default.div.withConfig({displayName:"Styles__RightCol",componentId:"sc-9b415bf9-2"})` + display: flex; + flex-direction: column; +`,e_s=eL.default.a.withConfig({displayName:"Styles__AnchorButton",componentId:"sc-9b415bf9-3"})` + display: flex; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(6)}; + border-radius: ${eI.UiSpacing.getPx(2.5)}; + color: ${e=>e.theme.appColors.hex(20)}; + ${e1.UiTypography.sm}; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + color: ${e=>e.theme.appColors.hex(10)}; + } +`,e_d=eL.default.button.withConfig({displayName:"Styles__Button",componentId:"sc-9b415bf9-4"})` + display: flex; + align-self: flex-start; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(6)}; + border-radius: ${eI.UiSpacing.getPx(2.5)}; + color: ${e=>e.theme.appColors.hex(20)}; + ${e1.UiTypography.sm}; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + border-color: ${e=>e.theme.appColors.hex(60)}; + color: ${e=>e.theme.appColors.hex(10)}; + } + + &:not([disabled]):hover { + cursor: pointer; + } +`;(0,eL.default)(e1.Notice).withConfig({displayName:"Styles__StyledNotice",componentId:"sc-9b415bf9-5"})` + align-self: flex-start; + ${e1.UiTypography.sm}; + margin-top: ${eI.UiSpacing.getPx(4)}; + width: 100%; +`;let e_c=eL.default.div.withConfig({displayName:"Styles__FlexContainer",componentId:"sc-9b415bf9-6"})` + display: flex; + gap: ${eI.UiSpacing.getPx(2)}; +`,e_m=eL.default.div.withConfig({displayName:"Styles__Layout",componentId:"sc-9b415bf9-7"})` + display: flex; + flex: 1; + min-height: 100vh; + overflow-x: auto; + @media (min-width: 992px) { + overflow-x: initial; + } +`,e_u=eL.default.div.withConfig({displayName:"Styles__Main",componentId:"sc-9b415bf9-8"})` + display: flex; + min-height: 100vh; + width: 100%; + flex-direction: column; + padding: 14px 22px 24px; + background: ${e=>e.theme.appColors.hex(100)}; + align-self: flex-start; + + @media (min-width: 768px) { + padding: 9px ${eI.UiSpacing.getPx(5)} 24px 32px; + } +`,e_p=eL.default.h2.withConfig({displayName:"Styles__Heading",componentId:"sc-9b415bf9-9"})` + color: ${e=>e.theme.textColors.hex(10)}; + margin: 0 0 5px; + ${e1.UiTypography.lg}; +`,e_g=eL.default.div.withConfig({displayName:"Styles__SmallHeading",componentId:"sc-9b415bf9-10"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(10)}; + font-weight: bold; + margin-bottom: ${eI.UiSpacing.getPx(1)}; +`;eL.default.h1.withConfig({displayName:"Styles__Title",componentId:"sc-9b415bf9-11"})` + font-size: 22px; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; + padding: 0; + margin-bottom: 20px; + + @media (min-width: 768px) { + padding: ${e=>e.forActivity?"0 30px":"0"}; + } +`;let e_f=eL.default.h1.withConfig({displayName:"Styles__TitleAlt",componentId:"sc-9b415bf9-12"})` + color: ${e=>e.theme.appColors.hex(10)}; + font-size: 22px; + font-weight: 500; + line-height: 32px; + margin-bottom: 4px; + + @media (min-width: 768px) { + padding: ${e=>e.forActivity?"0 30px":"0"}; + } +`,e_h=eL.default.p.withConfig({displayName:"Styles__Description",componentId:"sc-9b415bf9-13"})` + color: ${e=>e.theme.appColors.hex(10)}; + font-size: 16px; + margin-bottom: 24px; + @media (min-width: 1025px) and (max-width: 1200px) { + max-width: 600px; + } + @media (min-width: 1201px) { + max-width: 1024px; + } +`,e_y=eL.default.span.withConfig({displayName:"Styles__Subtitle",componentId:"sc-9b415bf9-14"})` + margin-bottom: 5px; + color: #999; + font-size: 13px; + font-weight: 500; + text-transform: uppercase; +`,e_b=eL.default.p.withConfig({displayName:"Styles__Paragraph",componentId:"sc-9b415bf9-15"})` + display: inline; + padding: 0; + margin: 0 0 10px; + color: ${e=>e.theme.appColors.hex(40)}; + ${e1.UiTypography.sm}; + line-height: 1.2rem; + + & a { + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,e_v=eL.default.div.withConfig({displayName:"Styles__Section",componentId:"sc-9b415bf9-16"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; + color: #ccc; + max-width: ${e=>e.$fullwidth?"1024px":"430px"}; +`,e_k=eL.default.fieldset.withConfig({displayName:"Styles__FieldSet",componentId:"sc-9b415bf9-17"})` + display: block; +`,e_E=eL.default.hr.withConfig({displayName:"Styles__HorizontalLine",componentId:"sc-9b415bf9-18"})` + background-color: ${e=>e.theme.appColors.hex(70)}; + margin-bottom: 30px; + width: 100%; +`;eL.default.div.withConfig({displayName:"Styles__Footer",componentId:"sc-9b415bf9-19"})` + padding: 20px 0 30px; + margin-top: 20px; + border-top: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,eL.default.button.withConfig({displayName:"Styles__ButtonSave",componentId:"sc-9b415bf9-20"})` + display: flex; + font-weight: bold; + padding: 8px 20px; + color: #ffffff; + font-size: 15px; + border-radius: 10px; + outline: 0; + border: 0; + cursor: pointer; + background: ${e=>e.theme.primaryColorScheme?.base}; + text-transform: uppercase; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha90}; + } + + &:focus { + outline: 0; + } + + &:disabled { + opacity: 0.1; + } + + transition: background-color 100ms ease-in; +`;let e_x=(0,eL.default)(pJ).withConfig({displayName:"Styles__SpaceAvatarStyled",componentId:"sc-9b415bf9-21"})` + display: flex; + width: ${e=>e.imgSize}px; + height: ${e=>e.imgSize}px; + flex-shrink: 0; + background: ${e=>Su(e.color).base}; + align-items: center; + justify-content: center; + border-radius: 10px; + color: #fff; + font-size: ${e=>e.fontSize}px; + font-weight: 500; + overflow: hidden; + margin-right: calc(var(--menu-item-gap) - 2px); + + & > span { + text-transform: uppercase; + } + + & > img { + width: ${e=>e.imgSize}; + height: ${e=>e.imgSize}; + } +`,e__=eL.default.span.withConfig({displayName:"Styles__WorkspaceName",componentId:"sc-9b415bf9-22"})` + color: ${e=>e.theme.textColors.hex(10)}; + display: block; + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + ${e1.UiTypography.sm} +`;eL.default.img.withConfig({displayName:"Styles__Img",componentId:"sc-9b415bf9-23"})` + width: 100%; +`,eL.default.a.withConfig({displayName:"Styles__StyledLink",componentId:"sc-9b415bf9-24"})` + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + + &:hover, + :visited { + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + } + + &:hover { + opacity: 0.8; + } +`,eL.default.button.withConfig({displayName:"Styles__ButtonSubtle",componentId:"sc-9b415bf9-25"})` + background-color: ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.textColors.hex(10)} !important; + display: flex; + font-weight: 500; + padding: 8px 20px; + font-size: 15px; + border-radius: 10px; + outline: 0; + border: 0; + cursor: pointer; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(60)}; + } + + &:focus { + outline: 0; + } + + &:disabled { + opacity: 0.1; + } + + transition: background-color 100ms ease-in; +`,eL.default.div.withConfig({displayName:"Styles__Panel",componentId:"sc-9b415bf9-26"})` + background-color: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + padding: 28px 32px; + margin-bottom: 12px; +`;let e_w=eL.default.div.withConfig({displayName:"Styles__Container",componentId:"sc-9b415bf9-27"})` + display: flex; + flex-direction: column; + margin: ${eI.UiSpacing.getPx(5)} 0; +`,e_N=eL.default.div.withConfig({displayName:"Styles__Actions",componentId:"sc-9b415bf9-28"})` + display: flex; + margin: ${eI.UiSpacing.getPx(2)} 0 ${eI.UiSpacing.getPx(8)}; + gap: ${eI.UiSpacing.getPx(2)}; +`,e_C=eL.default.div.withConfig({displayName:"Styles__ContainerGrid",componentId:"sc-9b415bf9-29"})` + display: grid; + grid-template-columns: 48px auto; + color: ${e=>e.theme.appColors.hex(10)}; +`,e_M=eL.default.div.withConfig({displayName:"Styles__Steps",componentId:"sc-9b415bf9-30"})` + padding-top: ${eI.UiSpacing.getPx(1.5)}; + ol { + margin: 0; + padding: 0; + list-style-position: inside; + } + ol li { + margin: ${eI.UiSpacing.getPx(2)} 0 ${eI.UiSpacing.getPx(1)}; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + } +`,e_S=eL.default.div.withConfig({displayName:"Styles__Integrations",componentId:"sc-9b415bf9-31"})` + display: flex; + flex-direction: column; + margin: ${eI.UiSpacing.getPx(5)} 0; +`,e_I=(0,eL.default)(sC.OL).withConfig({displayName:"Styles__IntegrationItem",componentId:"sc-9b415bf9-32"})` + display: grid; + margin-bottom: ${eI.UiSpacing.getPx(2)}; + grid-template-columns: 50px 1fr auto; + border-radius: 10px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + color: ${e=>e.theme.appColors.hex(10)}; + padding: ${eI.UiSpacing.getPx(4)}; + ${e1.UiTypography.sm} + + & .details { + display: flex; + flex-direction: column; + padding-right: ${eI.UiSpacing.getPx(4)}; + + & .title { + ${e1.UiTypography.md}; + color: ${e=>e.theme.appColors.hex(10)}; + font-weight: bold; + margin-bottom: ${eI.UiSpacing.getPx(1)}; + } + & .description { + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(50)}; + + & a { + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } + } + } + + &:hover { + border-color: ${e=>e.theme.appColors.hex(60)}; + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,e_D=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"Styles__StyledBreadcrumbIcon",componentId:"sc-9b415bf9-33"})` + margin: 0 5px; + color: ${e=>e.theme.appColors.hex(50)}; + transform: rotate(-90deg); + align-self: center; +`,e_T=eL.default.form.withConfig({displayName:"Styles__SamlSsoForm",componentId:"sc-9b415bf9-34"})` + display: flex; + flex-direction: column; + max-width: 480px; +`,e_$=eL.default.div.withConfig({displayName:"Styles__FieldGroup",componentId:"sc-9b415bf9-35"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,e_P=eL.default.input.withConfig({displayName:"Styles__FieldInput",componentId:"sc-9b415bf9-36"})` + display: flex; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + border-radius: 10px; + margin-top: 8px; + padding: 6px 12px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.sm}; +`,e_F=eL.default.textarea.withConfig({displayName:"Styles__FieldTextarea",componentId:"sc-9b415bf9-37"})` + display: flex; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(90)}; + border-radius: 10px; + margin-top: 8px; + padding: 6px 12px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + ${e1.UiTypography.sm}; +`,e_A=function(){let e=(0,e$.useDispatch)(),[t,a]=ev.useState(!1),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),{arrowProps:o,popperProps:i,referenceProps:s}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"bottom",visible:t}),d=ev.useCallback(()=>{a(!0)},[]),c=ev.useCallback(()=>{a(!1)},[]),m=ev.useCallback(()=>{e(uO.actions.toggleQuickAddDialog())},[e]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...s,onClick:m,onMouseEnter:d,onMouseLeave:c,className:"duration-250 relative flex h-7 w-7 items-center justify-center transition ease-in-out hover:text-appcolor-500"},ev.createElement(tn.Icon,{icon:"header_quickadd"})),t&&ev.createElement(eI.Tooltip,{arrowProps:o,popperProps:i},ev.createElement(IN,null,ev.createElement(eY.Z,{id:"general.quickadd",defaultMessage:"Quick Add"}),ev.createElement(e1.Shortcut.Combo,{alwaysDark:!0},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"K")))))},e_R=eL.default.div.withConfig({displayName:"SettingsHeader__SectionTitle",componentId:"sc-77eaf899-0"})` + margin-bottom: 13px; + display: flex; + align-items: center; +`,e_j=eL.default.div.withConfig({displayName:"SettingsHeader__IconWrapper",componentId:"sc-77eaf899-1"})` + background-color: ${e=>e.theme.isNightMode?"#333":"#ccc"}; + border-radius: 10px; + padding: 3px; + line-height: 1; + margin-right: 8px; + color: ${e=>e.theme.isNightMode?"#999":"#fff"}; +`,e_O=eL.default.div.withConfig({displayName:"SettingsHeader__Actions",componentId:"sc-77eaf899-2"})` + display: flex; + margin-left: auto; + position: relative; + align-items: center; +`,e_U=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"SettingsHeader__StyledBreadcrumbIcon",componentId:"sc-77eaf899-3"})` + margin: 0 5px; + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + transform: rotate(-90deg); +`,e_Z=eL.default.span.withConfig({displayName:"SettingsHeader__StyledTitleValue",componentId:"sc-77eaf899-4"})` + color: ${e=>e.theme.isNightMode?"#fff":"#333"}; + font-size: 16px; +`,e_L=(0,eL.default)(sC.rU).withConfig({displayName:"SettingsHeader__StyledLink",componentId:"sc-77eaf899-5"})` + display: flex; + align-items: center; +`,e_B=function(e){let{breadCrumbTitle:t}=e;return ev.createElement(e_R,null,ev.createElement(IS,{desktopHidden:!0}),ev.createElement(e_L,{to:"/settings"},ev.createElement(e_j,null,ev.createElement(tn.Icon,{icon:"dd_settings"})),ev.createElement(e_Z,null,ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"}))),null!=t?ev.createElement(ev.Fragment,null,ev.createElement(e_U,null),ev.createElement(e_Z,null,t)):null,ev.createElement(e_O,null,ev.createElement(e_A,null),ev.createElement(Sz,null),ev.createElement(Ii,null)))},e_z=(0,e$.connect)(function(e){return{ssoErrors:ae(e)}})(function(e){let{ssoErrors:t}=e;return 0===t.length?null:ev.createElement(e1.Notice,{$type:"danger"},ev.createElement("ul",null,t.map((e,t)=>ev.createElement("li",{key:`${t}`},e))))}),e_V=eL.default.button.withConfig({displayName:"Styles__AccountNoticeButton",componentId:"sc-bf625d73-0"})` + border: 0; + outline: 0; + background: none; + padding: 0; + margin: 0; + font-size: 15px; + color: ${eI.ThemeColors.warning}; + font-weight: bold; + text-decoration: underline; + cursor: pointer; + + &:hover { + opacity: 0.7; + } + + &:focus { + outline: none; + } +`,e_q=eL.default.div.withConfig({displayName:"Styles__Section",componentId:"sc-bf625d73-1"})` + margin-bottom: 20px; +`,e_W=eL.default.label.withConfig({displayName:"Styles__Label",componentId:"sc-bf625d73-2"})` + color: #999; + text-transform: uppercase; + margin-bottom: 5px; + ${e1.UiTypography.xs}; +`;eL.default.h2.withConfig({displayName:"Styles__Heading",componentId:"sc-bf625d73-3"})` + font-size: 17px; + color: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333"}; + margin: 0 0 5px; +`;let e_H=eL.default.p.withConfig({displayName:"Styles__Paragraph",componentId:"sc-bf625d73-4"})` + display: flex; + align-items: center; + padding: 0; + margin: 0 0 10px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; +`,e_G=(0,eL.default)(lT.Ho).withConfig({displayName:"Styles__IconUploadAvatar",componentId:"sc-bf625d73-5"})``,e_K=eL.default.div.withConfig({displayName:"Styles__UploadAvatar",componentId:"sc-bf625d73-6"})` + display: flex; + width: 100px; + height: 100px; + border-radius: 100px; + overflow: hidden; + position: relative; + padding: 0; + margin: 0; + outline: 0; + background: 0; + cursor: pointer; + border: 0; + + & > img { + width: 100px; + height: 100px; + } + + &:focus { + outline: none; + } +`,e_Y=eL.default.div.withConfig({displayName:"Styles__UploadAvatarHover",componentId:"sc-bf625d73-7"})` + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + opacity: 0; + position: absolute; + background: rgba(0, 0, 0, 0.8); + color: #fff; + font-size: 12px; + + ${e_K}:hover & { + opacity: 1; + } + + transition: opacity 200ms ease-in; + + > svg { + height: 28px; + margin-bottom: 5px; + } +`,e_Q=eL.default.div.withConfig({displayName:"Styles__Container",componentId:"sc-bf625d73-8"})` + max-width: 900px; +`,e_J=eL.default.div.withConfig({displayName:"Styles__TwoCol",componentId:"sc-bf625d73-9"})` + display: grid; + @media (min-width: 768px) { + grid-template-columns: repeat(2, 1fr); + column-gap: 40px; + } +`,e_X=eL.default.div.withConfig({displayName:"Styles__OneCol",componentId:"sc-bf625d73-10"})` + @media (min-width: 768px) { + max-width: 500px; + } +`,e_0=eL.default.button.withConfig({displayName:"Styles__ButtonToggleSSO",componentId:"sc-bf625d73-11"})` + display: flex; + justify-content: space-between; + outline: 0; + background: 0; + cursor: pointer; + border: 0; + border-radius: 10px; + margin: 0 0 2px; + cursor: pointer; + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f3f7f9"}; + padding: 20px; + margin: 0 0 20px; + width: 100%; + + &:hover { + background: ${e=>e.theme?.isNightMode?"#272c30":"#ECF1F5"}; + } +`,e_1=eL.default.a.withConfig({displayName:"Styles__LinkConnectSSO",componentId:"sc-bf625d73-12"})` + display: flex; + align-items: center; + justify-content: space-between; + outline: 0; + background: 0; + cursor: pointer; + border: 0; + border-radius: 10px; + margin: 0 0 15px; + background: ${e=>e.theme?.isNightMode?"#1C1F21":"#f3f7f9"}; + padding: 20px; + + &:hover { + background: ${e=>e.theme?.isNightMode?"#272c30":"#ECF1F5"}; + } +`,e_2=eL.default.div.withConfig({displayName:"Styles__SSOName",componentId:"sc-bf625d73-13"})` + display: flex; + justify-items: spread-apart; + align-items: center; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; +`,e_5=eL.default.div.withConfig({displayName:"Styles__Toggle",componentId:"sc-bf625d73-14"})` + display: flex; + align-items: center; + width: 40px; + height: 26px; + border-radius: 20px; + background: ${e=>e.theme.appColors.hex(100)}; + + & > span { + display: flex; + width: 22px; + height: 22px; + border-radius: 22px; + transform: ${e=>e.connected?"translateX(16px)":"translateX(2px)"}; + background: ${e=>e.connected?e.theme.primaryColorScheme?.base:"#ccc"}; + } +`,e_3=(0,eL.default)(lT.UR).withConfig({displayName:"Styles__IconSSOGoogle",componentId:"sc-bf625d73-15"})` + flex-shrink: 0; + height: 36px; + margin-right: 10px; + width: 36px; +`,e_4=(0,eL.default)(lT.rI).withConfig({displayName:"Styles__IconSSOApple",componentId:"sc-bf625d73-16"})` + flex-shrink: 0; + height: 36px; + margin-right: 10px; + width: 36px; +`,e_6=(0,eL.default)(lT.n_).withConfig({displayName:"Styles__IconSSOContacts",componentId:"sc-bf625d73-17"})` + flex-shrink: 0; + height: 36px; + margin-right: 10px; + width: 36px; +`,e_8=eL.default.button.withConfig({displayName:"Styles__Button",componentId:"sc-bf625d73-18"})` + display: flex; + align-self: flex-start; + outline: 0; + background: 0; + cursor: pointer; + border: 0; + background: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + padding: 6px 18px 6px 12px; + border-radius: 5px; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha90}; + } + + transition: background-color 100ms ease-in; +`,e_7=eL.default.div.withConfig({displayName:"Styles__SettingsFooter",componentId:"sc-bf625d73-19"})` + margin-bottom: 40px; + margin-top: 10px; +`;eL.default.button.withConfig({displayName:"Styles__SaveButton",componentId:"sc-bf625d73-20"})` + display: flex; + font-weight: bold; + padding: 8px 20px; + color: #ffffff; + font-size: 15px; + border-radius: 10px; + outline: 0; + border: 0; + cursor: pointer; + background: ${e=>e.theme.primaryColorScheme?.base}; + text-transform: uppercase; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha90}; + } + + &:focus { + outline: 0; + } + + &:disabled { + opacity: 0.1; + } + + transition: background-color 100ms ease-in; +`,eL.default.button.withConfig({displayName:"Styles__CloseAccountButton",componentId:"sc-bf625d73-21"})` + display: flex; + font-weight: bold; + padding: 8px 20px; + color: #fff; + font-size: 15px; + border-radius: 10px; + outline: 0; + border: 0; + cursor: ${e=>e.disabled?"default":"pointer"}; + background: ${eI.ThemeColors.danger}; + transition: background-color 100ms ease-in; + text-transform: uppercase; + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha90}; + } + + &:focus { + outline: 0; + } + + &:disabled { + opacity: 0.1; + } +`;let e_9=eL.default.div.withConfig({displayName:"CloseAccount__InputWrapper",componentId:"sc-b8409ed6-0"})` + margin-bottom: 8px; + @media (min-width: 768px) { + max-width: 430px; + } +`,ewe=function(e){let{accounts:t,samlSsoConfig:a}=e,n=(0,eK.Z)(),[l,r]=(0,ev.useState)(""),o=(0,e$.useDispatch)(),i=(0,ev.useCallback)(e=>{r(e.target.value)},[]),s=(0,ev.useCallback)(e=>{e.preventDefault(),o(hT.actions.toggleDeleteAccountDialog({confirmation:l}))},[l,o]);return ev.createElement(e_k,null,ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.delete_account",defaultMessage:"Delete Account"})),null!=a?ev.createElement(oy,null,ev.createElement(eY.Z,{id:"general.delete_saml_sso_config",defaultMessage:"Please delete your SAML SSO config."})):null!=t.samlSso?ev.createElement(oy,null,ev.createElement(eY.Z,{id:"general.delete_saml_sso_contact",defaultMessage:"Please contact {domain} admin to delete your account.",values:{domain:t.samlSso.display_name?.replace(/.*@/,"")}})):ev.createElement(ev.Fragment,null,ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.delete_subtitle",defaultMessage:"Once you delete your account and account data, there is no going back."})),ev.createElement(e_q,null,ev.createElement(e_W,null,ev.createElement(eY.Z,{id:"general.close_account_warning",defaultMessage:"Delete your account and account data"})),ev.createElement("form",{onSubmit:s},ev.createElement(ok,null,ev.createElement(e_9,null,ev.createElement(ou,{id:"cancel-email",onChange:i,placeholder:n.formatMessage({id:"general.confirm_email",defaultMessage:"Confirm Email"}),type:"email"})),ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",type:"submit",disabled:""===l},ev.createElement(eY.Z,{id:"general.delete_account",defaultMessage:"Delete Account"})))))))};function ewt(){if("undefined"==typeof navigator)return null;if(null!=navigator.language)return navigator.language;if(Array.isArray(navigator.languages)){let e=navigator.languages[0];if(null!=e)return e}return null}function ewa(e){switch(e){case"zh-Hans":return"zh-CN";case"zh-Hant":return"zh-TW";default:return e}}function ewn(e){let t=ewa(e??ewt()??"en-US");return eG().defineLocale("local",{parentLocale:t}),"local"}function ewl(e){eG().locale(e)}function ewr(e,t,a){let n={week:{dow:t??eG().localeData(ewt()??"en-US").firstDayOfWeek()}};switch(a){case"h:mm A":n.longDateFormat={LT:"h:mm A",LTS:"h:mm:ss A"};break;case"HH:mm":n.longDateFormat={LT:"HH:mm",LTS:"HH:mm:ss"}}eG().updateLocale(e,n)}function ewo(e){null!=e?eG().tz.setDefault(e):eG().tz.setDefault()}function ewi(e){if(!e.submitting){if(null!=e.error)return ev.createElement(oy,null,e.error);if(null!=e.submitError)return ev.createElement(oy,null,e.submitError)}return null}let ews=(0,eL.default)(cF).withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-61e40e12-0"})` + padding: 7px ${eI.UiSpacing.getPx(3)}; + color: ${e=>e.theme.appColors.hex(10)}; + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,ewd=function(e){let{children:t,name:a,value:n,onClick:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:l,stopRef:r,name:a,value:n});return ev.createElement(ews,o.props,t)},ewc=eL.default.span.withConfig({displayName:"styled__Separator",componentId:"sc-cf4dba8e-0"})` + background: ${e=>e.theme.appColors.hex(80)}; + margin: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(0)}; + height: 20px; + width: 1px; +`,ewm=eL.default.div.withConfig({displayName:"styled__CaretContainer",componentId:"sc-cf4dba8e-1"})` + display: flex; + padding: ${eI.UiSpacing.getPx(2)}; +`,ewu=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"styled__CaretIcon",componentId:"sc-cf4dba8e-2"})` + transform: var(--global-icon-scale); + color: ${e=>e.theme.appColors.hex(70)}; +`,ewp=eL.default.button.withConfig({displayName:"styled__StyledDropdownToggle",componentId:"sc-cf4dba8e-3"})` + cursor: pointer; + display: flex; + align-items: center; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: var(--menu-border-radius); + justify-content: space-between; + background: ${e=>e.theme.appColors.hex(100)}; + width: 100%; + &:hover { + ${ewu} { + color: ${e=>e.theme.appColors.hex(60)}; + } + ${ewc} { + background: ${e=>e.theme.appColors.hex(60)}; + } + } +`,ewg=eL.default.div.withConfig({displayName:"styled__IconsWrapper",componentId:"sc-cf4dba8e-4"})` + display: flex; +`,ewf=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-cf4dba8e-5"})` + display: flex; + flex-direction: column; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(0)}; + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: none; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,ewh=eL.default.div.withConfig({displayName:"DayOfWeekSelectField__Section",componentId:"sc-189b5e11-0"})` + margin-bottom: 5px; +`,ewy=eL.default.div.withConfig({displayName:"DayOfWeekSelectField__Wrapper",componentId:"sc-189b5e11-1"})` + padding-left: ${eI.UiSpacing.getPx(2.5)}; + ${e1.UiTypography.sm}; +`,ewb=(0,eL.default)(eI.Popup).withConfig({displayName:"DayOfWeekSelectField__DayOfWeekPopup",componentId:"sc-189b5e11-2"})` + width: ${e=>e.calculatedWidth?e.calculatedWidth+"px":"auto"}; +`,ewv=function(e){let{id:t,input:a,meta:n}=e,l=a.value,r=a.onChange,o=(0,ev.useMemo)(()=>{let e=[{label:"Default Browser",value:null}];return eG().weekdays().map((t,a)=>{e.push({label:t,value:a})}),e},[]),i=(0,ev.useCallback)(e=>{let t=o.find(t=>t.value===e);if(null!=t)return t.label},[o]),s=(0,ev.useCallback)(e=>{null!=e?r(e):r(null)},[r]),d=ewa(ewt()??"en-US"),c=eG()().day(eG().localeData(d).firstDayOfWeek()).format("dddd"),m=(0,ev.useMemo)(()=>null!=i(l)?i(l):`${c} (Browser Default)`,[c,i,l]),u=ewi(n),[p,g]=ev.useReducer(eI.popupReducer,{expanded:!1}),f=ev.useRef(null),h=ev.useRef(null),y=ev.useCallback(()=>{f.current?.focus()},[]);(0,eI.usePopupEvents)({state:p,onCollapse:y});let b=(0,eI.usePopup)({referenceElementRef:f,popupElementRef:h,state:p,placement:"bottom-start"}),v=(0,eI.useMenuButton)({dispatch:g,ref:f,state:p}),k=ev.useCallback(e=>{"Activate"===e.type&&g({type:"Collapse"})},[]);return ev.createElement(ok,{className:og()({"has-error":null!=u})},ev.createElement("label",{htmlFor:t},ev.createElement(eY.Z,{id:"general.day_of_week",defaultMessage:"Start of the week"})),ev.createElement(ewh,null,ev.createElement(ewp,{type:"button",...v.props},ev.createElement(ewy,null,m),ev.createElement(ewg,null,ev.createElement(ewc,null),ev.createElement(ewm,null,ev.createElement(ewu,null)))),p.expanded&&ev.createElement(ewb,{calculatedWidth:f.current?.offsetWidth??null,...b.props,dispatch:g,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:k},ev.createElement(ewf,{initialFocus:b.initialFocus,loop:!0},o.map((e,t)=>ev.createElement(ewd,{key:t,onClick:()=>s(e.value),name:`${e.value}`},e.label)))))),u)},ewk=function(e){let{id:t,input:a,meta:n,label:l,placeholder:r,type:o,disabled:i}=e,s=ewi(n);return ev.createElement(ok,{className:og()({"has-error":null!=s})},ev.createElement("label",{htmlFor:t},l),ev.createElement(ou,{id:t,...a,placeholder:r,type:o,disabled:i}),s)};var ewE=a(47660);let ewx=(0,eL.default)(ewE.ZP).withConfig({displayName:"LocaleSelectField__Select",componentId:"sc-772a9862-0"})` + width: 100%; + ${e1.UiTypography.sm}; + + & > div { + cursor: pointer; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + + .locale-select__placeholder { + color: ${e=>e.theme.textColors.hex(10)}; + } + + .locale-select__single-value { + color: ${e=>e.theme.appColors.hex(10)}; + } + + .locale-select__indicator-separator { + background: ${e=>e.theme.appColors.hex(80)}; + } + + .locale-select__indicator { + & path { + fill: ${e=>e.theme.appColors.hex(70)}; + } + } + + &.locale-select__control--is-focused, + &:hover { + box-shadow: none !important; + border-color: ${e=>e.theme.appColors.hex(70)}; + + .locale-select__indicator-separator { + background: ${e=>e.theme.appColors.hex(60)}; + } + + .locale-select__indicator { + & path { + fill: ${e=>e.theme.appColors.hex(60)}; + } + } + } + } + + .locale-select__menu { + ${tM}; + max-height: 300px; + box-shadow: none; + &:hover { + border-color: ${e=>e.theme.appColors.hex(70)}; + } + } + + .locale-select__menu-list { + max-height: inherit; + } + + .locale-select__option { + cursor: pointer; + text-align: left; + padding: 7px 12px; + color: ${e=>e.theme.appColors.hex(10)}; + &:active { + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + .locale-select__option--is-focused { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + + .locale-select__option--is-selected { + font-weight: 500; + background: none; + color: ${e=>e.theme.appColors.hex(10)}; + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + .locale-select__input { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,ew_=eL.default.div.withConfig({displayName:"LocaleSelectField__Section",componentId:"sc-772a9862-1"})` + display: flex; + align-items: center; + margin-bottom: 5px; + padding: 0; +`,eww=function(e){let{id:t,input:a,meta:n}=e,l=a.name,r=a.value,o=a.onChange,i=(0,ev.useMemo)(()=>new Map(S6),[]),s=(0,ev.useMemo)(()=>{let e=[{value:null,label:"Browser Default"}];for(let[t,a]of i.entries())e.push({value:t,label:`${a.name}`});return e},[i]),d=(0,ev.useMemo)(()=>{if(null!=r){let e=i.get(r);if(null!=e)return{value:r,label:`${e.name}`}}return null},[i,r]),c=(0,ev.useCallback)(e=>{null!=e?o(e.value):o(null)},[o]),m=ewi(n);return ev.createElement(ok,{classnames:og()({"has-error":null!=m})},ev.createElement("label",{htmlFor:t},ev.createElement(eY.Z,{id:"general.language",defaultMessage:"Language"})),ev.createElement(ew_,null,ev.createElement(ewx,{classNamePrefix:"locale-select",id:t,name:l,onChange:c,value:d,options:s,placeholder:"Browser Default"})),m)},ewN={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"EmailChangeCancelMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"EmailChangeCancelInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emailChangeCancel"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"pendingEmail"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]}}]},ewC={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"EmailVerifyResendMutation"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emailVerifyResend"}}]}}]},ewM=function(e){let t=e.type??"resend",[a,{data:n,loading:l}]=(0,cs.D)(ewC),r=n?.emailVerifyResend===!0;return l?ev.createElement("div",{className:"inline-block"},ev.createElement(eI.Spinner,{size:12})):r?ev.createElement(eY.Z,{id:"general.account_verification_sent",defaultMessage:"Sent!"}):ev.createElement(e_V,{onClick:()=>a()},"send"===t?ev.createElement(eY.Z,{id:"general.account_verification_send",defaultMessage:"Send"}):ev.createElement(eY.Z,{id:"general.account_verification_resend",defaultMessage:"Resend"}))},ewS=eL.default.div.withConfig({displayName:"PendingEmail__SpinnerContainer",componentId:"sc-fdbf1b1f-0"})` + display: inline-block; +`,ewI=(0,eL.default)(e1.Notice).withConfig({displayName:"PendingEmail__StyledNotice",componentId:"sc-fdbf1b1f-1"})` + align-self: start; + max-width: 430px; + word-wrap: break-word; +`,ewD=function(e){let[t,{loading:a}]=(0,cs.D)(ewN),n=(0,eK.Z)(),{currentUser:l}=e,r=(0,ev.useCallback)(()=>{t({variables:{input:{clientMutationId:(0,ld.Z)()}}})},[t]),o=(0,ev.useCallback)(()=>{M_(n.formatMessage({id:"general.are_you_sure_you_want_to_cancel_changing_your_email",defaultMessage:"Are you sure you want to cancel changing your email?"}),{onApprove:r})},[r,n]);return null==l||null!=l.verified_at?null:a?ev.createElement(ewS,null,ev.createElement(eI.Spinner,{size:12})):null==l.pendingEmail?ev.createElement(ewI,{$type:"warning"},ev.createElement(eY.Z,{id:"general.account_verification_send_email",defaultMessage:"Send verification email to {email}",values:{email:l.email}})," ",ev.createElement(ewM,{type:"send"})):"user_request"===l.pendingEmail.type?ev.createElement(ewI,{$type:"warning"},ev.createElement(eY.Z,{id:"general.account_verification_notice_email_changed",defaultMessage:"To complete changing your email address, please verify your new email address by clicking the link sent to {pendingEmail}. {br}Cancel Change |",values:{br:ev.createElement("br",null),pendingEmail:l.pendingEmail.email,strong:e=>ev.createElement("strong",null,e),AccountNoticeButton:e=>ev.createElement(e_V,{type:"button",onClick:o},e)}})," ",ev.createElement(ewM,null)):ev.createElement(ewI,{$type:"warning"},ev.createElement(eY.Z,{id:"general.account_verification_notice",defaultMessage:"Please check your email to verify your account."})," ",ev.createElement(ewM,null))};!function(e){e.Twelve="h:mm A",e.TwentyFour="HH:mm"}(et||(et={}));let ewT=(0,eL.default)(ewE.ZP).withConfig({displayName:"TimeFormatSelectField__Select",componentId:"sc-d1d062a5-0"})` + width: 100%; + ${e1.UiTypography.sm}; + + & > div { + cursor: pointer; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + + .timeformat-select__placeholder { + color: ${e=>e.theme.textColors.hex(10)}; + } + + .timeformat-select__single-value { + color: ${e=>e.theme.appColors.hex(10)}; + } + + .timeformat-select__indicator-separator { + background: ${e=>e.theme.appColors.hex(80)}; + } + + .timeformat-select__indicator { + & path { + fill: ${e=>e.theme.appColors.hex(70)}; + } + } + + &.timeformat-select__control--is-focused, + &:hover { + box-shadow: none !important; + border-color: ${e=>e.theme.appColors.hex(70)}; + + .timeformat-select__indicator-separator { + background: ${e=>e.theme.appColors.hex(60)}; + } + + .timeformat-select__indicator { + & path { + fill: ${e=>e.theme.appColors.hex(60)}; + } + } + } + } + + .timeformat-select__menu { + ${tM}; + max-height: 300px; + box-shadow: none; + &:hover { + border-color: ${e=>e.theme.appColors.hex(70)}; + } + } + + .timeformat-select__menu-list { + max-height: inherit; + } + + .timeformat-select__option { + cursor: pointer; + text-align: left; + padding: 7px 12px; + color: ${e=>e.theme.appColors.hex(10)}; + &:active { + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + .timeformat-select__option--is-focused { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + + .timeformat-select__option--is-selected { + font-weight: 500; + background: none; + color: ${e=>e.theme.appColors.hex(10)}; + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + .timeformat-select__input { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,ew$=eL.default.div.withConfig({displayName:"TimeFormatSelectField__Section",componentId:"sc-d1d062a5-1"})` + display: flex; + align-items: center; + margin-bottom: 5px; + padding: 0; +`,ewP=function(e){let{id:t,input:a,meta:n}=e,l=a.name,r=a.value,o=a.onChange,i=(0,ev.useMemo)(()=>eG()(),[]),s=(0,ev.useMemo)(()=>[{label:"Browser Default",value:null},{label:i.format("h:mm A"),value:"h:mm A"},{label:i.format("HH:mm"),value:"HH:mm"}],[i]),d=(0,ev.useMemo)(()=>{switch(r){case"h:mm A":return{label:i.format("h:mm A"),value:"h:mm A"};case"HH:mm":return{label:i.format("HH:mm"),value:"HH:mm"};default:return null}},[i,r]),c=(0,ev.useCallback)(e=>{null!=e?o(e.value):o(null)},[o]),m=ewi(n);return ev.createElement(ok,{classnames:og()({"has-error":null!=m})},ev.createElement("label",{htmlFor:t},ev.createElement(eY.Z,{id:"general.time_format",defaultMessage:"Time format"})),ev.createElement(ew$,null,ev.createElement(ewT,{classNamePrefix:"timeformat-select",id:t,name:l,onChange:c,value:d,options:s,placeholder:"Browser Default"})),m)},ewF=(0,eL.default)(ewE.ZP).withConfig({displayName:"TimeZoneSelectField__Select",componentId:"sc-4e6fbc63-0"})` + width: 100%; + ${e1.UiTypography.sm}; + + & > div { + cursor: pointer; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + + .timezone-select__placeholder { + color: ${e=>e.theme.textColors.hex(10)}; + } + + .timezone-select__single-value { + color: ${e=>e.theme.appColors.hex(10)}; + } + + .timezone-select__indicator-separator { + background: ${e=>e.theme.appColors.hex(80)}; + } + + .timezone-select__indicator { + & path { + fill: ${e=>e.theme.appColors.hex(70)}; + } + } + + &.timezone-select__control--is-focused, + &:hover { + box-shadow: none !important; + border-color: ${e=>e.theme.appColors.hex(70)}; + + .timezone-select__indicator-separator { + background: ${e=>e.theme.appColors.hex(60)}; + } + + .timezone-select__indicator { + & path { + fill: ${e=>e.theme.appColors.hex(60)}; + } + } + } + } + + .timezone-select__menu { + ${tM}; + max-height: 300px; + box-shadow: none; + &:hover { + border-color: ${e=>e.theme.appColors.hex(70)}; + } + } + + .timezone-select__menu-list { + max-height: inherit; + } + + .timezone-select__option { + cursor: pointer; + text-align: left; + padding: 7px 12px; + color: ${e=>e.theme.appColors.hex(10)}; + &:active { + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + .timezone-select__option--is-focused { + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(80)}; + } + + .timezone-select__option--is-selected { + font-weight: 500; + background: none; + color: ${e=>e.theme.appColors.hex(10)}; + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + } + + .timezone-select__input { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,ewA=eL.default.div.withConfig({displayName:"TimeZoneSelectField__Section",componentId:"sc-4e6fbc63-1"})` + display: flex; + align-items: center; + margin-bottom: 5px; + padding: 0; +`,ewR=function(e){let{id:t,input:a,meta:n}=e,l=a.name,r=a.value,o=a.onChange,{timezonesMap:i}=AB(),s=(0,ev.useMemo)(()=>{let e=[{label:"Browser Default",value:null}];for(let t of Object.values(i))e.push({label:t.humanReadableLabel,value:t.ianaCode});return e},[i]),d=(0,ev.useMemo)(()=>{if(null!=r&&r.length>0){let e=i[r];return{label:e.humanReadableLabel,value:e.ianaCode}}return null},[i,r]),c=(0,ev.useCallback)(e=>{null!=e?o(e.value):o(null)},[o]),m=ewi(n);return ev.createElement(ok,{classnames:og()({"has-error":null!=m})},ev.createElement("label",{htmlFor:t},ev.createElement(eY.Z,{id:"general.timezone",defaultMessage:"Time zone"})),ev.createElement(ewA,null,ev.createElement(ewF,{autoFocus:!1,classNamePrefix:"timezone-select",id:t,menuPlacement:"top",name:l,onChange:c,value:d,options:s,placeholder:"Browser Default"})),m)},ewj=function(e){let{handleSubmit:t,submitting:a,currentUser:n,accounts:l,samlSsoConfig:r}=e,[o,i]=(0,ev.useState)(!1),s=(0,eK.Z)(),d=(0,ev.useCallback)(()=>{i(e=>!e)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("form",{onSubmit:t},ev.createElement(e_Q,null,ev.createElement(e_q,null,ev.createElement(e_z,null)),ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.profile_account",defaultMessage:"Profile Account"})),ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.profile_subtitle",defaultMessage:"Manage your Taskade account. All changes in your account will be applied to all of your workspace."})),ev.createElement(ok,null,ev.createElement("label",null,ev.createElement(eY.Z,{id:"general.profile_photo",defaultMessage:"Profile Photo"})),ev.createElement(e_K,{className:"file-input-upload",onClick:e=>{e.preventDefault(),i(!0)}},ev.createElement(e_Y,null,ev.createElement(e_G,null),ev.createElement(eY.Z,{id:"general.upload_photo",defaultMessage:"Upload Photo"})),ev.createElement("img",{className:"avatar",src:n.avatars_v2.default?.mdpi.url,alt:"Profile"}))),ev.createElement(e_J,null,ev.createElement(r$.gN,{component:ewk,name:"handle",id:"settings-username",label:s.formatMessage({id:"general.username",defaultMessage:"Username"}),type:"text",placeholder:s.formatMessage({id:"general.username",defaultMessage:"Username"})}),ev.createElement(r$.gN,{component:ewk,name:"display_name",id:"settings-displayname",label:s.formatMessage({id:"general.full_name",defaultMessage:"Full name"}),type:"text",placeholder:s.formatMessage({id:"general.full_name",defaultMessage:"Full name"})}),ev.createElement(r$.gN,{component:ewk,name:"email",id:"settings-email",label:s.formatMessage({id:"general.email",defaultMessage:"Email"}),type:"email",placeholder:s.formatMessage({id:"general.email",defaultMessage:"Email"}),disabled:null!=l.samlSso||null!=r}),ev.createElement(r$.gN,{component:ewR,name:"timezone",id:"settings-timezone"}),ev.createElement(ewD,{currentUser:n}),ev.createElement(r$.gN,{component:ewP,name:"preferences.timeFormat",id:"settings-timeformat"}),ev.createElement(r$.gN,{component:ewv,name:"preferences.dayOfWeek",id:"settings-dayofweek"}),ev.createElement(r$.gN,{component:eww,name:"locale",id:"settings-locale"})),ev.createElement(e_7,null,ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",type:"submit",disabled:a},ev.createElement(eY.Z,{id:"general.Update",defaultMessage:"Update"}))))),o&&ev.createElement(eER,{isOpen:o,onToggle:d,avatarSrc:n.avatars_v2.default?.mdpi.url}),ev.createElement(e_E,null),ev.createElement(e_X,null,ev.createElement(ewe,{accounts:l,samlSsoConfig:r})))},ewO=eL.default.div.withConfig({displayName:"AccountTabs__TabContainer",componentId:"sc-1d941e6e-0"})` + display: flex; + margin-bottom: 20px; + overflow-x: auto; +`,ewU=(0,eL.default)(sC.OL).withConfig({displayName:"AccountTabs__StyledNavLink",componentId:"sc-1d941e6e-1"})` + display: flex; + margin-right: 5px; + border-radius: 10px; + position: relative; + color: ${e=>e.theme.textColors.hex(50)}; + padding: 5px 16px; + ${e1.UiTypography.sm}; + border-radius: 30px; + align-items: center; + text-align: center; + white-space: nowrap; + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } + &.active { + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: 500; + } +`,ewZ=()=>ev.createElement(ewO,null,ev.createElement(ewU,{to:"/settings",exact:!0},ev.createElement(eY.Z,{id:"general.account",defaultMessage:"Account"})),ev.createElement(ewU,{to:"/settings/password",exact:!0},ev.createElement(eY.Z,{id:"general.password",defaultMessage:"Password"})),ev.createElement(ewU,{to:"/settings/sso",exact:!0},ev.createElement(eY.Z,{id:"general.connected_accounts",defaultMessage:"Connected Accounts"})),ev.createElement(ewU,{to:"/settings/sessions",exact:!0},ev.createElement(eY.Z,{id:"general.sessions",defaultMessage:"Sessions"}))),ewL={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AccountQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"locale"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"default"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"verified_at"}},{kind:"Field",name:{kind:"Name",value:"pendingEmail"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dayOfWeek"}},{kind:"Field",name:{kind:"Name",value:"timeFormat"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"myAccounts"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"apple"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"facebook"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"google"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"twitter"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"samlSso"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"samlSsoConfig"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},ewB=function(e){let{currentUser:t,accounts:a,samlSsoConfig:n}=e,l=(0,ll.x)(),r=(0,ev.useMemo)(()=>({email:t.email,handle:t.handle,display_name:t.display_name,timezone:t.timezone,locale:t.locale,preferences:{dayOfWeek:t.preferences.dayOfWeek,timeFormat:t.preferences.timeFormat}}),[t.display_name,t.email,t.handle,t.locale,t.preferences.dayOfWeek,t.preferences.timeFormat,t.timezone]),o=async(e,t,a)=>{let n={};for(let e of t.getRegisteredFields()){let a=t.getFieldState(e);null!=a&&a.dirty&&pA()(n,e,a.value??null)}if(!ts()(n))try{await l.mutate({mutation:e_l,variables:{input:n}})}catch(e){ts()(e.graphQLErrors)||a(e.graphQLErrors.map(e=>{try{return JSON.parse(e.message)}catch(e){return null}}).filter(e=>null!=e&&null!=e.data).reduce((e,t)=>({...e,...t.data}),{}))}};return ev.createElement(r$.l0,{onSubmit:o,initialValues:r,component:ewj,currentUser:t,accounts:a,samlSsoConfig:n})},ewz=function(){let e=(0,eK.Z)(),{data:t,loading:a,error:n}=(0,eB.a)(ewL),l="Settings - Taskade",r=t?.me??null,o=t?.myAccounts??null;return a?ev.createElement(e_u,null,ev.createElement(eI.Spinner,null)):null==r||null==o?ev.createElement(e_u,null,ev.createElement(efB,{message:e.formatMessage({id:"general.errors.load_user_data",defaultMessage:"There was a problem loading your user data, please relogin."})})):null!=n?ev.createElement(e_u,null,ev.createElement(efB,{message:e.formatMessage({id:"general.errors.load_settings",defaultMessage:"There was a problem loading your settings."})})):ev.createElement(e_u,null,ev.createElement(_2,{title:l,ogTitle:l}),ev.createElement(e_B,null),ev.createElement(ewZ,null),ev.createElement(ewB,{currentUser:r,accounts:o,samlSsoConfig:t?.samlSsoConfig}))},ewV=eL.default.a.withConfig({displayName:"Space__Wrapper",componentId:"sc-4ea3cb2-0"})` + display: flex; + align-items: center; + margin-left: ${e=>e.isSubspace?20:0}px; +`,ewq=(0,eL.default)(e__).withConfig({displayName:"Space__SpaceName",componentId:"sc-4ea3cb2-1"})` + margin-left: 8px; + color: ${e=>e.theme.textColors.hex(10)}; +`,ewW=function(e){let{className:t,space:a}=e;return ev.createElement(ewV,{href:"/settings/billing",className:t,isSubspace:a.is_subspace},ev.createElement(eI.ThemeProvider,{theme:{primaryColor:a.color}},ev.createElement(nA,{space:a,size:"sm"}),ev.createElement(ewq,null,a.name)))},ewH=function(e){let{tree:t}=e,{space:a,children:n}=t;return ev.createElement(ev.Fragment,null,ev.createElement(ewW,{space:a}),n.map(e=>ev.createElement(ewH,{key:e.id,tree:e})))},ewG=eL.default.ul.withConfig({displayName:"SpaceSelector__List",componentId:"sc-3357700f-0"})` + margin: 16px 0 0; + padding: 0; +`,ewK=eL.default.li.withConfig({displayName:"SpaceSelector__ListItem",componentId:"sc-3357700f-1"})` + display: flex; + list-style-type: none; + margin-bottom: 5px; + padding: 6px 10px; + color: #43bc6a; + + display: flex; + align-items: center; + overflow: clip; + position: relative; + + & svg { + margin-left: auto; + position: relative; + z-index: 2; + } + + & a { + position: relative; + z-index: 2; + pointer-events: none; + } + & input { + display: none; + margin-left: auto; + } + & label { + position: absolute; + top: 0; + width: 100%; + height: 100%; + left: 0; + } + & label:hover:after { + display: flex; + content: ''; + border-radius: 10px; + width: 100%; + height: 100%; + position: absolute; + top: 0; + z-index: 1; + background: ${e=>e.theme.appColors.hex(80)}; + cursor: pointer; + } +`,ewY=eL.default.div.withConfig({displayName:"SpaceSelector__IconCheck",componentId:"sc-3357700f-2"})` + margin-left: auto; + opacity: ${e=>e.$selected?"1":"0"}; + position: relative; + z-index: 2; + transition: opacity ease-in-out 100ms; + pointer-events: none; + + ${ewK}:hover & { + opacity: 1; + } +`,ewQ=function(e){let{edges:t,onSelect:a}=e,n=ev.useMemo(()=>{let e=[];for(let a of t)a.node.space.preferences?.isAppSumo===!0&&e.push(a.node.id);return e},[t]),[l,r]=ev.useState(new Set(n)),o=ev.useMemo(()=>{let e=[];for(let a of t)e.push(a.node);return e},[t]),i=ev.useMemo(()=>pI(o),[o]),s=e=>{let t=e.target.value;r(e=>(e.has(t)?e.delete(t):e.add(t),new Set(e)))};return(0,ev.useEffect)(()=>{let e=[];for(let a of t)l.has(a.node.id)&&e.push(a);a(e)},[t,a,l]),ev.createElement(ewG,null,i.map(e=>ev.createElement(ewK,{key:e.id},ev.createElement(ewH,{tree:e}),ev.createElement("label",{htmlFor:`check-${e.id}`}),ev.createElement("input",{type:"checkbox",checked:l.has(e.id),onChange:s,value:e.id,id:`check-${e.id}`}),ev.createElement(ewY,{$selected:l.has(e.id)},ev.createElement(tn.Icon,{icon:"dd_check"})))))},ewJ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OwnerMembershipsQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"membershipType"},value:{kind:"EnumValue",value:"space"}},{kind:"ObjectField",name:{kind:"Name",value:"role"},value:{kind:"StringValue",value:"owner",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"hasSpaceSubscription"},value:{kind:"BooleanValue",value:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MembershipParts"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SpaceParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Space"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MembershipParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Membership"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SpaceParts"}}]}}]}}]},ewX={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpacePreferencesAppSumoUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpacePreferencesAppSumoUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spacePreferencesAppSumoUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"spaces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"taskadePlan"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"usage"}}]}},{kind:"Field",name:{kind:"Name",value:"taskadePlanType"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}}]}}]}}]},ew0=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-36fc737a-0"})` + display: flex; + align-self: flex-start; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + color: #fff; + ${e1.UiTypography.sm}; + + border: none; + border-radius: 10px; + padding: 7px 20px; + font-weight: 500; + + &:hover { + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &:disabled { + color: ${e=>e.theme.appColors.hex(50)}; + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,ew1=eL.default.div.withConfig({displayName:"styled__Section",componentId:"sc-36fc737a-1"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; + color: #ccc; + max-width: ${e=>e.$fullwidth?"1024px":"430px"}; +`,ew2=eL.default.h2.withConfig({displayName:"styled__Heading",componentId:"sc-36fc737a-2"})` + color: ${e=>e.theme.textColors.hex(10)}; + margin: 0 0 5px; + ${e1.UiTypography.lg}; +`,ew5=eL.default.p.withConfig({displayName:"styled__Paragraph",componentId:"sc-36fc737a-3"})` + display: inline; + padding: 0; + margin: 0 0 10px; + color: ${e=>e.theme.appColors.hex(20)}; + ${e1.UiTypography.sm}; + line-height: 1.2rem; + margin-bottom: 24px; + + & a { + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,ew3=eL.default.p.withConfig({displayName:"styled__PlanDescription",componentId:"sc-36fc737a-4"})` + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + line-height: 21px; + margin-top: 4px; +`,ew4=eL.default.div.withConfig({displayName:"styled__Plan",componentId:"sc-36fc737a-5"})` + display: flex; + flex-direction: column; + margin: 5px 0 20px; +`,ew6=eL.default.div.withConfig({displayName:"styled__PlanName",componentId:"sc-36fc737a-6"})` + display: inline-flex; + align-items: center; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.sm}; + line-height: 22px; +`;eL.default.div.withConfig({displayName:"styled__Actions",componentId:"sc-36fc737a-7"})` + display: flex; + margin-top: 16px; + margin-bottom: 16px; + gap: 12px; +`,eL.default.button.withConfig({displayName:"styled__ManageButton",componentId:"sc-36fc737a-8"})` + display: flex; + width: auto; + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + ${e1.UiTypography.sm}; + font-weight: 500; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`;let ew8=eL.default.button.withConfig({displayName:"styled__CancelButton",componentId:"sc-36fc737a-9"})` + display: flex; + opacity: 0; + width: auto; + ${e1.UiTypography.sm}; + margin-top: auto; +`,ew7=eL.default.div.withConfig({displayName:"styled__FooterSection",componentId:"sc-36fc737a-10"})` + display: flex; + align-items: center; + + & span { + ${e1.UiTypography.sm}; + margin-left: 16px; + color: ${e=>e.theme.appColors.hex(50)}; + } +`,ew9=(0,eL.default)(e1.Notice).withConfig({displayName:"styled__StyledNotice",componentId:"sc-36fc737a-11"})` + display: flex; + margin-top: 12px; + padding: 12px 16px; + ${e1.UiTypography.sm}; + color: ${eI.ThemeColors.success}; +`,eNe=(0,eL.default)(e1.Notice).withConfig({displayName:"styled__StyledErrorNotice",componentId:"sc-36fc737a-12"})` + display: flex; + margin-top: 12px; + padding: 12px 16px; + ${e1.UiTypography.sm}; + color: ${eI.ThemeColors.danger}; +`,eNt=function(){let e=(0,eF.k6)(),[t,a]=(0,ev.useState)(!1),[n,l]=(0,ev.useState)(!1),[r,o]=ev.useState(!1),i=ev.useRef(null),s=ev.useRef(null),d=ev.useRef(null),{arrowProps:c,popperProps:m,referenceProps:u}=(0,eI.useControlledTooltip)({referenceElementRef:i,arrowElementRef:s,popperElementRef:d,placement:"top",visible:r}),p=ev.useCallback(()=>{o(!0)},[]),g=ev.useCallback(()=>{o(!1)},[]),{data:f,loading:h,error:y}=(0,eB.a)(ewJ,{fetchPolicy:"network-only"}),[b]=(0,cs.D)(ewX),{data:v,loading:k,error:E}=(0,eB.a)(ED),x=v?.me?.appSumo?.planName??"Unknown",_=v?.me?.appSumo?.invoiceItemUuid??"",w=_.startsWith("rc:"),N=!_.startsWith("warroom")&&!_.startsWith("stripe:")&&!w,C=v?.me?.email,[M,S]=ev.useState([]),I=()=>{if(""!==_){window.open(`/billing/appsumo/invoices/${_}`,"_blank","noopener,noreferrer");return}},D=f?.memberships?.edges??[];if(h||k||null!=y||null!=E)return ev.createElement(e_u,null,ev.createElement(eI.Spinner,{height:319}));let T=v?.me;if(null==T||null==T.appSumo)return e.push({pathname:"/settings"}),null;let $=T.appSumo.taskadePlanType,P=T.appSumo.state,F=P.quantity["workspace.member.limit"]??0;if("free"===$)return e.push({pathname:"/settings"}),null;let A=fR.Vl.getQuantity("workspace.limit",P);return ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:"Billing"}),ev.createElement("div",{className:"flex max-w-5xl flex-col gap-10"},ev.createElement("div",{className:"flex"},ev.createElement(ew1,{$fullwidth:!0},ev.createElement(ew2,null,ev.createElement(eY.Z,{id:"general.activate_your_workspaces",defaultMessage:"Activate Your Workspaces"})),ev.createElement(ew5,null,ev.createElement(eY.Z,{id:"general.activate_premium_features_help",defaultMessage:"Enable premium features for your workspaces with our all-in-one subscription. Are you looking to update or upgrade your plan? Learn how here. For tutorials and guides, please visit our Help Center. If you need help or have any questions, please contact us.",values:{link1:e=>ev.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://www.taskade.com/contact"},e),link2:e=>ev.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://help.taskade.com"},e),link3:e=>ev.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://help.taskade.com/hc/en-us/articles/360016328713--Upgrade-to-Premium-Plans#4-add-seats---members"},e)}})),ev.createElement("div",{className:"mt-3"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.plan",defaultMessage:"Plan"})),ev.createElement(ew4,null,ev.createElement(ew6,null,("v3.business"===$||"v3.ultimate"===$)&&F>0?ev.createElement("strong",null,ev.createElement("span",null,`${x} `),ev.createElement(eY.Z,{id:"general.billing_number_of_seats",defaultMessage:"({numberOfSeats} seats)",values:{numberOfSeats:F}})):ev.createElement("strong",null,x)),N&&ev.createElement(ew3,null,ev.createElement(eY.Z,{id:"general.appsumo_description",defaultMessage:"To redeem your lifetime deal select the workspaces you’d like to upgrade. You may visit this page at anytime to change or upgrade additional workspaces."})),w&&ev.createElement(ew3,null,ev.createElement(eY.Z,{id:"general.revenuecat_description",defaultMessage:"To manage your subscription on iOS go to Settings > Account > Subscriptions. For Google Play, open the Google Play app, tap on your profile picture, select 'Payments & subscriptions', and then choose 'Subscriptions'."})),ev.createElement("div",{className:"my-2 flex gap-2"},("v3.business"===$||"v3.ultimate"===$)&&ev.createElement("button",{className:"hover:border-primary-dark hover:text-primary-dark flex items-center justify-center rounded-lg border border-solid border-primary bg-appcolor-100 px-6 py-2 text-sm text-primary hover:bg-appcolor-200 disabled:opacity-50",onClick:I,disabled:""===_},ev.createElement(eY.Z,{id:"general.plan_add_seats",defaultMessage:"Add Seats"})),!w&&ev.createElement("button",{className:"flex rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-2 text-sm text-appcolor-700 hover:border-appcolor-400 hover:bg-appcolor-200 hover:text-appcolor-900",onClick:I,disabled:""===_},ev.createElement(eY.Z,{id:"general.manage_plans",defaultMessage:"Manage / Update Plan"})),!N&&!w&&ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"flex rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-2 text-sm text-appcolor-700 hover:border-appcolor-400 hover:bg-appcolor-200 hover:text-appcolor-900",onClick:I,disabled:""===_},ev.createElement(eY.Z,{id:"general.change_payment",defaultMessage:"Change Payment"})),ev.createElement("button",{className:"flex rounded-lg border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-2 text-sm text-appcolor-700 hover:border-appcolor-400 hover:bg-appcolor-200 hover:text-appcolor-900",onClick:I,disabled:""===_},ev.createElement(eY.Z,{id:"general.plan_view_invoices",defaultMessage:"View Invoices"})))))),ev.createElement("div",{className:"mt-3"},ev.createElement("div",null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.workspace",defaultMessage:"Workspace"})),ev.createElement("button",{...u,onMouseEnter:p,onMouseLeave:g},ev.createElement("div",{className:"ml-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-appcolor-200 text-xs font-bold text-appcolor-500 transition duration-150 ease-in-out hover:bg-appcolor-400"},"?")),r&&ev.createElement(eI.Tooltip,{arrowProps:c,popperProps:m},ev.createElement("div",{className:"w-56 break-words text-center"},ev.createElement(eY.Z,{id:"general.billing.select-activate-tooltip",defaultMessage:"Select and activate premium features for your workspaces based on your subscription plan."})))),ev.createElement(ew1,null,t&&ev.createElement(ew9,{$type:"success"},ev.createElement(eY.Z,{id:"general.appsumo_upgrade_success",defaultMessage:"Your workspaces have been upgraded!"})),n&&ev.createElement(eNe,{$type:"danger"},ev.createElement(eY.Z,{id:"general.please_select_a_workspace_to_activate",defaultMessage:"Please select a workspace to activate."})),ev.createElement(ewQ,{edges:D,onSelect:S})),ev.createElement(ew7,null,ev.createElement(ew0,{onClick:()=>{let e=[];for(let t of M)e.push(t.node.space.id);if(0===e.length){l(!0);return}b({variables:{input:{clientMutationId:(0,ld.Z)(),spaceIds:e}},refetchQueries:[{query:ED}]}),a(!0),l(!1)},disabled:"unlimited"!==A&&M.length>A},ev.createElement(eY.Z,{id:"general.activate_selected_workspaces",defaultMessage:"Activate Selected Workspaces"})),"unlimited"!==A&&ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.appsumo_select_up_to",defaultMessage:"Select up to {workspaceLimit} workspaces",values:{workspaceLimit:A}})))," ")))),ev.createElement(ew8,{onClick:()=>{if("undefined"==typeof profitwell){window.open("mailto:support@taskade.com?subject=Cancel+Subscription");return}null!=C&&profitwell("start",{user_email:C});let e=_.startsWith("stripe:")?_.substring(7):null;profitwell("init_cancellation_flow",{subscription_id:e}).then(e=>{"retained"!==e.status&&"aborted"!==e.status&&window.open("mailto:support@taskade.com?subject=Cancel+Subscription")})},disabled:""===_},ev.createElement(eY.Z,{id:"general.cancel_plan",defaultMessage:"Cancel plan"})))},eNa=(0,la.ZP)` + query ArchivedMemberships { + spaceMemberships: memberships(filterby: { archived: true }) { + totalCount + edges { + node { + id + role + order + space { + id + name + color + is_subspace + is_unread + member_count + parent_id + archived_at + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + } + sharedSpaceMemberships: memberships(filterby: { membershipType: shared, archived: true }) { + totalCount + edges { + node { + id + role + space { + id + name + color + is_subspace + member_count + parent_id + archived_at + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + } + } +`,eNn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"WorkspaceDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"WorkspaceDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workspaceDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eNl=eL.default.div.withConfig({displayName:"DeleteSpaceDialogBody__FlexContainer",componentId:"sc-1e87efb9-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,eNr=(0,eI.getColorScheme)(eI.ThemeColors.danger),eNo=(0,eL.default)(e1.Notice).withConfig({displayName:"DeleteSpaceDialogBody__StyledNotice",componentId:"sc-1e87efb9-1"})` + color: ${eI.ThemeColors.danger}; + border-color: ${eI.ThemeColors.danger}; + background: ${eNr?.alpha10}; + margin: 0 0 20px; + ${e1.UiTypography.sm}; +`,eNi=eL.default.h1.withConfig({displayName:"DeleteSpaceDialogBody__Header",componentId:"sc-1e87efb9-2"})` + ${e1.ArticleTypography.heading3}; + font-weight: 500; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,eNs=function(e){let{space:t}=e,{handleDelete:a,handleToggle:n,deleting:l,deleteError:r,confirmationKey:o,setConfirmationKey:i}=function(e){let{space:t,exit:a}=e,n=(0,eF.k6)(),[l,r]=(0,ev.useState)(""),o=t.parent_id??t.parent_membership?.space.id??null,[i,{loading:s,error:d}]=(0,cs.D)(eNn,{update:e=>{if(null==o)return;let a=e.readQuery({query:x1,variables:{workspaceId:o}});null!=a&&e.writeQuery({query:x1,variables:{workspaceId:o},data:(0,es.ZP)(a,e=>{if(null==e.memberships)return e;let a=e.memberships.edges.filter(e=>!(e.node.space.id===t.id||e.node.space.parent_id===t.id));return e.memberships.edges=a,e})});let n=e.readQuery({query:eNa});null!=n&&e.writeQuery({query:eNa,data:(0,es.ZP)(n,e=>{let a=e.spaceMemberships.edges.filter(e=>!(e.node.space.id===t.id||e.node.space.parent_id===t.id));e.spaceMemberships.edges=a})})},onQueryUpdated:e=>{if("ActiveSubspaceMembershipsQuery"===e.queryName||"ArchivedMemberships"===e.queryName)return e.refetch()}});return{handleDelete:e=>{i({variables:{input:{clientMutationId:(0,ld.Z)(),spaceID:t.id,confirmationKey:l}}}).then(()=>{if(a(!0),t.parent_membership?.space.id)n.push(`/spaces/${t.parent_membership?.space.id}`);else{if(window.location.href.includes("/settings/archives"))return;n.push("/")}})},handleToggle:e=>{a()},deleting:s,deleteError:d,confirmationKey:l,setConfirmationKey:r}}(e),s=(0,ev.useRef)();return((0,ev.useEffect)(()=>{s.current&&s.current.focus()},[]),l)?ev.createElement(eNl,null,ev.createElement(eI.Spinner,null)):ev.createElement(eNl,null,ev.createElement(eNi,null,ev.createElement(eY.Z,{id:"general.delete_workspace_header",defaultMessage:"Delete {spaceName}",values:{spaceName:t.name}})),r&&ev.createElement(rO,{margin:"0 0 10px 0"},r.graphQLErrors?.[0]?.extensions?.exception?.details??r.graphQLErrors?.[0]?.message),ev.createElement(rP,null,t.is_subspace?ev.createElement(eNo,null,ev.createElement(eY.Z,{id:"general.delete_folder_confirmation",defaultMessage:"Are you sure you want to delete {spaceName}? All projects in this folder will be lost.",values:{spaceName:t.name,strong:e=>ev.createElement("strong",null,e)}})):ev.createElement(eNo,null,ev.createElement(eY.Z,{id:"general.delete_workspace_folders_confirmation",defaultMessage:"By deleting this {spaceName}, you will delete all folders and projects. All your data and billing credits will be lost, this can't be reverted.",values:{spaceName:t.name,strong:e=>ev.createElement("strong",null,e)}}))),ev.createElement(rL,{htmlFor:"confirmation-key"},ev.createElement(eY.Z,{id:"general.delete_workspace_confirmation_key",defaultMessage:"Please type {spaceName} to confirm.",values:{spaceName:t.name,b:e=>ev.createElement("b",null,e)}})),ev.createElement(rB,null,ev.createElement(rz,{ref:s,id:"confirmation-key",type:"text",onChange:e=>{let{value:t}=e.target;i(t)},onKeyPress:e=>{"Enter"===e.key&&o===t.name&&a()},value:o})),ev.createElement(rF,null,ev.createElement(rj,{onClick:n},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(rR,{disabled:o!==t.name,onClick:a},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))},eNd=(0,e$.connect)(function(e){return{isOpen:ec()(e,["modal","spaceDelete","isOpen"],!1)}},function(e){return(0,ek.DE)({onToggle:rb},e)})(function(e){let{isOpen:t,onToggle:a,role:n,space:l}=e;return Eu({role:n,action:"delete"})&&t?ev.createElement(eI.ModalDialog,{autofocus:!1,isOpen:t,close:a},e=>{let{exit:t}=e;return ev.createElement(eNs,{exit:t,space:l})}):null}),eNc=(0,la.ZP)` + mutation RestoreSpace($input: ArchiveSpaceInput!) { + archiveSpace(input: $input) { + clientMutationId + ok + memberships { + id + order + space { + id + archived_at + } + } + } + } +`,eNm=eL.default.div.withConfig({displayName:"Styles__StyledTable",componentId:"sc-e7d88994-0"})` + display: flex; + flex-direction: column; +`,eNu=eL.default.div.withConfig({displayName:"Styles__StyledTableHead",componentId:"sc-e7d88994-1"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + grid-template-columns: 200px 1fr 1fr; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 13px; + font-weight: 500; + text-transform: uppercase; + padding: 16px 0 10px; + + @media (min-width: 480px) { + grid-template-columns: 300px 1fr 1fr; + } + + @media (min-width: 992px) { + grid-template-columns: 50% 1fr 1fr; + } + + @media (min-width: 1200px) { + grid-template-columns: 30% 1fr 1fr; + } +`,eNp=eL.default.div.withConfig({displayName:"Styles__StyledTableRow",componentId:"sc-e7d88994-2"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + grid-template-columns: 200px 1fr 1fr; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 16px 0; + + @media (min-width: 480px) { + grid-template-columns: 300px 1fr 1fr; + } + + @media (min-width: 992px) { + grid-template-columns: 50% 1fr 1fr; + } + + @media (min-width: 1200px) { + grid-template-columns: 30% 1fr 1fr; + } +`,eNg=eL.default.div.withConfig({displayName:"Styles__StyledTableCell",componentId:"sc-e7d88994-3"})` + text-align: ${e=>e.align??"left"}; + display: ${e=>e.hide?"none":"block"}; + + a { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + + &:hover, + :visited { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + } + } + + @media (min-width: 992px) { + display: block; + } +`,eNf=eL.default.button.withConfig({displayName:"Styles__StyledDropdownToggle",componentId:"sc-e7d88994-4"})` + border: 0; + padding: 0; + background: none; + cursor: pointer; + color: ${e=>e.theme.textColors.hex("70")}; + + &:hover { + color: ${e=>e.theme.textColors.hex("10")}; + } + + &:focus { + outline: 0; + } +`,eNh=eL.default.div.withConfig({displayName:"Styles__StyledWorkspace",componentId:"sc-e7d88994-5"})` + display: grid; + grid-template-columns: 30px auto; + grid-gap: 5px; + align-items: center; +`,eNy=eL.default.div.withConfig({displayName:"Styles__StyledDropdownToggleWrapper",componentId:"sc-e7d88994-6"})` + display: flex; + justify-content: flex-end; +`;eL.default.div.withConfig({displayName:"Styles__FlexContainer",componentId:"sc-e7d88994-7"})` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + min-height: 320px; +`,eL.default.p.withConfig({displayName:"Styles__BodyText",componentId:"sc-e7d88994-8"})` + color: #bfbfbf; + font-size: 1.125rem; + text-align: center; +`,eL.default.img.withConfig({displayName:"Styles__EmptyImage",componentId:"sc-e7d88994-9"})` + display: flex; + margin-bottom: 12px; +`;let eNb=(0,eL.default)(eI.Menu).withConfig({displayName:"SpaceItem__StyledMenu",componentId:"sc-68ce97c1-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,eNv=ev.memo(function(e){let{membership:t,isParentArchived:a,onDelete:n}=e,[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{o.current?.focus()},[]);(0,eI.usePopupEvents)({state:l,onCollapse:s});let d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"bottom-start"}),c=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),m=ev.useCallback(()=>{r({type:"Collapse"})},[]),[u]=(0,cs.D)(eNc),p=pW({role:t.role,action:"archive"}),g=pW({role:t.role,action:"delete"}),f=e=>{u({variables:{input:{id:e.space.id,archived:!1,clientMutationId:(0,ld.Z)()}},refetchQueries:[{query:lu,variables:lg(!1,e.space.parent_id)}],update:(t,a)=>{let{data:n,errors:l}=a;if(null!=l||null==n)return;let r=t.readQuery({query:eNa});null!=r&&t.writeQuery({query:eNa,data:(0,es.ZP)(r,t=>{let a=t.spaceMemberships.edges.filter(t=>t.node.space.id!==e.space.id&&t.node.space.parent_id!==e.space.id),n=t.sharedSpaceMemberships.edges.filter(t=>t.node.space.id!==e.space.id&&t.node.space.parent_id!==e.space.id);return t.spaceMemberships.edges=a,t.sharedSpaceMemberships.edges=n,t})})}})};return ev.createElement(eNp,null,ev.createElement(eNg,null,ev.createElement(sC.rU,{to:`/spaces/${t.space.id}`},t.space.is_subspace&&a?ev.createElement(eNh,{style:{marginLeft:"20px"}},ev.createElement(e_x,{space:t.space,size:"large"}),ev.createElement(e__,null,t.space.name)):ev.createElement(eNh,null,ev.createElement(e_x,{space:t.space,size:"large"}),ev.createElement(e__,null,t.space.name)))),ev.createElement(eNg,null,ev.createElement("span",{style:{textAlign:"right",flex:1}},t.space.member_count)),ev.createElement(eNg,null,ev.createElement(eNy,null,p||g?ev.createElement(eNf,{type:"button",...c.props},ev.createElement(tn.Icon,{icon:"header_more"})):null),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:m},ev.createElement(eNb,{initialFocus:d.initialFocus,loop:!0},p&&!a&&ev.createElement(cF,{onClick:()=>f(t)},t.space.is_subspace?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_restore"}),ev.createElement(eY.Z,{id:"general.folder_restore",defaultMessage:"Restore Folder"})):ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_restore"}),ev.createElement(eY.Z,{id:"general.workspace_restore",defaultMessage:"Restore Workspace"}))),g&&ev.createElement(cF,{$warning:!0,onClick:()=>{n(t)}},t.space.is_subspace?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.folder_delete",defaultMessage:"Delete Folder"})):ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.workspace_delete",defaultMessage:"Delete Workspace"}))))))))}),eNk=eL.default.p.withConfig({displayName:"ArchivesScreen__NoArchives",componentId:"sc-ea30a4c3-0"})` + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + padding: 0; + margin: 20px 0 0; +`,eNE=function(){let e=(0,eK.Z)(),t=(0,e$.useDispatch)(),[a,n]=(0,ev.useState)(null),{data:l,error:r,loading:o}=(0,eB.a)(eNa,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),i=l?.sharedSpaceMemberships?.edges??[],s=(l?.spaceMemberships?.edges??[]).filter(e=>null==i.find(t=>t.node.id===e.node.id)),d=s.reduce((e,t)=>e.set(t.node.space.id,t),new Map),c=s.reduce((e,t)=>{let a=t.node.space.parent_id;if(null==a){let a=e.get(t.node.space.id)??[];return 0===a.length?e.set(t.node.space.id,[]):e.set(t.node.space.id,[...a])}let n=e.get(a)??[];return e.set(a,[...n,t])},new Map),m=e=>{n(e),t(rb())};return o||null!=r?ev.createElement(e_u,null,ev.createElement(eI.Spinner,{height:319})):ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.archives",defaultMessage:"Archives"})}),ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.archives",defaultMessage:"Archives"})),ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.archives_description",defaultMessage:"Manage your archived spaces. Whether it's a workspace or a folder, you can restore or delete them."})),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eNm,null,ev.createElement(eNu,null,ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.spaces_heading",defaultMessage:"Spaces"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.members_heading",defaultMessage:"Members"}))),o||0!==i.length||0!==s.length?null:ev.createElement(eNk,null,ev.createElement(eY.Z,{id:"general.no_archives",defaultMessage:"You have no archived spaces."})),[...c.keys()].map(e=>{let t=d.get(e);return null==t?c.get(e)?.map(e=>ev.createElement(eNv,{key:e.node.id,membership:e.node,onDelete:m})):ev.createElement("div",{key:t.node.space.id},ev.createElement(eNv,{membership:t.node,onDelete:m}),c.get(t.node.space.id)?.map(e=>ev.createElement("div",{className:"subspaces",key:e.node.space.id},ev.createElement(eNv,{membership:e.node,isParentArchived:!!t.node.space.archived_at,onDelete:m}))))}),i.map(e=>ev.createElement(eNv,{key:e.node.space.id,membership:e.node,onDelete:m}))),null!=a?ev.createElement(eNd,{role:a.role,space:a.space}):null))},eNx=(0,la.ZP)` + query MyWorkspacesInfoQuery { + me { + id + memberships(filterby: { actions: "manage_billing", is_subspace: false }) { + id + role + space { + id + color + name + type + billable_members { + totalCount + } + preferences { + trialEndedAt + isAppSumo + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + current_subscription { + id + status + payload + started_at + ended_at + renewed_at + } + } + } + } + } +`,eN_=eL.default.div.withConfig({displayName:"Styles__StyledTable",componentId:"sc-3fa933f6-0"})` + display: flex; + flex-direction: column; +`,eNw=eL.default.div.withConfig({displayName:"Styles__StyledTableHead",componentId:"sc-3fa933f6-1"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + align-items: center; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + grid-template-columns: 2fr 1.5fr; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 16px 0 10px; + + @media (min-width: 992px) { + grid-template: + 'workspace plan members expires actions' + / 17% 15% 13% 15% 25%; + } +`,eNN=eL.default.div.withConfig({displayName:"Styles__StyledTableRow",componentId:"sc-3fa933f6-2"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + align-items: center; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + grid-template-columns: 2fr 1.5fr; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 16px 0; + + @media (min-width: 992px) { + grid-template: + 'workspace plan members expires actions' + / 17% 15% 13% 15% 25%; + } +`,eNC=eL.default.div.withConfig({displayName:"Styles__StyledTableCell",componentId:"sc-3fa933f6-3"})` + text-align: ${e=>e.align??"left"}; + display: ${e=>e.hide?"none":"block"}; + + a { + color: ${e=>e.theme.appColors.hex(10)}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + } + + @media (min-width: 992px) { + display: block; + } +`,eNM=eL.default.div.withConfig({displayName:"WorkspacesRow__StyledWorkspace",componentId:"sc-59a565ac-0"})` + display: grid; + grid-template-columns: 30px auto; + grid-gap: 5px; + align-items: center; +`,eNS=eL.default.a.withConfig({displayName:"WorkspacesRow__StyledPlan",componentId:"sc-59a565ac-1"})` + text-transform: capitalize; + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + + span { + display: none; + + @media (min-width: 768px) { + display: inline; + } + } + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base} !important; + } +`,eNI=eL.default.button.withConfig({displayName:"WorkspacesRow__StyledButton",componentId:"sc-59a565ac-2"})` + cursor: pointer; + border-radius: 0.625rem; + font-size: 0.9375rem; + font-weight: bold; + padding: 0.375rem 0.75rem; + font-weight: 600; + transition: background-color ease-in 0.2s; + margin-right: 0.5rem; + border: 0; + outline: 0; + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + background: ${e=>e.theme?.primaryColorScheme?.alpha20}; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha30}; + color: ${e=>e.theme?.primaryColorScheme?.darker10}; + } +`,eND=eL.default.div.withConfig({displayName:"WorkspacesRow__StyledTooltipContent",componentId:"sc-59a565ac-3"})` + max-width: 320px; + text-align: center; +`,eNT={free:(0,te.Em)({id:"general.plan_tooltip_free",defaultMessage:"You are on the Free plan. Create as many tasks, projects, and folders as you'd like. Share your projects and invite others to collaborate in your folders and workspace for free."}),unlimited:(0,te.Em)({id:"general.plan_tooltip_unlimited",defaultMessage:"You are on the Unlimited plan. All premium features are unlocked members in the workspace. Share your projects for free and invite others to collaborate. Only folder and workspace members are billable."}),lite:(0,te.Em)({id:"general.plan_tooltip_free",defaultMessage:"You are on the Free plan. Create as many tasks, projects, and folders as you'd like. Share your projects and invite others to collaborate in your folders and workspace for free."}),trial:(0,te.Em)({id:"general.plan_tooltip_trial",defaultMessage:"You are on a free trial of our premium plan. Once the trial ends, we'll automatically move your workspace to our free plan unless you choose to upgrade."}),AppSumo:(0,te.Em)({id:"general.plan_tooltip_appsumo_update",defaultMessage:"You are on a custom plan. All premium features are unlocked in the workspace. Share your projects for free and invite others to collaborate."})},eN$={free:"Free",unlimited:"Unlimited",lite:"Free",trial:"Unlimited (Trial)",AppSumo:"Custom"},eNP=function(e){let{interval:t}=e;return ev.createElement("span",null,"year"===t?"Yearly":"Monthly")},eNF=function(e){let t=(0,e$.useDispatch)(),{index:a,membership:n}=e,{space:l}=n,{id:r,color:o,name:i,preferences:s,type:d,billable_members:c,current_subscription:m}=l,u=pW({role:n.role,action:"manage_settings"}),p=s?.trialEndedAt??null,g=s?.isAppSumo??null,f="starter"===d?"free":d;"unlimited"===d&&(null!=p&&null==m&&cc().unix(p).isAfter(cc()())&&(f="trial"),g&&(f="AppSumo"));let[h,y]=ev.useState(!1),b=ev.useRef(null),v=ev.useRef(null),k=ev.useRef(null),{arrowProps:E,popperProps:x,referenceProps:_}=(0,eI.useControlledTooltip)({referenceElementRef:b,arrowElementRef:v,popperElementRef:k,placement:"top",visible:h});return ev.createElement(eNN,{index:a},ev.createElement(eNC,null,ev.createElement(sC.rU,{to:`/settings/billing/${r}`},ev.createElement(eNM,null,ev.createElement(e_x,{color:o,space:l,size:"small",imgSize:26,fontSize:15}),ev.createElement(e__,null,i)))),ev.createElement(eNC,{hide:!0},ev.createElement(eNS,{..._,href:"AppSumo"===f?"/settings/plans":"/upgrade",target:"_blank",onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},rel:"noopener noreferrer"},eN$[f]," ",m&&"unlimited"===d&&"trial"!==f&&ev.createElement(eNP,{interval:m.payload.plan.interval})),h&&ev.createElement(eI.Tooltip,{arrowProps:E,popperProps:x},ev.createElement(eND,null,ev.createElement(eY.Z,eNT[f])))),ev.createElement(eNC,{hide:!0},u?ev.createElement(sC.rU,{to:`/settings/billing/${r}/members`},ev.createElement(eY.Z,{id:"general.member_count",defaultMessage:"{count, plural, =0 {no members} one {{count} member} other {{count} members}}",values:{count:c?.totalCount??1}})):ev.createElement(eY.Z,{id:"general.member_count",defaultMessage:"{count, plural, =0 {no members} one {{count} member} other {{count} members}}",values:{count:c?.totalCount??1}})),ev.createElement(eNC,null,"free"===f||"lite"===f||"trial"===f?ev.createElement(eNI,{onClick:()=>{t(d4(r))}},ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})):"AppSumo"===f?null:ev.createElement(sC.rU,{to:`/settings/billing/${r}`},ev.createElement(eNI,null,ev.createElement(eY.Z,{id:"general.manage_subscription",defaultMessage:"Manage Subscription"})))))},eNA=function(){let{data:e,error:t,loading:a}=(0,eB.a)(eNx);if(a)return ev.createElement(eI.Spinner,null);if(null!=t)return ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.error_billable_workspace",defaultMessage:"Error loading billable workspace."}));let n=e?.me?.memberships??[];return ev.createElement(eN_,null,ev.createElement(eNw,null,ev.createElement(eNC,null,ev.createElement(e_y,null,ev.createElement(eY.Z,{id:"general.workspace",defaultMessage:"Workspace"}))),ev.createElement(eNC,{hide:!0},ev.createElement(e_y,null,ev.createElement(eY.Z,{id:"general.plan",defaultMessage:"Plan"}))),ev.createElement(eNC,{hide:!0},ev.createElement(e_y,null,ev.createElement(eY.Z,{id:"general.members",defaultMessage:"Members"}))),ev.createElement(eNC,null,ev.createElement(e_y,null,ev.createElement(eY.Z,{id:"general.actions",defaultMessage:"Actions"})))),n.map((e,t)=>ev.createElement(eNF,{key:e.space.id,index:t,membership:e})))},eNR=eL.default.a.withConfig({displayName:"BillingType__StyledLink",componentId:"sc-b2a802d5-0"})` + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + + &:hover, + :visited { + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + } + + &:hover { + opacity: 0.8; + } +`,eNj=function(){return ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.billing_manage_workspaces_upgrade",defaultMessage:"Manage all your workspaces under one subscription. Discover the benefits of our All-in-One Premium Plans.",values:{plans:e=>ev.createElement(eNR,{target:"_blank",rel:"noopener noreferrer",href:"/upgrade"},e)}})),ev.createElement(eNA,null))},eNO=function(){let e="Billing - Taskade",t=(0,eK.Z)();return ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:t.formatMessage({id:"general.billing",defaultMessage:"Billing"})}),ev.createElement(_2,{title:e,ogTitle:e}),ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.billing",defaultMessage:"Billing"})),ev.createElement(eNj,null))};var eNU=a(96026),eNZ=a.n(eNU);let eNL=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-9706ed90-0"})` + display: flex; + margin: 20px 0 30px; + justify-content: center; +`,eNB=(0,eL.default)(sC.rU).withConfig({displayName:"styled__PageLink",componentId:"sc-9706ed90-1"})` + display: ${e=>e.disabled?"none":"flex"}; + align-items: center; + border-radius: 5px; + background: ${e=>e.active&&e.theme?.primaryColorScheme.base}; + padding: 4px 10px; + border: 0; + font-size: 15px; + color: ${e=>e.active?"#fff":"#999"} !important; + + & path { + fill: #999; + } + + &:hover { + color: ${e=>e.active?"#fff":e.theme?.primaryColorScheme.base} !important; + & path { + fill: ${e=>e.theme?.primaryColorScheme.base}; + } + cursor: pointer; + } +`,eNz=()=>window.scrollTo(0,0),eNV=function(e){let{children:t,pathname:a,params:n,hash:l,at:r,i:o}=e,i=e.showActive??!1,s=new URLSearchParams(Array.from(n.entries()));s.set("page",`${o}`);let d=s.toString(),c=`${a}?${d}${l}`;return ev.createElement(eNB,{active:i&&o===r,to:c,onClick:eNz},t)},eNq=function(e){let{pathname:t,params:a,hash:n,at:l,total:r}=e,o=Math.min(r,l+1);return o===l?null:ev.createElement(eNV,{pathname:t,params:a,hash:n,at:l,i:o},ev.createElement(tn.Icon,{icon:"default_caret_right"}))},eNW=function(e){let{pathname:t,params:a,hash:n,at:l}=e,r=Math.max(1,l-1);return r===l?null:ev.createElement(eNV,{pathname:t,params:a,hash:n,at:l,i:r},ev.createElement(tn.Icon,{icon:"default_caret_left"}))},eNH=function(e){let{hash:t,itemPerPage:a,pathname:n,search:l,totalCount:r}=e,o=Math.ceil(r/a);if(o<=1)return null;let i=new URLSearchParams(l),s=Number(i.get("page")??1),d=Number.isNaN(s)?1:s,c=Math.max(1,d-3),m=Math.min(o,d+3)+1;return ev.createElement(eNL,null,ev.createElement(eNW,{pathname:n,params:i,hash:t,at:d}),eNZ()(c,m).map(e=>ev.createElement(eNV,{pathname:n,params:i,hash:t,at:d,i:e,key:`page-${e}`,showActive:!0},e)),ev.createElement(eNq,{pathname:n,params:i,hash:t,at:d,total:o}))},eNG=function(e){let{sort:t,direction:a,children:n}=e,l=(0,eF.TH)(),r=new URLSearchParams(l.search);r.set("sort",`${t}-${"asc"===a?"desc":"asc"}`);let o=r.toString(),i={pathname:l.pathname,hash:l.hash,search:o};return ev.createElement(sC.rU,{to:i},n," ","asc"===a?"↓":"↑")},eNK={sort:"handle",direction:"asc"},eNY={sort:"name",direction:"asc"},eNQ={member:new Set(["handle"]),folder:new Set(["name"])},eNJ=new Set(["asc","desc"]);function eNX(e,t){let a=new URLSearchParams(e).get("sort");if(null==a)return null;let n=a.match(/^(.+)-(.+)$/);if(null==n)return null;let l=n[1],r=n[2],o=eNQ[t];return(null==o||o.has(l))&&eNJ.has(r)?{sort:l,direction:r}:null}let eN0=eL.default.div.withConfig({displayName:"styled__AccessContainer",componentId:"sc-fe71a6a3-0"})` + display: flex; + flex-direction: column; + overflow-y: scroll; + ${tS} +`,eN1=eL.default.h1.withConfig({displayName:"styled__AccessTitle",componentId:"sc-fe71a6a3-1"})` + ${e1.UiTypography.sm}; + font-weight: 500; + color: ${e=>e.theme.appColors.hex(10)}; + margin-bottom: 2px; +`,eN2=eL.default.p.withConfig({displayName:"styled__AccessDescription",componentId:"sc-fe71a6a3-2"})` + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + padding: 0; + margin: 0; +`,eN5=eL.default.span.withConfig({displayName:"styled__Subtitle",componentId:"sc-471f50c1-0"})` + margin-bottom: 5px; + font-weight: 500; + text-transform: uppercase; + ${e1.UiTypography.xs}; + color: ${e=>e.theme.appColors.hex(50)}; +`,eN3=eL.default.div.withConfig({displayName:"styled__StyledTable",componentId:"sc-471f50c1-1"})` + display: flex; + flex-direction: column; +`,eN4=eL.default.div.withConfig({displayName:"styled__StyledTableHead",componentId:"sc-471f50c1-2"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + align-items: center; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + grid-template-columns: 35% 10% 10% 1fr auto; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 0 0 10px; + + @media (min-width: 992px) { + grid-template: + 'name member project status options' + / 35% 10% 10% 1fr auto; + } +`,eN6=eL.default.div.withConfig({displayName:"styled__StyledTableRow",componentId:"sc-471f50c1-3"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + align-items: center; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + grid-template-columns: 35% 10% 10% 1fr auto; + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + padding: 8px 0; + + @media (min-width: 992px) { + grid-template: + 'name member project status options' + / 35% 10% 10% 1fr auto; + } +`,eN8=eL.default.div.withConfig({displayName:"styled__StyledTableCell",componentId:"sc-471f50c1-4"})` + text-align: ${e=>e.align??"left"}; + display: ${e=>e.hide?"none":"block"}; + + a { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + + &:hover, + :visited { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + } + } + + @media (min-width: 992px) { + display: block; + } +`;eL.default.div.withConfig({displayName:"styled__FolderAvatar",componentId:"sc-471f50c1-5"})` + display: flex; + flex: 1 0 auto; + width: 36px; + height: 36px; + background: transparent; +`;let eN7=eL.default.div.withConfig({displayName:"styled__FolderName",componentId:"sc-471f50c1-6"})` + display: flex; + align-items: flex-end; + position: relative; + color: ${e=>e.theme.appColors.hex(10)}; + font-weight: 500; + margin-bottom: 3px; +`,eN9=eL.default.div.withConfig({displayName:"styled__FolderWrapper",componentId:"sc-471f50c1-7"})` + display: grid; + align-items: center; + grid-template-columns: 36px 1fr; + line-height: 1; +`,eCe=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-471f50c1-8"})` + max-width: 1024px; + padding: 0px 0 24px; +`,eCt=(0,la.ZP)` + query Folders($spaceId: ID!, $first: Int, $after: String, $orderby: [SpaceOrdering]) { + membership(space_id: $spaceId) { + id + role + space { + id + folders(first: $first, after: $after, orderby: $orderby) { + totalCount + edges { + node { + id + archived_at + color + document_count + name + member_count + owner_count + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } + } + } + } +`,eCa=(0,la.ZP)` + mutation WorkspaceDeleteMutation($input: WorkspaceDeleteInput!) { + workspaceDelete(input: $input) { + clientMutationId + ok + isOptimistic @client + } + } +`,eCn=(0,la.ZP)` + mutation SubspaceJoinAsOwnerMutation($input: SubspaceJoinAsOwnerInput!) { + subspaceJoinAsOwner(input: $input) { + clientMutationId + ok + } + } +`,eCl=(0,eL.default)(cF).withConfig({displayName:"MenuItem__MenuButton",componentId:"sc-b852f60d-0"})` + position: relative; + justify-content: space-between; +`,eCr=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(eCl,o.props,t)},eCo=(0,eL.default)(eI.Menu).withConfig({displayName:"OptionsMenu__StyledMenu",componentId:"sc-2971e3bd-0"})` + padding: var(--menu-padding); + min-width: 220px; + border-radius: 10px; + overflow-y: ${e=>e.$selected?"scroll":"inherit"}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,eCi=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eCo,{initialFocus:t,loop:!0},ev.createElement(eCr,{name:"delete"},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})),ev.createElement(eCr,{name:"join_as_owner"},ev.createElement(eY.Z,{id:"general.join_as_owner",defaultMessage:"Join as Owner"}))))},eCs=eL.default.button.withConfig({displayName:"OptionsDropdown__DropdownToggle",componentId:"sc-dbc2f761-0"})` + margin: 0 0 0 6px; + padding: 0; + background: none; + box-shadow: none; + border-radius: 10px; + cursor: pointer; + outline: 0; + border: 0; + color: ${e=>e.theme.primaryColorScheme?.base}; + width: 26px; + height: 26px; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,eCd=function(e){let{currentUserMembership:t,space:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=ev.useCallback(()=>{r.current?.focus()},[]);(0,eI.usePopupEvents)({state:n,onCollapse:i});let s=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:n,placement:"bottom-end"}),d=(0,eI.useMenuButton)({dispatch:l,ref:r,state:n}),{handleDelete:c}=function(e,t){let a=(0,eF.TH)(),n=ev.useMemo(()=>eNX(a.search,"folder")??eNY,[a.search]),l=ev.useMemo(()=>egi(a.search,50),[a.search]),[r]=(0,cs.D)(eCa);return{handleDelete:ev.useCallback(()=>{let a=(0,ld.Z)(),o="";for(;o!==t.name&&null!=o;)o=prompt(`Are you sure you want to delete ${t.name}? All projects in this folder will be lost. Please type '${t.name}' to confirm.`);null!=o&&r({optimisticResponse:{workspaceDelete:{__typename:"WorkspaceDeletePayload",clientMutationId:a,isOptimistic:!0,ok:!0}},variables:{input:{clientMutationId:a,spaceID:t.id,confirmationKey:o}},update:(a,r)=>{let{data:{workspaceDelete:o}}=r,i={spaceId:e.space.id,orderby:[n],...l},s=a.readQuery({query:eCt,variables:i});null!=s&&null!=s.membership.space.folders&&(a.writeQuery({query:eCt,data:(0,es.ZP)(s,e=>(null!=e.membership.space.folders&&(e.membership.space.folders.edges=e.membership.space.folders.edges.filter(e=>e.node.id!==t.id)),e)),variables:i}),o.isOptimistic||(a.evict({id:a.identify(t)}),a.gc()))}})},[t,n,l,e,r])}}(t,a),{handleJoinAsOwner:m}=function(e,t,a){let n=(0,eF.TH)(),l=(0,e$.useDispatch)(),r=ev.useMemo(()=>eNX(n.search,"folder")??eNY,[n.search]),o=ev.useMemo(()=>egi(n.search,50),[n.search]),[i]=(0,cs.D)(eCn);return{handleJoinAsOwner:ev.useCallback(()=>{let n=(0,ld.Z)();try{i({optimisticResponse:{subspaceJoinAsOwner:{__typename:"SubspaceJoinAsOwnerPayload",clientMutationId:n,ok:!0}},variables:{input:{clientMutationId:n,subspaceId:t}},update:n=>{let i={spaceId:e.space.id,orderby:[r],...o},s=n.readQuery({query:eCt,variables:i});null!=s&&null!=s.membership.space.folders&&(n.writeQuery({query:eCt,data:(0,es.ZP)(s,e=>(null!=e.membership.space.folders&&(e.membership.space.folders.edges=e.membership.space.folders.edges.map(e=>e.node.id!==t?e:(0,es.ZP)(e,e=>{e.node.owner_count=e.node.owner_count+1,e.node.member_count=e.node.member_count+1}))),e)),variables:i}),l(l3.success({uid:`join-folder-as-owner-${t}`,message:`Joined ${a}!`,position:"br",autoDismiss:3,dismissible:!1})))}})}catch(e){l(l3.error({uid:"join-folder-as-owner-error",message:"There was an error joining the folder. Please try again.",position:"br",autoDismiss:3,dismissible:!1}))}},[t,a,e,l,r,o,i])}}(t,a.id,a.name),u=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t}=e.payload;switch(t){case"delete":c();break;case"join_as_owner":m()}l({type:"Collapse",payload:"none"});break}case"Dismiss":l({type:"Collapse"})}},[c,m]);return ev.createElement(ev.Fragment,null,ev.createElement(eCs,d.props,ev.createElement(tn.Icon,{icon:"header_more"})),n.expanded&&ev.createElement(eI.Popup,{...s.props,dispatch:l,modal:!0},ev.createElement(eCi,{initialFocus:s.initialFocus,menuGroupDispatch:u})))},eCc=function(e){let{currentUserMembership:t,space:a}=e;return ev.createElement(eN6,null,ev.createElement(eN8,null,ev.createElement(eN9,null,ev.createElement(nA,{space:a,size:"sm"}),ev.createElement(eN7,null,a.name))),ev.createElement(eN8,null,ev.createElement(eY.Z,{id:"general.number_of_members",values:{count:a.member_count},defaultMessage:"{count, plural, =0 {None} one {# member} other {# members}}"})),ev.createElement(eN8,null,ev.createElement(eY.Z,{id:"general.number_of_projects",values:{count:a.document_count},defaultMessage:"{count, plural, =0 {None} one {# project} other {# projects}}"})),ev.createElement(eN8,null,null!=a.archived_at?ev.createElement(eY.Z,{id:"general.archived",defaultMessage:"Archived"}):ev.createElement(eY.Z,{id:"general.active",defaultMessage:"Active"})),ev.createElement(eN8,null,ev.createElement(eCd,{currentUserMembership:t,space:a})))},eCm=function(e){let{currentUserMembership:t,match:a}=e,n=(0,eF.TH)(),l=a.params.spaceID,r=ev.useMemo(()=>eNX(n.search,"folder")??eNY,[n.search]),o=ev.useMemo(()=>egi(n.search,50),[n.search]),{data:i,loading:s,error:d}=(0,eB.a)(eCt,{variables:{spaceId:l,orderby:[r],...o},fetchPolicy:"network-only",skip:null==l||t.role!==vB});if(s)return ev.createElement(eI.Spinner,{height:319});if(null!=d)return ev.createElement(eN0,null,ev.createElement(eN2,null,ev.createElement(eY.Z,{id:"general.error_loading_workspace_manage_folders",defaultMessage:"There was an error loading the folders list. Please try again."})));if(!pW({role:i?.membership?.role,action:"manage_settings"}))return ev.createElement(eN0,null,ev.createElement(eN2,null,ev.createElement(eY.Z,{id:"general.no_workspace_manage_settings_permissions",defaultMessage:"You do not have permissions to access this page."})));let c=i?.membership.space.folders?.edges??[];if(0===c.length)return ev.createElement(eN0,null,ev.createElement(eN2,null,ev.createElement(eY.Z,{id:"general.no_folders_found",defaultMessage:"There are no available folders in this workspace."})));let m=i?.membership.space.folders?.totalCount??0;return ev.createElement(eCe,null,ev.createElement(eN3,null,ev.createElement(eN4,null,ev.createElement(eN8,null,ev.createElement(eN5,null,ev.createElement(eNG,r,ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})))),ev.createElement(eN8,null,ev.createElement(eN5,null,ev.createElement(eY.Z,{id:"general.members",defaultMessage:"Members"}))),ev.createElement(eN8,null,ev.createElement(eN5,null,ev.createElement(eY.Z,{id:"general.projects",defaultMessage:"Projects"}))),ev.createElement(eN8,null,ev.createElement(eN5,null,ev.createElement(eY.Z,{id:"general.status",defaultMessage:"Status"}))),ev.createElement(eN8,null))),c.map(e=>ev.createElement(eCc,{key:e.node.id,currentUserMembership:t,space:e.node})),ev.createElement(eNH,{pathname:n.pathname,search:n.search,hash:n.hash,totalCount:m,itemPerPage:50}))},eCu=eL.default.span.withConfig({displayName:"styled__Subtitle",componentId:"sc-a5f26493-0"})` + margin-bottom: 5px; + ${e1.UiTypography.xs}; + color: ${e=>e.theme.appColors.hex(50)}; + font-weight: 500; + text-transform: uppercase; +`,eCp=eL.default.div.withConfig({displayName:"styled__StyledTable",componentId:"sc-a5f26493-1"})` + display: flex; + flex-direction: column; +`,eCg=eL.default.div.withConfig({displayName:"styled__StyledTableHead",componentId:"sc-a5f26493-2"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + align-items: center; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + grid-template-columns: 35% 1fr auto; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 0 0 10px; + + @media (min-width: 992px) { + grid-template: + 'name permissions options' + / 35% 1fr auto; + } +`,eCf=eL.default.div.withConfig({displayName:"styled__StyledTableRow",componentId:"sc-a5f26493-3"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + align-items: center; + gap: 5px; + margin: 0; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + display: grid; + grid-template-columns: 35% 1fr auto; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 8px 0; + + @media (min-width: 992px) { + grid-template: + 'name permissions options' + / 35% 1fr auto; + } +`,eCh=eL.default.div.withConfig({displayName:"styled__StyledTableCell",componentId:"sc-a5f26493-4"})` + text-align: ${e=>e.align??"left"}; + display: ${e=>e.hide?"none":"block"}; + + a { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + + &:hover, + :visited { + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + } + } + + @media (min-width: 992px) { + display: block; + } +`,eCy=eL.default.img.withConfig({displayName:"styled__UserAvatar",componentId:"sc-a5f26493-5"})` + display: flex; + flex: 1 0 auto; + width: 26px; + height: 26px; + border-radius: 50px; + background: transparent; +`,eCb=eL.default.div.withConfig({displayName:"styled__UserInfo",componentId:"sc-a5f26493-6"})` + display: flex; + flex-direction: column; + padding-left: 3px; +`,eCv=eL.default.div.withConfig({displayName:"styled__UserName",componentId:"sc-a5f26493-7"})` + display: flex; + align-items: flex-end; + position: relative; + color: ${e=>e.theme.appColors.hex(10)}; + font-weight: 500; + margin-bottom: 3px; +`,eCk=eL.default.span.withConfig({displayName:"styled__UserHandle",componentId:"sc-a5f26493-8"})` + font-weight: bold; +`,eCE=eL.default.span.withConfig({displayName:"styled__UserFullName",componentId:"sc-a5f26493-9"})` + color: ${e=>e.theme.appColors.hex(40)}; + font-weight: 400; +`,eCx=eL.default.div.withConfig({displayName:"styled__UserWrapper",componentId:"sc-a5f26493-10"})` + display: grid; + align-items: center; + grid-template-columns: 36px 1fr; + line-height: 1; +`,eC_=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-a5f26493-11"})` + max-width: 1024px; + padding: 0px 20px 24px 0; +`,eCw=(0,la.ZP)` + fragment AllMemberParts on Membership { + id + role + user { + ...BasicUserFields + } + } + ${up} +`,eCN=(0,la.ZP)` + query AllMembers($spaceId: ID!, $first: Int, $after: String, $orderby: [AllMemberOrdering]) { + membership(space_id: $spaceId) { + id + role + space { + id + all_members(first: $first, after: $after, orderby: $orderby) { + totalCount + edges { + node { + id + membership { + ...AllMemberParts + } + user { + id + display_name + handle + avatars_v2 { + small { + mdpi { + url + } + } + } + } + } + } + } + } + } + } + ${eCw} +`,eCC=(0,la.ZP)` + mutation WorkspaceMemberRemoveMutation($input: WorkspaceMemberRemoveInput!) { + workspaceMemberRemove(input: $input) { + clientMutationId + isOptimistic @client + ok + } + } +`,eCM=(0,eL.default)(cF).withConfig({displayName:"MenuItem__MenuButton",componentId:"sc-b852f60d-0"})` + position: relative; + justify-content: space-between; +`,eCS=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(eCM,o.props,t)},eCI=(0,eL.default)(eI.Menu).withConfig({displayName:"OptionsMenu__StyledMenu",componentId:"sc-efd06728-0"})` + padding: var(--menu-padding); + min-width: 220px; + border-radius: 10px; + overflow-y: ${e=>e.$selected?"scroll":"inherit"}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background-color: ${e=>e.theme.appColors.hex(100)}; +`,eCD=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eCI,{initialFocus:t,loop:!0},ev.createElement(eCS,{name:"remove"},ev.createElement(eY.Z,{id:"general.remove",defaultMessage:"Remove"}))))},eCT=eL.default.button.withConfig({displayName:"OptionsDropdown__DropdownToggle",componentId:"sc-8fc775f4-0"})` + margin: 0 0 0 6px; + padding: 0; + background: none; + box-shadow: none; + border-radius: 10px; + cursor: pointer; + outline: 0; + border: 0; + color: ${e=>e.theme.primaryColorScheme?.base}; + width: 26px; + height: 26px; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,eC$=function(e){let{currentUserMembership:t,member:a}=e,n=(0,eF.TH)(),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=ev.useRef(null),i=ev.useRef(null),s=ev.useCallback(()=>{o.current?.focus()},[]);(0,eI.usePopupEvents)({state:l,onCollapse:s});let d=(0,eI.usePopup)({referenceElementRef:o,popupElementRef:i,state:l,placement:"bottom-end"}),c=(0,eI.useMenuButton)({dispatch:r,ref:o,state:l}),m=ev.useMemo(()=>eNX(n.search)??eNK,[n.search]),u=ev.useMemo(()=>egi(n.search,50),[n.search]),[p]=(0,cs.D)(eCC),g=ev.useCallback(()=>{if(!confirm("Are you sure you want to remove this user?"))return;let e=(0,ld.Z)();p({optimisticResponse:{workspaceMemberRemove:{__typename:"WorkspaceMemberRemovePayload",clientMutationId:e,isOptimistic:!0,ok:!0}},update:(e,n)=>{let{data:{workspaceMemberRemove:l}}=n,r={spaceId:t.space.id,orderby:[m],...u},o=e.readQuery({query:eCN,variables:r});if(null!=o&&null!=o.membership.space.all_members&&(e.writeQuery({query:eCN,data:(0,es.ZP)(o,e=>(null!=e.membership.space.all_members&&(e.membership.space.all_members.edges=e.membership.space.all_members.edges.filter(e=>e.node.id!==a.id)),e)),variables:r}),!l.isOptimistic&&null!=o.membership.space)){e.modify({id:e.identify(o.membership.space),fields:{all_members(e,t){let{DELETE:a}=t;return a},memberships(e,t){let{DELETE:a}=t;return a}}});let a=e.readQuery({query:lu,variables:lg(!1,t.space.id)});if(null!=a)for(let t of a?.memberships?.edges??[])e.modify({id:e.identify(t.node.space),fields:{memberships(e,t){let{DELETE:a}=t;return a}}})}},variables:{input:{clientMutationId:e,memberID:`${a.id}`}}})},[t.space.id,a.id,m,u,p]),f=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:t}=e.payload;"remove"===t&&g(),r({type:"Collapse",payload:"none"});break}case"Dismiss":r({type:"Collapse"})}},[g]),h=t.id===a.id?"leave":"remove_user";return pW({role:t.role,action:h})?ev.createElement(ev.Fragment,null,ev.createElement(eCT,c.props,ev.createElement(tn.Icon,{icon:"header_more"})),l.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:r,modal:!0},ev.createElement(eCD,{initialFocus:d.initialFocus,menuGroupDispatch:f}))):null},eCP=(0,la.ZP)` + mutation WorkspaceMemberUpdateMutation($input: WorkspaceMemberUpdateInput!) { + workspaceMemberUpdate(input: $input) { + clientMutationId + membership { + ...AllMemberParts + } + } + } + ${eCw} +`,eCF=eL.default.button.withConfig({displayName:"styled__ChangeRoleButton",componentId:"sc-5ec4dace-0"})` + background: none; + border: 0; + color: ${e=>e.theme.textColors.hex(50)}; + font-size: 15px; + box-shadow: none !important; + &:focus { + outline: none; + } + &:hover { + background: none; + color: ${e=>e.theme.textColors.hex(10)}; + } + &:active { + color: ${e=>e.theme.textColors.hex(10)} !important; + background: none !important; + } + &::after { + vertical-align: 0.14em; + margin-left: 8px; + } + cursor: pointer; +`,eCA=eL.default.div.withConfig({displayName:"styled__SelectedRole",componentId:"sc-5ec4dace-1"})` + display: flex; + min-width: 30px; + align-items: flex-start; + justify-content: center; +`,eCR=eL.default.div.withConfig({displayName:"styled__RoleDescription",componentId:"sc-5ec4dace-2"})` + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; +`,eCj=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-5ec4dace-3"})` + display: flex; + overflow: auto; + flex-direction: column; + color: ${e=>e.theme.textColors.hex(10)}; + min-width: 320px !important; + max-width: 425px !important; + padding: 0.5rem 0; + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + ${tM}; + + max-height: auto; + @media (max-height: 800px) { + max-height: 260px; + } +`,eCO=eL.default.button.withConfig({displayName:"styled__MenuButton",componentId:"sc-5ec4dace-4"})` + display: flex; + flex-direction: row; + cursor: pointer; + outline: 0 !important; + border: none; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)} !important; + padding: 5px 5px; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,eCU=function(e){let{name:t,value:a,children:n}=e,l=(0,ev.useRef)(null),r=(0,eI.useMenuItem)({stopRef:l,name:t,value:a});return ev.createElement(eCO,r.props,n)},eCZ=function(e){let{menuGroupDispatch:t,initialFocus:a,roleEntries:n,selectedEntry:l}=e,r=gV();return ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eCj,{initialFocus:a,loop:!0},n.map(e=>{let[t,a]=e,n=(yF.get(a.value)?.isPaidFeature??!1)&&r.isPaywallEnabled;return ev.createElement(eCU,{key:t,name:"change",value:a.value},ev.createElement(eCA,null,l?.value===a.value&&ev.createElement(tn.Icon,{icon:"dd_check"})),ev.createElement(eCR,null,ev.createElement("div",null,ev.createElement(bu,{fontWeight:"500",role:a.value}),n&&ev.createElement(e1.UpgradeBadge,{className:"ml-2"})),ev.createElement(bg,{role:a.value})))})))},eCL=function(e){let{membership:t,roleEntries:a}=e,n=(0,e$.useDispatch)(),l=gV(),r=(0,ev.useRef)(null),o=(0,ev.useRef)(null),[i,s]=(0,ev.useReducer)(eI.popupReducer,{expanded:!1,initialFocus:"first"}),d=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:i,placement:"bottom-end"}),c=(0,eI.useMenuButton)({state:i,dispatch:s,ref:r}),[m]=(0,cs.D)(eCP),u=(0,ev.useCallback)(e=>{if(yF.get(e)?.isPaidFeature&&l.isPaywallEnabled){null!=l.id&&n(d4(l.id));return}let a=(0,ld.Z)();m({optimisticResponse:{allMemberUpdate:{__typename:"WorkspaceMemberUpdatePayload",clientMutationId:a,membership:{...t,role:e}}},variables:{input:{clientMutationId:a,memberID:t.id,role:e}}})},[n,t,l,m]),p=(0,ev.useCallback)(e=>{"Activate"===e.type&&("change"===e.payload.name&&u(e.payload.value),s({type:"Collapse"}))},[u,s]),g=yF.get(t.role);return ev.createElement(ev.Fragment,null,ev.createElement(eCF,{type:"button",...c.props},ev.createElement(bu,{role:g?.value}),ev.createElement(tn.Icon,{icon:"caret_down"})),i.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:s,modal:!0},ev.createElement(eCZ,{menuGroupDispatch:p,roleEntries:a,selectedEntry:g,initialFocus:d.initialFocus})))},eCB=function(e){let{membership:t}=e;return null==t.role?null:ev.createElement(bu,{role:t.role})},eCz=function(e){let{currentUserMembership:t,membership:a}=e,n=vG(t.role,yP);return null==a?ev.createElement(eY.Z,{id:"general.non_workspace_member",defaultMessage:"Non-workspace Member"}):t.id===a.id?ev.createElement(eCB,{membership:a}):null!=a.role?ev.createElement(eCL,{membership:a,roleEntries:n}):void 0},eCV=function(e){let{currentUserMembership:t,member:a}=e,n=a.user.avatars_v2?.small?.mdpi.url;return ev.createElement(eCf,null,ev.createElement(eCh,null,ev.createElement(eCx,null,ev.createElement(eCy,{src:n}),ev.createElement(eCb,null,ev.createElement(eCv,null,ev.createElement(eCk,null,a.user.handle),null!=a.user.display_name&&ev.createElement(eCE,null," ",a.user.display_name))))),ev.createElement(eCh,null,ev.createElement(eCz,{currentUserMembership:t,membership:a.membership})),ev.createElement(eCh,null,ev.createElement(eC$,{currentUserMembership:t,member:a})))},eCq=function(e){let{currentUserMembership:t,match:a}=e,n=(0,eF.TH)(),l=a.params.spaceID,r=ev.useMemo(()=>eNX(n.search,"member")??eNK,[n.search]),o=ev.useMemo(()=>egi(n.search,50),[n.search]),{data:i,loading:s,error:d,refetch:c}=(0,eB.a)(eCN,{variables:{spaceId:l??"",orderby:[r],...o},skip:null==l||"owner"!==t.role}),m=UZ(i);if(ev.useEffect(()=>{m?.membership.space.all_members!=null&&i?.membership.space.all_members==null&&c()},[m?.membership.space.all_members,i?.membership.space.all_members,c]),s)return ev.createElement(eI.Spinner,{height:319});if(null!=d)return ev.createElement(eN0,null,ev.createElement(eN2,null,ev.createElement(eY.Z,{id:"general.error_loading_workspace_manage_members_",defaultMessage:"There was an error loading the members list. Please try again."})));if(!pW({role:i?.membership?.role,action:"manage_settings"}))return ev.createElement(eN0,null,ev.createElement(eN2,null,ev.createElement(eY.Z,{id:"general.no_workspace_manage_settings_permissions",defaultMessage:"You do not have permissions to access this page."})));let u=i?.membership.space.all_members?.edges,p=i?.membership.space.all_members?.totalCount??0;if(null==u||0===u.length)return null;let g=t.space;return ev.createElement(gz,{spaceId:g.id,spaceType:g.type,spaceIsSubspace:g.is_subspace},ev.createElement(eC_,null,ev.createElement(eCp,null,ev.createElement(eCg,null,ev.createElement(eCh,null,ev.createElement(eCu,null,ev.createElement(eNG,r,ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})))),ev.createElement(eCh,null,ev.createElement(eCu,null,ev.createElement(eY.Z,{id:"general.workspace_permissions",defaultMessage:"Workspace Permissions"}))),ev.createElement(eCh,null))),u.map(e=>ev.createElement(eCV,{key:e.node.user.id,currentUserMembership:t,member:e.node})),ev.createElement(eNH,{pathname:n.pathname,search:n.search,hash:n.hash,totalCount:p,itemPerPage:50})))},eCW=(0,eL.default)(sC.OL).withConfig({displayName:"Tab__StyledNavLink",componentId:"sc-5c5c8361-0"})` + display: flex; + position: relative; + ${e1.UiTypography.sm}; + padding: 0.5rem 1rem; + color: ${e=>e.theme.appColors.hex(50)}; + white-space: nowrap; + align-items: center; + transition: background-color ease-in-out 0.2s, color ease-in-out 0.2s; + border-radius: 30px; + + &.active, + &.active:hover { + background: ${e=>e.theme.isNightMode?"#222a30":e.theme.primaryColorScheme?.alpha10}; + color: ${e=>e.theme?.primaryColorScheme?.base}; + font-weight: 500; + } + + &:hover { + color: ${e=>e.theme?.primaryColorScheme?.base}; + } +`,eCH=function(e){let{children:t,to:a}=e,n=(0,eF.$B)({exact:!0,path:a});return ev.createElement(eCW,{to:a,active:null!=n,exact:!0},t)},eCG=eL.default.div.withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__StyledBreadcrumbs",componentId:"sc-6ddf9ca6-0"})` + margin-bottom: 13px; + display: flex; + align-items: center; +`,eCK=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__StyledBreadcrumbIcon",componentId:"sc-6ddf9ca6-1"})` + margin: 0 5px; + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + transform: rotate(-90deg); +`,eCY=eL.default.span.withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__StyledTitleValue",componentId:"sc-6ddf9ca6-2"})` + max-width: 100%; + color: ${e=>e.theme.isNightMode?"#fff":"#333"}; + font-size: 16px; + line-height: 20px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +`,eCQ=eL.default.div.withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__StyledAvatar",componentId:"sc-6ddf9ca6-3"})` + background-color: ${e=>e.theme.isNightMode?"#333":"#ccc"}; + border-radius: 10px; + padding: 3px; + line-height: 1; + margin-right: 8px; + + > svg { + fill: ${e=>e.theme.isNightMode?"#999":"#fff"}; + } +`,eCJ=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__StyledCaretIcon",componentId:"sc-6ddf9ca6-4"})` + margin-left: 3px; + fill: ${e=>e.theme.isNightMode?"#ccc":"#666"}; +`,eCX=eL.default.div.withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__StyledSpaceTitle",componentId:"sc-6ddf9ca6-5"})` + display: flex; + align-items: center; + + &:hover { + ${eCY}, + ${eCJ}, + ${eCQ} { + opacity: 0.7; + } + } +`,eC0=eL.default.div.withConfig({displayName:"TaskadeUnlimitedBreadcrumbs__Actions",componentId:"sc-6ddf9ca6-6"})` + display: flex; + margin-left: auto; + position: relative; + align-items: center; +`,eC1=function(e){return ev.createElement(eCG,null,ev.createElement(sC.rU,{to:"/settings"},ev.createElement(eCX,null,ev.createElement(eCQ,null,ev.createElement(tn.Icon,{icon:"dd_settings"})),ev.createElement(eCY,null,ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"})))),ev.createElement(eCK,null),ev.createElement(eCY,null,e.name),ev.createElement(eC0,null,ev.createElement(e_A,null),ev.createElement(Sz,null),ev.createElement(Ii,null)))},eC2=(0,la.ZP)` + query WorkpaceQuery($spaceID: ID!) { + membership(space_id: $spaceID) { + id + role + space { + id + is_subspace + name + color + type + billable_members { + edges { + cursor + node { + id + user { + ...BasicUserFields + } + } + } + totalCount + } + customer { + id + balance + email + default_payment_method { + id + provider + object + ... on StripeCard { + brand + country + exp_month + exp_year + funding + last4 + } + } + } + preferences { + isAppSumo + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + default { + hdpi { + url + size { + width + height + } + } + } + } + } + } + documents_v2 { + totalCount + } + current_subscription { + id + status + payload + started_at + ended_at + renewed_at + } + } + } + } + ${up} +`,eC5=eL.default.div.withConfig({displayName:"Section",componentId:"sc-a851fcba-0"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + + &:last-child { + margin-bottom: 0; + } +`,eC3=eL.default.div.withConfig({displayName:"Subtitle",componentId:"sc-ea73f87c-0"})` + display: flex; + ${e1.UiTypography.xs}; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(50)}; + text-transform: uppercase; + margin-bottom: 10px; + align-items: center; + + & > a { + color: ${e=>e.theme.textColors.hex(50)}; + text-transform: uppercase; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + } +`,eC4=eL.default.div.withConfig({displayName:"BillableMembers__Help",componentId:"sc-d1979451-0"})` + display: inline-block; + width: 15px; + height: 15px; + margin-left: 10px; + border-radius: 15px; + background: #999; + color: ${e=>e.theme?.isNightMode?"#222":"#fff"}; + line-height: 15px; + font-size: 12px; + font-weight: bold; + text-align: center; + letter-spacing: -1px; + vertical-align: baseline; + cursor: pointer; +`,eC6=eL.default.div.withConfig({displayName:"BillableMembers__MemberHeader",componentId:"sc-d1979451-1"})` + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; +`,eC8=eL.default.div.withConfig({displayName:"BillableMembers__Member",componentId:"sc-d1979451-2"})` + display: flex; + align-items: center; + color: ${e=>e.theme.textColors.hex(10)}; + align-items: center; + border-bottom: 1px solid ${e=>e.theme.isNightMode?"#262A2D":"#e5e5e5"}; + color: ${e=>e.theme.isNightMode?"#ccc":"#999"} !important; + font-size: 15px; + padding: 16px 0; +`,eC7=eL.default.div.withConfig({displayName:"BillableMembers__MemberBody",componentId:"sc-d1979451-3"})` + display: flex; + flex-direction: column; +`,eC9=eL.default.img.withConfig({displayName:"BillableMembers__Avatar",componentId:"sc-d1979451-4"})` + display: flex; + border-radius: 36px; + margin-right: 10px; + width: 36px; + height: 36px; +`,eMe=eL.default.div.withConfig({displayName:"BillableMembers__Name",componentId:"sc-d1979451-5"})` + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: bold; +`,eMt=eL.default.div.withConfig({displayName:"BillableMembers__Handle",componentId:"sc-d1979451-6"})` + color: #999; +`,eMa=eL.default.div.withConfig({displayName:"BillableMembers__StyledTooltip",componentId:"sc-d1979451-7"})` + max-width: 200px; +`,eMn=(0,la.ZP)` + mutation WorkspaceDeleteMutation($input: WorkspaceDeleteInput!) { + workspaceDelete(input: $input) { + clientMutationId + } + } +`,eMl=eL.default.div.withConfig({displayName:"DeleteWorkspaceDialogBody__FlexContainer",componentId:"sc-7bb50fd-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,eMr=(0,eI.getColorScheme)(eI.ThemeColors.danger),eMo=(0,eL.default)(e1.Notice).withConfig({displayName:"DeleteWorkspaceDialogBody__StyledNotice",componentId:"sc-7bb50fd-1"})` + color: ${eI.ThemeColors.danger}; + border-color: ${eI.ThemeColors.danger}; + background: ${eMr?.alpha10}; + margin: 0 0 20px; + ${e1.UiTypography.sm}; +`,eMi=eL.default.h1.withConfig({displayName:"DeleteWorkspaceDialogBody__Header",componentId:"sc-7bb50fd-2"})` + ${e1.ArticleTypography.heading3}; + font-weight: 500; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,eMs=function(e){let{space:t}=e,{handleDelete:a,handleToggle:n,deleting:l,deleteError:r,confirmationKey:o,setConfirmationKey:i}=function(e){let{space:t,exit:a}=e,n=(0,eF.k6)(),[l,r]=ev.useState(""),[o,{loading:i,error:s}]=(0,cs.D)(eMn,{update:e=>{let a=lg(!1),n=e.readQuery({query:lu,variables:a});null!=n&&e.writeQuery({query:lu,variables:a,data:(0,es.ZP)(n,e=>{if(null==e.memberships)return e;let a=e.memberships.edges.filter(e=>e.node.space.id!==t.id);return e.memberships.edges=a,e})})}});return{handleDelete:()=>{o({variables:{input:{clientMutationId:(0,ld.Z)(),spaceID:t.id,confirmationKey:l}}}).then(()=>{a(!0),n.push("/")})},handleToggle:()=>{a()},deleting:i,deleteError:s,confirmationKey:l,setConfirmationKey:r}}(e);return l?ev.createElement(eMl,null,ev.createElement(eI.Spinner,null)):ev.createElement(eMl,null,ev.createElement(eMi,null,ev.createElement(eY.Z,{id:"general.delete_workspace_header",defaultMessage:"Delete {spaceName}",values:{spaceName:t.name}})),r&&ev.createElement(rO,{className:"mb-2.5"},r.graphQLErrors?.[0]?.extensions?.exception?.details??r.graphQLErrors?.[0]?.message),ev.createElement(rP,null,ev.createElement(eMo,null,ev.createElement(eY.Z,{id:"general.delete_workspace_confirmation",defaultMessage:"By deleting this workspace, you will delete all folders and projects. All your data and billing credits will be lost, this can't be reverted.",values:{spaceName:t.name,strong:e=>ev.createElement("strong",null,e)}}))),ev.createElement(rL,{htmlFor:"confirmation-key"},ev.createElement(eY.Z,{id:"general.delete_workspace_confirmation_key",defaultMessage:"Please type {spaceName} to confirm.",values:{spaceName:t.name,b:e=>ev.createElement("b",null,e)}})),ev.createElement(rB,null,ev.createElement(rz,{id:"confirmation-key",type:"text",onChange:e=>{let{value:t}=e.target;i(t)},onKeyPress:e=>{"Enter"===e.key&&o===t.name&&a()},value:o})),ev.createElement(rF,null,ev.createElement(rj,{onClick:n},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(rR,{disabled:o!==t.name,onClick:a},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))},eMd=function(e){let{isOpen:t,close:a,space:n}=e;return t?ev.createElement(eI.ModalDialog,{isOpen:t,close:a},e=>{let{exit:t}=e;return ev.createElement(eMs,{exit:t,space:n})}):null},eMc=eL.default.div.withConfig({displayName:"DeleteSpace__FlexContainer",componentId:"sc-c11363e3-0"})` + display: flex; + flex-direction: column; + justify-content: flex-start; + background: ${e=>e.theme.appColors.hex(100)}; +`,eMm=eL.default.button.withConfig({displayName:"DeleteSpace__Delete",componentId:"sc-c11363e3-1"})` + display: flex; + align-items: center; + flex-wrap: wrap; + + padding: 0 12px; + height: 34px; + width: min-content; + border: solid 1px ${eI.ThemeColors.danger}; + border-radius: 10px; + + ${e1.UiTypography.sm}; + font-weight: 600; + color: ${eI.ThemeColors.danger}; + + cursor: pointer; + transition: background-color ease-in 0.2s; + + &:hover { + color: #fff; + background: ${eI.ThemeColors.danger}; + } +`,eMu=eL.default.div.withConfig({displayName:"PaymentMethod__PaymentMethodWrapper",componentId:"sc-b0d48d60-0"})` + display: flex; + height: 17px; + align-items: center; + flex: 1; +`,eMp=eL.default.div.withConfig({displayName:"PaymentMethod__CardBrand",componentId:"sc-b0d48d60-1"})` + display: flex; + width: 24px; + height: 30px; + margin-right: 10px; + align-items: center; + justify-content: center; +`,eMg=eL.default.div.withConfig({displayName:"PaymentMethod__CardNumber",componentId:"sc-b0d48d60-2"})` + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; +`,eMf=eL.default.div.withConfig({displayName:"PaymentMethod__CardExp",componentId:"sc-b0d48d60-3"})` + display: flex; + justify-self: flex-end; + margin-left: auto; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; +`,eMh=function(e){let{brand:t}=e;switch(t){case"amex":return ev.createElement(lT.ZM,null);case"diners":return ev.createElement(lT.Fl,null);case"discover":return ev.createElement(lT.Hn,null);case"jcb":return ev.createElement(lT.So,null);case"mastercard":return ev.createElement(lT.QQ,null);case"unionpay":return ev.createElement(lT.P1,null);case"visa":return ev.createElement(lT.Y3,null);default:return ev.createElement(lT.JA,null)}},eMy=function(e){let{paymentMethod:t}=e;return ev.createElement(eMu,null,ev.createElement(eMp,null,ev.createElement(eMh,{brand:t.brand})),ev.createElement(eMg,null,"Ending in ",t.last4),ev.createElement(eMf,null,t.exp_month," / ",t.exp_year))},eMb=eL.default.div.withConfig({displayName:"PaymentMethodSection__PaymentMethodWrapper",componentId:"sc-9d7b1ee9-0"})` + margin-bottom: 10px; + max-width: 230px; +`,eMv=eL.default.div.withConfig({displayName:"PlanInfo__StyledPlanInfo",componentId:"sc-abf4b49e-0"})``,eMk=eL.default.h4.withConfig({displayName:"PlanInfo__StyledPlanTitle",componentId:"sc-abf4b49e-1"})` + font-weight: bold; + margin-bottom: 0; +`,eME=eL.default.p.withConfig({displayName:"PlanInfo__StyledPlanDetails",componentId:"sc-abf4b49e-2"})` + display: inline; + padding: 0; + margin: 0; + ${e1.UiTypography.sm}; +`,eMx=eL.default.a.withConfig({displayName:"PlanInfo__StyledLink",componentId:"sc-abf4b49e-3"})` + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + + &:hover, + :visited { + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + } + + &:hover { + opacity: 0.8; + } +`,eM_=function(e){let{membership:t}=e,{type:a,current_subscription:n,preferences:l}=t.space;switch(a){case"unlimited":if(l?.isAppSumo)return ev.createElement(eMv,null,ev.createElement(eMk,null,ev.createElement(eY.Z,{id:"general.premium",defaultMessage:"Premium"})),ev.createElement(eME,null,ev.createElement(eY.Z,{id:"general.workspace_upgrade_custom_activated",defaultMessage:"You are on a custom plan. Premium features are unlocked in this workspace."})));return ev.createElement(eMv,null,ev.createElement(eMk,null,n?.payload.plan.interval==="year"?ev.createElement(eY.Z,{id:"general.workspace_upgrade_plan_unlimited_yearly",defaultMessage:"Unlimited Yearly Plan"}):ev.createElement(eY.Z,{id:"general.workspace_upgrade_plan_unlimited_monthly",defaultMessage:"Unlimited Monthly Plan"})),ev.createElement(eME,null,ev.createElement(eY.Z,{id:"general.workspace_upgrade_details_storage",defaultMessage:"Your workspace has unlimited storage based on your current plan ({type}).",values:{type:a,cap:e=>ev.createElement("span",{style:{textTransform:"capitalize"}},e),plans:e=>ev.createElement(eMx,{target:"_blank",rel:"noopener noreferrer",href:"/upgrade"},e)}})));case"lite":return ev.createElement(eMv,null,ev.createElement(eMk,null,ev.createElement(eY.Z,{id:"general.workspace_upgrade_plan_lite",defaultMessage:"Lite Plan"})),ev.createElement(eME,null,ev.createElement(eY.Z,{id:"general.billing_discover_premium_plans",defaultMessage:"Discover the benefits of our All-in-One Premium Plans.",values:{type:a,max_count:999,cap:e=>ev.createElement("span",{style:{textTransform:"capitalize"}},e),plans:e=>ev.createElement(eMx,{target:"_blank",rel:"noopener noreferrer",href:"/upgrade"},e)}})));case"starter":return ev.createElement(eMv,null,ev.createElement(eMk,null,ev.createElement(eY.Z,{id:"general.workspace_upgrade_plan_free",defaultMessage:"Free Plan"})),ev.createElement(eME,null,ev.createElement(eY.Z,{id:"general.billing_discover_premium_plans",defaultMessage:"Discover the benefits of our All-in-One Premium Plans.",values:{type:"Free",max_count:999,cap:e=>ev.createElement("span",{style:{textTransform:"capitalize"}},e),plans:e=>ev.createElement(eMx,{target:"_blank",rel:"noopener noreferrer",href:"/upgrade"},e)}})))}},eMw=function(e){let{membership:t}=e;return ev.createElement("div",{className:"mt-5 flex flex-col text-xs"},ev.createElement("form",{method:"POST",action:"/billing/create-customer-portal-session"},ev.createElement("input",{type:"hidden",name:"type",value:"unlimited"}),ev.createElement("input",{type:"hidden",name:"workspaceId",value:t.space.id}),ev.createElement("button",{className:"inline-flex cursor-pointer text-primary hover:text-primary/80",type:"submit"},ev.createElement(eY.Z,{id:"general.manage_subscription",defaultMessage:"Manage Subscription"}))))},eMN=eL.default.div.withConfig({displayName:"Sidebar__StyledSidebar",componentId:"sc-2c65cb4d-0"})` + padding: 20px; + background: ${e=>e.theme?.primaryColorScheme?.alpha10}; + border: 1px solid ${e=>e.theme?.primaryColorScheme?.alpha30}; + border-radius: 10px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; +`,eMC=eL.default.p.withConfig({displayName:"Sidebar__Heading",componentId:"sc-2c65cb4d-1"})` + margin: 0 0 5px; + font-weight: bold; + + & > a { + border-bottom: 2px solid ${e=>e.theme?.primaryColorScheme?.base}; + color: ${e=>e.theme?.isNightMode?"#e5e5e5":"#333"}; + + &:hover { + color: ${e=>e.theme?.primaryColorScheme?.base}; + } + } +`,eMM=eL.default.div.withConfig({displayName:"Sidebar__StyledList",componentId:"sc-2c65cb4d-2"})` + margin: 15px 0 20px; +`,eMS=eL.default.div.withConfig({displayName:"Sidebar__StyledPoint",componentId:"sc-2c65cb4d-3"})` + display: flex; + + :not(:last-child) { + margin-bottom: 6px; + } +`,eMI=(0,eL.default)(lT.Zl).withConfig({displayName:"Sidebar__StyledTickIcon",componentId:"sc-2c65cb4d-4"})` + height: 19px; + width: 20px; + margin-right: 5px; + + path { + fill: ${e=>e.theme?.primaryColorScheme?.base}; + } +`,eMD=eL.default.span.withConfig({displayName:"Sidebar__StyledMessage",componentId:"sc-2c65cb4d-5"})` + font-size: 14px; +`,eMT=eL.default.button.withConfig({displayName:"Sidebar__ButtonUpgrade",componentId:"sc-2c65cb4d-6"})` + margin: 0; + padding: 6px 16px; + border: 0; + border-radius: 10px; + background: ${e=>e.theme?.primaryColorScheme?.base}; + color: #fff; + outline: 0; + font-weight: 500; + cursor: pointer; + transition: background-color 150ms ease-in-out; + + &:focus { + outline: 0; + } + &:hover { + background: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } + + span { + display: inline-block; + line-height: 22px; + } +`,eM$=eL.default.a.withConfig({displayName:"Sidebar__ComparePlans",componentId:"sc-2c65cb4d-7"})` + display: inline-flex; + width: fit-content; + color: ${e=>e.theme.primaryColorScheme?.base}; + border-bottom: 1px solid ${e=>e.theme.primaryColorScheme?.alpha50}; + margin-left: 16px; + font-weight: 500; + ${e1.UiTypography.sm}; + padding-bottom: 4px; + position: relative; + top: -2px; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + border-color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,eMP=eL.default.a.withConfig({displayName:"Sidebar__StyledLink",componentId:"sc-2c65cb4d-8"})` + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + + &:hover, + :visited { + color: ${e=>e.theme.primaryColorScheme?.base??"#FF2D60"}; + } + + &:hover { + opacity: 0.8; + } +`,eMF=(0,eL.default)(lT.OP).withConfig({displayName:"Sidebar__StyledUpgradeIcon",componentId:"sc-2c65cb4d-9"})` + margin: 0 5px 0 -5px; + + path { + fill: #fff; + } +`,eMA=eL.default.hr.withConfig({displayName:"Sidebar__StyledDivider",componentId:"sc-2c65cb4d-10"})` + margin: 20px 0 15px; + background-color: ${e=>e.theme.appColors.hex(70)}; +`,eMR=eL.default.span.withConfig({displayName:"Sidebar__PromoCode",componentId:"sc-2c65cb4d-11"})` + font-weight: 500; +`,eMj=eL.default.div.withConfig({displayName:"OverviewScreen__StyledScreen",componentId:"sc-f5e78084-0"})` + display: grid; + grid-template: + 'plan' + 'sidebar' + 'paymentmethod' + 'deletespace' + 'billablemembers'; + align-items: start; + gap: 40px 40px; + + @media (min-width: 768px) { + grid-template: + 'plan sidebar' + 'paymentmethod sidebar' + 'deletespace sidebar' + 'billablemembers sidebar' + / auto 35%; + } +`,eMO=(0,eL.default)(eC5).withConfig({displayName:"OverviewScreen__StyledPlanSection",componentId:"sc-f5e78084-1"})` + grid-area: plan; +`,eMU=(0,eL.default)(function(e){let{membership:t,className:a}=e,{type:n}=t.space,l=t.space.customer?.default_payment_method;return t.space.preferences?.isAppSumo||"unlimited"!==n?null:ev.createElement(eC5,{className:a},ev.createElement(eC3,null,"Payment Method"),null!=l?ev.createElement(eMb,null,ev.createElement(eMy,{paymentMethod:l})):ev.createElement("div",{className:"mb-2.5 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"general.theres_no_payment_method",defaultMessage:"There's no payment method saved."})))}).withConfig({displayName:"OverviewScreen__StyledPaymentMethodSection",componentId:"sc-f5e78084-2"})` + grid-area: paymentmethod; +`,eMZ=(0,eL.default)(function(e){let{arrowProps:t,popperProps:a,referenceProps:n,setVisible:l,visible:r}=(0,eI.useTooltip)({placement:"top"}),{membership:o,className:i}=e,s=o.space.billable_members?.edges,d=o.space.billable_members?.totalCount,c=pW({role:o.role,action:"manage_settings"});return null==s?null:ev.createElement(ev.Fragment,null,ev.createElement(eC5,{className:i},ev.createElement(eC6,null,ev.createElement(eC3,null,c?ev.createElement(sC.rU,{to:`/settings/billing/${o.space.id}/members`},ev.createElement(eY.Z,{id:"general.billable_members_with_count",defaultMessage:"Workspace Members ({billableMembersCount})",values:{billableMembersCount:d}})):ev.createElement(eY.Z,{id:"general.billable_members_with_count",defaultMessage:"Workspace Members ({billableMembersCount})",values:{billableMembersCount:d}}),ev.createElement(eC4,{...n,onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)}},"?"))),s.map(e=>{let{cursor:t}=e,a=e.node?.user;if(null==a)return null;let{avatars_v2:n,display_name:l,handle:r}=a;return ev.createElement(eC8,{key:t},ev.createElement(eC9,{src:n?.small?.mdpi.url}),ev.createElement(eC7,null,ev.createElement(eMe,null,l),ev.createElement(eMt,null,r)))})),r&&ev.createElement(eI.Tooltip,{arrowProps:t,popperProps:a},ev.createElement(eMa,null,ev.createElement(eY.Z,{id:"general.billable_members_help_project_members_free",defaultMessage:"Only workspace and folder members are billable. You may add unlimited members at the project level for free."}))))}).withConfig({displayName:"OverviewScreen__StyledBillableMembersSection",componentId:"sc-f5e78084-3"})` + grid-area: billablemembers; +`,eML=(0,eL.default)(function(e){let t=(0,e$.useDispatch)(),{membership:a,className:n}=e,{id:l,current_subscription:r,preferences:o}=a.space;if(o?.isAppSumo)return null;if(!r)return ev.createElement(eMN,{className:n},ev.createElement(eMC,null,ev.createElement(eY.Z,{id:"general.upgrade_to_unlock",defaultMessage:"Ready to Go Limitless? Go Pro!",values:{a:e=>ev.createElement("a",{href:"/upgrade",target:"_blank",rel:"noopener noreferrer"}," ",e)}})," \uD83D\uDE80"),ev.createElement(eMM,null,ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,{className:"text-moving-rainbow"}," ",ev.createElement(eY.Z,{id:"general.upgrade_unlimited_ai_credits",defaultMessage:"Unlimited AI Credits"}))),ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.build_custom_ai_agents",defaultMessage:"Custom AI Agents"}))),ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.manage_multiple_workspaces",defaultMessage:"Multiple Workspaces"}))),ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.ai_powered_workflow_generation",defaultMessage:"AI-Powered Workflows"}))),ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.large_file_uploads_and_storage",defaultMessage:"File Uploads and Storage"}))),ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.cloud_calendar_integration",defaultMessage:"Cloud & Calendar Integrations"}))),ev.createElement(eMS,null,ev.createElement(eMI,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.version_history_and_more",defaultMessage:"Version History and More!",values:{pricing:e=>ev.createElement(eMP,{target:"_blank",rel:"noopener noreferrer",href:"/upgrade"},e)}})))),ev.createElement(eMT,{onClick:()=>{t(d4(l))}},ev.createElement(eMF,null),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))),ev.createElement(eM$,{href:"https://taskade.com/features",rel:"noopener noferrer",target:"_blank"},ev.createElement(eY.Z,{id:"general.compare_plans",defaultMessage:"Compare Plans"})));{let{payload:e,ended_at:t,renewed_at:l}=r,{discount:o}=e,i=cc()(l??t).format("L"),s=e.plan.amount*e.quantity/100,d=0;if(null!=o&&o.coupon.valid){let{amount_off:e,percent_off:t,currency:a,duration:n}=o.coupon;"once"===n&&"trialing"!==r.status?d=0:null!=o.end&&o.end<=cc()(l).unix()?d=0:null!=e&&"usd"===a?d=e/100:null!=t&&(d=t/100*s)}let c=(r.payload.latest_invoice?.ending_balance??0)/100,m=Math.max(0,s-d+c),u=o?.promotion_code,p="string"==typeof u?u:u?.code??null,g=o?.coupon??null,f=g?.duration??null;return ev.createElement(eMN,{className:n},ev.createElement(eMC,null,ev.createElement(eY.Z,{id:"general.payment",defaultMessage:"Payment"})),ev.createElement(eMD,null,l?ev.createElement(eY.Z,{id:"general.next_bill",defaultMessage:"Your next bill is ${bill} on {renewed_at}.",values:{renewed_at:i,bill:m,b:e=>ev.createElement("b",null,e)}}):ev.createElement(eY.Z,{id:"general.plan_ends",defaultMessage:"Your plan ends on {ended_at}.",values:{ended_at:i,b:e=>ev.createElement("b",null,e)}})),null!=o&&null!=g&&ev.createElement(ev.Fragment,null,ev.createElement(eMA,null),ev.createElement(eMD,null,"once"===f&&"trialing"===r.status&&ev.createElement(eY.Z,{id:"general.payment_discount_once",defaultMessage:"Promotional code {couponCode} ({couponName}) to be applied on next bill",values:{PromoCode:e=>ev.createElement(eMR,null,e),couponCode:p,couponName:g?.name}}),"repeating"===f&&cc()(l).isSameOrBefore(cc().unix(o.start).add(g.duration_in_months,"months"))&&ev.createElement(eY.Z,{id:"general.payment_discount_repeating",defaultMessage:"Promotional code {couponCode} ({couponName}) applied until {couponEnd}",values:{PromoCode:e=>ev.createElement(eMR,null,e),b:e=>ev.createElement("b",null,e),couponCode:p,couponName:g?.name,couponEnd:cc().unix(o.start).add(g.duration_in_months,"months").format("L")}}),"forever"===f&&ev.createElement(eY.Z,{id:"general.payment_discount_forever",defaultMessage:"Promotional code {couponCode} ({couponName}) applied permanently",values:{PromoCode:e=>ev.createElement(eMR,null,e),couponCode:p,couponName:g?.name}}))),c<0&&ev.createElement(ev.Fragment,null,ev.createElement(eMA,null),ev.createElement(eMD,null,ev.createElement(eY.Z,{id:"general.referral_credits",defaultMessage:"Credit Balance"}),": $",Math.abs(c))),ev.createElement(eMA,null),ev.createElement(eMw,{membership:a}))}}).withConfig({displayName:"OverviewScreen__StyledSidebarSection",componentId:"sc-f5e78084-4"})` + grid-area: sidebar; + max-width: 320px; +`,eMB=(0,eL.default)(function(e){let{membership:t}=e,{space:a}=t,[n,l]=ev.useState(!1);return ev.createElement(eMc,null,ev.createElement(eC3,null,ev.createElement(eY.Z,{id:"general.danger_zone",defaultMessage:"Danger Zone"})),ev.createElement(eMm,{onClick:()=>l(!0)},ev.createElement(eY.Z,{id:"general.delete_workspace",defaultMessage:"Delete workspace"})),ev.createElement(eMd,{isOpen:n,close:()=>l(!1),space:a}))}).withConfig({displayName:"OverviewScreen__DeleteSpaceSection",componentId:"sc-f5e78084-5"})` + grid-area: deletespace; +`,eMz=function(e){let{membership:t}=e,a=d6();return ev.createElement(eMj,null,a&&ev.createElement(eMO,null,ev.createElement(eC3,null,ev.createElement(eY.Z,{id:"general.plan",defaultMessage:"Plan"})),ev.createElement(eM_,{membership:t})),a&&ev.createElement(ev.Fragment,null,ev.createElement(eML,{membership:t}),ev.createElement(eMU,{membership:t})),ev.createElement(eMB,{membership:t}),a&&ev.createElement(eMZ,{membership:t}))},eMV=function(){let{spaceID:e}=(0,eF.UO)(),{data:t,error:a,loading:n}=(0,eB.a)(eC2,{variables:{spaceID:e}}),l=t?.membership?.space?.color,r=(0,ev.useMemo)(()=>null==l?void 0:{primaryColor:l},[l]),o=ev.useMemo(()=>{if(null!=l)try{let[e,t,a]=gW()(l).rgb();return{"--color-primary":`${e} ${t} ${a}`}}catch(e){uT(e,uI),console.warn(e);return}},[l]),i=pW({role:t?.membership?.role,action:"manage_settings"}),s="Workspace Billing - Taskade";if(n)return ev.createElement(e_u,null,ev.createElement(eI.Spinner,null));if(null!=a)return ev.createElement(e_u,null,"An error occurred");let d=t?.membership;if(null==d)return ev.createElement(e_u,null,"Membership not found");let{space:c}=d,{id:m,name:u}=c;return ev.createElement(eI.ThemeProvider,{theme:r},ev.createElement(e_u,{style:o},ev.createElement(_2,{title:s,ogTitle:s}),ev.createElement(eC1,{name:u}),ev.createElement(e_v,{$fullwidth:!0},ev.createElement("div",{className:"mb-5 flex"},ev.createElement(eCH,{to:`/settings/billing/${m}`},ev.createElement(eY.Z,{id:"general.workspace_billing_overview",defaultMessage:"Overview"})),i&&ev.createElement(ev.Fragment,null,ev.createElement(eCH,{to:`/settings/billing/${m}/members`},ev.createElement(eY.Z,{id:"general.members",defaultMessage:"Members"})),ev.createElement(eCH,{to:`/settings/billing/${m}/folders`},ev.createElement(eY.Z,{id:"general.folders",defaultMessage:"Folders"})))),ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:"/settings/billing/:spaceID",render:()=>ev.createElement(eMz,{membership:d})}),ev.createElement(eF.AW,{path:"/settings/billing/:spaceID/members",render:e=>ev.createElement(eCq,{...e,currentUserMembership:d})}),ev.createElement(eF.AW,{path:"/settings/billing/:spaceID/folders",render:e=>ev.createElement(eCm,{...e,currentUserMembership:d})})))))},eMq=function(){return ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:"/settings/billing",component:eNO}),ev.createElement(eF.AW,{path:"/settings/billing/:spaceID",component:eMV}))},eMW=(0,eL.default)("div").withConfig({displayName:"StyledTableParts__Container",componentId:"sc-d231039f-0"})` + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: stretch; + + margin-top: 20px !important; + width: 100%; + + .night-mode & { + color: #ccc; + } +`;(0,eL.default)("h2").withConfig({displayName:"StyledTableParts__Title",componentId:"sc-d231039f-1"})` + font-size: 17px; + color: ${e=>e.theme.appColors.hex(50)}; + margin: 0 0 2px; +`;let eMH=(0,eL.default)("div").withConfig({displayName:"StyledTableParts__Table",componentId:"sc-d231039f-2"})` + display: flex; + flex-direction: column; +`,eMG=(0,eL.default)("div").withConfig({displayName:"StyledTableParts__TableRow",componentId:"sc-d231039f-3"})` + border-bottom: 1px solid ${e=>e.theme?.isNightMode?"#333":"#e5e5e5"}; + display: grid; + grid-template-columns: repeat(4, 1fr); + color: ${e=>e.theme.appColors.hex(50)}; + padding: 16px 0; + ${e1.UiTypography.sm} +`,eMK=(0,eL.default)(eMG).withConfig({displayName:"StyledTableParts__TableHeaderRow",componentId:"sc-d231039f-4"})` + font-size: 13px; + color: ${e=>(e.theme?.isNightMode,"#999")} !important; + border-bottom: 1px solid ${e=>e.theme?.isNightMode?"#262A2D":"#e5e5e5"}; + text-transform: uppercase; + font-weight: 500; + padding: 16px 0 10px; +`,eMY=(0,eL.default)("button").attrs({type:"button"}).withConfig({displayName:"StyledTableParts__Button",componentId:"sc-d231039f-5"})` + cursor: pointer; + border-radius: 10px; + font-size: 15px; + line-height: 15px; + font-weight: bold; + padding: 0 12px; + font-weight: 600; + height: 34px; + transition: background-color ease-in 0.2s; + margin-right: 8px; + border: 0; + outline: 0; + color: ${e=>e.theme?.primaryColorScheme?.darker10}; + background: ${e=>e.theme?.primaryColorScheme?.alpha20}; + + &:focus, + &:hover { + outline: 0; + background: ${e=>e.theme?.primaryColorScheme?.alpha30}; + color: ${e=>e.theme?.primaryColorScheme?.darker10}; + } +`,eMQ=eL.default.span.withConfig({displayName:"StyledTableParts__Span",componentId:"sc-d231039f-6"})` + display: flex; + color: ${e=>e.theme.appColors.hex(10)}; + align-items: center; +`,eMJ=(0,la.ZP)` + mutation RevokeCalendarTokenMutation($input: RevokeCalendarTokenInput!) { + revokeCalendarToken(input: $input) { + ok + } + } +`,eMX=function(e){let{id:t}=e,[a,{loading:n,data:l}]=(0,cs.D)(eMJ),r=(0,ev.useCallback)(()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),id:t}}})},[t,a]);return n?ev.createElement(eY.Z,{id:"general.revoking",defaultMessage:"Revoking…"}):null!=l&&l.revokeCalendarToken.ok?ev.createElement(eY.Z,{id:"general.revoked",defaultMessage:"Revoked"}):ev.createElement(e_d,{onClick:r},ev.createElement(eY.Z,{id:"general.revoke_access",defaultMessage:"Revoke Access"}))},eM0=function(e){let{last_used_at:t,user_agent:a,id:n}=e.token,l=a&&(a.browser.name||a.ua)||"-",r=a&&a.os.name||"-";return ev.createElement(eMG,null,ev.createElement(eMQ,null,l),ev.createElement(eMQ,null,r),ev.createElement(eMQ,null,null!=t?cc()(t).fromNow():ev.createElement(eY.Z,{id:"general.never",defaultMessage:"Never"})),ev.createElement(eMQ,null,ev.createElement(eMX,{id:n})))},eM1=function(e){let{data:t}=e,{me:a}=t;if(null==a)return ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.calendar_tokens_unauthorized",defaultMessage:"Unable to retrieve calendar tokens for guest"}));let{edges:n}=a.calendar_tokens;return ev.createElement(eMW,null,ev.createElement(eMH,null,ev.createElement(eMK,null,ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.platform",defaultMessage:"Platform"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.device",defaultMessage:"Device"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.last_used",defaultMessage:"Last Used"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.access",defaultMessage:"Access"}))),n.map(e=>ev.createElement(eM0,{key:e.node.id,token:e.node}))))},eM2=eL.default.input.withConfig({displayName:"TextField",componentId:"sc-65ca2b4-0"})` + width: 100%; + max-width: 320px; + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(10)}; + background: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + border-radius: 10px; + background-clip: padding-box; + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(2)}; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + + &:focus { + border-color: ${e=>e.theme.appColors.hex(60)}; + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,eM5=function(e){let{url:t}=e;return null==t?null:ev.createElement(eM2,{name:"url",readOnly:!0,value:t})},eM3=function(e){let{children:t,Logo:a,title:n}=e;return ev.createElement(e_C,null,ev.createElement(a,null),ev.createElement(e_M,null,ev.createElement(e_g,null,n),t))},eM4=(0,la.ZP)` + query CalendarTokensQuery { + me { + id + calendar_tokens { + edges { + node { + id + token + user_agent + last_used_at + } + } + } + } + } +`,eM6=(0,la.ZP)` + mutation GenerateCalendarTokenMutation($input: GenerateCalendarTokenInput!) { + generateCalendarToken(input: $input) { + token { + id + token + } + } + } +`,eM8=function(){let e=(0,eK.Z)(),[t,a]=(0,ev.useState)(e.formatMessage({id:"general.copy",defaultMessage:"Copy"})),n=(0,e$.useSelector)(dI),{loading:l,error:r,data:o,refetch:i}=(0,eB.a)(eM4),[s,d]=(0,cs.D)(eM6);if(l)return ev.createElement("div",null,ev.createElement(eI.Spinner,null));let c=async()=>{await s({variables:{input:{clientMutationId:(0,ld.Z)()}}}),await i()},m=!l&&eu()(r)&&!eu()(o?.me),u=o?.me?.calendar_tokens?.edges?.length??0,p=m&&u>0,g=d.data?.generateCalendarToken?.token?.token??null,f=g?new dS(n).urlFor({pathname:`/webcal?token=${g}`}):null,h=p?o.me.calendar_tokens.edges[0].node.token:null,y=h?new dS(n).urlFor({pathname:`/webcal?token=${h}`}):null;return ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_r,null,ev.createElement(e_o,null,ev.createElement(lT.ic,null)),ev.createElement(e_i,null,ev.createElement(e_p,null,ev.createElement(eY.Z,{id:"general.calendar_feed",defaultMessage:"Calendar Feed"})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.calendar_feed_subtitle",defaultMessage:"Use the calendar feed integration to one-way sync all your tasks with Google, Apple or Outlook. Learn more by visiting our help center.",values:{Link:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/articles/360041880593",target:"_blank",rel:"noopener noreferrer"},e)}})),p||d.called?null:ev.createElement(e_d,{onClick:c},ev.createElement(eY.Z,{id:"general.generate_api_token",defaultMessage:"Generate API Token"})),p?ev.createElement(e_w,null,ev.createElement(e_g,null,ev.createElement(eY.Z,{id:"general.how_to_sync",defaultMessage:"How to Sync"})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.first_copy_url_below",defaultMessage:"First, copy the URL below."})),ev.createElement(e_c,null,ev.createElement(eM5,{url:f||y}),ev.createElement(e_d,{onClick:()=>{navigator.clipboard.writeText(f||y),a(e.formatMessage({id:"general.copied",defaultMessage:"Copied!"}))}},t))):null,p||d.called?ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.sync_with_apple_google_see_intstructions_below",defaultMessage:"You may sync with Apple, Google Calendar. See instructions below."})),ev.createElement(eM3,{Logo:lT.iA,title:e.formatMessage({id:"general.apple_calendar",defaultMessage:"Apple Calendar"})},ev.createElement("ol",null,ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.open_apple_calendar",defaultMessage:"Open Apple Calendar"})),ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.go_to_file_create_calendar_subscription",defaultMessage:"Go to File > Create Calendar Subscription",values:{strong:e=>ev.createElement("strong",null,e)}})),ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.paste_url_click_subscribe",defaultMessage:"Then paste the URL above and click on ''Subscribe''.",values:{strong:e=>ev.createElement("strong",null,e)}}))))):null,p||d.called?ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eM3,{Logo:lT.nj,title:e.formatMessage({id:"general.google_calendar",defaultMessage:"Google Calendar"})},ev.createElement("ol",null,ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.go_to_google_calendar_settings_page",defaultMessage:"Go to Google Calendar's settings page"})),ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.on_left_navigation_panel_navigate_to_add_calendar_from_url",defaultMessage:"On the left navigation panel, navigate to Add Calendar > From URL",values:{strong:e=>ev.createElement("strong",null,e)}})),ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.paste_url_above_click_on_add_calendar",defaultMessage:"Then paste the URL above and click on ''Add calendar''",values:{strong:e=>ev.createElement("strong",null,e)}}))))):null,p||d.called?ev.createElement(ev.Fragment,null,ev.createElement(eM3,{Logo:lT.rc,title:e.formatMessage({id:"general.outlook_calendar",defaultMessage:"Outlook Calendar"})},ev.createElement("ol",null,ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.open_outlook_calendar",defaultMessage:"Open Outlook Calendar"})),ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.on_left_navigation_panel_navigate_to_add_calendar_subscribe_from_web",defaultMessage:"On the left navigation panel, navigate to Add Calendar > Subscribe from web",values:{strong:e=>ev.createElement("strong",null,e)}})),ev.createElement("li",null,ev.createElement(eY.Z,{id:"general.paste_url_above_click_on_import",defaultMessage:"Then paste the URL above and click on ''Import''",values:{strong:e=>ev.createElement("strong",null,e)}}))))):null,p||d.called?ev.createElement(e_w,null,ev.createElement(e_g,null,ev.createElement(eY.Z,{id:"general.api_token",defaultMessage:"API TOKEN"})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.for_security_revoke_access_generate_new_token_usage_appear_below_as_soon_as_sync_apple_google_calendar",defaultMessage:"For security, you may revoke access at any point or generate a new token. Usage will appear below as soon as you sync with Apple or Google calendar."})),ev.createElement(e_c,null,g?ev.createElement(eM5,{url:g}):null,ev.createElement(e_d,{onClick:c},ev.createElement(eY.Z,{id:"general.generate_new_token",defaultMessage:"Generate new token"}))),ev.createElement(eM1,{data:o})):null)))},eM7=function(){let e=(0,eK.Z)();return ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.calendar_feed",defaultMessage:"Calendar Feed"})}),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eM8,{value:"calendar_feed"})))},eM9=eL.default.a.withConfig({displayName:"Space__Wrapper",componentId:"sc-e8e858ea-0"})` + display: flex; + align-items: center; + + margin-left: ${e=>e.isSubspace?20:0}px; +`,eSe=(0,eL.default)(e__).withConfig({displayName:"Space__SpaceName",componentId:"sc-e8e858ea-1"})` + margin-left: 8px; + color: ${e=>e.theme.textColors.hex(10)}; +`,eSt=(0,eL.css)` + display: inline-flex; + border-radius: 10px; + text-transform: uppercase; + margin-left: 8px; + font-size: 12px; + padding: 4px 10px; + font-weight: 500; + user-select: none; +`,eSa=(0,eL.default)(lT.yG).withConfig({displayName:"Space__IconSync",componentId:"sc-e8e858ea-2"})` + transform: scale(0.8); + & path { + fill: ${eI.ThemeColors.success}; + } +`,eSn=(0,eI.getColorScheme)(eI.ThemeColors.upgrade),eSl=eL.default.span.withConfig({displayName:"Space__UpgradePill",componentId:"sc-e8e858ea-3"})` + ${eSt} + color: ${eSn?.base}; + background: ${eSn?.alpha10}; + + &:hover { + background: ${eSn?.alpha20}; + } +`,eSr=(0,eL.default)(function(e){let{className:t,space:a}=e;return ev.createElement(eM9,{href:"/settings/billing",className:t,isSubspace:a.is_subspace},ev.createElement(eI.ThemeProvider,{theme:{primaryColor:a.color}},ev.createElement(pJ,{space:a,size:"small"}),ev.createElement(eSe,null,a.name)),"unlimited"===a.type?ev.createElement(eSa,null):ev.createElement(eSl,null,"Upgrade"))}).withConfig({displayName:"Tree__StyledSpace",componentId:"sc-21f9b951-0"})` + margin-bottom: 8px; +`,eSo=function(e){let{tree:t}=e,{space:a,children:n}=t;return ev.createElement(ev.Fragment,null,ev.createElement(eSr,{space:a}),n.map(e=>ev.createElement(eSo,{key:e.id,tree:e})))},eSi=(0,la.ZP)` + mutation GoogleCalendarDeleteMutation($input: GoogleCalendarDeleteInput!) { + googleCalendarDelete(input: $input) { + clientMutationId + ok + } + } +`,eSs=(0,la.ZP)` + mutation GoogleCalendarResyncMutation($input: GoogleCalendarResyncInput!) { + googleCalendarResync(input: $input) { + clientMutationId + ok + } + } +`,eSd=(0,la.ZP)` + query MyGoogleCalendarsQuery { + me { + id + google_calendars { + edges { + node { + id + gc_name + gc_id + profile_email + } + } + } + } + } +`,eSc=(0,la.ZP)` + query MySpacesQuery { + me { + id + memberships { + id + space { + id + type + name + color + is_subspace + parent_membership { + id + space { + id + } + } + preferences { + avatars { + small { + hdpi { + url + } + } + } + } + } + } + } + } +`,eSm=(0,eL.default)(lT.iV).withConfig({displayName:"GoogleCalendar__StyledGoogleCalendarIcon",componentId:"sc-a7527f89-0"})` + flex-shrink: 0; +`,eSu=(0,eL.default)(e1.Notice).withConfig({displayName:"GoogleCalendar__DisconnectNotice",componentId:"sc-a7527f89-1"})` + ${e1.UiTypography.sm}; +`,eSp=eL.default.span.withConfig({displayName:"GoogleCalendar__Highlight",componentId:"sc-a7527f89-2"})` + font-weight: 600; + white-space: nowrap; +`,eSg=(0,eL.default)(sC.rU).withConfig({displayName:"GoogleCalendar__StyledLink",componentId:"sc-a7527f89-3"})` + color: ${e=>e.theme.primaryColorScheme?.base}; +`,eSf=(0,eL.default)(e1.Notice).withConfig({displayName:"GoogleCalendar__StyledNotice",componentId:"sc-a7527f89-4"})` + align-self: flex-start; + ${e1.UiTypography.sm}; + margin-top: ${eI.UiSpacing.getPx(4)}; + width: 100%; + cursor: pointer; +`,eSh=eL.default.a.withConfig({displayName:"GoogleCalendar__StyledBillingLink",componentId:"sc-a7527f89-5"})` + color: ${eI.ThemeColors.upgrade}; + &:hover { + text-decoration: underline; + } +`,eSy=eL.default.div.withConfig({displayName:"GoogleCalendar__WorkspacesWrapper",componentId:"sc-a7527f89-6"})` + display: flex; + flex-direction: column; + margin: ${eI.UiSpacing.getPx(5)} 0; +`,eSb=eL.default.div.withConfig({displayName:"GoogleCalendar__TreeContainer",componentId:"sc-a7527f89-7"})` + margin: ${eI.UiSpacing.getPx(2)} 0 ${eI.UiSpacing.getPx(5)}; +`,eSv=function(){let e=function(){let{data:e}=(0,eB.a)(eSd);return(0,ev.useMemo)(()=>e?.me?.google_calendars?.edges?.[0]?.node??null,[e])}(),t=(0,e$.useDispatch)(),{data:a}=(0,eB.a)(eSc),n=(0,ev.useMemo)(()=>a?.me?.memberships?.map(e=>e.space)?.some(e=>"unlimited"===e.type)??!1,[a]),l=(0,ev.useMemo)(()=>a?.me?.memberships??[],[a]),[r,{loading:o}]=(0,cs.D)(eSi,{update:(t,a)=>{let{data:n,errors:l}=a;if(null!=l||null==n)return;let r=t.readQuery({query:eSd});null!=r&&null!=r.me&&t.writeQuery({query:eSd,data:{...r,me:{...r.me,google_calendars:{...r.me.google_calendars,edges:r.me.google_calendars.edges.filter(t=>t.node.id!==e?.id),totalCount:r.me.google_calendars.totalCount-1}}}})}}),[i,{loading:s}]=(0,cs.D)(eSs),d=(0,ev.useCallback)(()=>{null!=e&&r({variables:{input:{clientMutationId:(0,ld.Z)(),id:e.id}}})},[e,r]),c=(0,ev.useCallback)(()=>{null!=e&&i({variables:{input:{clientMutationId:(0,ld.Z)(),id:e.id}}})},[e,i]),m=()=>{t(d4())};return ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_r,null,ev.createElement(e_o,null,ev.createElement(eSm,null)),ev.createElement(e_i,null,ev.createElement(e_p,null,ev.createElement(eY.Z,{id:"general.google_calendar",defaultMessage:"Google Calendar"}),!n&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:m})),ev.createElement(e_b,null,null==e?ev.createElement(eY.Z,{id:"general.google_calendar_instructions",defaultMessage:"2-way sync between Taskade and Google Calendar, you can add or edit scheduled tasks from either side. Note any pre-existing events from other calendars are not synced with Taskade. Learn more by visiting our help center.",values:{Link:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/articles/1500010239122",target:"_blank",rel:"noopener noreferrer"},e)}}):ev.createElement(ev.Fragment,null,ev.createElement(eY.Z,{id:"general.google_calendar_connected",defaultMessage:"You are 2-way synced with calendar {calendar} using {account}, events created there will sync with your Taskade Calendar. Note that other Google Calendars besides Taskade are not synced and will not appear in your Taskade Calendar.",values:{calendar:e.gc_name,account:e.profile_email,b:e=>ev.createElement(eSp,null,e),Link:e=>ev.createElement(eSg,{to:"/calendar"},e)}}))),!n&&ev.createElement(eSf,{$type:"upgrade",onClick:m},"⚡️"," ",ev.createElement(eY.Z,{id:"general.google_calendar_paywall",defaultMessage:"This feature requires at least 1 upgraded workspace, visit billing for more information.",values:{link:e=>ev.createElement(eSh,null,e)}})),null==e&&n&&ev.createElement(e_N,null,ev.createElement(e_s,{href:"/auth/google/calendar",target:"_blank",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.google_calendar_connect_calendar",defaultMessage:"Connect Calendar"}))),null!=e&&ev.createElement(ev.Fragment,null,ev.createElement(ev.Fragment,null,o?ev.createElement(eI.Spinner,null):ev.createElement(e_N,null,ev.createElement(e_d,{onClick:d},ev.createElement(eY.Z,{id:"general.disconnect",defaultMessage:"Disconnect"})),ev.createElement(e_d,{onClick:c},s?ev.createElement(eI.Spinner,null):ev.createElement(eY.Z,{id:"general.resync",defaultMessage:"Resync"})))),ev.createElement(eSy,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.spaces",defaultMessage:"Spaces"})),ev.createElement(eSb,null,pI(l).map(e=>ev.createElement(eSo,{key:e.id,tree:e}))),ev.createElement(eSu,{$type:"danger"},"⚠️"," ",ev.createElement(eY.Z,{id:"general.google_calendar_disconnect_warning",defaultMessage:"When disconnecting, the Taskade calendar in your Google Calendar will be deleted along with all the events.",values:{b:e=>ev.createElement(eSp,null,e)}})))))))},eSk=function(){let e=(0,eK.Z)();return ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.gcal",defaultMessage:"Google Calendar"})}),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eSv,{value:"google_calendar"})))},eSE=function(){let e=(0,eK.Z)(),{data:t}=(0,eB.a)(ED),a=t?.me?.appSumo?.taskadePlanType??"free",n=d6();return ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.integrations",defaultMessage:"Integrations"})}),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_p,null,"Integrations"),ev.createElement(e_b,null,"Use one of our integrations to supercharge your productivity."),ev.createElement(e_S,null,ev.createElement(e_I,{to:"/settings/integrations/calendar-feed"},ev.createElement(lT.ic,null),ev.createElement("div",{className:"details"},ev.createElement("span",{className:"title"},ev.createElement(eY.Z,{id:"general.calendar_feed",defaultMessage:"Calendar Feed"})),ev.createElement("span",{className:"description"},ev.createElement(eY.Z,{id:"general.integrations_subtitle_temporary",defaultMessage:"Use the calendar feed integration to one-way sync all your tasks with Google, Apple or Outlook."}))),ev.createElement(e_D,null)),(n||"free"!==a)&&ev.createElement(ev.Fragment,null,ev.createElement(e_I,{to:"/settings/integrations/google-calendar"},ev.createElement(lT.iV,null),ev.createElement("div",{className:"details"},ev.createElement("span",{className:"title"},ev.createElement(eY.Z,{id:"general.google_calendar",defaultMessage:"Google Calendar"})),ev.createElement("span",{className:"description"},ev.createElement(eY.Z,{id:"general.google_calendar_description",defaultMessage:"2-way sync between Taskade and Google Calendar, you can add or edit scheduled tasks from either side."}))),ev.createElement(e_D,null)),ev.createElement(e_I,{to:"/settings/integrations/zapier"},ev.createElement(lT.us,null),ev.createElement("div",{className:"details"},ev.createElement("span",{className:"title"},ev.createElement(eY.Z,{id:"general.zapier",defaultMessage:"Zapier"})),ev.createElement("span",{className:"description"},ev.createElement(eY.Z,{id:"general.zapier_description",defaultMessage:"Zapier lets you connect Taskade with thousands of apps to automate your work with just a few clicks."}))),ev.createElement(e_D,null))))))},eSx=eL.default.div.withConfig({displayName:"ZapierScreen__ZapierEmbed",componentId:"sc-cfd1da06-0"})` + @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap'); + + --zapier-brand: #ff2d60; + --zapier-brand-120: #ff2d60; + --zapier-text: ${e=>e.theme.appColors.hex(10)}; + --zapier-text-80: ${e=>e.theme.appColors.hex(50)}; + --zapier-bg-5: ${e=>e.theme.appColors.hex(90)}; + --zapier-bg-5b: ${e=>e.theme.appColors.hex(90)} --zapier-bg-0: + ${e=>e.theme.appColors.hex(100)}; + --zapier-icon-bg: ${e=>e.theme.appColors.hex(80)}; + --zapier-icon-color: ${e=>e.theme.appColors.hex(60)}; + --zapier-icon-border-color: ${e=>e.theme.appColors.hex(90)}; + --zapier-service-icon-border-color: ${e=>e.theme.appColors.hex(90)}; + --zapier-input-border-color: rgb(0 0 0 / 50%); + --zapier-border-color: ${e=>e.theme.appColors.hex(70)}; + --zapier-modal-background-color: ${e=>e.theme.appColors.hex(100)}; + --zapier-modal-border-color: ${e=>e.theme.appColors.hex(80)}; + --zapier-zap-state-off-bg: #403f3e; + --zapier-zap-state-off-text: #fff; + --zapier-zap-state-on-bg: #0f884e; + --zapier-zap-state-on-text: #fff; + --zapier-avatar-bg: #1a4a4c; + --zapier-avatar-text: #fff; + --zapier-button-text: #fff; + --zapier-button-bg: var(--zapier-brand); + --zapier-elevation-5: 0 5px 10px 0 rgb(0 0 0 / 10%); + --zapier-elevation-6: 0 5px 10px 0 rgb(0 0 0 / 20%); + --zapier-elevation-30: 0 10px 20px 0 rgb(0 0 0 / 30%); + --zapier-elevation-zap: 0 8px 8px -8px rgb(0 0 0 / 20%); + --zapier-grid-unit: 10px; + --zapier-button-input-border-radius: 10px; + --zapier-font-family: 'Inter', Helvetica, arial, sans-serif; + --zapier-font-size-26px: max(calc(16px * 1.625), 1.625rem); + --zapier-font-size-20px: max(calc(16px * 1.25), 1.25rem); + --zapier-font-size-18px: max(calc(16px * 1.125), 1.125rem); + --zapier-font-size-16px: max(16px, 1rem); + --zapier-font-size-14px: max(calc(16px * 0.875), 0.875rem); + --zapier-font-size-12px: max(calc(16px * 0.75), 0.75rem); +`,eS_=eL.default.a.withConfig({displayName:"ZapierScreen__StyledBillingLink",componentId:"sc-cfd1da06-1"})` + color: ${eI.ThemeColors.upgrade}; + &:hover { + text-decoration: underline; + } +`,eSw=(0,eL.default)(e1.Notice).withConfig({displayName:"ZapierScreen__StyledNotice",componentId:"sc-cfd1da06-2"})` + align-self: flex-start; + ${e1.UiTypography.sm}; + margin-top: ${eI.UiSpacing.getPx(4)}; + width: 100%; + cursor: pointer; +`,eSN=function(){let e=(0,eK.Z)(),t=(0,e$.useDispatch)(),{data:a}=(0,eB.a)(eSc),n=ev.useMemo(()=>a?.me?.memberships?.map(e=>e.space)?.some(e=>"unlimited"===e.type)??!1,[a]),l=()=>{t(d4())};return ev.createElement(e_u,null,ev.createElement(eT.ql,null,ev.createElement("script",{type:"module",src:"https://cdn.zapier.com/packages/partner-sdk/v0/zapier-elements/zapier-elements.esm.js"})),ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.zapier",defaultMessage:"Zapier"})}),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_r,null,ev.createElement(e_o,null,ev.createElement(lT.us,null)),ev.createElement(e_i,null,ev.createElement(e_p,null,ev.createElement(eY.Z,{id:"general.zapier",defaultMessage:"Zapier"}),!n&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:l})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.zapier_subtitle",defaultMessage:"Zapier lets you connect Taskade with thousands of apps to automate your work with just a few clicks. Learn more by visiting our Help Center.",values:{Link:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/articles/8931913052563",target:"_blank",rel:"noopener noreferrer"},e)}})),!n&&ev.createElement(eSw,{$type:"upgrade",onClick:l},"⚡️"," ",ev.createElement(eY.Z,{id:"general.zapier_paywall",defaultMessage:"This feature requires at least 1 upgraded workspace, visit billing for more information.",values:{link:e=>ev.createElement(eS_,null,e)}})),n&&ev.createElement(ev.Fragment,null,ev.createElement(e_N,null,ev.createElement(e_s,{href:"https://zapier.com/apps/taskade/integrations",target:"_blank",rel:"noopener noreferrer"},"Connect with Zapier")),ev.createElement(eSx,null,ev.createElement("zapier-app-directory",{app:"taskade","link-target":"new-tab",theme:"auto","create-without-template":"hide","use-this-zap":"hide"})))))))},eSC=eL.default.div.withConfig({displayName:"FirebaseNotificationSettings__NotificationMessage",componentId:"sc-6a6e0a08-0"})` + font-size: 14px; + display: flex; + align-items: center; + justify-content: space-between; + outline: 0; + background: 0; + border: 0; + border-radius: 10px; + margin: 0 0 2px; + background-color: ${e=>e.theme?.isNightMode?"#1D2021":"#FAFCFD"}; + padding: 20px; + margin: 0 0 20px; + + > p { + margin-bottom: 0; + } +`,eSM=eL.default.div.withConfig({displayName:"FirebaseNotificationSettings__IconSuccess",componentId:"sc-6a6e0a08-1"})` + background-color: #85de73; + border-radius: 100px; + height: 30px; + width: 30px; + line-height: 30px; + color: #fff; + margin-right: 10px; + flex: none; + text-align: center; +`,eSS=eL.default.div.withConfig({displayName:"FirebaseNotificationSettings__IconDisabled",componentId:"sc-6a6e0a08-2"})` + background-color: #f4d748; + border-radius: 100px; + height: 30px; + width: 30px; + line-height: 30px; + color: #fff; + margin-right: 10px; + flex: none; + text-align: center; +`,eSI=eL.default.div.withConfig({displayName:"FirebaseNotificationSettings__IconNotSupported",componentId:"sc-6a6e0a08-3"})` + background-color: #ed938f; + border-radius: 100px; + height: 30px; + width: 30px; + line-height: 30px; + color: #fff; + margin-right: 10px; + flex: none; + text-align: center; +`,eSD=eL.default.div.withConfig({displayName:"FirebaseNotificationSettings__Text",componentId:"sc-6a6e0a08-4"})` + & a { + color: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + } +`,eST=(0,e$.connect)(function(e){return{permission:_R(e)}})(e=>{let t=e.permission;VY&&"messaging/permission-default"===t&&(t="messaging/permission-blocked");let a=()=>{gr("/settings/notifications")};return null!=t&&t.length>0?ev.createElement(e_q,null,ev.createElement(eSC,null,(()=>{switch(t){case"messaging/permission-default":return ev.createElement(ev.Fragment,null,ev.createElement(e_H,null,ev.createElement(eSS,null,ev.createElement(tn.Icon,{icon:"dd_notifications"})),ev.createElement(eY.Z,{id:"general.enable_browser_notifications_to_stay_updated",defaultMessage:"To stay up to date with recent activities, we encourage you to enable browser notifications. Please allow notifications for Taskade in your browser settings or click on 'Enable Notifications'."})),ev.createElement(e_8,{type:"button",onClick:a},ev.createElement(eY.Z,{id:"general.enable_notifications",defaultMessage:"Enable Notifications"})));case"messaging/permission-blocked":return ev.createElement(e_H,null,ev.createElement(eSS,null,ev.createElement(tn.Icon,{icon:"dd_notifications"})),ev.createElement(eSD,null,ev.createElement(eY.Z,{id:"general.allow_notifications_in_settings",defaultMessage:"Please allow notifications for Taskade in your browser settings. Learn more about enabling browser notifications.",values:{support:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/articles/1500001192481--I-m-not-receiving-notifications-How-can-I-enable-them",target:"_blank",rel:"noopener noreferrer"},e)}})));case"messaging/permission-granted":return ev.createElement(e_H,null,ev.createElement(eSM,null,ev.createElement(tn.Icon,{icon:"dd_check"})),ev.createElement(eY.Z,{id:"general.browser_notifications_are_enabled",defaultMessage:"Your browser notifications are enabled."}));case"messaging/unsupported-browser":return ev.createElement(e_H,null,ev.createElement(eSI,null,ev.createElement(tn.Icon,{icon:"dd_notifications"})),ev.createElement(eY.Z,{id:"general.errors.notifications_not_supported",defaultMessage:"Your browser does not support notifications."}));default:return null}})())):null}),eS$=(0,la.ZP)` + query NotificationsQuery { + me { + id + notificationsSettings { + browser + email + mobile + } + } + memberships(filterby: { archived: false }) { + totalCount + edges { + node { + id + order + space { + id + name + parent_id + color + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + } + } + } + } + } + } + notificationsSettings { + browser + email + mobile + } + } + } + } + } +`,eSP=(0,la.ZP)` + mutation CurrentUserNotificationUpdateMutation($input: CurrentUserNotificationUpdateInput!) { + currentUserNotificationUpdate(input: $input) { + clientMutationId + me { + id + notificationsSettings { + browser + email + mobile + } + } + } + } +`,eSF=dw.z.enum(["browser","email","mobile"]),eSA=dw.z.enum(["ignored","mentioned","watched"]),eSR=dw.z.enum([...eSA.options,"default","inherited"]);dw.z.object({browser:eSR,email:eSR,mobile:eSR});let eSj={watched:(0,te.Em)({id:"general.watch",defaultMessage:"Watch"}),mentioned:(0,te.Em)({id:"general.mention",defaultMessage:"Mention"}),ignored:(0,te.Em)({id:"general.ignore",defaultMessage:"Ignore"})},eSO={watched:(0,te.Em)({id:"general.watch_description",defaultMessage:"Notify on all updates."}),mentioned:(0,te.Em)({id:"general.mention_description",defaultMessage:"Notify only when mentioned."}),ignored:(0,te.Em)({id:"general.ignore_description",defaultMessage:"Ignore all updates."})},eSU=function(e){let{name:t,selected:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({name:t,value:"inherited",stopRef:n});return ev.createElement("div",{...l.props,className:"flex cursor-pointer py-2 pl-1.5 pr-5 text-sm text-appcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200"},ev.createElement("div",{className:"flex w-10 flex-none flex-col items-center justify-start"},a&&ev.createElement(tn.Icon,{icon:"dd_check",width:20,height:20})),ev.createElement("div",{className:"flex-auto flex-col"},ev.createElement("div",{className:"font-medium"},ev.createElement(eY.Z,{id:"general.inherit",defaultMessage:"Inherit"})),ev.createElement("div",{className:"mt-0.5 text-xs text-textcolor-500"},ev.createElement(eY.Z,{id:"general.default_description",defaultMessage:"Use default settings from account level."}))))},eSZ=function(e){let{name:t,value:a,selected:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({name:t,value:a,stopRef:l});return ev.createElement("div",{...r.props,className:"flex cursor-pointer px-1.5 py-2 text-sm text-textcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200"},ev.createElement("div",{className:"flex w-10 flex-none flex-col items-center justify-start"},n&&ev.createElement(tn.Icon,{icon:"dd_check",width:20,height:20})),ev.createElement("div",{className:"flex-auto flex-col"},ev.createElement("div",{className:"font-medium"},ev.createElement(eY.Z,eSj[e.value])),ev.createElement("div",{className:"mt-0.5 text-xs text-textcolor-500"},ev.createElement(eY.Z,eSO[e.value]))))},eSL=function(e){let{name:t,value:a,menuGroupDispatch:n,initialFocus:l}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:n},ev.createElement(eI.Menu,{className:"max-w-xs rounded-lg border border-solid border-appcolor-300 bg-appcolor-0 py-2",initialFocus:l,loop:!0},null==e.defaultValue&&ev.createElement(eSU,{name:t,selected:"inherited"===a}),ev.createElement(eSZ,{name:t,value:"watched",selected:"watched"===a}),ev.createElement(eSZ,{name:t,value:"mentioned",selected:"mentioned"===a}),ev.createElement(eSZ,{name:t,value:"ignored",selected:"ignored"===a})))},eSB=function(e){let{onChange:t}=e,a=ev.useRef(null),n=ev.useRef(null),[l,r]=ev.useReducer(eI.popupReducer,{expanded:!1}),o=(0,eI.useMenuButton)({ref:a,state:l,dispatch:r}),i=(0,eI.usePopup)({referenceElementRef:a,popupElementRef:n,state:l,placement:"bottom"}),s=ev.useCallback(e=>{if("Activate"===e.type){let a=eSF.safeParse(e.payload.name);if(a.success){if("inherited"===e.payload.value)t?.(a.data,null);else{let n=eSA.safeParse(e.payload.value);n.success&&t?.(a.data,n.data)}}r({type:"Collapse"})}},[t]),d=ev.useMemo(()=>"default"===e.value?e.defaultValue??"watched":e.value,[e.defaultValue,e.value]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{...o.props,className:og()("flex items-center justify-between gap-0.5 rounded-full border border-solid border-appcolor-300 py-0.5 pl-2.5 pr-1.5 text-xs hover:cursor-pointer hover:border-appcolor-400","inherited"===e.value?"bg-appcolor-200 text-textcolor-500":"bg-appcolor-200 text-textcolor-900")},ev.createElement("div",{className:"flex flex-auto items-center justify-center"},"inherited"!==e.value&&null==e.defaultValue&&ev.createElement("div",{className:"mr-1 h-1 w-1 rounded-full bg-upgrade"}),ev.createElement("span",{className:"text-center"},"inherited"===d?ev.createElement(eY.Z,{id:"general.use_default",defaultMessage:"Use default"}):ev.createElement(eY.Z,eSj[d]))),ev.createElement(tn.Icon,{icon:"caret_down",className:"h-3 w-3"})),l.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:r,modal:!0},ev.createElement(eSL,{name:e.name,value:d,menuGroupDispatch:s,initialFocus:i.initialFocus,defaultValue:e.defaultValue})))},eSz=function(e){let t=og()("border-0 border-b border-solid border-appcolor-300 py-2 text-xs font-medium uppercase text-textcolor-500"),a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useState(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"bottom",visible:r});return ev.createElement("div",{className:"grid grid-cols-6"},ev.createElement("div",{className:og()(t,"col-span-3 col-start-1")},null!=e.title&&ev.createElement("div",{className:"flex items-center"},ev.createElement("span",null,e.title),ev.createElement("div",{...d,onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)}},ev.createElement(tn.Icon,{icon:"dd_help",className:"ml-1 h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-700"})),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement("div",{className:"py-2 text-xs text-applight-300"},ev.createElement(eY.Z,{id:"general.explain_space_level_notifications",defaultMessage:"Override the default notifications for specific folders in your workspace."}))))),ev.createElement("div",{className:og()(t,"text-center")},ev.createElement(eY.Z,{id:"general.browser",defaultMessage:"Browser"})),ev.createElement("div",{className:og()(t,"text-center")},ev.createElement(eY.Z,{id:"general.mobile",defaultMessage:"Mobile"})),ev.createElement("div",{className:og()(t,"text-center")},ev.createElement(eY.Z,{id:"general.email",defaultMessage:"Email"})),e.children)},eSV=function(e){let{currentUser:t}=e,{notificationsSettings:a}=t,n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useState(!1),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"bottom",visible:o}),m=(0,ll.x)(),u=ev.useCallback((e,a)=>{let n=(0,ld.Z)();m.mutate({mutation:eSP,variables:{input:{clientMutationId:n,changes:[{key:e,value:a}]}},optimisticResponse:{currentUserNotificationUpdate:{clientMutationId:n,me:{...t,notificationsSettings:{...t.notificationsSettings,[e]:a??"default"}}}}})},[m,t]),p=og()("border-0 border-b border-solid border-appcolor-300 py-2 text-sm font-normal");return ev.createElement(ev.Fragment,null,ev.createElement(eSz,null,ev.createElement("div",{className:og()(p,"col-span-3 col-start-1 flex items-center")},ev.createElement(eY.Z,{id:"general.my_notifications",defaultMessage:"Default Settings"}),ev.createElement("div",{...c,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)}},ev.createElement(tn.Icon,{icon:"dd_help",className:"ml-1 h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-700"})),o&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement("div",{className:"py-2 text-xs text-applight-300"},ev.createElement(eY.Z,{id:"general.explain_account_level_notifications",defaultMessage:"The default notifications for folders in your workspace that haven't been changed."})))),ev.createElement("div",{className:og()(p,"flex items-center justify-center")},ev.createElement(eSB,{name:"browser",value:a.browser,defaultValue:"watched",onChange:u})),ev.createElement("div",{className:og()(p,"flex items-center justify-center")},ev.createElement(eSB,{name:"mobile",value:a.mobile,defaultValue:"watched",onChange:u})),ev.createElement("div",{className:og()(p,"flex items-center justify-center")},ev.createElement(eSB,{name:"email",value:a.email,defaultValue:"watched",onChange:u}))))},eSq=(0,la.ZP)` + mutation SpaceNotificationUpdateMutation($input: SpaceNotificationUpdateInput!) { + spaceNotificationUpdate(input: $input) { + clientMutationId + membership { + id + notificationsSettings { + browser + email + mobile + } + } + } + } +`,eSW=function(e){let{membership:t}=e,{notificationsSettings:a,space:n}=t,l=(0,ll.x)(),r=ev.useCallback((e,a)=>{let r=(0,ld.Z)();l.mutate({mutation:eSq,variables:{input:{clientMutationId:r,spaceID:n.id,changes:[{key:e,value:a}]}},optimisticResponse:{spaceNotificationUpdate:{clientMutationId:r,membership:{...t,notificationsSettings:{...t.notificationsSettings,[e]:a??"inherited"}}}}})},[l,t,n.id]),o=og()("border-0 border-b border-solid border-appcolor-300 py-2 text-sm font-normal"),i=og()("col-span-3 col-start-1 flex items-center gap-2");return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:og()(o,i,"pl-3")},null==n.parent_id?ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex h-6 w-6 items-center justify-center rounded-lg bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"home",width:16,height:16})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"}))):ev.createElement(ev.Fragment,null,ev.createElement(nA,{space:n,size:"xs"}),ev.createElement("span",null,n.name))),ev.createElement("div",{className:og()(o,"flex items-center justify-center")},ev.createElement(eSB,{name:"browser",value:a.browser,onChange:r})),ev.createElement("div",{className:og()(o,"flex items-center justify-center")},ev.createElement(eSB,{name:"mobile",value:a.mobile,onChange:r})),ev.createElement("div",{className:og()(o,"flex items-center justify-center")},ev.createElement(eSB,{name:"email",value:a.email,onChange:r})))},eSH=function(e){let{membershipConnection:t}=e,a=(0,eK.Z)().formatMessage({id:"general.workspace",defaultMessage:"Workspace"}),n=t?.edges,{workspaceTrees:l,sharedFolders:r}=ev.useMemo(()=>(function(e){let t={},a=[];for(let n of e)if(null==n.space.parent_id){let e=n.space.id,l=t[e]??[],r={id:e,order:n.order,homeFolder:n,folders:l},o=CM()(a,r,"order");a.splice(o,0,r),delete t[e]}else{let e=n.space.parent_id,l=p6()(a,t=>t.id===e);if(-1===l){let a=t[e];if(null==a)t[e]=[n];else{let e=CM()(a,n,"order");a.splice(e,0,n)}}else{let e=a[l],t=CM()(e.folders,n,"order");e.folders.splice(t,0,n)}}let n=[];for(let[,e]of Object.entries(t))if(null!=e)for(let t of e){let e=CM()(n,t,"order");n.splice(e,0,t)}return{workspaceTrees:a,sharedFolders:n}})(n?.map(e=>e.node)??[]),[n]),o=og()("border-0 border-b border-solid border-appcolor-300 py-2 text-sm font-normal"),i=og()("col-span-3 col-start-1 flex items-center gap-2");return ev.createElement(eSz,{title:a},l.map(e=>{let{homeFolder:t}=e;return ev.createElement(ev.Fragment,{key:e.id},ev.createElement("div",{className:og()(o,i)},ev.createElement(nA,{space:e.homeFolder.space,size:"xs"}),ev.createElement("span",null,t.space.name)),ev.createElement("div",{className:o}),ev.createElement("div",{className:o}),ev.createElement("div",{className:o}),ev.createElement(eSW,{membership:t}),e.folders.map(e=>ev.createElement(eSW,{key:e.id,membership:e})))}),r.map(e=>ev.createElement(eSW,{key:e.id,membership:e})))},eSG=function(){let{data:e,loading:t}=(0,eB.a)(eS$,{fetchPolicy:"cache-and-network"}),a=e?.me,n=e?.memberships;return t?ev.createElement("div",{className:"mx-auto"},ev.createElement(eI.Spinner,{size:16})):null==a?ev.createElement("div",null,ev.createElement(sC.rU,{to:"/login",className:"text-primary hover:text-primary/50"},ev.createElement(eY.Z,{id:"general.login_prompt",defaultMessage:"Click here to sign back in."}))):ev.createElement("div",null,ev.createElement("div",null,ev.createElement(eST,null)),ev.createElement("div",{className:"flex flex-col gap-10"},ev.createElement(eSV,{currentUser:a}),ev.createElement(eSH,{membershipConnection:n})))},eSK=function(){let e=(0,eK.Z)(),t="Notifications - Taskade";return ev.createElement(e_u,null,ev.createElement(_2,{title:t,ogTitle:t}),ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.notifications",defaultMessage:"Notifications"})}),ev.createElement("div",{className:"max-w-5xl text-textcolor-900"},ev.createElement(eSG,null)))},eSY=(0,la.ZP)` + mutation OrganizationCreateMutation($input: OrganizationCreateInput!) { + organizationCreate(input: $input) { + clientMutationId + organization { + id + name + } + } + } +`,eSQ=function(){let e=(0,eF.k6)(),[t]=(0,cs.D)(eSY),a=ev.useMemo(()=>({id:null,name:""}),[]),{register:n,setError:l,formState:{errors:r},handleSubmit:o}=(0,sz.cI)({defaultValues:a}),i=async a=>{try{await t({variables:{input:{clientMutationId:(0,ld.Z)(),name:a.name}},update:(t,a)=>{let{data:n,errors:l}=a;null==l&&null!=n&&(t.writeQuery({query:ex9,data:{organization:{...n.organizationCreate.organization}}}),n?.organizationCreate?.organization?.id!=null&&e.push({pathname:`/settings/organizations/${n?.organizationCreate?.organization?.id}/overview`}))}})}catch(e){e instanceof ea.cA?l("name",{message:e.message}):l("name",{message:"Unknown error"})}};return ev.createElement(ev.Fragment,null,ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.organization_note_helpcenter",defaultMessage:"Streamline your workspace management by centralizing them all within a single organization. To learn more about organizations, visit our Help Center",values:{support:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/sections/12069644048659--Security"},e)}})),ev.createElement("form",{className:"flex-column flex max-w-[30rem]",onSubmit:o(i)},ev.createElement("input",{...n("id"),type:"hidden"}),ev.createElement(e_$,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})),ev.createElement(e_P,{...n("name"),type:"text",required:!0,placeholder:"example.com"}),r.name&&ev.createElement("div",{className:"bg-red-100 border-red-400 text-red-700 relative rounded border px-4 py-3",role:"alert"},ev.createElement("span",{className:"block sm:inline"},r.name.message)),ev.createElement(e_d,{className:"mt-2"},ev.createElement(eY.Z,{id:"general.create",defaultMessage:"Create"})))))},eSJ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OrganizationPreferencesUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationPreferencesUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPreferencesUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"}}]}}]}}]}}]},eSX=(0,la.ZP)` + mutation OrganizationUpdateMutation($input: OrganizationUpdateInput!) { + organizationUpdate(input: $input) { + clientMutationId + organization { + id + name + spaces { + edges { + node { + id + name + } + } + } + } + } + } +`,eS0={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OwnerMembershipsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NamedType",name:{kind:"Name",value:"MembershipFiltering"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"current_subscription"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"renewed_at"}}]}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"isAppSumo"}}]}}]}}]}}]}}]}}]}}]},eS1=function(e){let{organization:t}=e,[a]=(0,cs.D)(eSX),n=ev.useMemo(()=>({id:t.id,name:t.name}),[t]),{register:l,setError:r,formState:{errors:o},handleSubmit:i}=(0,sz.cI)({defaultValues:n}),s=async e=>{try{await a({variables:{input:{clientMutationId:(0,ld.Z)(),id:e.id,name:e.name}},update:(e,t)=>{let{data:a,errors:n}=t;if(null!=n||null==a)return;let l=e.readQuery({query:ex9});null!=l&&e.writeQuery({query:ex9,data:{...l,organization:{...a.organizationUpdate.organization}}})}})}catch(e){e instanceof ea.cA?r("name",{message:e.message}):r("name",{message:"Unknown error"})}},d=fR.Vl.getFeature("organization.scim").plans[t.taskadePlanType];return ev.createElement("form",{className:"flex-column flex max-w-[30rem]",onSubmit:i(s)},ev.createElement("input",{...l("id"),type:"hidden"}),ev.createElement(e_$,{className:"w-full"},ev.createElement("div",null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})),ev.createElement(e_P,{className:"w-full",...l("name"),type:"text",required:!0,placeholder:"example.com"}),o.name&&ev.createElement("div",{className:"bg-red-100 border-red-400 text-red-700 relative rounded border px-4 py-3",role:"alert"},ev.createElement("span",{className:"block sm:inline"},o.name.message))),ev.createElement("div",{className:"pt-[1rem]"},ev.createElement(e_d,null,ev.createElement(eY.Z,{id:"general.update",defaultMessage:"Update"}))),d&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"pt-[1.875rem]"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.scim_token",defaultMessage:"SCIM Token"}))),ev.createElement("div",{className:"mt-2 w-full rounded-[0.625rem] border border-appcolor-300 bg-appcolor-100 px-[0.75rem] py-[0.375rem] text-sm"},t.scim_token))))},eS2=function(e){let t=(0,e$.useDispatch)(),{peopleGroup:a}=e,n=ev.useCallback(()=>{t(e_a.actions.toggleManagePeopleGroupDialog({peopleGroup:a}))},[t,a]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-center py-2 text-sm font-normal"},a.name),ev.createElement("div",{className:"flex items-center py-2 text-sm font-normal"},a.peopleGroupMembers.edges.length," members"),ev.createElement("div",{className:"flex items-center py-2 text-sm font-normal"},ev.createElement(e_d,{onClick:n},ev.createElement(eY.Z,{id:"general.manage",defaultMessage:"Manage"}))))},eS5=function(e){let{organization:t}=e,a=(0,ll.x)(),{data:n,loading:l,error:r}=(0,eB.a)(eS0,{variables:{filterby:{membershipType:b.Space,role:"owner"}},fetchPolicy:"network-only"}),[o]=(0,cs.D)(eSJ),i=ev.useCallback((e,n)=>{if(t?.id==null||e.current_subscription?.renewed_at==null&&!e.preferences?.isAppSumo)return;let l=n.has(e.id),r=[];l?n.forEach((t,a)=>{a!==e.id&&r.push(a)}):(r=Array.from(n.keys())).push(e.id);let o=(0,ld.Z)();a.mutate({mutation:eSX,variables:{input:{clientMutationId:o,id:t.id,spaceIds:r}},refetchQueries:[{query:ex9}]})},[a,t.id]),s=ev.useCallback(async e=>{await o({variables:{input:{clientMutationId:(0,ld.Z)(),id:t.id,canMemberCreateWorkspace:e}}})},[o,t.id]),d=fR.Vl.getFeature("organization.scim").plans[t.taskadePlanType],c=n?.memberships?.edges??[],m=ev.useMemo(()=>{let e=new Map;for(let a of t.spaces?.edges??[])e.set(a.node.id,a.node);return e},[t.spaces?.edges]);return l||null!=r?ev.createElement(eI.Spinner,{height:20}):ev.createElement(ev.Fragment,null,ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.organization_note_helpcenter",defaultMessage:"Streamline your workspace management by centralizing them all within a single organization. To learn more about organizations, visit our Help Center",values:{support:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/sections/12069644048659--Security"},e)}}))),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eS1,{organization:t})),d&&ev.createElement(ev.Fragment,null,ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e1.Overline,{className:"mb-2"},ev.createElement(eY.Z,{id:"general.workspaces",defaultMessage:"Workspaces"})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.organization_workspace_list",defaultMessage:"Include or exclude a workspace from your organization"})),c.map(e=>ev.createElement("div",{key:e.node.space.id,className:"flex max-w-md cursor-pointer rounded-lg hover:bg-appcolor-200",onClick:()=>i(e.node.space,m)},ev.createElement("div",{className:"flex w-full items-center py-[0.3rem] text-sm"},ev.createElement(nA,{space:e.node.space,size:"sm"}),ev.createElement("div",{className:"pl-[0.5rem] pr-[1rem]"},e.node.space.name),e.node.space.current_subscription?.renewed_at==null&&!e.node.space.preferences?.isAppSumo&&ev.createElement("div",{className:"flex items-center whitespace-nowrap rounded-[0.625rem] bg-appcolor-200 px-2.5 py-0.75 text-xs font-medium uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))),m.has(e.node.space.id)&&ev.createElement("div",{className:"flex items-center whitespace-nowrap px-2.5 py-0.75"},ev.createElement(tn.Icon,{icon:"dd_check"}))))),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e1.Overline,{className:"mb-2"},ev.createElement(eY.Z,{id:"general.people",defaultMessage:"People & People Group"})),t.peopleGroups.edges.length>0?ev.createElement(ev.Fragment,null,ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.organization_people_group_list",defaultMessage:"To grant or revoke access to workspaces for a group, click on 'Manage'. To add or remove groups, assign or unassign the application from these groups using your IdP"})),ev.createElement("div",{className:"grid grid-cols-3"},ev.createElement("div",{className:"border-0 border-b border-solid border-appcolor-300 py-2 text-xs font-medium uppercase text-textcolor-500"},ev.createElement(eY.Z,{id:"general.group",defaultMessage:"Group"})),ev.createElement("div",{className:"border-0 border-b border-solid border-appcolor-300 py-2 text-xs font-medium uppercase text-textcolor-500"},ev.createElement(eY.Z,{id:"general.members",defaultMessage:"Members"})),ev.createElement("div",{className:"border-0 border-b border-solid border-appcolor-300 py-2 text-xs font-medium uppercase text-textcolor-500"}),t.peopleGroups.edges.map(e=>ev.createElement(eS2,{key:e.node.id,peopleGroup:e.node})))):ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.organization_setup_scim_help_center",defaultMessage:"In order to enable team access via SCIM, the initial step is to setup SAML SSO. For further information, please refer to our Help Center",values:{support:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/sections/12069644048659--Security"},e)}}))),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e1.Overline,{className:"mb-2"},ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"})),ev.createElement("div",{className:"flex items-center text-sm"},ev.createElement(eY.Z,{id:"general.organization_preferences_can_member_create_workspace",defaultMessage:"Allow members to create workspaces."}),ev.createElement(e1.Switch,{className:"ml-2 cursor-pointer",checked:t.preferences.canMemberCreateWorkspace??!0,onChange:s})))))},eS3=(0,la.ZP)` + query SamlSsoConfigQuery { + samlSsoConfig { + id + idpIssuer + domain + ssoUrl + idpPubSigningCert + spaceIds + } + } +`,eS4=(0,la.ZP)` + mutation SamlSsoConfigUserUpdateMutation($input: SamlSsoConfigUpdateInput!) { + samlSsoConfigUpdate(input: $input) { + clientMutationId + samlSsoConfig { + id + domain + ssoUrl + idpIssuer + idpPubSigningCert + } + } + } +`,eS6=eL.default.label.withConfig({displayName:"Styled__WorkspaceItem",componentId:"sc-72dd21c5-0"})` + display: flex; + border-radius: 10px; + cursor: pointer; + ${e1.UiTypography.sm}; + align-items: center; + padding: 4px 8px 4px 8px; + margin-bottom: 0.25rem; + justify-content: space-between; + transition: background-color ease-in-out 200ms; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + & input { + position: absolute; + width: 0; + height: 0; + } + & input ~ svg { + opacity: 0; + transition: opacity ease-in-out 200ms; + } + & input:checked ~ svg { + opacity: 1; + color: ${e=>e.theme.appColors.hex(10)}; + } +`,eS8=eL.default.div.withConfig({displayName:"Styled__Name",componentId:"sc-72dd21c5-1"})` + display: flex; + align-items: center; + gap: var(--menu-item-gap); + width: auto; + max-width: 80%; + hyphen: auto; + word-break: break-all; + color: ${e=>e.theme.appColors.hex(10)}; + + & > div:first-child { + display: flex; + flex-shrink: 0; + width: 20px; + height: 20px; + & > span { + ${e1.UiTypography.xs}; + transform: scale(1); + } + } + + label { + margin: 0; + } +`,eS7=eL.default.div.withConfig({displayName:"Styled__UpgradeBadge",componentId:"sc-72dd21c5-2"})` + display: flex; + align-items: center; + white-space: nowrap; + padding: 3px 10px; + font-weight: 500; + border-radius: 10px; + ${e1.UiTypography.xxs}; + color: ${e=>e.theme.appColors.hex(50)}; + background: ${e=>e.theme.appColors.hex(80)}; + text-transform: uppercase; +`,eS9=eL.default.div.withConfig({displayName:"Styled__OverlineTitle",componentId:"sc-72dd21c5-3"})` + margin: 1.25rem 0 0.5rem 0; + text-transform: uppercase; + color: ${e=>e.theme.textColors.hex(50)}; + ${e1.UiTypography.xs} +`,eIe=(0,eL.default)(e1.Notice).withConfig({displayName:"Styled__ErrorNotice",componentId:"sc-72dd21c5-4"})` + display: flex; + ${e1.UiTypography.sm} + margin: 0.5rem 0 1rem; + color: ${eI.ThemeColors.danger}; +`,eIt=(0,eL.default)(e1.Notice).withConfig({displayName:"Styled__SuccessNotice",componentId:"sc-72dd21c5-5"})` + display: flex; + ${e1.UiTypography.sm} + margin: 0.5rem 0 1rem; + color: ${eI.ThemeColors.success}; +`,eIa=function(){let[e,t]=ev.useState(!1),[a,n]=ev.useState(!1),[l,r]=ev.useState(!1),[o]=(0,cs.D)(eS4),{data:i,loading:s}=(0,eB.a)(eS3),{data:d,loading:c,error:m}=(0,eB.a)(eS0,{variables:{filterby:{membershipType:b.Space,role:"owner"}},fetchPolicy:"network-only"}),u=null!=i&&null!=i.samlSsoConfig,p=ev.useMemo(()=>({id:i?.samlSsoConfig?.id??null,domain:i?.samlSsoConfig?.domain??"",ssoUrl:i?.samlSsoConfig?.ssoUrl??"",idpIssuer:i?.samlSsoConfig?.idpIssuer??"",idpPubSigningCert:i?.samlSsoConfig?.idpPubSigningCert??"",spaceIds:i?.samlSsoConfig?.spaceIds??[]}),[i?.samlSsoConfig]),{register:g,setError:f,clearErrors:h,formState:{errors:y,isDirty:v},handleSubmit:k,reset:E,getValues:x}=(0,sz.cI)({defaultValues:p});ev.useEffect(()=>{E({id:i?.samlSsoConfig?.id??null,domain:i?.samlSsoConfig?.domain??"",ssoUrl:i?.samlSsoConfig?.ssoUrl??"",idpIssuer:i?.samlSsoConfig?.idpIssuer??"",idpPubSigningCert:i?.samlSsoConfig?.idpPubSigningCert??"",spaceIds:i?.samlSsoConfig?.spaceIds??[]}),r(!1)},[E,i?.samlSsoConfig]),ev.useEffect(()=>{v&&(h("general"),r(!1))},[v,h]);let _=async e=>{t(!0);try{await o({variables:{input:{clientMutationId:(0,ld.Z)(),id:e.id,domain:e.domain,ssoUrl:e.ssoUrl,idpIssuer:e.idpIssuer,idpPubSigningCert:e.idpPubSigningCert,spaceIds:e.spaceIds}},update:(e,t)=>{let{data:a,errors:n}=t;if(null!=n||null==a)return;let l=e.readQuery({query:eS3});null!=l&&e.writeQuery({query:eS3,data:{...l,samlSsoConfig:{...a.samlSsoConfigUpdate.samlSsoConfig}}})}}),r(!0)}catch(e){if(e instanceof ea.cA)switch(e.message){case"Guest are not allow to update SAML SSO config":case"Please verify your email":case"SAML SSO config not found":case"Invalid config":f("general",{type:"custom",message:e.message});break;case"Invalid domain":case"Domain is not same as your email domain":f("domain",{type:"custom",message:e.message});break;case"Invalid SSO URL":f("ssoUrl",{type:"custom",message:e.message});break;case"Please select at least 1 valid workspace":f("spaceIds",{type:"custom",message:e.message});break;default:f("general",{type:"custom",message:"Unknown error"})}else f("general",{type:"custom",message:"Unknown error"})}t(!1)},w=d?.memberships?.edges??[];return ev.createElement(ev.Fragment,null,ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.saml_security_note_helpcenter",defaultMessage:"Manage your workspace security and authentication. Learn more by visiting the Help Center.",values:{support:e=>ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/sections/12069644048659--Security"},e)}}))),ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_g,null,ev.createElement(eY.Z,{id:"general.saml",defaultMessage:"SAML"})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.saml_description",defaultMessage:"Configure single sign-on using SAML identity providers (Okta, Google Workspace, OneLogin, Auth0)."})),s?ev.createElement(eI.Spinner,{height:20}):null,u&&!a?ev.createElement(e_N,null,ev.createElement(e_d,{onClick:e=>{e.preventDefault(),r(!1),n(!0)}},ev.createElement(eY.Z,{id:"general.saml_edit_configuration",defaultMessage:"Edit Configuration"}))):null,l&&ev.createElement(e_N,null,ev.createElement(eIt,null,ev.createElement(eY.Z,{id:"general.saml_sso_config_saved",defaultMessage:"Saved"}))),s||u&&!a?null:ev.createElement(e_T,{onSubmit:k(_)},ev.createElement("input",{...g("id"),type:"hidden"}),y.general&&ev.createElement(eIe,{$type:"danger"},y.general.message),ev.createElement(e_$,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.saml_domain",defaultMessage:"Domain"})),ev.createElement(e_P,{...g("domain"),type:"text",required:!0,placeholder:"example.com"}),y.domain&&ev.createElement(eIe,{$type:"danger"},y.domain.message)),ev.createElement(e_$,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.saml_sso_url",defaultMessage:"SSO URL"})),ev.createElement(e_P,{...g("ssoUrl"),type:"text",required:!0,placeholder:"https://example.com/url"}),y.ssoUrl&&ev.createElement(eIe,{$type:"danger"},y.ssoUrl.message)),ev.createElement(e_$,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.saml_idp_issuer",defaultMessage:"IDP Issuer"})),ev.createElement(e_P,{...g("idpIssuer"),type:"text",required:!0,placeholder:"https://example.com/idpid"})),ev.createElement(e_$,null,ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.saml_idp_public_signing_cert",defaultMessage:"IDP Public Signing Cert"})),ev.createElement(e_F,{rows:5,...g("idpPubSigningCert"),required:!0})),ev.createElement(e_g,null,ev.createElement(eY.Z,{id:"general.saml_default_workspace",defaultMessage:"Default Workspace"})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.saml_select_default_workspaces_to_sso_with",defaultMessage:"To enable single sign-on (SSO) for your team, you'll need to choose a default workspace to connect to. This workspace should be upgraded and owned by you."})),ev.createElement(e_b,null,ev.createElement(eY.Z,{id:"general.saml_change_default_workspaces",defaultMessage:"Important: This cannot be changed after it's configured. Please contact support@taskade.com if you need to change the default workspace.",values:{support:e=>ev.createElement("a",{href:"mailto:support@taskade.com"},e)}})),ev.createElement(e_$,null,y.spaceIds&&ev.createElement(eIe,{$type:"danger"},y.spaceIds.message),ev.createElement(eS9,null,ev.createElement(eY.Z,{id:"general.workspace",defaultMessage:"Workspace"})),c?ev.createElement(eI.Spinner,{height:20}):null,null!=m?ev.createElement(eIe,{$type:"danger"},ev.createElement(eY.Z,{id:"general.saml_error_loading_workspaces",defaultMessage:"There's an error loading your workspaces."})):null,w.map(e=>ev.createElement(eS6,{htmlFor:`check-${e.node.id}`,key:e.node.id},ev.createElement(eS8,null,ev.createElement(nA,{space:e.node.space,size:"sm"}),e.node.space.name,e.node.space.current_subscription?.renewed_at==null&&!e.node.space.preferences?.isAppSumo&&ev.createElement(eS7,null,ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"}))),ev.createElement("input",{type:"checkbox",...g("spaceIds"),value:e.node.space.id,id:`check-${e.node.id}`,disabled:u||e.node.space.current_subscription?.renewed_at==null&&!e.node.space.preferences?.isAppSumo||x("spaceIds").length>0&&!x("spaceIds").includes(e.node.space.id)}),ev.createElement(tn.Icon,{icon:"dd_check"})))),ev.createElement(e_N,null,e?null:ev.createElement(e_d,null,ev.createElement(eY.Z,{id:"general.saml_configure",defaultMessage:"Configure"}))))))},eIn=function(){let e=(0,eK.Z)(),t=(0,eF.k6)(),a=(0,eF.$B)("/settings/organizations/:organizationId/:tab(overview|samlsso)?"),n=a?.params?.tab,l=a?.params?.organizationId==="new",{data:r,loading:o}=(0,eB.a)(ex9),i=r?.organization;return null!=i&&l?(t.push({pathname:`/settings/organizations/${i.id}/overview`}),null):null==i||l||a?.params?.organizationId===`${i.id}`?ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:e.formatMessage({id:"general.organization",defaultMessage:"Organization"})}),!l&&ev.createElement("div",{className:"mb-[1.25rem] flex overflow-x-auto"},ev.createElement(sC.OL,{to:`/settings/organizations/${i?.id}/overview`,isActive:(e,t)=>[`/settings/organizations/${i?.id}/overview`,"/settings/organizations/new"].includes(t.pathname),className:"mr-[0.313rem] flex items-center whitespace-nowrap rounded-3xl px-[1rem] py-[0.313rem] text-center text-sm text-appcolor-500 hover:text-appcolor-900",activeClassName:"!text-appcolor-900 font-medium bg-appcolor-200"},ev.createElement(eY.Z,{id:"general.overview",defaultMessage:"Overview"})),ev.createElement(sC.OL,{to:`/settings/organizations/${i?.id}/samlsso`,exact:!0,className:"mr-[0.313rem] flex items-center whitespace-nowrap rounded-3xl px-[1rem] py-[0.313rem] text-center text-sm text-appcolor-500 hover:text-appcolor-900",activeClassName:"!text-appcolor-900 font-medium bg-appcolor-200"},ev.createElement(eY.Z,{id:"general.saml_sso",defaultMessage:"SAML SSO"}))),o&&ev.createElement(eI.Spinner,{height:20}),l&&ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eSQ,null)),"overview"===n&&null!=i&&ev.createElement(eS5,{organization:i}),"samlsso"===n&&null!=i&&ev.createElement(eIa,null)):(t.replace({pathname:`/settings/organizations/${i.id}/${n}`}),null)},eIl={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MfaCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MfaCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfaCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"mfa"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaTotp"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_verified"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"secret"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaBackupCode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"codesOriginal"}}]}}]}}]}}]}}]},eIr=new Set(["backup_code"]),eIo=(0,lb.C)({initial:"idle",tsTypes:{},schema:{context:{},events:{},services:{}},states:{idle:{on:{MANAGEMENT_SESSION_STARTED:{target:"methods_list"}}},methods_list:{on:{SET_UP_NEW_METHOD:{target:"picking_method"}}},picking_method:{on:{METHOD_PICKED:{target:"mfa_creating",actions:(0,lv.assign)({mfaMethod:(e,t)=>t.method})},CANCEL_SET_UP:{target:"methods_list"}}},mfa_creating:{invoke:{src:"createMfa",onDone:[{cond:e=>eIr.has(e.mfaMethod),target:"mfa_user_setup",actions:(0,lv.assign)({mfa:(e,t)=>t.data})},{target:"mfa_user_naming",actions:(0,lv.assign)({mfa:(e,t)=>t.data})}],onError:{target:"error",actions:(0,lv.assign)({error:(e,t)=>t.data})}}},mfa_user_naming:{on:{MFA_NAMED:{target:"mfa_user_setup",actions:(0,lv.assign)({mfa:(e,t)=>(0,es.ZP)(e.mfa,e=>{if(null==e)return null;e.name=t.mfa.name})})}}},mfa_user_setup:{on:{MFA_SETUP_COMPLETE:{target:"finished"}}},finished:{on:{RETURN_TO_LIST:{target:"methods_list"}}},error:{type:"final"}}});function eIi(e){let t={remainingCounts:{others:0,backupCode:0}},{currentCounts:a}=e;return 0===a.backupCode&&(t.remainingCounts.backupCode=1),a.others+1<=2&&(t.remainingCounts.others=2-a.others),t}let eIs={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUserMfasQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"mfas"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaTotp"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaBackupCode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}}]}}]}}]}}]}}]},eId={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MfaRemoveMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MfaRemoveInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfaRemove"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eIc=function(e){let{mfaId:t,mfaName:a,exit:n}=e,[l]=(0,cs.D)(eId),r=ev.useCallback(()=>{l({variables:{input:{clientMutationId:(0,ld.Z)(),id:t}},refetchQueries:[eIs]})},[t,l]),[o,i]=ev.useState("");return ev.createElement(eI.ModalDialog,{isOpen:!0,close:n},()=>ev.createElement("div",{className:"flex flex-col px-8 py-6"},ev.createElement("h1",{className:"mb-1 text-lg font-medium"},ev.createElement(eY.Z,{id:"mfa.delete_item_title",defaultMessage:"Delete Multi-Factor Authentication Method"})),ev.createElement("p",{className:"mb-1 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.delete_item_dialog_description",defaultMessage:"Enter {name} to confirm:",values:{name:a,u:e=>ev.createElement("u",null,e)}})),ev.createElement("input",{className:"mt-2 rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",value:o,onChange:e=>{i(e.target.value)}}),ev.createElement("div",{className:"mt-3 flex items-center justify-end gap-x-2"},ev.createElement("button",{className:"flex items-center self-start rounded-lg bg-appcolor-200 px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-appcolor-300",onClick:n},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{className:"flex items-center self-start rounded-lg bg-danger px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-danger/90 disabled:bg-danger/50 disabled:text-white/70",onClick:r,disabled:o!==a},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})))))},eIm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MfaRenameMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MfaRenameInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfaRename"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"mfa"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaTotp"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_verified"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]}}]},eIu=function(e){let{mfaId:t,currentName:a,isEditing:n,setIsEditing:l}=e,[r,{loading:o,error:i}]=(0,cs.D)(eIm),s=ev.useRef(null);ev.useEffect(()=>{n&&s.current?.focus()},[n]);let d=ev.useCallback(async e=>{e!==a&&await r({variables:{input:{clientMutationId:(0,ld.Z)(),id:t,name:e}}}),l(!1)},[a,t,r,l]);return n?ev.createElement("div",{className:"flex items-center gap-x-2"},ev.createElement("input",{ref:s,className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-2 py-1 text-sm leading-none text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",defaultValue:a,onBlur:e=>{o||d(e.target.value)},disabled:o,onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Enter:if(o)return;d(e.currentTarget.value);break;case eI.KeyboardKeys.Escape:l(!1)}}}),o&&ev.createElement("div",null,ev.createElement(eI.Spinner,{size:20})),null!=i&&ev.createElement("span",{className:"select-none text-sm text-danger"},ev.createElement(eY.Z,{id:"general.an_error_occurred",defaultMessage:"An error occurred"}))):ev.createElement("span",{className:"text-sm leading-none"},a)},eIp=function(e){let{className:t,name:a,value:n,children:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,name:a,value:n});return ev.createElement("div",{...o.props,className:og()("flex items-center gap-x-2 px-4 py-1.5 hover:cursor-pointer hover:bg-appcolor-300 focus:bg-appcolor-300",t)},l)},eIg=function(e){let{initialFocus:t,menuGroupDispatch:a,disableRename:n}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{initialFocus:t,loop:!0},ev.createElement("div",{className:"flex w-56 flex-col rounded-lg border border-appcolor-300 bg-appcolor-0 py-2"},!0!==n&&ev.createElement(eIp,{className:"select-none",name:"rename"},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_edit"}),ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"mfa.rename",defaultMessage:"Rename"}))),ev.createElement(eIp,{className:"select-none text-danger",name:"delete"},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_delete"}),ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))))},eIf=function(e){let{mfa:t}=e,a=(0,eK.Z)(),n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom",computeModifiersCallback:tr}),s=(0,eI.useMenuButton)({dispatch:o,ref:n,state:r}),[d,c]=ev.useState(!1),[m,u]=ev.useState(!1),p=ev.useCallback(e=>{if("Activate"===e.type)switch(e.payload.name){case"rename":o({type:"Collapse"}),c(!0);break;case"delete":u(!0)}},[]),g=ev.useMemo(()=>{switch((0,ei.assert)(null!=t.__typename),t.__typename){case"MfaBackupCode":return"backup_code";case"MfaTotp":return"totp"}},[t.__typename]),f=ev.useMemo(()=>"name"in t&&null!=t.name?t.name:a.formatMessage(ws[g]),[t,a,g]),h=ev.useCallback(()=>{u(!1)},[]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-start gap-x-2 rounded-lg border border-appcolor-300 px-4 py-2"},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:wi[g]}),ev.createElement("div",{className:"flex flex-col"},ev.createElement(eIu,{isEditing:d,setIsEditing:c,currentName:f,mfaId:t.id}),ev.createElement("span",{className:"mt-0.5 text-xs text-textcolor-400"},ev.createElement(eY.Z,{id:"mfa.created",defaultMessage:"Created on {date}",values:{date:cc()(t.created_at).format("LLL")}}))),ev.createElement("button",{className:"ml-auto flex items-center justify-center rounded-lg px-2 py-1 text-textlight-300 hover:bg-appcolor-200",...s.props},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"header_more"}))),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0},ev.createElement(eIg,{initialFocus:i.initialFocus,menuGroupDispatch:p,disableRename:"MfaBackupCode"===t.__typename})),m&&ev.createElement(eIc,{mfaId:t.id,mfaName:f,exit:h}))},eIh=function(e){let{onSetupClick:t}=e,{data:a,loading:n,error:l}=(0,eB.a)(eIs,{fetchPolicy:"cache-and-network"}),r=ev.useMemo(()=>a?.me?.mfas?.edges??[],[a]),o=ev.useMemo(()=>{let e={currentCounts:{others:0,backupCode:0}};for(let t of r)"MfaBackupCode"===t.node.__typename?e.currentCounts.backupCode++:e.currentCounts.others++;return eIi(e)},[r]),i=ev.useMemo(()=>{let{backupCode:e,others:t}=o.remainingCounts;return e>0||t>0},[o.remainingCounts]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex flex-col"},n&&ev.createElement(eI.Spinner,null),null!=l&&ev.createElement("span",{className:"text-danger"},ev.createElement(eY.Z,{id:"general.generic_error_occurred",defaultMessage:"An error occurred."})),ev.createElement(e1.Overline,{className:"mb-2 mt-2"},ev.createElement(eY.Z,{id:"mfa.active",defaultMessage:"Active"})),0===r.length&&ev.createElement("span",{className:"text-sm text-textcolor-300"},ev.createElement(eY.Z,{id:"mfa.empty_state",defaultMessage:"You have no multi-factor authentication methods set up."})),ev.createElement("div",{className:"mb-4 flex flex-col gap-y-2 self-stretch"},r.map(e=>ev.createElement(eIf,{key:e.node.id,mfa:e.node}))),null!=a&&ev.createElement(ev.Fragment,null,ev.createElement(e1.Overline,{className:"mb-1"},ev.createElement(eY.Z,{id:"mfa.setup_additional_methods",defaultMessage:"Set up Additional Methods"})),i?ev.createElement("button",{className:"mt-1 flex items-center self-start rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-primary/90",onClick:t},ev.createElement(eY.Z,{id:"mfa.setup",defaultMessage:"Set up"})):ev.createElement("span",{className:"text-sm text-textcolor-300"},ev.createElement(eY.Z,{id:"mfa.maximum_reached",defaultMessage:"You have reached the maximum number of MFA methods."})))))},eIy={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MfaManagementSessionCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MfaManagementSessionCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfaManagementSessionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},eIb=function(e){let{onManagementSessionStarted:t}=e,a=(0,eK.Z)(),[n,l]=ev.useState(""),[r,{loading:o,error:i}]=(0,cs.D)(eIy),s=ev.useCallback(async()=>{let{data:e}=await r({variables:{input:{clientMutationId:(0,ld.Z)(),password:n}}});null!=e&&t()},[n,r,t]),d=ev.useMemo(()=>i?.graphQLErrors?.[0]?.extensions?.statusCode===403,[i]);return ev.createElement("div",{className:"flex flex-col"},ev.createElement(ev.Fragment,null,ev.createElement("span",{className:"mb-3 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.password_prompt",defaultMessage:"For security purposes, please enter the password for your account:"})),o?ev.createElement("div",{className:"p-4"},ev.createElement(eI.Spinner,{size:20})):ev.createElement(ev.Fragment,null,ev.createElement("input",{className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"password",placeholder:a.formatMessage({id:"general.password",defaultMessage:"Password"}),value:n,onChange:e=>{l(e.target.value)},onKeyDown:e=>{e.key===eI.KeyboardKeys.Enter&&s()}}),d&&ev.createElement("span",{className:"mt-1 text-sm text-danger"},ev.createElement(eY.Z,{id:"mfa.incorrect_password",defaultMessage:"Incorrect password"})),ev.createElement("button",{className:"mt-3 flex items-center self-end rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-primary/90 disabled:bg-primary/60 disabled:text-white/60",disabled:0===n.length,onClick:()=>{s()}},ev.createElement(eY.Z,{id:"general.confirm",defaultMessage:"Confirm"})))))},eIv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MfaManagementBackupCodeAcknowledgeMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MfaManagementBackupCodeAcknowledgeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfaManagementBackupCodeAcknowledge"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"mfa"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaBackupCode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_verified"}}]}}]}}]}}]}}]},eIk=function(e){let{mfa:t,onAcknowledge:a,exit:n}=e,[l]=(0,cs.D)(eIv),r=async()=>{let{data:e}=await l({variables:{input:{clientMutationId:(0,ld.Z)(),id:t.id}},refetchQueries:[eIs]});null!=e&&a()};return ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"mb-4 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.backup_code_setup_instructions",defaultMessage:"Keep a copy of the codes below."})),ev.createElement("textarea",{value:t.codesOriginal?.join("\n")??void 0,className:"mt-2 h-56 resize-none whitespace-pre rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm leading-snug text-textcolor-500 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100"}),ev.createElement("div",{className:"mt-3 flex items-center justify-end gap-x-3"},ev.createElement("button",{className:"flex items-center rounded-lg bg-appcolor-300 px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-appcolor-200",onClick:n},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{className:"flex items-center rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-primary/90",onClick:r},ev.createElement(eY.Z,{id:"mfa.backup_code_acknowledgement",defaultMessage:"Acknowledge"}))))},eIE=function(e){let{onNamingCompleted:t,onCancelClick:a,mfaId:n}=e,l=(0,eK.Z)(),[r]=(0,cs.D)(eIm),[o,i]=ev.useState(""),s=ev.useCallback(async()=>{let{data:e}=await r({variables:{input:{clientMutationId:(0,ld.Z)(),id:n,name:o}}}),a=e?.mfaRename?.mfa??null;null!=a&&t(a)},[o,n,r,t]),d=async()=>{s()};return ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"mb-1 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.name_app_description",defaultMessage:"Enter a name for the authenticator app."})),ev.createElement("input",{className:"mt-2 rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",autoComplete:"current-password",placeholder:l.formatMessage({id:"mfa.enter_authenticator_app_name",defaultMessage:"Enter authenticator app name"}),value:o,onChange:e=>{i(e.target.value)},onKeyDown:e=>{e.key===eI.KeyboardKeys.Enter&&s()}}),ev.createElement("div",{className:"mt-3 flex items-center justify-end gap-x-3"},ev.createElement("button",{className:"flex items-center rounded-lg bg-appcolor-300 px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-appcolor-200",onClick:a},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{className:"flex items-center self-end rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-primary/90 disabled:bg-primary/60 disabled:text-white/60",onClick:d,disabled:0===o.length},ev.createElement(eY.Z,{id:"general.continue",defaultMessage:"Continue"}))))},eIx=function(e){let{method:t,onSelect:a,disabled:n}=e;return ev.createElement("div",{className:og()("flex select-none gap-x-2 rounded-lg border border-appcolor-300 px-4 py-2",{"opacity-40":n,"hover:cursor-pointer hover:bg-appcolor-200":!0!==n}),onClick:()=>{n||a(t)},"aria-disabled":n},ev.createElement(tn.Icon,{icon:"share_password",className:"h-4 w-4"}),ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"text-sm font-bold"},ev.createElement(eY.Z,ws[t])),ev.createElement("span",{className:"mt-0.5 text-sm text-textcolor-500 md:max-w-sm"},ev.createElement(eY.Z,wd[t]))))},eI_=function(e){let{onMethodPicked:t,onReturnClick:a}=e,{data:n}=(0,eB.a)(eIs),l=ev.useMemo(()=>n?.me?.mfas?.edges??[],[n]),r=ev.useMemo(()=>{let e={currentCounts:{others:0,backupCode:0}};for(let t of l)"MfaBackupCode"===t.node.__typename?e.currentCounts.backupCode++:e.currentCounts.others++;return eIi(e)},[l]);return ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"mb-4 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.pick_a_method",defaultMessage:"Pick a method from the list below."})),ev.createElement("div",{className:"flex flex-col gap-y-3"},ev.createElement(eIx,{method:"totp",onSelect:t,disabled:0===r.remainingCounts.others}),ev.createElement(eIx,{method:"backup_code",onSelect:t,disabled:0===r.remainingCounts.backupCode})),ev.createElement("button",{className:"mt-3 flex items-center self-end rounded-lg bg-appcolor-300 px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-appcolor-200",onClick:a},ev.createElement(eY.Z,{id:"general.return",defaultMessage:"Return"})))};var eIw=a(92592);let eIN={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MfaManagementTotpVerifyMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MfaManagementTotpVerifyInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mfaManagementTotpVerify"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"mfa"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MfaTotp"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_verified"}}]}}]}}]}}]}}]},eIC=function(e){let{mfa:t,onVerified:a,exit:n}=e,l=(0,eK.Z)(),[r,{loading:o,error:i}]=(0,cs.D)(eIN),[s,d]=ev.useState(""),[c,m]=ev.useState(null);ev.useEffect(()=>{(async function(){m(await eIw.toDataURL(t.url))})()},[t.url]);let u=ev.useCallback(async()=>{let{data:e}=await r({variables:{input:{clientMutationId:(0,ld.Z)(),id:t.id,token:s}},refetchQueries:[eIs]});null!=e&&a()},[s,t.id,r,a]);return ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"mb-4 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.totp_setup_instructions",defaultMessage:"Scan the QR code with your authenticator app."})),null!=c?ev.createElement("img",{className:"h-48 w-48 self-center",src:c,alt:""}):ev.createElement(eI.Spinner,null),ev.createElement("span",{className:"mb-1 mt-4 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.totp_setup_manual_instructions",defaultMessage:"Alternatively, enter this code manually:"})),ev.createElement("input",{type:"text",disabled:!0,value:t.secret,className:"mt-2 rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-500 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100"}),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"mfa.totp_verification_section",defaultMessage:"Verify Code"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.totp_verification_instructions",defaultMessage:"Enter the code from the authentication app to ensure that everything is working."})),ev.createElement("input",{className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",autoComplete:"one-time-code",value:s,onChange:e=>{d(e.target.value)},onKeyDown:e=>{e.key===eI.KeyboardKeys.Enter&&u()},placeholder:l.formatMessage({id:"mfa.totp_authentication_code",defaultMessage:"Authentication Code"})}),null!=i&&ev.createElement("span",{className:"text-danger"},ev.createElement(eY.Z,{id:"general.an_error_occurred",defaultMessage:"An error occurred"})),o?ev.createElement(eI.Spinner,null):ev.createElement("div",{className:"mt-3 flex items-center justify-end gap-x-3"},ev.createElement("button",{className:"flex items-center rounded-lg bg-appcolor-300 px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-appcolor-200",onClick:n},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement("button",{className:"flex items-center rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-primary/90",onClick:()=>{u()}},ev.createElement(eY.Z,{id:"mfa.totp_verify_code",defaultMessage:"Verify Code"}))))},eIM=function(e){let{onReturnClick:t}=e;return ev.createElement(ev.Fragment,null,ev.createElement("span",{className:"text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"mfa.setup_complete",defaultMessage:"Setup complete!"})),ev.createElement("button",{className:"mt-3 flex items-center self-end rounded-lg bg-appcolor-300 px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-appcolor-200",onClick:t},ev.createElement(eY.Z,{id:"general.return",defaultMessage:"Return"})))},eIS=function(e){let{exit:t}=e,[a]=(0,cs.D)(eIl),n=ev.useCallback(async(e,t)=>{(0,ei.assert)(null!=e.mfaMethod);let{data:n}=await a({variables:{input:{clientMutationId:(0,ld.Z)(),method:e.mfaMethod}}});return(0,ei.assert)(null!=n),n.mfaCreate.mfa},[a]),[l,r]=(0,ls.e)(eIo,{services:{createMfa:n}}),o=ev.useCallback(()=>{r({type:"MANAGEMENT_SESSION_STARTED"})},[r]),i=ev.useCallback(()=>{r({type:"SET_UP_NEW_METHOD"})},[r]),s=ev.useCallback(e=>{r({type:"METHOD_PICKED",method:e})},[r]),d=ev.useCallback(()=>{r({type:"CANCEL_SET_UP"})},[r]),c=ev.useCallback(e=>{r({type:"MFA_NAMED",mfa:e})},[r]),m=ev.useCallback(()=>{r({type:"MFA_SETUP_COMPLETE"})},[r]),u=ev.useCallback(()=>{r({type:"RETURN_TO_LIST"})},[r]);return ev.createElement("div",{className:"flex flex-col px-8 py-6"},ev.createElement("h1",{className:"mb-1 text-lg font-medium"},ev.createElement(eY.Z,{id:"mfa.setup_title",defaultMessage:"Multi-Factor Authentication"})),l.matches("idle")&&ev.createElement(eIb,{onManagementSessionStarted:o}),l.matches("methods_list")&&ev.createElement(eIh,{onSetupClick:i}),l.matches("picking_method")&&ev.createElement(eI_,{onMethodPicked:s,onReturnClick:d}),l.matches("mfa_creating")&&ev.createElement("div",{className:"mt-2"},ev.createElement(eI.Spinner,null)),l.matches("mfa_user_naming")&&ev.createElement(eIE,{onNamingCompleted:c,onCancelClick:t,mfaId:l.context.mfa.id}),l.matches("mfa_user_setup")&&ev.createElement(ev.Fragment,null,"totp"===l.context.mfaMethod&&ev.createElement(eIC,{mfa:l.context.mfa,onVerified:m,exit:t}),"backup_code"===l.context.mfaMethod&&ev.createElement(eIk,{mfa:l.context.mfa,onAcknowledge:m,exit:t})),l.matches("finished")&&ev.createElement(eIM,{onReturnClick:u}),l.matches("error")&&ev.createElement("span",{className:"text-danger"},ev.createElement(eY.Z,{id:"general.an_error_occurred",defaultMessage:"An error occurred"})))},eII=(0,d9.oM)({name:"dialogs.mfaSetupDialog",initialState:{isOpen:!1},reducers:{toggleMfaSetupDialog:(e,t)=>({isOpen:!e.isOpen})}}),eID=(0,e$.connect)(function(e){return e.dialogs.mfaSetup})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=ev.useCallback(()=>{a(eII.actions.toggleMfaSetupDialog())},[a]);return t?ev.createElement(eI.ModalDialog,{close:n,isOpen:t,backdropOpacity:eI.ModalDialogOpacity.Translucent},e=>{let{exit:t}=e;return ev.createElement(eIS,{exit:t})}):null}),eIT={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUserVerifiedQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"verified_at"}}]}}]}}]},eI$=function(){let e=(0,e$.useDispatch)(),{data:t,loading:a}=(0,eB.a)(eIT),n=ev.useMemo(()=>null==t?null:t.me?.verified_at!=null,[t]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"mb-8 flex flex-col"},ev.createElement("h1",{className:"text-lg font-medium"},ev.createElement(eY.Z,{id:"mfa.title",defaultMessage:"Multi-Factor Authentication"})),ev.createElement("span",{className:"mt-1 text-sm text-textcolor-700"},ev.createElement(eY.Z,{id:"mfa.feature_description",defaultMessage:"Multi-factor authentication enhances your account security by introducing an extra verification step during login."})),a&&ev.createElement("div",{className:"flex self-start py-4"},ev.createElement(eI.Spinner,null)),!0===n&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"mt-2"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",onClick:()=>{e(eII.actions.toggleMfaSetupDialog())}},ev.createElement(eY.Z,{id:"general.configure",defaultMessage:"Configure"}))),ev.createElement(eID,null)),!1===n&&ev.createElement("span",{className:"mt-4 flex self-start rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 p-2 px-3 text-sm text-textcolor-800"},ev.createElement(eY.Z,{id:"mfa.verification_required",defaultMessage:"\uD83D\uDCA1 Please verify your account to set up multi-factor authentication."}))))},eIP={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserOAuthApplications"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"verified_at"}},{kind:"Field",name:{kind:"Name",value:"applications"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"logo"}},{kind:"Field",name:{kind:"Name",value:"client_id"}},{kind:"Field",name:{kind:"Name",value:"client_secret"}},{kind:"Field",name:{kind:"Name",value:"redirect_uris"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"homepage_url"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]}}]}}]}}]},eIF=(0,d9.oM)({name:"dialogs.oauthUpdate",initialState:{isOpen:!1},reducers:{toggleOAuthUpdateDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{isOpen:!0,app:t.payload.app}}}),eIA={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OAuthApplicationCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ApplicationCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"applicationCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"application"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"logo"}},{kind:"Field",name:{kind:"Name",value:"redirect_uris"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"homepage_url"}},{kind:"Field",name:{kind:"Name",value:"client_id"}},{kind:"Field",name:{kind:"Name",value:"client_secret"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]}}]},eIR=function(e){let{exit:t}=e,a=(0,eK.Z)(),[n,l]=ev.useState(!1),[r,o]=ev.useState(""),[i]=(0,cs.D)(eIA,{refetchQueries:[eIP]}),s=(0,e$.useDispatch)(),d=ev.useMemo(()=>({name:"",homepage_url:"",description:"",callback_urls:"",logo:null}),[]),{register:c,setError:m,formState:{errors:u},handleSubmit:p}=(0,sz.cI)({defaultValues:d}),g=async e=>{l(!0);let n=!1,r=[];if(""===e.name&&(m("name",{type:"custom",message:a.formatMessage({id:"oauth.name_error",defaultMessage:"Application Name cannot be empty."})}),l(!1),n=!0),""===e.homepage_url?(m("homepage_url",{type:"custom",message:a.formatMessage({id:"oauth.homepage_url_empty_error",defaultMessage:"Homepage URL cannot be empty."})}),l(!1),n=!0):null==(0,sX.normalizeUrl)(e.homepage_url)&&(m("homepage_url",{type:"custom",message:a.formatMessage({id:"oauth.homepage_url_invalid_error",defaultMessage:"Homepage URL is an invalid URL."})}),l(!1),n=!0),""===e.callback_urls)m("callback_urls",{type:"custom",message:a.formatMessage({id:"oauth.callback_urls_empty_error",defaultMessage:"Callback URLs cannot be empty."})}),l(!1),n=!0;else{let t=e.callback_urls.split(/\r\n|\r|\n/g);t.forEach(e=>{null==(0,sX.normalizeUrl)(e)&&(m("callback_urls",{type:"custom",message:a.formatMessage({id:"oauth.callback_urls_invalid_error",defaultMessage:"Some of the callback URLs given are invalid URLs."})}),l(!1),n=!0)}),r=t}if(!n)try{let a=await i({variables:{input:{clientMutationId:(0,ld.Z)(),name:e.name,description:e.description,homepage_url:e.homepage_url,redirect_uris:r,logo:null}}});(0,ei.assert)(a.data?.applicationCreate.application.client_id!=null),(0,ei.assert)(a.data?.applicationCreate.application.client_secret!=null),l(!1),t(),s(eIF.actions.toggleOAuthUpdateDialog({app:a.data.applicationCreate.application}))}catch(t){let e=(0,ei.getMessageFromError)(t);e?o(e):o("Unknown Error"),l(!1)}};return ev.createElement("form",{onSubmit:p(g)},ev.createElement("div",{className:"flex w-[800px] flex-col px-8 py-6"},ev.createElement("h1",{className:"mb-1 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_header",defaultMessage:"Create a new OAuth2 Application"})),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_name",defaultMessage:"Application Name"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_name_subtitle",defaultMessage:"User visible name for your application"})),ev.createElement("input",{...c("name"),className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",placeholder:a.formatMessage({id:"oauth.create_name_placeholder",defaultMessage:"Application Name"})}),u.name&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},u.name.message),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_developer_url",defaultMessage:"Developer URL"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_developer_subtitle",defaultMessage:"Homepage of the application"})),ev.createElement("input",{...c("homepage_url"),className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",placeholder:a.formatMessage({id:"oauth.create_developer_url",defaultMessage:"Developer URL"})}),u.homepage_url&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},u.homepage_url.message),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_description",defaultMessage:"Description"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_description_subtitle",defaultMessage:"Describe your application."})),ev.createElement("textarea",{...c("description"),className:"mt-2 h-20 resize-none rounded-lg bg-appcolor-200 px-4 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",placeholder:a.formatMessage({id:"oauth.create_description",defaultMessage:"Description"})}),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_callback_urls",defaultMessage:"Callback URLs"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_callback_desc",defaultMessage:"All OAuth Authorization Redirect URLs, separated with newlines"})),ev.createElement("textarea",{...c("callback_urls"),className:"mt-2 h-20 resize-none rounded-lg bg-appcolor-200 px-4 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",placeholder:a.formatMessage({id:"oauth.create_callback",defaultMessage:"Callback URLs"})}),u.callback_urls&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},u.callback_urls.message),ev.createElement("div",{className:"mb-2 mt-4"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",type:"submit",disabled:n},ev.createElement(eY.Z,{id:"general.create",defaultMessage:"Create"}))),r&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},r)))},eIj=(0,d9.oM)({name:"dialogs.oauthCreate",initialState:{isOpen:!1},reducers:{toggleOAuthCreateDialog:e=>({isOpen:!e.isOpen})}}),eIO=(0,e$.connect)(function(e){return e.dialogs.oauthCreate})(function(e){let{isOpen:t}=e,a=(0,e$.useDispatch)(),n=ev.useCallback(()=>{a(eIj.actions.toggleOAuthCreateDialog())},[a]);return t?ev.createElement(eI.ModalDialog,{close:n,isOpen:t,backdropOpacity:eI.ModalDialogOpacity.Translucent},e=>{let{exit:t}=e;return ev.createElement(eIR,{exit:t})}):null}),eIU={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OAuthApplicationRotateSecretMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ApplicationRotateSecretInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"applicationRotateSecret"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"client_secret"}}]}}]}}]},eIZ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OAuthApplicationUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ApplicationUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"applicationUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"application"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"logo"}},{kind:"Field",name:{kind:"Name",value:"redirect_uris"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"homepage_url"}},{kind:"Field",name:{kind:"Name",value:"client_id"}},{kind:"Field",name:{kind:"Name",value:"client_secret"}}]}}]}}]}}]},eIL=function(e){let{exit:t,app:a}=e,n=(0,eK.Z)(),[l,r]=ev.useState(!1),[o,i]=ev.useState(""),[s,d]=ev.useState(a.client_secret),[c]=(0,cs.D)(eIZ),[m]=(0,cs.D)(eIU),u=ev.useMemo(()=>({name:a.name,homepage_url:a.homepage_url,description:a.description,callback_urls:a.redirect_uris.toString().replace(",","\n"),logo:a.logo??null}),[a.description,a.homepage_url,a.logo,a.name,a.redirect_uris]),{register:p,setError:g,formState:{errors:f},handleSubmit:h,reset:y}=(0,sz.cI)({defaultValues:u}),b=async()=>{try{let e=await m({variables:{input:{id:a.id,clientMutationId:(0,ld.Z)()}}});(0,ei.assert)(e.data?.applicationRotateSecret.client_secret!=null),d(e.data?.applicationRotateSecret.client_secret)}catch(t){let e=(0,ei.getMessageFromError)(t);e?i(e):i("Unknown Error"),r(!1)}},v=async e=>{r(!0);let l=!1,o=[];if(""===e.name&&(g("name",{type:"custom",message:n.formatMessage({id:"oauth.name_error",defaultMessage:"Application Name cannot be empty."})}),r(!1),l=!0),""===e.homepage_url?(g("homepage_url",{type:"custom",message:n.formatMessage({id:"oauth.homepage_url_empty_error",defaultMessage:"Homepage URL cannot be empty."})}),r(!1),l=!0):null==(0,sX.normalizeUrl)(e.homepage_url)&&(g("homepage_url",{type:"custom",message:n.formatMessage({id:"oauth.homepage_url_invalid_error",defaultMessage:"Homepage URL is an invalid URL."})}),r(!1),l=!0),""===e.callback_urls)g("callback_urls",{type:"custom",message:n.formatMessage({id:"oauth.callback_urls_empty_error",defaultMessage:"Callback URLs cannot be empty."})}),r(!1),l=!0;else{let t=e.callback_urls.split(/\r\n|\r|\n/g);t.forEach(e=>{null==(0,sX.normalizeUrl)(e)&&(g("callback_urls",{type:"custom",message:n.formatMessage({id:"oauth.callback_urls_invalid_error",defaultMessage:"Some of the callback URLs given are invalid URLs."})}),r(!1),l=!0)}),o=t}if(!l)try{let n=await c({variables:{input:{id:a.id,clientMutationId:(0,ld.Z)(),name:e.name,description:e.description,homepage_url:e.homepage_url,redirect_uris:o,logo:null}}});(0,ei.assert)(n.data?.applicationUpdate.application.client_id!=null),(0,ei.assert)(n.data?.applicationUpdate.application.client_secret!=null),r(!1),y(),t()}catch(t){let e=(0,ei.getMessageFromError)(t);e?i(e):i("Unknown Error"),r(!1)}};return ev.createElement("form",{onSubmit:h(v)},ev.createElement("div",{className:"flex w-[800px] flex-col px-8 py-6"},ev.createElement("h1",{className:"mb-4 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.edit_header",defaultMessage:"Edit OAuth2 Application"})),ev.createElement("h2",{className:"mb-1 text-lg font-medium"},"Client ID"),ev.createElement("span",{className:"mb-4 text-sm"},a.client_id),ev.createElement("h2",{className:"mb-1 text-lg font-medium"},"Client Secret"),ev.createElement("span",{className:"mb-1 text-sm"},s),ev.createElement("div",{className:"mb-2 mt-4"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",onClick:b,type:"button"},ev.createElement(eY.Z,{id:"oauth.rotate_secret",defaultMessage:"Rotate Secret"}))),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_name",defaultMessage:"Application Name"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_name_subtitle",defaultMessage:"User visible name for your application"})),ev.createElement("input",{...p("name"),className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",placeholder:n.formatMessage({id:"oauth.create_name_placeholder",defaultMessage:"Application Name"})}),f.name&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},f.name.message),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_developer_url",defaultMessage:"Developer URL"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_developer_subtitle",defaultMessage:"Homepage of the application"})),ev.createElement("input",{...p("homepage_url"),className:"rounded-lg border border-appcolor-300 bg-appcolor-100 px-4 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",placeholder:n.formatMessage({id:"oauth.create_developer_url",defaultMessage:"Developer URL"})}),f.homepage_url&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},f.homepage_url.message),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_description",defaultMessage:"Description"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_description_subtitle",defaultMessage:"Describe your application."})),ev.createElement("textarea",{...p("description"),className:"mt-2 h-20 resize-none rounded-lg bg-appcolor-200 px-4 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",placeholder:n.formatMessage({id:"oauth.create_description",defaultMessage:"Description"})}),ev.createElement("h1",{className:"mb-1 mt-8 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.create_callback_urls",defaultMessage:"Callback URLs"})),ev.createElement("span",{className:"mb-2 text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.create_callback_desc",defaultMessage:"All OAuth Authorization Redirect URLs, separated with newlines"})),ev.createElement("textarea",{...p("callback_urls"),className:"mt-2 h-20 resize-none rounded-lg bg-appcolor-200 px-4 py-2 text-sm leading-snug text-appcolor-700 placeholder:text-appcolor-500",placeholder:n.formatMessage({id:"oauth.create_callback_urls",defaultMessage:"Callback URLs"})}),f.callback_urls&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},f.callback_urls.message),ev.createElement("div",{className:"mb-2 mt-4"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",type:"submit",disabled:l},ev.createElement(eY.Z,{id:"general.confirm",defaultMessage:"Confirm"}))),o&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},o)))},eIB=(0,e$.connect)(function(e){return e.dialogs.oauthUpdate})(function(e){let{isOpen:t,app:a}=e,n=(0,e$.useDispatch)(),l=ev.useCallback(()=>{n(eIF.actions.toggleOAuthUpdateDialog())},[n]);return t?ev.createElement(eI.ModalDialog,{close:l,isOpen:t,backdropOpacity:eI.ModalDialogOpacity.Translucent},e=>{let{exit:t}=e;return ev.createElement(eIL,{exit:t,app:a})}):null}),eIz={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OAuthApplicationDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ApplicationDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"applicationDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eIV=function(e){let{className:t,name:a,value:n,children:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,name:a,value:n});return ev.createElement("div",{...o.props,className:og()("flex items-center gap-x-2 px-4 py-1.5 hover:cursor-pointer hover:bg-appcolor-300 focus:bg-appcolor-300",t)},l)},eIq=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{initialFocus:t,loop:!0},ev.createElement("div",{className:"flex w-56 flex-col rounded-lg border border-appcolor-300 bg-appcolor-0 py-2"},ev.createElement(eIV,{className:"select-none",name:"edit"},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_edit"}),ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"oauth.edit",defaultMessage:"Edit Application Details"}))),ev.createElement(eIV,{className:"select-none text-danger",name:"delete"},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_delete"}),ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))))},eIW=function(e){let{app:t}=e,a=(0,e$.useDispatch)(),[n,l]=ev.useState(""),r=ev.useRef(null),o=ev.useRef(null),[i]=(0,cs.D)(eIz,{refetchQueries:[eIP]}),[s,d]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),c=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:s,placement:"bottom",computeModifiersCallback:tr}),m=(0,eI.useMenuButton)({dispatch:d,ref:r,state:s}),u=ev.useCallback(async e=>{l("");try{await i({variables:{input:{clientMutationId:(0,ld.Z)(),id:e}}})}catch(e){l((0,ei.getMessageFromError)(e)??"")}},[i]),p=ev.useCallback(e=>{if("Activate"===e.type)switch(e.payload.name){case"edit":a(eIF.actions.toggleOAuthUpdateDialog({app:t}));break;case"delete":u(t.id)}},[t,u,a]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-start gap-x-2 rounded-lg border border-appcolor-300 px-4 py-2"},ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",{className:"text-sm leading-none"},t.name),ev.createElement("span",{className:"mt-0.5 text-xs text-textcolor-400"},ev.createElement(eY.Z,{id:"mfa.created",defaultMessage:"Created on {date}",values:{date:cc()(t.created_at).format("LLL")}}))),ev.createElement("button",{className:"ml-auto flex items-center justify-center rounded-lg px-2 py-1 text-textlight-300 hover:bg-appcolor-200",...m.props},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"header_more"})),null!=n&&ev.createElement("span",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},n)),s.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:d,modal:!0},ev.createElement(eIq,{initialFocus:c.initialFocus,menuGroupDispatch:p})))},eIH=function(){let{data:e,loading:t}=(0,eB.a)(eIP),a=ev.useMemo(()=>null==e?null:e.me?.verified_at!=null,[e]),n=(0,e$.useDispatch)();return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"mb-8 flex flex-col"},ev.createElement("h1",{className:"mb-2 text-lg font-medium"},ev.createElement(eY.Z,{id:"oauth.title",defaultMessage:"OAuth2 Applications"})),ev.createElement("span",{className:"text-sm text-textcolor-500"},ev.createElement(eY.Z,{id:"oauth.description",defaultMessage:"You can manage your OAuth2 applications here."})),t&&ev.createElement("div",{className:"flex self-start py-4"},ev.createElement(eI.Spinner,null)),ev.createElement("div",{className:"mb-4 mt-4 flex flex-col gap-y-2 self-stretch"},e?.me?.applications?.edges.map(e=>ev.createElement(eIW,{key:e.node.id,app:e.node}))),!0===a&&ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"mt-4 flex items-center self-start rounded-lg bg-primary px-5 py-2 text-sm font-bold uppercase text-white transition-colors hover:bg-primary/90",onClick:()=>{n(eIj.actions.toggleOAuthCreateDialog())}},ev.createElement(eY.Z,{id:"general.create",defaultMessage:"Create"})),ev.createElement(eIO,null),ev.createElement(eIB,null)),!1===a&&ev.createElement("span",{className:"mt-4 flex self-start rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 p-2 px-3 text-sm text-textcolor-800"},ev.createElement(eY.Z,{id:"oauth.verification_required",defaultMessage:"\uD83D\uDCA1 Please verify your account to use OAuth2 Applications."}))))},eIG={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PatDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PatDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"patDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},eIK={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserPersonalAccessTokens"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"verified_at"}},{kind:"Field",name:{kind:"Name",value:"pats"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"last_accessed_at"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]}}]}}]}}]},eIY=function(e){let{pats:t,createdTokenId:a,removeCreatedTokenBox:n}=e,[l]=(0,cs.D)(eIG,{refetchQueries:[eIK]}),[r,o]=(0,ev.useState)(""),i=async e=>{o("");try{await l({variables:{input:{clientMutationId:(0,ld.Z)(),id:e}}}),e===a&&n()}catch(e){o((0,ei.getMessageFromError)(e)??"")}};return ev.createElement(ev.Fragment,null,null!=r&&ev.createElement("span",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},r),t.map(e=>ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"grid grid-cols-4 items-center border-b border-appcolor-300 py-2 text-sm decoration-appcolor-500"},ev.createElement("span",null,e.name),ev.createElement("span",null,cc()(e.created_at).format("DD-MMM-YYYY")),ev.createElement("span",null,null==e.last_accessed_at?ev.createElement(eY.Z,{id:"general.never",defaultMessage:"Never"}):cc()(e.last_accessed_at).fromNow()),ev.createElement("span",null,ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",onClick:()=>i(e.id)},ev.createElement(eY.Z,{id:"pat.delete_token",defaultMessage:"Delete Token"})))))))},eIQ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PatCreateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PatCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"patCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"pat"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"token"}}]}}]}}]}}]},eIJ=function(){let e=(0,eK.Z)(),[t,a]=ev.useState(null),[n,l]=ev.useState(!1),[r,o]=ev.useState(!1),{data:i,loading:s}=(0,eB.a)(eIK),[d,c]=(0,ev.useState)(""),[m,u]=(0,ev.useState)(""),[p,g]=(0,ev.useState)(""),[f]=(0,cs.D)(eIQ,{refetchQueries:[eIK]}),h=ev.useMemo(()=>({name:""}),[]),y=ev.useMemo(()=>null==i?null:i.me?.verified_at!=null,[i]),{register:b,setError:v,formState:{errors:k},handleSubmit:E,reset:x}=(0,sz.cI)({defaultValues:h}),_=async t=>{if(o(!0),""===t.name){v("name",{type:"custom",message:e.formatMessage({id:"pat.name_error",defaultMessage:"Name cannot be empty."})}),o(!1);return}try{let e=await f({variables:{input:{clientMutationId:(0,ld.Z)(),name:t.name}}});(0,ei.assert)(e.data?.patCreate?.pat?.token!=null),u(e.data?.patCreate.pat?.token),c(e.data.patCreate.pat.name),g(e.data?.patCreate.pat.id),o(!1),x()}catch(t){let e=(0,ei.getMessageFromError)(t);e?v("name",{type:"custom",message:e}):v("name",{type:"custom",message:"Unknown Error"}),o(!1)}};return ev.useEffect(()=>{if(null==t)return;let e=new(hF())(t);return e.on("success",()=>{l(!0)}),()=>{e.destroy()}},[t]),ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex max-w-screen-lg flex-col"},ev.createElement("h1",{className:"text-lg font-medium"},ev.createElement(eY.Z,{id:"pat.title",defaultMessage:"Personal Access Tokens"})),ev.createElement("span",{className:"mt-1 text-sm text-textcolor-700"},ev.createElement(eY.Z,{id:"pat.feature_description",defaultMessage:"Generate personal access tokens to authenticate and interact securely with the Taskade API."})),s&&ev.createElement("div",{className:"flex self-start py-4"},ev.createElement(eI.Spinner,null)),i?.me?.pats!=null&&i?.me?.pats?.edges.length!==0&&ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"grid grid-cols-4 border-b border-appcolor-300 px-0 py-4 pb-1 pt-4 text-xs font-medium uppercase text-appcolor-500 decoration-appcolor-600"},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.date_created",defaultMessage:"Date Created"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.last_accessed_at",defaultMessage:"Last Accessed At"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"pat.delete_token",defaultMessage:"Delete Token"}))),ev.createElement(eIY,{pats:i.me.pats.edges.map(e=>e.node),createdTokenId:p,removeCreatedTokenBox:()=>{u(""),c(""),g("")}})),""!==m&&""!==d&&ev.createElement("div",{className:"mb-4 mt-4 max-w-[70%] rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-4"},ev.createElement("h2",{className:"text-md mb-1 font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"pat.header",defaultMessage:"Successfully created new Personal Access Token: {patName}",values:{patName:d}})),ev.createElement("div",{className:"mb-4 text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"pat.new_description",defaultMessage:"Please copy this token as you won't be able to view it again."})),ev.createElement("div",{className:"flex"},ev.createElement("div",{className:"flex flex-grow items-center rounded-l-lg border border-appcolor-300 bg-appcolor-200 pl-2 text-sm"},ev.createElement("input",{className:"w-full bg-appcolor-200",type:"text",value:m,disabled:!0})),ev.createElement("div",{ref:a,"data-clipboard-action":"copy","data-clipboard-text":m,onMouseOut:()=>{l(!1)},onBlur:()=>{l(!1)},className:"cursor-pointer rounded-r-lg border-y border-r border-appcolor-300 bg-appcolor-100 p-2 px-4 text-sm hover:bg-appcolor-200"},n?ev.createElement(eY.Z,{id:"pat.copied",defaultMessage:"Token copied!"}):ev.createElement(eY.Z,{id:"pat.copy",defaultMessage:"Copy"})))),!1===y&&ev.createElement("span",{className:"mb-8 mt-4 flex self-start rounded-lg border border-solid border-appcolor-400 bg-appcolor-200 p-2 px-3 text-sm text-textcolor-800"},ev.createElement(eY.Z,{id:"pat.verification_required",defaultMessage:"\uD83D\uDCA1 Please verify your account to generate access tokens."})),!0===y&&ev.createElement("form",{onSubmit:E(_),className:"mt-2"},ev.createElement("div",{className:"grid md:grid-cols-2 md:gap-x-10"},ev.createElement("input",{...b("name"),className:"mt-2 rounded-lg border border-appcolor-300 bg-appcolor-100 px-3 py-2 text-sm text-textcolor-1000 placeholder:text-appcolor-500 focus:border-appcolor-400 focus:bg-appcolor-100",type:"text",placeholder:e.formatMessage({id:"pat.token_name",defaultMessage:"Token name"})})),k.name&&ev.createElement("label",{className:"decoration-red-700 bg-red-700 text-xs text-danger"},k.name.message),ev.createElement("div",{className:"mb-10 mt-2.5"},ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",type:"submit",disabled:r},ev.createElement(eY.Z,{id:"pat.generate_token",defaultMessage:"Generate token"}))))))},eIX=(0,e$.connect)(null,function(e){return(0,ek.DE)({submitChangePasswordForm:cv},e)})(function(e){let{submitChangePasswordForm:t}=e,a="Change Password - Taskade",n=(0,eK.Z)();return ev.createElement(e_u,null,ev.createElement(_2,{title:a,ogTitle:a}),ev.createElement(e_B,null),ev.createElement(ewZ,null),ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.change_password",defaultMessage:"Change Password"})),ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.password_subtitle",defaultMessage:"Make sure it's at least 6 characters."})),ev.createElement(r$.l0,{onSubmit:(e,a,n)=>{let{new:l,confirm:r}=e,o={};(!l||l.length<6)&&(o={...o,new:["Password must be at least 6 characters."]}),(!r||r.length<6)&&(o={...o,confirm:["Password must be at least 6 characters."]}),ts()(o)?t(e,a,n):n(o)},render:e=>{let{handleSubmit:t,submitError:a,submitting:l}=e;return ev.createElement("form",{onSubmit:t},ev.createElement(e_v,null,!l&&a&&ev.createElement(e1.Notice,{$type:"danger"},a),ev.createElement(r$.gN,{component:o_,id:"settings-current-password",label:n.formatMessage({id:"general.current_password",defaultMessage:"Current Password"}),tag:ou,type:"password",placeholder:n.formatMessage({id:"general.current_password",defaultMessage:"Current Password"}),name:"current",submitting:l,disabled:l}),ev.createElement(r$.gN,{component:o_,id:"settings-new-password",label:n.formatMessage({id:"general.new_password",defaultMessage:"New Password"}),tag:ou,type:"password",placeholder:n.formatMessage({id:"general.new_password",defaultMessage:"New Password"}),name:"new",submitting:l,disabled:l}),ev.createElement(r$.gN,{component:o_,id:"settings-confirm-password",label:n.formatMessage({id:"general.confirm_password",defaultMessage:"Confirm Password"}),tag:ou,type:"password",placeholder:n.formatMessage({id:"general.confirm_password",defaultMessage:"Confirm Password"}),name:"confirm",submitting:l,disabled:l}),ev.createElement(e_7,null,ev.createElement("button",{className:"flex cursor-pointer rounded-lg border-0 bg-primary px-5 py-2 text-base text-sm font-medium text-white decoration-white outline-0 transition duration-100 ease-in hover:bg-primary/90 focus:outline-0 disabled:opacity-10",type:"submit",disabled:l},ev.createElement(eY.Z,{id:"general.update",defaultMessage:"Update"})))))}}),ev.createElement(e_E,null),ev.createElement(eI$,null),ev.createElement(e_E,null),ev.createElement(eIJ,null),ev.createElement(e_E,null),ev.createElement(eIH,null))}),eI0=function(){return ev.createElement("div",{className:"mb-8 max-w-[70%] rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-4"},ev.createElement("h2",{className:"text-md mb-1 font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.earn_up_to_50_percent_lifetime_comission",defaultMessage:"Earn with Taskade Premium Referrals"})),ev.createElement("div",{className:"mb-4 text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.join_forces_with_taskade_forefront",defaultMessage:"Join our affiliate partnership program, share your referral link, and earn up to 50% lifetime commission on each upgrade. Sign up, share your unique link, and start earning today!",values:{link:e=>ev.createElement("a",{className:"text-primary transition duration-150 ease-in-out hover:opacity-75",href:"https://www.taskade.com/blog/affiliate-partnership-program/",target:"_blank",rel:"noopener noreferrer"},e),upgrade:e=>ev.createElement("a",{className:"text-primary transition duration-150 ease-in-out hover:opacity-75",href:"/upgrade",target:"_blank",rel:"noopener noreferrer"},e)}})),ev.createElement("a",{className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",href:"https://partners.taskade.com/",target:"_blank",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.join_affiliate_program",defaultMessage:"Join our Partnership Program"})))},eI1=(0,la.ZP)` + query CreditEntryBalance { + me { + id + handle + } + creditEntries { + edges { + node { + referredUser { + ...BasicUserFields + } + space { + id + name + } + type + amount + } + } + balance + } + } + ${up} +`,eI2=function(e){let{meHandle:t}=e,a=`https://www.taskade.com/u/${t}/recommend`,n=(0,eK.Z)(),l=n.formatMessage({id:"general.share_message",defaultMessage:"Chat, organize, and get things done with @Taskade. Sign up for free!"}),[r,o]=(0,ev.useState)(n.formatMessage({id:"general.copy_link",defaultMessage:"Copy Link"}));return ev.createElement("div",{className:"mb-8 max-w-[70%] rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-4"},ev.createElement("h2",{className:"text-md mb-1 font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.get_100_in_ai_credits",defaultMessage:"Refer New Users for AI Credits"})),ev.createElement("div",{className:"mb-4 text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.when_you_refer_someone_to_taskade",defaultMessage:"Invite others and earn 100 AI credits for each successful sign-up. Utilize these credits to unlock Taskade's powerful AI-driven features. Referrals won't have access to your workspaces.",values:{upgrade:e=>ev.createElement("a",{className:"text-primary transition duration-150 ease-in-out hover:opacity-75",href:"/upgrade",target:"_blank",rel:"noopener noreferrer"},e)}})),ev.createElement("span",{className:"mb-2 flex text-xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.referral_link",defaultMessage:"Referral link"})),ev.createElement("div",{className:"mb-4 flex gap-1"},ev.createElement(eM2,{name:"url",readOnly:!0,value:a}),ev.createElement("button",{className:"rounded-xl bg-primary px-3 text-sm text-white",onClick:()=>{navigator.clipboard.writeText(a),o(n.formatMessage({id:"general.copied",defaultMessage:"Copied!"}))}},r)),ev.createElement("span",{className:"mb-2 flex text-xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.referral_share",defaultMessage:"Share on"})),ev.createElement("div",{className:"flex gap-3"},ev.createElement("button",{className:"duration-250 relative inline-flex items-center border-b border-solid border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",type:"button",onClick:()=>{let e=`https://www.facebook.com/sharer/sharer.php?u=${a}"e=${l}`;window.open(e,"_blank","noopener,noreferrer,height=350,width=600")}},ev.createElement(tn.Icon,{icon:"share_facebook"}),ev.createElement(eY.Z,{id:"general.share_facebook",defaultMessage:"Facebook"})),ev.createElement("button",{type:"button",onClick:()=>{let e=`https://twitter.com/share?url=${a}&text=${l}&via=taskade`;window.open(e,"_blank","noopener,noreferrer,height=350,width=600")},className:"duration-250 relative inline-flex items-center border-b border-solid border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60"},ev.createElement(tn.Icon,{icon:"share_twitter"}),ev.createElement(eY.Z,{id:"general.share_twitter",defaultMessage:"Twitter"})),ev.createElement("button",{onClick:()=>{window.open(`mailto:?subject=You've been invited to Taskade!&body=${l} ${a}`)},className:"duration-250 relative inline-flex items-center border-b border-solid border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60"},ev.createElement(tn.Icon,{icon:"share_email"}),ev.createElement(eY.Z,{id:"general.share_email",defaultMessage:"Email"}))))},eI5=function(){return ev.createElement("div",{className:"mb-8 max-w-[70%] rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-6 py-4"},ev.createElement("h2",{className:"text-md mb-1 font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.review_us_and_get_rewarded",defaultMessage:"Review Taskade and Gain AI Credits"})),ev.createElement("div",{className:"mb-4 text-sm text-appcolor-600"},ev.createElement(eY.Z,{id:"general.for_every_review_you_write",defaultMessage:"Share your Taskade experience and earn up to 250 AI credits for each review. Capture your published reviews and send it to support@taskade.com to collect your credits.",values:{contact:e=>ev.createElement("a",{className:"text-primary transition duration-150 ease-in-out hover:opacity-75",href:"mailto:support@taskade.com",target:"_blank",rel:"noopener noreferrer"},e)}})),ev.createElement("span",{className:"mb-2 flex text-xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.review_us_on",defaultMessage:"Review us on"})),ev.createElement("div",{className:"flex gap-3"},ev.createElement("a",{href:"https://www.g2.com/products/taskade-taskade/reviews",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.review_g2",defaultMessage:"G2"})),ev.createElement("a",{href:"https://www.trustpilot.com/review/taskade.com",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.review_trust_pilot",defaultMessage:"Trustpilot"})),ev.createElement("a",{href:"https://www.capterra.com/p/170932/Taskade/",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.review_capterra",defaultMessage:"Capterra"}))),ev.createElement("span",{className:"mb-2 mt-4 flex text-xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.and_follow_us",defaultMessage:"And follow us on"})),ev.createElement("div",{className:"flex gap-3"},ev.createElement("a",{href:"https://twitter.com/taskade",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.social_twitter",defaultMessage:"Twitter"})),ev.createElement("a",{href:"https://www.instagram.com/taskade/",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.social_instagram",defaultMessage:"Instagram"})),ev.createElement("a",{href:"https://www.facebook.com/taskade/",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.social_facebook",defaultMessage:"Facebook"})),ev.createElement("a",{href:"https://www.youtube.com/taskade",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.social_youtube",defaultMessage:"YouTube"})),ev.createElement("a",{href:"https://www.reddit.com/r/taskade/",target:"_blank",className:"duration-250 relative inline-flex items-center border-b border-primary pb-1 text-sm font-medium leading-normal text-primary transition ease-in-out hover:border-primary/60 hover:text-primary/60",rel:"noopener noreferrer"},ev.createElement(eY.Z,{id:"general.social_reddit",defaultMessage:"Reddit"}))))},eI3=eL.default.p.withConfig({displayName:"ReferralCreditScreen__CreditBalance",componentId:"sc-9fd74295-0"})` + color: ${e=>e.theme.appColors.hex(10)}; + font-size: 16px; + margin-bottom: 24px; +`,eI4=eL.default.ul.withConfig({displayName:"ReferralCreditScreen__Entries",componentId:"sc-9fd74295-1"})` + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; + list-style: none; + padding: 0; + margin: 0; + + @media (min-width: 992px) { + max-width: 700px; + } +`,eI6=eL.default.li.withConfig({displayName:"ReferralCreditScreen__EntriesItem",componentId:"sc-9fd74295-2"})` + display: flex; + align-items: center; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + color: ${e=>e.theme.appColors.hex(10)}; + font-size: 15px; + padding: 16px 0; +`,eI8=eL.default.div.withConfig({displayName:"ReferralCreditScreen__EntriesMedia",componentId:"sc-9fd74295-3"})` + display: flex; + flex: 1; +`,eI7=eL.default.div.withConfig({displayName:"ReferralCreditScreen__EntriesMediaIcon",componentId:"sc-9fd74295-4"})` + align-items: center; + color: ${e=>e.theme.appColors.hex(50)}; + display: flex; + margin-right: 16px; +`,eI9=eL.default.div.withConfig({displayName:"ReferralCreditScreen__EntriesMediaBody",componentId:"sc-9fd74295-5"})` + flex-direction: row; +`,eDe=eL.default.div.withConfig({displayName:"ReferralCreditScreen__EntriesMediaTitle",componentId:"sc-9fd74295-6"})` + font-weight: 500; +`,eDt=eL.default.div.withConfig({displayName:"ReferralCreditScreen__EntriesMediaDescription",componentId:"sc-9fd74295-7"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,eDa=eL.default.div.withConfig({displayName:"ReferralCreditScreen__EntriesCredit",componentId:"sc-9fd74295-8"})` + font-weight: 500; +`,eDn=eL.default.span.withConfig({displayName:"ReferralCreditScreen__EntryCreditApplied",componentId:"sc-9fd74295-9"})` + color: ${eI.ThemeColors.danger}; +`,eDl=eL.default.span.withConfig({displayName:"ReferralCreditScreen__EntryCreditReceived",componentId:"sc-9fd74295-10"})` + color: ${eI.ThemeColors.success}; +`,eDr=function(){let{data:e,loading:t,error:a}=(0,eB.a)(eI1),n=e?.creditEntries.balance??0,l=e?.creditEntries.edges??[],r=e?.me.handle??null,o=(0,eK.Z)();return t?ev.createElement(e_u,null,ev.createElement(eI.Spinner,{height:319})):null!=a||null==r?ev.createElement(e_u,null,"An error occurred"):ev.createElement(e_u,null,ev.createElement(e_B,{breadCrumbTitle:o.formatMessage({id:"general.credits",defaultMessage:"Credits"})}),ev.createElement("h1",{className:"mb-1 text-lg"},ev.createElement(eY.Z,{id:"general.referrals_and_credits",defaultMessage:"Referrals and credits"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.introduce_others_to_a_new_era",defaultMessage:"Introduce others to a new era of AI-enhanced productivity. Refer Taskade and watch your AI credits multiply!"})),ev.createElement(eMW,null,ev.createElement(e_v,{$fullwidth:!0},ev.createElement(eI0,null),ev.createElement(eI5,null),ev.createElement(eI2,{meHandle:r}),ev.createElement("span",{className:"mb-2 flex text-xs uppercase text-appcolor-500"},ev.createElement(eY.Z,{id:"general.referral_credits",defaultMessage:"Credit Balance"})),ev.createElement(eI3,null,ev.createElement(eY.Z,{id:"general.referral_credits_balance_description",defaultMessage:"You have {balance} AI credit.",values:{balance:n,strong:e=>ev.createElement("strong",null,e)}})),ev.createElement(eI4,null,t||0!==l.length?null:ev.createElement(eI6,null,ev.createElement(eDt,null,ev.createElement(eY.Z,{id:"general.no_ai_credit",defaultMessage:"You have no AI credits at the moment. You can earn AI credits by inviting people to Taskade."}))),l.map((e,t)=>ev.createElement(eI6,{key:t},ev.createElement(eI8,null,ev.createElement(eI7,null,"applied"===e.node.type?ev.createElement(tn.Icon,{icon:"credit_applied"}):ev.createElement(tn.Icon,{icon:"credit_received"})),ev.createElement(eI9,null,"applied"===e.node.type?ev.createElement(ev.Fragment,null,ev.createElement(eDe,null,"Credit applied"),ev.createElement(eDt,null,"$",Math.abs(e.node.amount)," credits was used to upgrade"," ",e.node.space?.name," workspace")):ev.createElement(ev.Fragment,null,ev.createElement(eDe,null,"Credit earned"),null!=e.node.referredUser?ev.createElement(eDt,null,e.node.referredUser.handle," signed up using your referral link"):ev.createElement(eDt,null,"signed up using a referral link")))),ev.createElement(eDa,null,"applied"===e.node.type?ev.createElement(eDn,null,"-$",Math.abs(e.node.amount)):ev.createElement(eDl,null,"$",Math.abs(e.node.amount)))))))))},eDo=(0,la.ZP)` + query RecentSessionsQuery($first: Int = 20, $after: String = null) { + me { + id + sessions(first: $first, after: $after) { + edges { + node { + id + device + platform + lastSeenTimestamp + current + } + cursor + } + } + } + } +`,eDi=(0,la.ZP)` + mutation DeleteSessionMutation($input: DeleteSessionInput!) { + payload: deleteSession(input: $input) { + clientMutationId + ok + } + } +`,eDs=function(e){let{loading:t,deleted:a,onDeleteSession:n}=e;return t?ev.createElement(eY.Z,{id:"general.loading.revoking_access",defaultMessage:"Revoking…"}):a?ev.createElement(eY.Z,{id:"general.revoked_access",defaultMessage:"Revoked"}):ev.createElement(eMY,{onClick:n},ev.createElement(eY.Z,{id:"general.revoke_access",defaultMessage:"Revoke Access"}))},eDd=function(e){let{node:t}=e,[a,n]=(0,cs.D)(eDi),{data:l,loading:r}=n;return ev.createElement(eMG,null,ev.createElement(eMQ,null,t.platform),ev.createElement(eMQ,null,t.device),ev.createElement(eMQ,null,cc().unix(t.lastSeenTimestamp).fromNow()),ev.createElement(eMQ,null,t.current?ev.createElement(eY.Z,{id:"general.current_session",defaultMessage:"Current Session"}):ev.createElement(eDs,{loading:r,deleted:l?.payload?.ok??!1,onDeleteSession:()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),sessionID:t.id}}})}})))},eDc=function(){let{data:e,loading:t}=(0,eB.a)(eDo,{variables:{first:25,after:null}});if(t)return ev.createElement(eI.Spinner,null);let a=e?.me??null;if(null==a)return ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.errors.unable_to_retrieve_sessions",defaultMessage:"Unable to retrieve recent sessions for guest"}));let{edges:n}=a.sessions;return ev.createElement(ev.Fragment,null,n.map(e=>{let{node:t}=e;return ev.createElement(eDd,{key:t.id,node:t})}))},eDm=function(){return ev.createElement(e_v,{$fullwidth:!0},ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.session",defaultMessage:"Sessions"})),ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.recent_sessions_revoke_access",defaultMessage:"Below are your recent sessions, revoke access to log out of that device."})),ev.createElement(eMH,null,ev.createElement(eMK,null,ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.platform",defaultMessage:"Platform"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.device",defaultMessage:"Device"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.last_used",defaultMessage:"Last Used"})),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.access",defaultMessage:"Access"}))),ev.createElement(eDc,null)))},eDu=function(){return ev.createElement(e_u,null,ev.createElement(e_B,null),ev.createElement(ewZ,null),ev.createElement(eDm,null))};var eDp=a(75436),eDg=a(48403),eDf=a.n(eDg);let eDh=(0,la.ZP)` + mutation AccountDeleteMutation($input: AccountDeleteInput!) { + accountDelete(input: $input) { + clientMutationId + myAccounts { + id + apple { + id + display_name + type + } + facebook { + id + display_name + type + } + google { + id + display_name + type + } + twitter { + id + display_name + type + } + } + } + } +`,eDy=(0,la.ZP)` + query CurrentUserSocialAccountsQuery { + myAccounts { + id + apple { + id + display_name + type + } + facebook { + id + display_name + type + } + google { + id + display_name + type + metadata { + ... on AccountMetadataGoogle { + hasGooglePeople + } + } + } + twitter { + id + display_name + type + } + samlSso { + id + display_name + type + } + } + } +`,eDb={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"MyAccountsUpdatedSubscription"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"myAccountsUpdated"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"apple"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"facebook"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"google"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AccountMetadataGoogle"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasGooglePeople"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"twitter"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}},{kind:"Field",name:{kind:"Name",value:"samlSso"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},eDv=function(e){let{account:t}=e;switch(t){case"apple":return ev.createElement(e_4,null);case"google":return ev.createElement(e_3,null);default:return null}},eDk=function(){let e=(0,ll.x)(),t=(0,e$.useDispatch)(),a=(0,eK.Z)(),{data:n}=(0,eB.a)(eDy);(0,eDp.m)(eDb);let l=n?.myAccounts??null,r=n=>{if(null==l)return null;let r=n.currentTarget.getAttribute("data-type");if(null!=r&&confirm(a.formatMessage({id:"general.are_you_sure_you_want_to_disconnect_your_account",defaultMessage:"Are you sure you want to disconnect your {accountType} account?"},{accountType:eDf()(r)}))&&null!=n.currentTarget.getAttribute("data-id")){let a=(0,ld.Z)();e.mutate({mutation:eDh,variables:{input:{clientMutationId:a,type:r}},optimisticResponse:{__typename:"Mutation",accountDelete:{__typename:"AccountDeletePayload",clientMutationId:a,myAccounts:(0,es.ZP)(l,e=>(e[r]=null,e))}}}).then(()=>{t(l3.success({uid:"disconnect-account-success",message:"Disconnected!",position:"br",autoDismiss:1,dismissible:!1}))},()=>{t(l3.error({uid:"disconnect-account-error",message:"There was an error disconnecting your account. Please try again.",position:"br",autoDismiss:3,dismissible:!1}))})}};return ev.createElement(e_q,{className:"sso-accounts"},["google","apple","samlSso"].map(e=>{let t=n?.myAccounts?.[e]??null;return null!=t?ev.createElement("div",{key:t.id,className:"flex w-full flex-col"},ev.createElement(e_0,{type:"button",className:"items-center","data-id":t.id,"data-type":t.type,onClick:r,disabled:"samlSso"===e},ev.createElement(eDv,{account:e}),ev.createElement("div",{className:"flex grow flex-col justify-between"},ev.createElement(e_2,null,ev.createElement("div",{className:"flex flex-col text-left"},ev.createElement("span",null,"samlSso"!==e?`${eDf()(e)}: ${t.display_name}`:`SAML SSO: ${t.display_name?.replace(/.*@/,"")}`),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.connect_to_sso_account",defaultMessage:"Single Sign-On with {accountType}",values:{accountType:eDf()(e)}}))))),ev.createElement(e_5,{connected:!0},ev.createElement("span",null))),"google"===e&&ev.createElement("div",null,t.metadata?.hasGooglePeople?ev.createElement("a",{href:"/auth/google",className:"mb-4 flex items-center rounded-xl bg-appcolor-100 p-5"},ev.createElement(e_2,null,ev.createElement(e_6,null),ev.createElement("div",{className:"flex flex-col text-left"},ev.createElement("span",null,"Google Contacts"),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.google_contacts_description",defaultMessage:"Autocomplete your {accountType} contacts when inviting people.",values:{accountType:eDf()(e)}})))),ev.createElement("div",{className:"ml-auto pl-8 text-base text-primary hover:underline"},"Disconnect")):ev.createElement("a",{href:"/auth/google/people",className:"mb-4 flex items-center rounded-xl bg-appcolor-100 p-5"},ev.createElement(e_2,null,ev.createElement(e_6,null),ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",null,"Google Contacts"),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.google_contacts_description",defaultMessage:"Autocomplete your {accountType} contacts when inviting people.",values:{accountType:eDf()(e)}})))),ev.createElement("div",{className:"ml-auto pl-8 text-base text-primary hover:underline"},"Connect")))):"samlSso"!==e?ev.createElement("div",{key:`no-account-${e}`,className:"flex w-full flex-col"},ev.createElement(e_1,{href:`/auth/${e}`},ev.createElement(e_2,null,ev.createElement(eDv,{account:e}),ev.createElement("div",{className:"flex flex-col"},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.connect_to_account_type",defaultMessage:"Connect to {accountType}",values:{accountType:eDf()(e)}})),ev.createElement("span",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.connect_to_sso_account",defaultMessage:"Single Sign-On with {accountType}",values:{accountType:eDf()(e)}})))),ev.createElement(e_5,null,ev.createElement("span",null)))):void 0}))},eDE=function(){return ev.createElement(e_u,null,ev.createElement(e_B,null),ev.createElement(ewZ,null),ev.createElement(e_f,null,ev.createElement(eY.Z,{id:"general.connected_accounts",defaultMessage:"Connected Accounts"})),ev.createElement(e_h,null,ev.createElement(eY.Z,{id:"general.connected_accounts_description",defaultMessage:"Connect your social connections like Google or Apple."})),ev.createElement(e_v,null,ev.createElement(e_z,null),ev.createElement(eDk,null)))},eDx=function(){let{data:e,loading:t}=(0,eB.a)(sW),a=e?.me;return t?ev.createElement(e_u,null,ev.createElement(eI.Spinner,null)):null==a?ev.createElement(eF.l_,{to:"/login"}):ev.createElement(ev.Fragment,null,ev.createElement(e_c,null,ev.createElement(ex5,null),ev.createElement(e_m,null,ev.createElement(efN,null),ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:"/settings",component:ewz}),ev.createElement(eF.AW,{path:"/settings/billing",component:eMq}),ev.createElement(eF.AW,{path:"/settings/credits",component:eDr}),ev.createElement(eF.AW,{exact:!0,path:"/settings/integrations",component:eSE}),ev.createElement(eF.AW,{path:"/settings/integrations/zapier",component:eSN}),ev.createElement(eF.AW,{path:"/settings/integrations/google-calendar",component:eSk}),ev.createElement(eF.AW,{path:"/settings/integrations/calendar-feed",component:eM7}),ev.createElement(eF.AW,{path:"/settings/notifications",component:eSK}),ev.createElement(eF.AW,{path:"/settings/password",component:eIX}),ev.createElement(eF.AW,{path:"/settings/archives",component:eNE}),ev.createElement(eF.AW,{path:"/settings/sessions",component:eDu}),ev.createElement(eF.AW,{path:"/settings/sso",component:eDE}),ev.createElement(eF.AW,{path:"/settings/plans",component:eNt}),ev.createElement(eF.AW,{path:"/settings/organizations/:organizationId/overview",component:eIn}),ev.createElement(eF.AW,{path:"/settings/organizations/:organizationId/samlsso",component:eIn}),ev.createElement(eF.AW,{path:"/settings/organizations/new",component:eIn})))),ev.createElement(e_n,null))},eD_=eL.default.div.withConfig({displayName:"styled__MainColumn",componentId:"sc-a70fdec5-0"})` + display: flex; + flex-direction: column; + overflow-y: auto; + ${tM}; + flex: 1; + background: ${e=>e.theme.appColors.hex(100)}; + min-height: 100vh; + overflow-x: auto; + transition: background-color ease-in-out 0.2s; +`,eDw=eL.default.div.withConfig({displayName:"styled__RightColumnHeader",componentId:"sc-a70fdec5-1"})` + display: flex; + padding: 18px 22px 5px; + align-items: center; + + @media (min-width: 768px) { + padding: 9px ${eI.UiSpacing.getPx(5)} 5px 32px; + } +`,eDN=eL.default.div.withConfig({displayName:"styled__Title",componentId:"sc-a70fdec5-2"})` + display: flex; + align-items: center; + flex: 1; + color: ${e=>e.theme.appColors.hex(10)}; +`,eDC=eL.default.div.withConfig({displayName:"styled__TitleText",componentId:"sc-a70fdec5-3"})` + font-size: 16px; + line-height: 20px; +`;eL.default.div.withConfig({displayName:"styled__IconWrapper",componentId:"sc-a70fdec5-4"})` + display: flex; + flex-shrink: 0; + margin-right: 8px; + width: 26px; + height: 26px; + border-radius: 10px; + align-items: center; + justify-content: center; + + ${e=>{switch(e.$colorFor){case"recent":default:return(0,eL.css)` + background-color: #ff2d60; + `;case"activity":return(0,eL.css)` + background-color: #ff8742; + `;case"mytasks":return(0,eL.css)` + background-color: #85dd73; + `;case"search":return(0,eL.css)` + background-color: ${e.theme.isNightMode?"#333":"#e5e5e5"}; + color: ${e.theme.isNightMode?"#e5e5e5":"#333"}; + `;case"starred":return(0,eL.css)` + background-color: #ffdc4c; + `}}} + + & svg { + display: flex; + width: 26px; + height: 26px; + align-self: center; + + ${e=>{switch(e.$colorFor){case"starred":case"activity":return(0,eL.css)` + & path { + fill: #fff; + } + `;case"search":return(0,eL.css)` + width: 20px; + height: 20px; + `;default:return(0,eL.css)` + & path { + stroke: #fff; + } + `}}} + } +`;let eDM=eL.default.div.withConfig({displayName:"styled__Actions",componentId:"sc-a70fdec5-5"})` + display: flex; + flex: 1; + justify-content: flex-end; + position: relative; + align-items: center; +`,eDS=eL.default.div.withConfig({displayName:"styled__OwnedBy",componentId:"sc-a70fdec5-6"})` + font-size: 12px; + margin: 0 22px 5px; + color: ${e=>e.theme.isNightMode?"#cccccc":"#666666"}; + + @media (min-width: 768px) { + margin: 0 32px 5px; + } +`,eDI=eL.default.div.withConfig({displayName:"styled__RightColumnBody",componentId:"sc-a70fdec5-7"})` + padding-bottom: 20px; + height: 100%; + position: relative; +`,eDD=eL.default.div.withConfig({displayName:"styled__StyledSpaceTabs",componentId:"sc-a70fdec5-8"})` + display: flex; + margin: 8px 22px 12px; + + @media (min-width: 768px) { + margin: 8px 20px 12px 32px; + } +`,eDT=eL.default.div.withConfig({displayName:"styled__TabsContainer",componentId:"sc-a70fdec5-9"})` + display: flex; + flex: 0 1 auto; + overflow: auto; + margin-right: 20px; + ${tS} +`,eD$=(0,eL.default)(sC.OL).withConfig({displayName:"styled__StyledNavLink",componentId:"sc-a70fdec5-10"})` + border-radius: 30px; + position: relative; + display: flex; + min-height: 32px; + ${e1.UiTypography.sm}; + padding: 0 12px; + color: ${e=>e.theme.textColors.hex(30)}; + white-space: nowrap; + align-items: center; + transition: + background-color ease-in-out 0.2s, + color ease-in-out 0.2s; + + &:focus { + color: ${e=>e.theme.textColors.hex(30)}; + } + + &.active, + &.active:hover { + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.primaryColorScheme?.base}; + font-weight: 500; + } + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,eDP=eL.default.div.withConfig({displayName:"styled__StyledNewButton",componentId:"sc-a70fdec5-11"})` + display: flex; + flex: 1 1 auto; + justify-content: flex-end; + max-height: 32px; +`,eDF=eL.default.div.withConfig({displayName:"ActivityEmptyState__Wrapper",componentId:"sc-9d7d565b-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: 0 auto; + font-size: 14px; + text-align: center; + height: 100%; + padding: 32px 32px 160px 32px; + + @media (max-width: 768px) { + max-width: 540px; + padding-bottom: 100px; + } + + @media (max-width: 480px) { + max-width: 100%; + padding-bottom: 100px; + } +`,eDA=eL.default.h4.withConfig({displayName:"ActivityEmptyState__Heading",componentId:"sc-9d7d565b-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,eDR=eL.default.p.withConfig({displayName:"ActivityEmptyState__Description",componentId:"sc-9d7d565b-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,eDj=eL.default.div.withConfig({displayName:"ActivityEmptyState__EmptyImageWrapper",componentId:"sc-9d7d565b-3"})` + margin-bottom: 24px; + opacity: 40%; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,eDO=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(eDF,null,ev.createElement(eDj,null,!n&&ev.createElement(lT.ke,null)),ev.createElement(eDA,null,t),ev.createElement(eDR,null,a))},eDU=eL.default.div.withConfig({displayName:"ActivityItems__ActivityPage",componentId:"sc-d80709f9-0"})` + & > div { + padding-left: 30px; + } +`,eDZ=function(e){let{activity:t}=e,a=t.edges,n=(0,ev.useMemo)(()=>{let e;let t=[];for(let n of a){let a=n.node,l=SI(e,a,SS);null!=l&&t.push(ev.createElement(eDU,null,ev.createElement(St,{key:`activity-separator-${a.id}`,unixTimestampMs:l}))),t.push(ev.createElement(SM,{className:"activity-page",key:a.id,activity:a})),e=a}return t},[a]),l=(0,eF.k6)(),r=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:a}=e.payload;"activity"===t&&null!=a&&l.push(a)}},[l]);return ev.createElement(eI.MenuGroupContext.Provider,{value:r},ev.createElement(eI.Menu,{initialFocus:"first",loop:!0},n))},eDL=eL.default.div.withConfig({displayName:"Activity__Note",componentId:"sc-73dc5338-0"})` + padding: 10px 32px 20px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#333"}; + font-size: 16px; + white-space: nowrap; +`,eDB=(0,eL.default)(Cg).withConfig({displayName:"Activity__StyledMarkAllButton",componentId:"sc-73dc5338-1"})` + padding: 0; + font-size: 15px; + color: #999; + background: none; + border: 0; + cursor: pointer; + margin-right: 10px; + + &:hover, + &:focus { + color: ${e=>e.theme.textColors.hex(10)}; + } + + &:focus { + outline: 0; + } +`,eDz=function(e){let{location:t}=e,{hash:a,search:n,pathname:l}=t,r=(0,eK.Z)(),o=(0,e$.useSelector)(t7),{activity:i,error:s,loading:d}=M9(egi(n,10)),[c]=(0,cs.D)(M6),m=(0,ev.useCallback)(()=>{c({variables:{input:{clientMutationId:(0,ld.Z)()}},update:(e,t)=>{for(let a of t.data?.activitiesMarkAllAsRead.projectIds??[])e.writeFragment({id:e.identify({__typename:"Document",id:a}),fragment:(0,la.ZP)` + fragment documentFragment on Document { + is_unread + } + `,data:{is_unread:!1}})}})},[c]),u=(0,ev.useCallback)(e=>{let{totalCount:t}=e;return 0===t?null:ev.createElement(eNH,{pathname:l,search:n,hash:a,totalCount:t,itemPerPage:10})},[i]);if(ts()(o))return ev.createElement(eF.l_,{to:"/"});let p=i?.edges?.length??0;return ev.createElement(ev.Fragment,null,ev.createElement(eT.ql,null,ev.createElement("title",null,"Activity - Taskade")),ev.createElement(eDw,null,ev.createElement(IS,{desktopHidden:!0}),ev.createElement(eDN,null,ev.createElement(eDC,null,ev.createElement(eY.Z,{id:"general.activity",defaultMessage:"Activity"}))),ev.createElement(eDM,null,p>0&&ev.createElement(eDB,{onClick:m},ev.createElement(eY.Z,{id:"general.mark_all_as_read",defaultMessage:"Mark all as Read"})),ev.createElement(Sz,null),ev.createElement(Ii,null))),ev.createElement(eDI,null,d&&ev.createElement(eI.Spinner,{height:60}),s&&ev.createElement(eDL,null,ev.createElement(eY.Z,{id:"activity.error_loading",defaultMessage:"There's an error loading activity. Please try again later."})),0===p&&!d&&ev.createElement(eDO,{heading:r.formatMessage({id:"general.empty_state_activity",defaultMessage:"There is no activity."}),description:r.formatMessage({id:"general.empty_state_activity_description",defaultMessage:"Access your notifications in one place. The activity feed displays project edits, comments, due dates, assigned tasks, and assigned projects."})}),!d&&ts()(s)&&ev.createElement(eDZ,{activity:i}),!d&&ts()(s)&&u(i)))},eDV=function(e){let{children:t,onClick:a,name:n,warning:l,value:r}=e,o=ev.useRef(null),i=(0,eI.useMenuItem)({onClick:a,stopRef:o,name:n,value:r});return ev.createElement("div",{className:og()("flex select-none items-center px-3 py-1 text-sm hover:cursor-pointer",{"bg-appcolor-300":i.navigated},{"text-danger":l}),...i.props},t)},eDq=function(e){let{initialFocus:t,menuGroupDispatch:a}=e;return ev.createElement(eI.MenuGroupContext.Provider,{value:a},ev.createElement(eI.Menu,{className:"flex w-48 flex-col overflow-hidden rounded-xl border border-appcolor-300 bg-appcolor-0 py-2",initialFocus:t,loop:!0},ev.createElement(eDV,{name:"view_prompts"},ev.createElement(tn.Icon,{icon:"dd_prompt_templates",className:"mr-2 shrink-0 scale-80"}),ev.createElement(eY.Z,{id:"general.view_prompts",defaultMessage:"View prompts"})),ev.createElement(eDV,{name:"clear_history",warning:!0},ev.createElement(tn.Icon,{icon:"dd_delete",className:"mr-2 shrink-0 scale-80"}),ev.createElement(eY.Z,{id:"general.ai.clear_history",defaultMessage:"Clear history"}))))},eDW=function(e){let{onClickClearHistory:t,onClickViewPrompts:a}=e,[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:n,placement:"bottom-end"}),s=(0,eI.useMenuButton)({dispatch:l,ref:r,state:n}),d=ev.useCallback(e=>{switch(e.type){case"Activate":{let{name:n}=e.payload;switch(n){case"clear_history":t();break;case"view_prompts":a()}l({type:"Collapse",payload:"none"});break}case"Dismiss":l({type:"Collapse"})}},[t,a]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...s.props,className:"group ml-auto h-9 w-9 items-center justify-center rounded-xl border-0 p-1 text-appcolor-500 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"header_more",className:"text-appcolor-500 group-hover:text-appcolor-1000"})),n.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:l,modal:!0},ev.createElement(eDq,{initialFocus:i.initialFocus,menuGroupDispatch:d})))},eDH=function(){let e=(0,e$.useDispatch)(),[t,a]=ev.useState(!1),n=ev.useRef(null),l=ev.useRef(null),r=ev.useRef(null),{arrowProps:o,popperProps:i,referenceProps:s}=(0,eI.useControlledTooltip)({referenceElementRef:n,arrowElementRef:l,popperElementRef:r,placement:"top",visible:t});return ev.createElement(ev.Fragment,null,ev.createElement("button",{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},...s,onClick:()=>{e(sw())},className:"group mr-auto flex items-center justify-center rounded-xl p-2 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"chat_toggle",className:"text-appcolor-500 group-hover:text-appcolor-1000"})),t&&ev.createElement(eI.Tooltip,{arrowProps:o,popperProps:i},ev.createElement(eY.Z,{id:"general.close_taskade_ai",defaultMessage:"Close panel"})))},eDG={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ConversationDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"conversationDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eDK=function(){let e=(0,eK.Z)(),t=(0,e$.useDispatch)(),[a,{loading:n}]=(0,cs.D)(eDG),l={first:1,filterby:{projectId:null}},{data:r}=(0,eB.a)(O9,{variables:l}),o=r?.conversations.edges[0]?.node.id??null,i=async()=>{if(null==o)return;if(n)return null;let t=e.formatMessage({id:"general.confirm_clear_conversation",defaultMessage:"Are you sure you want to clear the conversation?"});confirm(t)&&await a({variables:{input:{clientMutationId:(0,ld.Z)(),id:o}},update:(e,t)=>{let{data:a,errors:n}=t;if(null!=n||null==a)return;let r={last:20,filterby:{conversationId:null}},i=e.readQuery({query:O7,variables:r});if(null==i||0===i.conversationMessages.edges.length)return;e.writeQuery({query:O7,variables:r,data:{...i,conversationMessages:{...i.conversationMessages,edges:[],pageInfo:{hasNextPage:!1,hasPreviousPage:!1,startCursor:null,endCursor:null}}}});let s=e.readQuery({query:O9,variables:l});if(null==s)return;let d=s.conversations.edges.findIndex(e=>e.node.id===o);-1!==d&&(s=Ml()(s,{conversations:{edges:{$splice:[[d,1]]}}}),e.writeQuery({query:O9,variables:l,data:s}))}})};return ev.createElement("div",{className:"relative flex max-h-screen w-96 flex-initial flex-col border-l border-appcolor-300"},ev.createElement("div",{className:"flex w-full items-center items-center justify-between border-b border-appcolor-300 px-3 py-2"},ev.createElement(eDH,null),ev.createElement("div",{className:"flex items-center text-sm"},ev.createElement(tn.Icon,{className:"mr-2",icon:"dd_chat"}),"Taskade AI"),ev.createElement(eDW,{onClickClearHistory:i,onClickViewPrompts:()=>{t(co.actions.toggleAiPromptTemplatesDialog())}})),ev.createElement(zF,null))},eDY=eL.default.button.withConfig({displayName:"AppNavigation__NavigateBack",componentId:"sc-3465a596-0"})` + display: flex; + width: 30px; + height: 30px; + color: ${e=>e.theme.appColors.hex(10)}; + align-items: center; + justify-content: center; + transform: var(--menu-item-icon-scale); + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } +`,eDQ=eL.default.button.withConfig({displayName:"AppNavigation__NavigateForward",componentId:"sc-3465a596-1"})` + display: flex; + width: 30px; + height: 30px; + color: ${e=>e.theme.appColors.hex(10)}; + align-items: center; + justify-content: center; + transform: var(--menu-item-icon-scale); + margin-right: 0.75rem; + + &:hover { + color: ${e=>e.theme.appColors.hex(50)}; + } +`,eDJ=function(){let e=(0,eF.k6)();return ev.createElement(ev.Fragment,null,ev.createElement(eDY,{onClick:()=>{e.goBack()}},ev.createElement(tn.Icon,{icon:"header_nav_back"})),ev.createElement(eDQ,{onClick:()=>{e.goForward()}},ev.createElement(tn.Icon,{icon:"header_nav_forward"})))},eDX=eL.default.div.withConfig({displayName:"MeHeader__Header",componentId:"sc-6f129654-0"})` + display: flex; + padding: 18px 22px 5px; + align-items: center; + color: ${e=>e.theme.textColors.hex("10")}; + @media (min-width: 768px) { + padding: 9px ${eI.UiSpacing.getPx(5)} 5px 32px; + } +`,eD0=eL.default.div.withConfig({displayName:"MeHeader__StyledTitle",componentId:"sc-6f129654-1"})` + display: flex; + align-items: center; + flex: 1; +`,eD1=eL.default.span.withConfig({displayName:"MeHeader__StyledTitleValue",componentId:"sc-6f129654-2"})` + margin-left: 8px; + color: ${e=>e.theme.isNightMode?"#fff":"#333"}; + font-size: 16px; + line-height: 20px; + white-space: nowrap; +`,eD2=eL.default.div.withConfig({displayName:"MeHeader__Actions",componentId:"sc-6f129654-3"})` + display: flex; + flex: 1; + justify-content: flex-end; + position: relative; + align-items: center; +`,eD5=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"MeHeader__StyledBreadcrumbIcon",componentId:"sc-6f129654-4"})` + margin-left: 5px; + color: ${e=>e.theme.isNightMode?"#ccc":"#666"}; + transform: rotate(-90deg); +`,eD3=(0,eL.default)(tn.Icon).withConfig({displayName:"MeHeader__StyledIcon",componentId:"sc-6f129654-5"})` + display: block; + margin-right: 5px; + + ${e=>e.$close&&(0,eL.css)` + @media screen and (min-width: 991px) { + transform: scaleX(-1); + } + `} +`,eD4={[eZ.recentIndex]:{icon:"sidebar_recent",message:(0,te.Em)({id:"general.recent",defaultMessage:"Recent"})},[eZ.myTasks]:{icon:"sidebar_mytasks",message:(0,te.Em)({id:"general.my_tasks",defaultMessage:"My Tasks"})},[eZ.calendarIndex]:{icon:"sidebar_calendar",message:(0,te.Em)({id:"general.calendar",defaultMessage:"Calendar"})},[eZ.starredIndex]:{icon:"sidebar_starred",message:(0,te.Em)({id:"general.starred",defaultMessage:"Starred"})}},eD6=function(e){let{isSearchSidebarClosed:t,onClick:a,isEmptySearchQuery:n}=e,{data:l,loading:r,error:o}=(0,eB.a)(sN),i=(0,eF.$B)("/:type(spaces|subspaces|shared|search|my-tasks)"),s=l?.me??null,{pathname:d}=(0,eF.TH)(),c=eD4[d];return r?ev.createElement(eDX,null,ev.createElement(eI.Spinner,{height:26})):null==s?ev.createElement(eDX,null,ev.createElement(eY.Z,{id:"general.errors.load_user_data",defaultMessage:"There was a problem loading your user data, please relogin."})):null!=o?ev.createElement(eDX,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."})):ev.createElement(eDX,null,ev.createElement(IS,{desktopHidden:!0}),Ic()&&ev.createElement(eDJ,null),i?.params.type==="shared"&&ev.createElement(eD0,null,ev.createElement(eD1,null,ev.createElement(eY.Z,{id:"general.shared_with_me",defaultMessage:"Shared with me"})),ev.createElement(eD5,null),ev.createElement(eD1,null,ev.createElement(eY.Z,{id:"general.projects",defaultMessage:"Projects"}))),i?.params.type==="search"&&ev.createElement(ev.Fragment,null,!n&&ev.createElement(ev.Fragment,null,ev.createElement("button",{className:"mr-2.5 max-lg:hidden",onClick:a},ev.createElement(eD3,{icon:"header_sidebar_open",$close:!t}))),ev.createElement(tn.Icon,{className:"max-lg:hidden",icon:"dd_search"}),ev.createElement(eD0,null,ev.createElement(eD1,null,ev.createElement(eY.Z,{id:"general.search",defaultMessage:"Search"})))),i?.params.type==="my-tasks"&&ev.createElement(ev.Fragment,null,t&&ev.createElement("button",{className:"mr-1.5 max-lg:hidden",onClick:a},ev.createElement(eD3,{icon:"header_sidebar_open",$close:!1})),ev.createElement(tn.Icon,{className:"max-lg:hidden",icon:"sidebar_mytasks"}),ev.createElement(eD0,null,ev.createElement(eD1,null,ev.createElement(eY.Z,{id:"general.my_tasks",defaultMessage:"My Tasks"})))),i?.params.type!=="shared"&&i?.params.type!=="search"&&i?.params.type!=="my-tasks"&&ev.createElement(eD0,null,null!=c?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:c.icon}),ev.createElement(eD1,null,ev.createElement(eY.Z,c.message))):ev.createElement(ev.Fragment,null,ev.createElement(ao,{avatars_v2:s.avatars_v2,handle:s.handle,size:26,radius:10,userID:s.id,hidePresence:!0}),ev.createElement(eD1,null,l?.me?.handle))),ev.createElement(eD2,null,ev.createElement(e_A,null),ev.createElement(Sz,null),ev.createElement(Ii,null)))};var eD8=a(73359);let eD7={agenda:K.Month,work_week:K.Month,month:K.Month,week:K.Week,day:K.Day},eD9={[K.Month]:"month",[K.Week]:"week",[K.Day]:"day"},eTe="show-all",eTt="space",eTa="space-home",eTn="space-folder",eTl=(0,la.ZP)` + query MembershipsQuery { + me { + id + memberships { + id + order + role + space { + id + color + name + archived_at + parent_membership { + id + order + role + space { + id + color + name + archived_at + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + default { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + } + } + } + } + } + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + default { + ldpi { + url + } + mdpi { + url + } + hdpi { + url + } + xhdpi { + url + } + xxhdpi { + url + } + xxxhdpi { + url + } + } + } + } + } + } + } + } + } +`,eTr=(e,t)=>new to.Z(t,{keys:["values"],threshold:.1}).search(e).map(e=>e.item),eTo=eL.default.button.withConfig({displayName:"styled__BoxContainer",componentId:"sc-732ea777-0"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.xl}; + + display: flex; + flex-direction: row; + align-items: center; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,eTi=(0,eL.default)(tn.Icon).attrs({icon:"dd_filter_workspace"}).withConfig({displayName:"styled__FeatureIcon",componentId:"sc-732ea777-1"})` + margin-right: ${eI.UiSpacing.getPx(1)}; + color: ${e=>e.theme.appColors.hex(10)}; + transform: var(--global-icon-scale); +`,eTs=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"styled__CaretIcon",componentId:"sc-732ea777-2"})` + margin-left: ${eI.UiSpacing.getPx(3)}; + color: ${e=>e.theme.appColors.hex(50)}; + transform: var(--global-icon-scale); +`,eTd=eL.default.div.withConfig({displayName:"styled__MenuItemContainer",componentId:"sc-732ea777-3"})` + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + overflow-wrap: break-word; + overflow: hidden; + white-space: nowrap; + width: 100%; + + column-gap: var(--menu-item-gap); + padding: var(--menu-item-padding); + padding-left: ${e=>eI.UiSpacing.getPx(e.$indented?10:4)}; + + &:hover { + cursor: pointer; + } + + &:hover, + &:focus { + background-color: ${e=>e.theme.appColors.hex(80)}; + } + + & svg { + transform: var(--menu-item-icon-scale); + flex-shrink: 0; + } + + ${e=>e.$active&&(0,eL.css)` + background-color: ${e.theme.appColors.hex(80)}; + `} +`,eTc=eL.default.div.withConfig({displayName:"styled__SpaceAvatarContainer",componentId:"sc-732ea777-4"})` + flex-shrink: 0; + + & > div { + width: 20px; + height: 20px; + } +`,eTm=(0,eL.css)` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(10)}; + max-width: 80%; + white-space: break-spaces; +`,eTu=eL.default.span.withConfig({displayName:"styled__SpaceName",componentId:"sc-732ea777-5"})` + ${eTm}; +`,eTp=eL.default.span.withConfig({displayName:"styled__HomeLabel",componentId:"sc-732ea777-6"})` + ${eTm}; +`,eTg=(0,eL.css)` + ${e1.UiBorderRadius.lg}; + + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + width: 20px; + height: 20px; +`,eTf=eL.default.div.withConfig({displayName:"styled__HomeIconContainer",componentId:"sc-732ea777-7"})` + ${eTg}; + + background-color: ${e=>e.theme.appColors.hex(80)}; +`,eTh=(0,eL.default)(tn.Icon).attrs({icon:"home",width:20,height:20}).withConfig({displayName:"styled__HomeIcon",componentId:"sc-732ea777-8"})` + color: ${e=>e.theme.appColors.hex(10)}; + transform: var(--global-icon-scale); +`,eTy=eL.default.div.withConfig({displayName:"styled__ShowAllIconContainer",componentId:"sc-732ea777-9"})` + ${eTg}; +`,eTb=(0,eL.default)(tn.Icon).attrs({icon:"dd_filter_workspace",width:20,height:20}).withConfig({displayName:"styled__ShowAllIcon",componentId:"sc-732ea777-10"})` + color: ${e=>e.theme.appColors.hex(10)}; +`,eTv=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"styled__CheckIcon",componentId:"sc-732ea777-11"})` + margin-left: auto; + color: ${e=>e.theme.primaryColorScheme?.base}; +`,eTk=eL.default.div.withConfig({displayName:"styled__EmptyState",componentId:"sc-732ea777-12"})` + ${e1.UiTypography.sm}; + + margin-top: ${eI.UiSpacing.getPx(1.5)}; + padding: var(--menu-item-padding); + color: ${e=>e.theme.appColors.hex(50)}; +`,eTE=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(eTd,{ref:a,$active:t.focused,onClick:t.activate,onMouseEnter:t.focus,$indented:!0},ev.createElement(eTc,null,ev.createElement(nA,{size:"xs",space:t.data.folder})),ev.createElement(eTu,null,t.data.folder.name),t.data.checked&&ev.createElement(eTv,null))},eTx=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(eTd,{ref:a,$active:t.focused,onClick:t.activate,onMouseEnter:t.focus},ev.createElement(eTy,null,ev.createElement(eTb,null)),ev.createElement(eTp,null,t.label),t.data.checked&&ev.createElement(eTv,null))},eT_=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(eTd,{ref:a,$active:t.focused,onClick:t.activate,onMouseEnter:t.focus,$indented:!0},ev.createElement(eTf,null,ev.createElement(eTh,null)),ev.createElement(eTp,null,ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"})),t.data.checked&&ev.createElement(eTv,null))},eTw=function(e){let{morseChildProps:t}=e,a=ev.useRef(null);return ev.useEffect(()=>{t.focused&&a.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t.focused]),ev.createElement(eTd,{ref:a,$active:t.focused,onClick:t.activate,onMouseEnter:t.focus},ev.createElement(eTc,null,ev.createElement(nA,{size:"xs",space:t.data.space})),ev.createElement(eTu,null,t.data.space.name),t.data.checked&&ev.createElement(eTv,null))},eTN="ShowAll",eTC="Space",eTM="SpaceHome",eTS="SpaceFolder",eTI={[eTN]:e=>ev.createElement(eTx,{morseChildProps:e}),[eTC]:e=>ev.createElement(eTw,{morseChildProps:e}),[eTM]:e=>ev.createElement(eT_,{morseChildProps:e}),[eTS]:e=>ev.createElement(eTE,{morseChildProps:e})},eTD=eL.default.div.withConfig({displayName:"SpaceMultiSelectDropdownBody__Container",componentId:"sc-c9038bc7-0"})` + ${e1.UiBorderRadius.md}; + display: flex; + flex-direction: column; + + padding: var(--menu-padding); + border-radius: var(--menu-border-radius); + + width: 280px; + background-color: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eTT=eL.default.input.withConfig({displayName:"SpaceMultiSelectDropdownBody__Input",componentId:"sc-c9038bc7-1"})` + ${e1.UiTypography.sm}; + + border: 0; + border-bottom: 1px solid ${e=>e.theme.appColors.hex(70)}; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(4)} ${eI.UiSpacing.getPx(3)}; + margin: 0 0 ${eI.UiSpacing.getPx(1)}; + background: none; + + &::-webkit-input-placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } + &:-moz-placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } + &:-ms-input-placeholder { + color: ${e=>e.theme.textColors.hex(50)}; + } +`,eT$=function(e){let{spaceIds:t,setSpaceIds:a,close:n}=e,[l,r]=ev.useState(""),{data:o}=(0,eB.a)(eTl,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-and-network"}),i=ev.useMemo(()=>o?.me?.memberships??[],[o]);ev.useEffect(()=>{if(0===i.length||null==t)return;let e=new Set(i.map(e=>e.space.id));a((0,es.ZP)(t,t=>{for(let a=t.length;a>=0;a--)e.has(t[a])||t.splice(a,1)}))},[i,a,t]);let s=function(e,t){let a=(0,eK.Z)(),n=ev.useMemo(()=>pI(t),[t]),l=ev.useMemo(()=>{let t=a.formatMessage({id:"general.spaces",defaultMessage:"Spaces"}),l=new Set(e??[]),r=[],o=a.formatMessage({id:"general.show_all",defaultMessage:"Show all"});for(let i of(r.push({itemType:eTe,render:eTN,data:{checked:null==e||0===e.length},label:o,values:[]}),n)){let e=i.children.map(e=>e.space.id),n=l.has(i.space.id);for(let t of e)if(!l.has(t)){n=!1;break}for(let o of(r.push({itemType:eTt,render:eTC,data:{space:i.space,folderIds:e,checked:n},label:i.space.name,values:[t,i.space.name]}),e.length>0&&r.push({itemType:eTa,render:eTM,data:{spaceId:i.space.id,checked:l.has(i.space.id)},label:a.formatMessage({id:"general.home",defaultMessage:"Home"}),values:[t,i.space.name]}),i.children))r.push({itemType:eTn,render:eTS,data:{folder:o.space,checked:l.has(o.space.id)},label:o.space.name,values:[t,o.space.name]})}return{type:"section",label:t,items:r}},[n,a,e]);return ev.useMemo(()=>[l],[l])}(t,i),d=ev.useRef(null),[c,m]=ev.useState(null),u=(0,eK.Z)();ev.useEffect(()=>{null!=c&&requestAnimationFrame(()=>{c.focus()})},[c]);let p=ev.useCallback(e=>{let n=null;switch(e.itemType){case eTe:break;case eTt:n=[e.data.space.id,...e.data.folderIds];break;case eTa:n=[e.data.spaceId];break;case eTn:n=[e.data.folder.id]}a(function(e,t){if(null==e)return t;if(null==t)return null;let a=new Set(e),n=0;for(let e of t)a.has(e)&&n++;let l=n!==t.length;for(let e of t)l?a.add(e):a.delete(e);return 0===a.size?null:[...a]}(t,n))},[a,t]);return ev.createElement(eTD,null,ev.createElement(eTT,{ref:m,value:l,placeholder:u.formatMessage({id:"general.filter",defaultMessage:"Filter"}),onChange:e=>{r(e.target.value)},onKeyDown:e=>{switch(e.key){case eI.KeyboardKeys.Escape:n();break;case eI.KeyboardKeys.Space:break;case eI.KeyboardKeys.ArrowUp:e.preventDefault(),d.current?.focusPrevItem();break;case eI.KeyboardKeys.ArrowDown:e.preventDefault(),d.current?.focusNextItem();break;case eI.KeyboardKeys.Enter:d.current?.activateCurrentItem()}e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),ev.createElement(tT,{ref:d,term:l,data:s,search:eTr,renderMap:eTI,onActivate:p,renderEmptyState:ev.createElement(eTk,null,ev.createElement(eY.Z,{id:"general.no_results",defaultMessage:"No results"}))}))},eTP=function(e){let{spaceIds:t,onSpaceIdsChange:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start",computeModifiersCallback:tr}),s=(0,eI.useMenuButton)({state:r,dispatch:o,ref:n}),d=ev.useCallback(()=>{o({type:"Collapse"})},[]);return ev.createElement(ev.Fragment,null,ev.createElement(eTo,s.props,ev.createElement(eTi,null),null==t||0===t.length?ev.createElement(eY.Z,{id:"general.tasks.sort_by.show_all",defaultMessage:"Show All"}):ev.createElement(eY.Z,{id:"general.tasks.filter.space.selected",defaultMessage:"{count} selected",values:{count:t.length}}),ev.createElement(eTs,null)),r.expanded&&ev.createElement(eI.Popup,{dispatch:o,...i.props,modal:!0},ev.createElement(eT$,{spaceIds:t,setSpaceIds:a,close:d})))},eTF=(0,la.ZP)` + mutation CurrentUserPreferencesGlobalCalendarUpdateMutation( + $input: CurrentUserPreferencesGlobalCalendarUpdateInput! + ) { + currentUserPreferencesGlobalCalendarUpdate(input: $input) { + clientMutationId + me { + id + preferences { + calendarView + globalCalendar + } + } + } + } +`,eTA=(0,la.ZP)` + fragment EventFragment on Event { + id + node + } +`,eTR=(0,la.ZP)` + query EventsQuery($filterby: EventFiltering!) { + events(filterby: $filterby) { + edges { + cursor + node { + id + document_id + workspace { + type + id + } + type + metadata { + document_title + workspace_name + workspace_color + view_path + } + node + } + } + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + totalCount + } + } +`,eTj=(0,la.ZP)` + query GoogleCalendarRawEventsQuery { + me { + id + google_calendars_raw_events { + edges { + cursor + node { + id + google_calendar_id + google_calendar_color + event + } + } + pageInfo { + hasNextPage + hasPreviousPage + endCursor + startCursor + } + } + } + } +`,eTO=(0,la.ZP)` + mutation ProjectDueDateAddMutation($input: ProjectDueDateAddInput!) { + projectDueDateAdd(input: $input) { + clientMutationId + ok + documentID + start + end + } + } +`,eTU=(0,la.ZP)` + mutation TaskDueDateUpdateMutation($input: TaskDueDateUpdateInput!) { + taskDueDateUpdate(input: $input) { + clientMutationId + ok + } + } +`;function eTZ(e){let t=e.timeZone??"Etc/UTC";return eG().tz(e.date??e.dateTime,t)}function eTL(e){return"taskade"===e.data.type}let eTB=(e,t)=>{switch(t.type){case"set_view":return(0,es.ZP)(e,e=>{e.view=t.view});case"set_filter":return(0,es.ZP)(e,e=>{e.filter=t.filter});case"set_space_ids":return(0,es.ZP)(e,e=>{e.spaceIds=t.spaceIds})}},eTz=(0,la.ZP)` + query GetGlobalCalendarPreferencesQuery { + me { + id + preferences { + calendarView + globalCalendar + } + } + } +`,eTV=eL.default.div.withConfig({displayName:"MenuItem__Wrapper",componentId:"sc-93c49f29-0"})` + cursor: pointer; + display: flex; + justify-content: space-between; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(3)}; + &:hover, + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,eTq=function(e){let{children:t,name:a,value:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,name:a,value:n});return ev.createElement(eTV,r.props,t)};eL.default.div.withConfig({displayName:"styled__CalendarNote",componentId:"sc-c66c52e1-0"})` + display: flex; + width: 100%; + font-size: 14px; + padding: 8px 12px; + background: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + border-radius: 10px; + margin-top: 24px; + color: ${e=>e.theme.textColors.hex(10)}; + flex-wrap: wrap; + + & svg { + margin-right: 5px; + } + + & > a { + margin-left: 4px; + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha50}; + } + } +`;let eTW=eL.default.div.withConfig({displayName:"styled__CalendarWrapper",componentId:"sc-c66c52e1-1"})` + display: flex; + flex-direction: column; + flex: 1; +`,eTH=eL.default.div.withConfig({displayName:"styled__Toolbar",componentId:"sc-c66c52e1-2"})` + display: flex; + margin-bottom: 16px; + padding: 20px 20px 0px; + width: 100%; + flex-direction: row; + flex-wrap: wrap; + column-gap: ${eI.UiSpacing.getPx(3)}; +`,eTG=eL.default.div.withConfig({displayName:"styled__SpinnerContainer",componentId:"sc-c66c52e1-3"})` + display: flex; + align-items: center; +`,eTK=eL.default.button.withConfig({displayName:"styled__StyledDropdownToggle",componentId:"sc-c66c52e1-4"})` + ${e1.UiTypography.sm}; + cursor: pointer; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: var(--menu-border-radius); + display: flex; + align-items: center; + padding: ${eI.UiSpacing.getPx(1)} ${eI.UiSpacing.getPx(2.5)}; + + &:hover { + background-color: ${e=>e.theme.appColors.hex(80)}; + } +`,eTY=(0,eL.default)(tn.Icon).attrs({icon:"dd_filter_assign"}).withConfig({displayName:"styled__FeatureIcon",componentId:"sc-c66c52e1-5"})` + margin-right: ${eI.UiSpacing.getPx(1)}; + color: ${e=>e.theme.appColors.hex(50)}; +`,eTQ=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"styled__CaretIcon",componentId:"sc-c66c52e1-6"})` + margin-left: ${eI.UiSpacing.getPx(2)}; + color: ${e=>e.theme.appColors.hex(50)}; +`,eTJ=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-c66c52e1-7"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(80)}; +`,eTX=eL.default.div.withConfig({displayName:"styled__FilterWrapper",componentId:"sc-c66c52e1-8"})` + display: flex; + flex-direction: column; + gap: 2px; +`,eT0=eL.default.div.withConfig({displayName:"styled__FilterHeader",componentId:"sc-c66c52e1-9"})` + color: ${e=>e.theme.appColors.hex(10)}; + font-weight: 500; + font-size: 14px; + line-height: 20px; +`,eT1=eL.default.div.withConfig({displayName:"styled__FilterDescription",componentId:"sc-c66c52e1-10"})` + color: ${e=>e.theme.appColors.hex(50)}; + font-weight: 400; + font-size: 13px; + line-height: 16px; + max-width: 195px; +`,eT2=eL.default.div.withConfig({displayName:"styled__SelectedPreference",componentId:"sc-c66c52e1-11"})` + display: flex; + min-width: 44px; + justify-content: flex-end; + align-items: center; +`,eT5=(0,eL.default)(tn.Icon).attrs({icon:"dd_check"}).withConfig({displayName:"styled__IconPreferenceSelected",componentId:"sc-c66c52e1-12"})` + color: ${e=>e.theme.appColors.hex(10)}; +`,eT3=function(e){let{currentUserId:t,calendarParametersState:a,calendarParametersDispatch:n}=e,{data:l}=(0,eB.a)(eTz),r=l?.me?.preferences.globalCalendar?.filter,[o]=(0,cs.D)(eTF),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1}),d=ev.useRef(null),c=ev.useRef(null),m=ev.useCallback(()=>{d.current?.focus()},[]);(0,eI.usePopupEvents)({state:i,onCollapse:m});let u=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:i,placement:"bottom-start"}),p=(0,eI.useMenuButton)({dispatch:s,ref:d,state:i}),g=ev.useCallback(e=>{if("Activate"===e.type){let{name:l}=e.payload,r=(0,ld.Z)();n({type:"set_filter",filter:l}),o({variables:{input:{clientMutationId:r,filter:l}},optimisticResponse:{__typename:"Mutation",currentUserPreferencesGlobalCalendarUpdate:{clientMutationId:r,me:{id:t,preferences:{calendarView:a.view,globalCalendar:{filter:l,spaceIds:a.spaceIds}}}}}})}s({type:"Collapse"})},[o,n,a.spaceIds,a.view,t]);return ev.createElement(ev.Fragment,null,ev.createElement(eTK,{className:"active-path",type:"button",...p.props},ev.createElement(eTY,null),("for_me"===r||null==r)&&ev.createElement(eY.Z,{id:"general.for_me",defaultMessage:"For me"}),"for_others"===r&&ev.createElement(eY.Z,{id:"general.for_others",defaultMessage:"For others"}),"for_everyone"===r&&ev.createElement(eY.Z,{id:"general.for_everyone",defaultMessage:"For everyone"}),ev.createElement(eTQ,null)),i.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:s,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:g},ev.createElement(eTJ,{initialFocus:u.initialFocus,loop:!0},ev.createElement(eTq,{name:"for_me"},ev.createElement(eTX,null,ev.createElement(eT0,null,ev.createElement(eY.Z,{id:"general.for_me",defaultMessage:"For me"})),ev.createElement(eT1,null,ev.createElement(eY.Z,{id:"general.global_calendar_for_me_info",defaultMessage:"Tasks with due dates created by me or assigned to me."}))),ev.createElement(eT2,null,("for_me"===r||null==r)&&ev.createElement(eT5,null))),ev.createElement(eTq,{name:"for_others"},ev.createElement(eTX,null,ev.createElement(eT0,null,ev.createElement(eY.Z,{id:"general.for_others",defaultMessage:"For others"})),ev.createElement(eT1,null,ev.createElement(eY.Z,{id:"general.global_calendar_for_others_info",defaultMessage:"Tasks with due dates and assigned to others."}))),ev.createElement(eT2,null,"for_others"===r&&ev.createElement(eT5,null))),ev.createElement(eTq,{name:"for_everyone"},ev.createElement(eTX,null,ev.createElement(eT0,null,ev.createElement(eY.Z,{id:"general.for_everyone",defaultMessage:"For everyone"})),ev.createElement(eT1,null,ev.createElement(eY.Z,{id:"general.global_calendar_for_everyone_info",defaultMessage:"All tasks with due dates."}))),ev.createElement(eT2,null,"for_everyone"===r&&ev.createElement(eT5,null)))))))};eL.default.div.withConfig({displayName:"Styles__FlexContainer",componentId:"sc-7964d769-0"})``,eL.default.div.withConfig({displayName:"Styles__Section",componentId:"sc-7964d769-1"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; + color: #ccc; + + max-width: ${e=>e.$fullwidth?"auto":"300px"}; +`,eL.default.div.withConfig({displayName:"Styles__Title",componentId:"sc-7964d769-2"})` + font-size: 13px; + font-weight: 500; + color: ${e=>e.theme.isNightMode?"#ccc":"#999"}; + text-transform: uppercase; + margin-bottom: 5px; +`,eL.default.h2.withConfig({displayName:"Styles__Heading",componentId:"sc-7964d769-3"})` + font-size: 17px; + color: ${e=>e.theme.textColors.hex(10)}; + margin: 0 0 5px; +`;let eT4=eL.default.p.withConfig({displayName:"Styles__Paragraph",componentId:"sc-7964d769-4"})` + display: flex; + padding: 0; + margin: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,eT6=(0,la.ZP)` + mutation GoogleCalendarRawEventMoveToProjectMutation( + $input: GoogleCalendarRawEventMoveToProjectInput! + ) { + googleCalendarRawEventMoveToProject(input: $input) { + clientMutationId + ok + attachment + } + } +`,eT8=(0,la.ZP)` + query RecentProjectsQuery { + recentProjects(first: 25) { + edges { + cursor + node { + id + edit_path + has_move_permission + has_leave_permission + is_owner + is_unread + info + pinned_at + role { + project + workspace + } + shared_preferences + space { + id + name + color + type + } + starred_at + view_path + templated_at + updated_at + user { + ...BasicUserFields + } + } + } + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + totalCount + } + } + ${up} +`,eT7=eL.default.div.withConfig({displayName:"Project__Wrapper",componentId:"sc-fee82eb3-0"})` + display: flex; + align-items: center; + width: 100%; + margin: 0; + padding: 6px 16px 6px 20px; + line-height: 20px; + background: none; + border: 0; + color: ${e=>e.theme.textColors.hex(10)}; + cursor: pointer; + width: 100%; + text-align: left; + + &:hover, + &:focus { + background: ${e=>e.theme.isNightMode?"#333":"#f8f8f8"}; + } + + &:focus { + outline: 0; + } + + svg { + display: flex; + flex-shrink: 0; + margin-right: 12px; + path { + stroke: ${e=>e.theme.isNightMode?"#e5e5e5":"#333"}; + } + } +`;eL.default.span.withConfig({displayName:"Project__EmojiWrapper",componentId:"sc-fee82eb3-1"})` + display: flex; + width: 20px; + height: 20px; + justify-content: center; + font-size: 18px; + line-height: 21px; + margin-right: var(--menu-item-gap); +`;let eT9=function(e){let{project:t,onProjectChosen:a}=e;return ev.createElement(eT7,{onClick:e=>a?.(e,t)},ev.createElement(lT.t6,null),t?.info?.title||"Untitled")},e$e=eL.default.div.withConfig({displayName:"GoogleCalendarEventDropdownBody__Wrapper",componentId:"sc-99a0a8d1-0"})` + max-width: 366px; + max-height: 400px; + padding: 16px 0; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + overflow-y: scroll; +`,e$t=eL.default.div.withConfig({displayName:"GoogleCalendarEventDropdownBody__Header",componentId:"sc-99a0a8d1-1"})` + padding: 0 20px; +`,e$a=eL.default.span.withConfig({displayName:"GoogleCalendarEventDropdownBody__Label",componentId:"sc-99a0a8d1-2"})` + display: flex; + color: #999; + font-size: 13px; + padding: 0 20px; + margin-bottom: 5px; +`,e$n=eL.default.div.withConfig({displayName:"GoogleCalendarEventDropdownBody__ProjectsList",componentId:"sc-99a0a8d1-3"})` + display: flex; + flex-direction: column; +`,e$l=eL.default.div.withConfig({displayName:"GoogleCalendarEventDropdownBody__Title",componentId:"sc-99a0a8d1-4"})` + display: flex; + color: ${e=>e.theme.textColors.hex(10)}; + font-size: 16px; + font-weight: 500; + margin-bottom: 2px; +`,e$r=function(e){let{eventData:t,onEventAdd:a}=e,n=(0,eB.a)(eT8),[l,r]=(0,cs.D)(eT6),o=(0,ev.useCallback)((e,n)=>{e.preventDefault(),e.stopPropagation(),l({variables:{input:{clientMutationId:(0,ld.Z)(),id:t.id,projectId:n.id}},update:(e,l)=>{let{data:r}=l,o=r?.googleCalendarRawEventMoveToProject?.attachment;if(null==o)return;let i=function(e,t,a,n){let l;l=null!=a.event.summary&&a.event.summary.length>0?{string:a.event.summary,delta:{ops:[{insert:a.event.summary},{insert:"\n",attributes:{paragraph:!0}}]}}:{string:"",delta:{ops:[{insert:"\n",attributes:{paragraph:!0}}]}};let r={type:"space",id:e.space?.id??""};return{__typename:"Event",document_id:e.id,id:`urn:taskade:d/${e.id}/${t}`,metadata:{document_title:e.info.title||"",view_path:e.view_path,workspace_color:e.space?.color||"",workspace_name:e.space?.name||"",__typename:"EventMetadata"},node:{__typename:"IndexedDocumentNode",id:t,ancestors:[],indices:[0],revision:0,line_number:1,cleared:!1,completed:!1,text:l,event:n.data,due_date:n.data,hashtags:[],mentions:[],assignees:[],tags:[],archived_at:null,created_at:eG()().toISOString(),updated_at:eG()().toISOString()},type:"node",workspace:r}}(n,o.node_id,t,o);a(t,i)}})},[l,t,a]),i=n.loading||r.loading;return ev.createElement(e$e,null,ev.createElement(e$t,null,ev.createElement(e$l,null,ev.createElement(eY.Z,{id:"general.google_calendar_add_to_project",defaultMessage:"Add to Project"})),ev.createElement(eT4,null,ev.createElement(eY.Z,{id:"general.google_calendar_add_to_project_instructions",defaultMessage:"This event is only visible to you unless added to a shared project."}))),ev.createElement(e$a,null,"RECENT"),ev.createElement(e$n,null,i?ev.createElement(eI.Spinner,null):n.data?.recentProjects?.edges?.filter(e=>e.node?.space?.type==="unlimited")?.map(e=>null==e.node?null:ev.createElement(eT9,{key:e.node.id,project:e.node,onProjectChosen:o}))))},e$o=(0,eL.default)(lT.nj).withConfig({displayName:"GoogleCalendarEvent__StyledGoogleIcon",componentId:"sc-9179d91a-0"})` + width: 20px; + height: 20px; + margin-left: -2px; + margin-right: 2px; + display: inline-block; + path { + display: inline-block; + fill: #fff; + } + vertical-align: top !important; +`,e$i=eL.default.button.withConfig({displayName:"GoogleCalendarEvent__GoogleCalendarEventWrapper",componentId:"sc-9179d91a-1"})` + display: flex; + width: 100%; + height: 100%; + align-items: flex-start; + color: #ffffff !important; + background: ${e=>e.$backgroundColor}; + border-radius: 5px; + border: none; + padding: 2px 8px; + z-index: 2; + + &:hover { + cursor: pointer; + } +`,e$s=eL.default.div.withConfig({displayName:"GoogleCalendarEvent__InnerWrapper",componentId:"sc-9179d91a-2"})` + padding: 0; + width: 100%; + margin-top: ${e=>e.$isMonthViewOrAllDay?"0px":"-2px"}; + display: flex; + flex-direction: row; + justify-content: space-between; + text-align: left; +`,e$d=eL.default.div.withConfig({displayName:"GoogleCalendarEvent__TextWrapper",componentId:"sc-9179d91a-3"})` + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 100%; + margin-right: 6px; + display: inline-block; + ${e1.UiTypography.sm}; +`,e$c=eL.default.span.withConfig({displayName:"GoogleCalendarEvent__StyledSpan",componentId:"sc-9179d91a-4"})` + overflow: hidden; + white-space: pre-wrap}; + text-overflow: ellipsis; + max-width: 100%; + + ${e1.UiTypography.sm}; + display: -webkit-inline-box; + text-align: left; + -webkit-box-orient: vertical; + -webkit-line-clamp: ${e=>e.$lines}; +`,e$m=eL.default.div.withConfig({displayName:"GoogleCalendarEvent__StyledTimeIndicator",componentId:"sc-9179d91a-5"})` + ${e1.UiTypography.xs}; + color: ${e=>e.theme.textColors.hex(30)}; + padding-top: 3px; + text-align: right; +`,e$u=function(e){let{event:t,onEventAdd:a}=e,{view:n}=t,l=n===K.Month,r=t.dateDuration.toDisplayState(),o="EventChunkAllDay"===t.type||"EventChunkMonthDay"===t.type&&t.isAllDay||null==r.startTime&&null==r.endTime,i=l||o,s=ev.useMemo(()=>edT(n,o,t.chunkStart,t.chunkEnd),[t.chunkEnd,t.chunkStart,o,n]),[d,c]=ev.useReducer(eI.popupReducer,{expanded:!1}),m=ev.useRef(null),u=ev.useRef(null),p=ev.useMemo(()=>ed$(t),[t]),g=(0,eI.usePopup)({referenceElementRef:m,popupElementRef:u,state:d,placement:"bottom",computeModifiersCallback:tr}),f=(0,eI.useMenuButton)({state:d,ref:m,dispatch:c}),h=ev.useCallback(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},[]);return ev.createElement(ev.Fragment,null,ev.createElement(e$i,{$backgroundColor:t.data.google_calendar_color,...f.props},ev.createElement(e$s,{$isMonthViewOrAllDay:i},l?ev.createElement(ev.Fragment,null,ev.createElement(e$d,null,ev.createElement(e$o,null),t.data.event.summary||ev.createElement(eY.Z,{defaultMessage:"(no title)",id:"general.google_calendar_empty_event"})),null!=p&&ev.createElement(e$m,null,p)):ev.createElement(e$c,{$lines:s},ev.createElement(e$o,null),t.data.event.summary||ev.createElement(eY.Z,{defaultMessage:"(no title)",id:"general.google_calendar_empty_event"})))),d.expanded&&ev.createElement(eI.Popup,{...g.props,dispatch:c,modal:!0},ev.createElement("div",{onClick:h},ev.createElement(e$r,{eventData:t.data,onEventAdd:a}))))},e$p=eL.default.div.withConfig({displayName:"TaskadeEvent__NodeText",componentId:"sc-e22c176a-0"})` + width: 100%; + height: 100%; + min-height: 28px; + padding: 2px 8px; + border-radius: 10px; + ${e1.UiTypography.sm}; + text-overflow: ellipsis; + overflow: hidden; + position: relative; + justify-content: space-between; + + display: flex; + flex-direction: row; + + background: ${e=>e?.$backgroundColor.alpha30}; + color: ${e=>e.theme.appColors.hex(10)}; + + &:hover { + background: ${e=>e?.$backgroundColor.alpha50}; + } +`,e$g=(0,eL.default)(eiK).withConfig({displayName:"TaskadeEvent__StyledSlateEditor",componentId:"sc-e22c176a-1"})` + height: 100%; + position: relative; + overflow: hidden; + + & > div { + overflow: hidden; + white-space: ${e=>e.$isMonthView?"nowrap":"pre-wrap"}; + text-overflow: ellipsis; + + ${e=>!e.$isMonthView&&(0,eL.css)` + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: ${e.$lines}; + `} + } +`,e$f=eL.default.div.withConfig({displayName:"TaskadeEvent__StyledTimeIndicator",componentId:"sc-e22c176a-2"})` + ${e1.UiTypography.xs}; + color: ${e=>e.theme.textColors.hex(30)}; + padding-top: 3px; + text-align: right; +`,e$h=function(e){let{event:t}=e,{nodeDelta:a,projectTitle:n,workspaceColor:l,workspaceName:r}=t.data,o=Sc(l??eI.Colors.BRAND),{view:i}=t,s=i===K.Month,d=t.dateDuration.toDisplayState(),c="EventChunkAllDay"===t.type||"EventChunkMonthDay"===t.type&&t.isAllDay||null==d.startTime&&null==d.endTime,m=ev.useMemo(()=>edT(i,c,t.chunkStart,t.chunkEnd),[t.chunkEnd,t.chunkStart,c,i]),u=ev.useMemo(()=>new(CI())(a.ops),[a.ops]),[p,g]=ev.useState(!1),f=(0,ev.useRef)(null),h=(0,ev.useRef)(null),y=(0,ev.useRef)(null),{arrowProps:b,popperProps:v,referenceProps:k}=(0,eI.useControlledTooltip)({referenceElementRef:f,arrowElementRef:h,popperElementRef:y,placement:"top",visible:p}),E=ev.useMemo(()=>ed$(t),[t]);return ev.createElement(e$p,{$backgroundColor:o,...k,onMouseEnter:()=>{g(!0)},onMouseLeave:()=>{g(!1)}},ev.createElement(e$g,{className:"flex items-center",delta:u,readOnly:!0,$isMonthView:s,$lines:m}),null!=E&&ev.createElement(e$f,null,E),p&&ev.createElement(eI.Tooltip,{arrowProps:b,popperProps:v},n," — ",r))},e$y=function(e){let{currentUserId:t,calendarView:a,preferences:n}=e,{state:l,dispatch:r}=function(e,t){let a=(0,eF.k6)(),n=ev.useMemo(()=>new URLSearchParams(a.location.search),[a.location.search]),[l,r]=ev.useReducer(eTB,lS(n,{view:e,filter:t?.filter,spaceIds:t?.spaceIds}));return ev.useEffect(()=>{let e=new URLSearchParams,{filter:t,spaceIds:n,view:r}=l;if(e.set("type",t),e.set("view",r),null!=n&&n.length>0)for(let t of n)e.append("spaceIds[]",t);a.replace({search:e.toString()})},[l,a]),{state:l,dispatch:r}}(a,n),{props:o}=edM(eD7[l.view]),[i,{data:s,loading:d,called:c}]=(0,eD8.t)(eTR,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),m=(0,eB.a)(eTj),[u]=(0,cs.D)(eTF),p=ev.useMemo(()=>lx(o.state.currentDay,l.spaceIds,l.filter),[o.state,l]);ev.useEffect(()=>{i({variables:p})},[t,i,p]),ev.useEffect(()=>{let e=eD9[o.state.currentView];if(e===a)return;r({type:"set_view",view:e});let n=(0,ld.Z)();u({variables:{input:{clientMutationId:n,view:e}},optimisticResponse:{__typename:"Mutation",currentUserPreferencesGlobalCalendarUpdate:{clientMutationId:n,me:{id:t,preferences:{calendarView:e,globalCalendar:{filter:l.filter,spaceIds:l.spaceIds}}}}}})},[r,l.filter,l.spaceIds,o.state.currentView,a,t,u]);let g=(0,ll.x)(),f=ev.useCallback((e,t)=>{let a=g.readQuery({query:eTj});if(null==a||null==a.me)return;g.writeQuery({query:eTj,data:(0,es.ZP)(a,t=>(null==t.me||(t.me.google_calendars_raw_events.edges=t.me.google_calendars_raw_events.edges.filter(t=>t.node.id!==e.id)),t))});let n=g.readQuery({query:eTR,variables:p});null!=n&&g.writeQuery({query:eTR,variables:p,data:(0,es.ZP)(n,e=>(e.events.edges.push({cursor:`${e.events.edges.length}`,node:t,__typename:"EventEdge"}),e.events.totalCount+=1,e))})},[g,p]),h=ev.useMemo(()=>{let e=[],t=s?.events??null;if(null!=t)for(let a of t.edges){let t=function(e){let{id:t,node:a,metadata:n,document_id:l}=e.node,{id:r,event:o,cleared:i,completed:s}=a;if(null==o)return null;let d=null!=o.start?{start:o.start,end:o.end}:{start:o.end};return{id:t,dateDuration:ez.DateDuration.fromDateRangeDesc(d),data:{cleared:i,completed:s,nodeId:r,nodeText:a.text.string,nodeDelta:a.text.delta,isRootNode:0===a.ancestors.length,projectId:l,projectTitle:n.document_title,workspaceName:n.workspace_name,workspaceColor:n.workspace_color,viewPath:n.view_path,type:"taskade",dateRangeDesc:d},stripeColor:n.workspace_color}}(a);null!=t&&e.push({...t,disableDrag:!1})}return e},[s?.events]),y=m.data?.me?.google_calendars_raw_events??null,b=ev.useMemo(()=>{let e=[];if(null!=y)for(let t of y.edges){let a=function(e){let t;let{id:a,event:n}=e.node,{start:l,end:r}=n;if(null==l||null==r)return null;let o=eTZ(l),i=eTZ(r);return t=o.isSame(i,"seconds")?{start:ez.MomentHelpers.toDateTimeDesc(o)}:{start:ez.MomentHelpers.toDateTimeDesc(o),end:ez.MomentHelpers.toDateTimeDesc(i)},{id:a,data:{...e.node,type:"google_calendar"},dateDuration:ez.DateDuration.fromDateRangeDesc(t),disableDrag:!0}}(t);null!=a&&e.push(a)}return e},[y]),v=ev.useMemo(()=>[...h,...b],[b,h]),k=ev.useCallback(e=>{switch(e.data.type){case"taskade":return ev.createElement(e$h,{event:e});case"google_calendar":return ev.createElement(e$u,{event:e,onEventAdd:f});default:return null}},[f]),[E]=(0,cs.D)(eTO),[x]=(0,cs.D)(eTU),_=(0,e$.useDispatch)(),w=(0,eK.Z)(),N=ev.useCallback(async(e,t)=>{try{e.data.isRootNode?await E({variables:{input:{clientMutationId:(0,ld.Z)(),documentID:e.data.projectId,start:t.start,end:t.end}}}):await x({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:e.data.projectId,nodeId:e.data.nodeId,dateRangeDesc:t}}});let a=g.readFragment({id:`Event:${e.id}`,fragment:eTA});if(null==a)return;let n=ez.DateDuration.fromDateRangeDesc(t).toCanonicalDateTimeDesc(),l=(0,es.ZP)(a,e=>{null!=e.node.event&&(e.node.event.start=n.start,e.node.event.end=n.end)});await g.writeFragment({id:`Event:${e.id}`,fragment:eTA,data:l})}catch(t){if("graphQLErrors"in t&&t.graphQLErrors[0]?.extensions?.code==="FORBIDDEN"){let t=`calendar-drag-${e.data.nodeId}`,a=w.formatMessage({id:"general.calendar_dnd_permission_error_body",defaultMessage:"You do not have permission to modify the due date"});_((0,l3.error)({position:"br",autoDismiss:5,dismissible:!1,uid:t,message:a}));return}er.Tb(t)}},[g,_,w,E,x]),C=ev.useCallback((e,t,a,n)=>{if(!eTL(e))return;let l={date:t,time:a??void 0,timezone:eG().tz.guess()};if("all_day"===n){N(e,{start:l});return}let r=ez.DateTimeDescHelpers.toMoment(l),o=r.clone().add(1,"hour");if(!edJ(e)){let t=ez.DateDuration.fromDateRangeDesc(e.data.dateRangeDesc);o=r.clone().add(t.duration.toObject())}N(e,{start:l,end:ez.MomentHelpers.toDateTimeDesc(o)})},[N]),M=ev.useCallback((e,t)=>{if(!eTL(e))return;let a=e.data,n=eG().tz.guess(),l={date:t,time:a.dateRangeDesc.start.time??void 0,timezone:n},r=ez.DateDuration.fromDateRangeDesc(a.dateRangeDesc),o=ez.DateTimeDescHelpers.toMoment(l).clone().add(r.duration.toObject());N(e,{start:l,end:ez.MomentHelpers.toDateTimeDesc(o)})},[N]),S=ev.useCallback((e,t,a)=>{_(uO.actions.toggleQuickAddDialog({date:e,time:t,type:a,currentDay:o.state.currentDay}))},[o.state.currentDay,_]),I=ev.useCallback((e,t,a)=>{_(uO.actions.toggleQuickAddDialog({date:e,time:t,type:a,currentDay:o.state.currentDay}))},[o.state.currentDay,_]),D=ev.useCallback((e,t,a)=>{_(uO.actions.toggleQuickAddDialog({date:e,time:t,type:a,currentDay:o.state.currentDay}))},[o.state.currentDay,_]),T=(0,eF.k6)(),$=ev.useCallback(e=>{eTL(e)&&T.push({pathname:`/d/${e.data.projectId}`,hash:`node-${e.data.nodeId}`})},[T]),P=ev.useCallback(e=>{r({type:"set_space_ids",spaceIds:e});let a=(0,ld.Z)();u({variables:{input:{clientMutationId:a,spaceIds:e}},optimisticResponse:{__typename:"Mutation",currentUserPreferencesGlobalCalendarUpdate:{clientMutationId:a,me:{id:t,preferences:{calendarView:l.view,globalCalendar:{filter:l.filter,spaceIds:e}}}}}})},[r,l.filter,l.view,t,u]);return c?ev.createElement(eTW,null,ev.createElement(eTH,null,ev.createElement(eTP,{spaceIds:l.spaceIds,onSpaceIdsChange:P}),ev.createElement(eT3,{currentUserId:t,calendarParametersState:l,calendarParametersDispatch:r}),d&&ev.createElement(eTG,null,ev.createElement(eI.Spinner,{width:20,height:20})),ev.createElement(edD,{calendarProps:o})),ev.createElement(edN,{events:v,calendarProps:o,eventRender:k,onEventClicked:$,onDayViewDragged:C,onWeekViewDragged:C,onMonthViewDragged:M,onDayEmptySpaceClick:S,onWeekEmptySpaceClick:I,onMonthEmptySpaceClick:D})):ev.createElement(eI.Spinner,{height:319})},e$b=function(){let{data:e,loading:t}=(0,eB.a)(eTz),a=e?.me?.id??null,n=e?.me?.preferences?.calendarView??"month",l=e?.me?.preferences?.globalCalendar??null;return ev.createElement(ev.Fragment,null,ev.createElement(eT.ql,null,ev.createElement("title",null,"Calendar - Taskade")),ev.createElement(eD6,null),t?ev.createElement(eI.Spinner,{height:319}):ev.createElement(ev.Fragment,null,null!=a&&ev.createElement(e$y,{currentUserId:a,calendarView:n,preferences:l})))},e$v=dw.z.object({spaceIds:dw.z.array(dw.z.string()).optional(),projectIds:dw.z.array(dw.z.string()).optional(),assignees:dw.z.array(dw.z.string()).optional(),assigneeType:dw.z.string().optional(),dueDateType:dw.z.string().optional(),dueDateSection:dw.z.string().optional(),projectType:dw.z.string().optional()});dw.z.object({filter:e$v});let e$k="task",e$E=ev.createContext(void 0),e$x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MembershipsQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"memberships"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"archived"},value:{kind:"BooleanValue",value:!1}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"parent_id"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]};function e$_(){let e=(0,eF.k6)();return{filterby:ev.useMemo(()=>{let t=new URLSearchParams(e.location.search);return{spaceIds:t.getAll("spaceIds")??void 0,assignees:t.getAll("assignees")??void 0,assigneeType:t.get("assigneeType")??void 0,dueDateType:t.get("dueDateType")??void 0,dueDateSection:t.get("dueDateSection")??void 0,projectType:t.get("projectType")??void 0}},[e.location.search])}}let e$w=function(e){let{avatar:t,count:a,inputField:n,inputId:l,isChecked:r,label:o}=e,i=t?.small?.mdpi?.url;return ev.createElement("div",{className:"flex"},n,ev.createElement("label",{className:"flex h-max w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:l},ev.createElement("div",{className:"flex items-center"},null!=i&&ev.createElement("img",{className:"mr-2 inline-block h-5 w-5 rounded-full",src:i}),o,a>0&&ev.createElement("span",{className:"ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600"},a)),r&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},e$N=function(e){let{inputField:t,inputId:a,isChecked:n,label:l}=e;return ev.createElement("div",{className:"flex"},t,ev.createElement("label",{className:"flex h-max w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:a},ev.createElement("div",{className:"flex items-center"},ev.createElement("div",{className:"mr-2 flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"assigned_nobody",className:"text-appcolor-500"})),ev.createElement("span",{className:"text-sm"},l)),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},e$C=function(e){let{getValues:t,isAssignmentsClosed:a,register:n,searchFilterValue:l,toggleClick:r,onChangeAssignees:o,onChangeAssigneeType:i}=e,s=(0,eB.a)(sW),d=s.data?.me,c=(0,eK.Z)(),m=ev.useMemo(()=>null==l||null==d?[]:Array.from(l.keys()).filter(e=>e!==d.handle).sort(),[d,l]);if(null==l||null==d)return null;let u=c.formatMessage({id:"general.me",defaultMessage:"Me"}),p=c.formatMessage({id:"general.unassigned",defaultMessage:"Unassigned"});return ev.createElement(ev.Fragment,null,ev.createElement("h3",{className:"mb-1 flex cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700",onClick:r},ev.createElement(tn.Icon,{className:"cursor-pointer rounded-full hover:bg-appcolor-400",icon:a?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.assigned_to",defaultMessage:"Assigned to"})),!a&&ev.createElement(ev.Fragment,null,ev.createElement(e$N,{label:p,inputId:"no-assignees-filter",inputField:ev.createElement("input",{...n("assigneeType"),type:"checkbox",id:"no-assignees-filter",value:"no_assignees",className:"hidden",onChange:i}),isChecked:"no_assignees"===t("assigneeType")}),ev.createElement(e$w,{avatar:d.avatars_v2,label:u,inputId:`assignee-${d.handle}`,inputField:ev.createElement("input",{...n("assignees"),type:"checkbox",id:`assignee-${d.handle}`,value:d.handle,className:"hidden",onChange:o}),isChecked:t("assignees").includes(d.handle),count:l.get(d.handle)?.count??0}),ev.createElement("div",{className:"mb-4"},m.map(e=>ev.createElement(e$w,{key:e,avatar:l.get(e)?.metadata?.avatars_v2,label:e,inputId:`assignee-${e}`,inputField:ev.createElement("input",{...n("assignees"),type:"checkbox",id:`assignee-${e}`,value:e,className:"hidden",onChange:o}),isChecked:t("assignees").includes(e),count:l.get(e)?.count??0})))))},e$M=function(e){let{register:t,isClosed:a,onToggle:n,getValues:l}=e;return ev.createElement(ev.Fragment,null,ev.createElement("h3",{className:"mb-1 flex cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700",onClick:n},ev.createElement(tn.Icon,{className:"cursor-pointer rounded-full hover:bg-appcolor-400",icon:a?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})),!a&&ev.createElement("div",{className:"flex"},ev.createElement("input",{...t("dueDateType"),type:"checkbox",id:"due-date-created-by-me-filter",value:p.CreatedByMe,className:"hidden"}),ev.createElement("label",{className:"flex h-max w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:"due-date-created-by-me-filter"},ev.createElement("div",{className:"flex items-center"},ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"addon_date",className:"text-appcolor-500"}))),ev.createElement("span",{className:"ml-2 text-sm"},ev.createElement(eY.Z,{id:"general.due_date_created_by_me",defaultMessage:"Created by me"}))),l("dueDateType")===p.CreatedByMe&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"}))))},e$S=eL.default.input.attrs({type:"radio"}).withConfig({displayName:"RadioButton__StyledRadioButton",componentId:"sc-ef9047d9-0"})` + appearance: none; + outline: none; + transition: border-color 30ms ease-in-out; + width: 1rem; + height: 1rem; + border-radius: 50%; + border: 0.15rem solid currentColor; + font: inherit; + margin: 0; + position: relative; + + &:hover { + border-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + + &::before { + position: absolute; + display: block; + top: -2px; + left: -2px; + + width: 1rem; + height: 1rem; + border-radius: 50%; + background-color: ${e=>e.theme.appColors.hex(0)}; + transition: 0.4s; + transform: scale(0); + } + + &:checked { + border-color: ${e=>e.theme.primaryColorScheme?.base}; + + &::before { + content: ''; + transform: scale(0.5); + box-shadow: inset 16px 0 0 0 ${e=>e.theme.primaryColorScheme?.base}; + } + } +`,e$I=ev.forwardRef(function(e,t){let{className:a,...n}=e;return ev.createElement(e$S,{ref:t,type:"radio",className:a,...n})}),e$D={[x.PastDue]:(0,te.Em)({id:"general.past_due",defaultMessage:"Past Due"}),[x.Today]:(0,te.Em)({id:"general.today",defaultMessage:"Today"}),[x.Upcoming]:(0,te.Em)({id:"general.upcoming",defaultMessage:"Upcoming"}),[x.NoDate]:(0,te.Em)({id:"general.no_date",defaultMessage:"No Date"})},e$T=function(e){let{register:t,value:a}=e;return ev.createElement("label",{className:"flex w-full cursor-pointer items-center rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:`due-date-section-${a}-filter`},ev.createElement("span",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement(e$I,{...t("dueDateSection"),className:"cursor-pointer text-appcolor-400 group-hover:border-primary",id:`due-date-section-${a}-filter`,value:a})),ev.createElement("span",{className:"ml-2"},ev.createElement(eY.Z,e$D[a])))},e$$=function(e){let{register:t,isClosed:a,onToggle:n}=e;return ev.createElement(ev.Fragment,null,ev.createElement("h3",{className:"mb-1 flex cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700",onClick:n},ev.createElement(tn.Icon,{className:"cursor-pointer rounded-full hover:bg-appcolor-400",icon:a?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.type",defaultMessage:"Type"})),!a&&ev.createElement("div",{className:"mb-4 flex flex-col"},ev.createElement(e$T,{value:x.PastDue,register:t}),ev.createElement(e$T,{value:x.Today,register:t}),ev.createElement(e$T,{value:x.Upcoming,register:t}),ev.createElement(e$T,{value:x.NoDate,register:t})))},e$P=function(e){let{space:t,count:a,isChecked:n,inputField:l}=e;return ev.createElement("div",{className:"flex w-full items-center rounded-lg pl-7 pr-3 hover:bg-appcolor-200"},ev.createElement("div",{className:"flex w-full items-center"},ev.createElement("div",{className:"flex h-6 w-6 items-center justify-center"},ev.createElement(nA,{space:t,size:"xs"})),l,ev.createElement("label",{htmlFor:`space-${t.id}`,className:"ml-2 flex h-8 grow cursor-pointer items-center justify-between"},ev.createElement("div",{className:"flex items-center gap-x-2"},ev.createElement("span",{className:"max-w-[8rem] overflow-hidden text-ellipsis whitespace-nowrap text-sm max-[1040px]:max-w-[6rem] max-lg:max-w-[16rem] max-[615px]:max-w-[10rem]"},t.name),ev.createElement("span",{className:og()("ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600",{hidden:0===a})},a)))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"}))},e$F=function(e){let{spaceId:t,count:a,isChecked:n,inputField:l}=e;return ev.createElement("div",{className:"flex w-full items-center rounded-lg pl-7 pr-3 hover:bg-appcolor-200"},ev.createElement("div",{className:"flex w-full items-center"},ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"home",width:16,height:16,className:"text-appcolor-500"})),l,ev.createElement("label",{htmlFor:`space-${t}`,className:"ml-2 flex h-8 grow cursor-pointer items-center justify-between"},ev.createElement("div",{className:"flex items-center"},ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"})),ev.createElement("span",{className:og()("ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600",{hidden:0===a})},a)))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"shrink-0 fill-appcolor-500"}))},e$A=function(e){let{register:t,getValues:a}=e;return ev.createElement("div",{className:"flex"},ev.createElement("input",{...t("projectType"),type:"checkbox",id:"project-type-external-collaborator-filter",value:N.ExternalCollaborator,className:"hidden"}),ev.createElement("label",{className:"flex h-max w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:"project-type-external-collaborator-filter"},ev.createElement("div",{className:"flex items-center"},ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"sidebar_shared",height:18,width:18,className:"text-appcolor-500"}))),ev.createElement("span",{className:"ml-2 text-sm"},ev.createElement(eY.Z,{id:"general.shared_with_me",defaultMessage:"Shared with me"}))),a("projectType")===N.ExternalCollaborator&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},e$R=function(e){let{spaceHomeAndFolderIds:t,workspaceTree:a,isChecked:n,onFold:l,onSpaceFilterChange:r,onFormChange:o,workspaceRootFoldedMap:i}=e;return ev.createElement("div",{className:"flex w-full items-center justify-between rounded-lg py-1.5 pl-5 pr-3 hover:bg-appcolor-200"},ev.createElement("div",{className:"relative flex grow cursor-pointer items-center",onClick:e=>{r(e,t,n,!0),o()}},ev.createElement(tn.Icon,{icon:i.get(t[0])?"default_caret_right":"default_caret_down",className:"duration-250 absolute -left-5 mr-2 cursor-pointer rounded-full text-appcolor-500 opacity-0 transition ease-in-out hover:text-appcolor-700 group-hover/fold:opacity-100",onClick:e=>{e.stopPropagation(),l(e,t[0])}}),ev.createElement("div",{className:"flex h-5 w-5 items-center"},ev.createElement(nA,{space:a.homeFolder.space,size:"xs",className:"shrink-0 scale-90 cursor-default"})),ev.createElement("div",{className:"ml-2 flex items-center"},ev.createElement("span",{className:"max-w-[10rem] overflow-hidden text-ellipsis whitespace-nowrap text-sm max-[1040px]:max-w-[8rem]"},a.homeFolder.space.name),ev.createElement("span",{className:og()("ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600",{hidden:0===a.count})},a.count))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"}))},e$j=function(e){let{searchResult:t,rightPanelDispatch:a}=e,{state:n,dispatch:l}=function(){let e=ev.useContext(e$E);return(0,ei.assert)(null!=e,"SearchContextProvider not available"),e}(),r=(0,eF.k6)(),{isSidebarClosed:o,isFoldersClosed:i,isWorkspaceRootFoldedMap:s,filtersMap:d,isAssignmentsClosed:c,isDueDateClosed:m,isDueDateSectionClosed:u}=n,{filterby:p}=e$_(),{data:g}=(0,eB.a)(e$x,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-and-network"}),f=ev.useMemo(()=>({type:e$k,spaceIds:p.spaceIds??[],assignees:p.assignees??[],assigneeType:p.assigneeType??void 0,dueDateType:p.dueDateType??void 0,dueDateSection:p.dueDateSection??void 0,projectType:p.projectType??void 0}),[p]),{register:h,getValues:y,setValue:b,reset:v}=(0,sz.cI)({defaultValues:f});ev.useEffect(()=>{v(f)},[f,v]);let{workspaceTrees:k}=ev.useMemo(()=>(function(e){let t={},a=new Map;for(let n of e)if(null==n.space.parent_id){let e=n.space.id,l=a.get(e)?.folders??new Map;for(let a of t[e]??[])l.set(a.space.id,a);let r={id:e,order:n.order,homeFolder:n,folders:l,count:0};a.set(e,r),delete t[e]}else{let e=n.space.parent_id,l=a.get(e);null==l?null==t[e]?t[e]=[n]:t[e]=[...t[e]??[],n]:l.folders.set(n.space.id,n)}return{workspaceTrees:a}})(g?.memberships?.edges?.map(e=>e.node)??[]),[g?.memberships?.edges]);ev.useEffect(()=>{if(t.loading)return;let e=new Map,a=new Map,n=new Map,r=new Map,o=new Map;for(let[e]of k)k.get(e).count=0;for(let l of t.data?.search?.filters??[])switch(l.id){case"type":for(let t of l.values)r.set(t.id,t),e.set(l.id,r);break;case"workspace":for(let t of l.values)for(let[n]of(a.set(t.id,t),e.set(l.id,a),k))k.has(t.id)&&t.id===n&&(k.get(t.id).count+=t.count),k.get(n)?.folders.get(t.id)!=null&&(k.get(n).count+=t.count);break;case"document":for(let t of l.values)n.set(t.id,t),e.set(l.id,n);break;case"completed":for(let t of l.values)"notCompleted"===t.id&&e.set("completed",new Map([[t.id,t]]));break;case"assignees":for(let e of l.values)o.set(e.id,e);e.set(l.id,o);break;default:continue}l({type:"init_filters_map",map:e}),0===s.size&&l({type:"workspace_root_toggle",spaceIds:Array.from(k.keys()),isFolded:!0})},[t.data?.search?.filters,t.loading,k,s.size,l]);let E=ev.useCallback((e,t)=>{(null==s.get(t)||!0===s.get(t))&&l({type:"workspace_root_toggle",spaceIds:[t],isFolded:!1}),!1===s.get(t)&&l({type:"workspace_root_toggle",spaceIds:[t],isFolded:!0})},[l,s]),x=()=>{let e=new URLSearchParams;for(let t of y("spaceIds"))e.append("spaceIds",t);for(let t of y("assignees"))e.append("assignees",t);let t=y("assigneeType");null==t||ts()(t)?e.delete("assigneeType"):e.set("assigneeType",t);let n=y("dueDateType");null!=n&&"string"==typeof n&&e.set("dueDateType",n);let l=y("dueDateSection");null!=l&&"string"==typeof l&&e.set("dueDateSection",l);let o=y("projectType");null!=o&&"string"==typeof o&&e.set("projectType",o),a({type:"close"}),r.push({pathname:"/my-tasks",search:e.toString()})},_=ev.useCallback((e,t,a,n)=>{let l=new Set(y("spaceIds"));if(n&&!1===a)for(let e of t)l.add(e);else if(n&&!0===a)for(let e of t)l.delete(e);else if(l.has(t[0]))for(let e of t)l.delete(e);else for(let e of t)l.add(e);b("spaceIds",Array.from(l))},[y,b]),w=ev.useCallback(e=>{let t=new Set(y("assignees")),a=e.target?.value,n=e.target?.checked;null!=a&&(n?t.add(a):t.delete(a)),b("assignees",Array.from(t))},[y,b]),C=ev.useCallback(e=>{let t=e.target?.value,a=e.target?.checked;null!=t&&(a?b("assigneeType",t):b("assigneeType",void 0))},[b]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:`z-20 flex w-80 flex-col overflow-y-auto border-r border-appcolor-300 px-3 py-4 max-lg:absolute max-lg:right-0 max-lg:h-full max-lg:w-[70%] max-lg:bg-appcolor-100 ${o?"hidden":"visible"}`},ev.createElement("div",{className:"mb-4 flex items-center justify-between px-2"},ev.createElement("span",{className:"mt-0.5 text-base font-medium"},ev.createElement(eY.Z,{id:"general.filters",defaultMessage:"Filters"})),ev.createElement(tn.Icon,{className:"cursor-pointer",icon:"header_sidebar_close",onClick:e=>{l({type:"sidebar_open_toggle"}),e.preventDefault()},width:20,height:20})),ev.createElement("form",{onChange:x},ev.createElement(e$$,{isClosed:u,onToggle:e=>{l({type:"due_date_section_toggle"}),e.preventDefault()},register:h}),ev.createElement(e$C,{getValues:y,isAssignmentsClosed:c,register:h,searchFilterValue:d.get("assignees"),toggleClick:e=>{l({type:"assignments_toggle"}),e.preventDefault()},onChangeAssignees:w,onChangeAssigneeType:C}),ev.createElement("div",{className:"group/fold"},ev.createElement("h3",{className:"mb-1 flex cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700",onClick:e=>{l({type:"folders_toggle"}),e.preventDefault()}},ev.createElement(tn.Icon,{className:"cursor-pointer rounded-full hover:bg-appcolor-400",icon:i?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.workspace_and_folders",defaultMessage:"Workspace & Folders"})),!i&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 hover:bg-appcolor-200",onClick:()=>{b("spaceIds",[]),b("projectType",void 0),x()}},ev.createElement("div",{className:"flex items-center rounded-lg"},ev.createElement("div",{className:"mr-2 flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"dd_filter_workspace",className:"text-appcolor-500"})),ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.all",defaultMessage:"All"}))),ts()(y("spaceIds"))&&y("projectType")!==N.ExternalCollaborator&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})),ev.createElement(e$A,{getValues:y,register:h}),ev.createElement("div",{className:"mb-4"},[...k.keys()].map(e=>{let t=k.get(e),{homeFolder:a,folders:n}=t,l=Array.from(n.keys());l.unshift(t.id);let r=l.every(e=>y("spaceIds").includes(e)),o=a.space.id;return ev.createElement(ev.Fragment,{key:t.id},ev.createElement(e$R,{spaceHomeAndFolderIds:l,workspaceTree:t,isChecked:r,onSpaceFilterChange:_,onFold:E,onFormChange:x,workspaceRootFoldedMap:s}),!s.get(o)&&ev.createElement(e$F,{inputField:ev.createElement("input",{...h("spaceIds"),type:"checkbox",onChange:e=>_(e,[o]),value:o,id:`space-${o}`,className:"hidden"}),spaceId:t.id,isChecked:y("spaceIds").includes(o),count:d.get("workspace")?.get(o)?.count??0}),[...n.keys()].map(e=>{let a=n.get(e);return s.get(t.id)||null==a?null:ev.createElement(ev.Fragment,null,ev.createElement(e$P,{key:e,inputField:ev.createElement("input",{...h("spaceIds"),type:"checkbox",onChange:t=>_(t,[e]),value:e,id:`space-${e}`,className:"hidden"}),space:a.space,isChecked:y("spaceIds").includes(e),count:d.get("workspace")?.get(e)?.count??0}))}))}))),ev.createElement(e$M,{isClosed:m,onToggle:e=>{l({type:"due_date_toggle"}),e.preventDefault()},register:h,getValues:y})))))},e$O=function(e){let{avatar:t,color:a,name:n,size:l}=e,r=(0,ev.useMemo)(()=>null==a?void 0:{primaryColor:a},[a]),o=t?.__typename==="SpaceAvatarsV2Custom"?t?.small?.hdpi.url:void 0,i=t?.__typename==="SpaceAvatarsV2Emoji"?t?.emoji:void 0;return ev.createElement(eI.ThemeProvider,{theme:r},null!=o?ev.createElement(e1.SpaceAvatar,{size:l,src:o,alt:n}):ev.createElement(e1.SpaceAvatar,{size:l,name:i??n}))},e$U={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"TaskFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Task"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"completed"}},{kind:"Field",name:{kind:"Name",value:"start"}},{kind:"Field",name:{kind:"Name",value:"end"}},{kind:"Field",name:{kind:"Name",value:"is_recurring"}},{kind:"Field",name:{kind:"Name",value:"assignees"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},e$Z=function(e){let{task:t,dispatch:a,currentUserId:n}=e,{document_id:l,node_id:r}=t,{users:o,loading:i}=aN({projectId:l}),s=ev.useRef(null),d=ev.useRef(null),[c,m]=ev.useReducer(eI.popupReducer,{expanded:!1}),u=(0,eI.usePopup)({referenceElementRef:s,popupElementRef:d,state:c,placement:"bottom"}),p=(0,eI.useMenuButton)({ref:s,state:c,dispatch:m}),g=t.assignees??[],f=1===g.length,[h]=(0,cs.D)(Fu),y=e=>null!=e&&"object"==typeof e&&"__typename"in e&&"User"===e.__typename,b=g.map(e=>e.handle);return ev.createElement(ev.Fragment,null,ev.createElement(e$L,{className:"max-w-fit rounded-xl px-2 py-2 text-xs hover:bg-appcolor-300",...p.props,onClick:()=>{c.expanded?m({type:"Collapse"}):m({type:"Expand"})}},0===g.length?ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:"addon_assign"}),ev.createElement(eY.Z,{id:"general.add_assignee",defaultMessage:"Add assignee"})):ev.createElement(ev.Fragment,null,ev.createElement(e$z,{$isSingleAvatar:f},g.map(e=>ev.createElement(e$B,{key:e.id,src:e.avatars_v2?.small?.mdpi.url,alt:e.handle}))),ev.createElement(e$V,{className:"inline-block overflow-hidden text-ellipsis whitespace-nowrap text-appcolor-900"},b.join(", ")))),c.expanded&&ev.createElement(eI.Popup,{...u.props,dispatch:m,modal:!0},i?ev.createElement(eI.Spinner,null):ev.createElement(a_,{members:o,currentUserId:n,hideUserPresence:!0,onUserSelect:e=>{y(e)&&(h({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:l,nodeIds:[r],assigneeId:e.id}},update:a=>{let n=a.readFragment({fragment:e$U,id:a.identify({__typename:"Task",id:t.id})});if(null==n)return;let l=(0,es.ZP)(n,t=>(null==t.assignees?t.assignees=[e]:t.assignees.some(t=>t.id===e.id)?t.assignees=t.assignees.filter(t=>t.id!==e.id):t.assignees=[...t.assignees,e],t));a.writeFragment({fragment:e$U,id:a.identify({__typename:"Task",id:t.id}),data:l})}}),a({type:"update_assignee",payload:{assignee:e}}))},onPopupClose:()=>{},onPopupBlur:()=>{},assignees:g})))},e$L=eL.default.button.withConfig({displayName:"AssigneeDropdown__Button",componentId:"sc-a7ae0ebc-0"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + column-gap: ${eI.UiSpacing.getRem(2)}; + color: ${e=>e.theme.textColors.hex(50)}; + margin-left: ${eI.UiSpacing.getPx(.5)}; +`,e$B=(0,eL.default)(e1.UserAvatar).attrs({size:"xs",shape:"circle"}).withConfig({displayName:"AssigneeDropdown__Avatar",componentId:"sc-a7ae0ebc-1"})` + border-radius: 50%; + background-color: white; + margin-right: -5px; +`,e$z=eL.default.div.withConfig({displayName:"AssigneeDropdown__AvatarCircleWrapper",componentId:"sc-a7ae0ebc-2"})` + display: inline-flex; + margin-right: ${e=>e.$isSingleAvatar?"3px":"8px"}; +`,e$V=eL.default.span.withConfig({displayName:"AssigneeDropdown__Assignees",componentId:"sc-a7ae0ebc-3"})` + white-space: nowrap; +`,e$q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectNodesCompletionUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectNodesCompletionUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectNodesCompletionUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"tasks"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"completed"}},{kind:"Field",name:{kind:"Name",value:"end"}},{kind:"Field",name:{kind:"Name",value:"start"}}]}}]}}]}}]},e$W=function(e){let{task:t,documentId:a,dispatch:n}=e,[l]=(0,cs.D)(e$q);return ev.createElement("button",{className:"flex items-center rounded-2xl bg-appcolor-200 px-3 py-1.5 text-sm text-appcolor-900 hover:bg-appcolor-300",onClick:()=>{let e=!t.completed;l({variables:{input:{clientMutationId:(0,ld.Z)(),nodeIds:[t.node_id],projectId:a,completed:e}},update:(e,a)=>{let l=e.readFragment({fragment:e$U,id:e.identify({__typename:"Task",id:t.id})});if(null==l)return;let r=a.data?.projectNodesCompletionUpdate?.tasks?.[0];null!=r&&(n({type:"update_task",payload:{task:r}}),e.writeFragment({fragment:e$U,id:e.identify({__typename:"Task",id:t.id}),data:{...l,...r}}))}})}},ev.createElement(tn.Icon,{icon:"dd_check"}),t.completed?ev.createElement(eY.Z,{id:"general.completed",defaultMessage:"Completed"}):ev.createElement(eY.Z,{id:"general.check",defaultMessage:"Check"}))},e$H=function(e){let{documentId:t,nodeId:a}=e,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"top",visible:n});return ev.createElement(ev.Fragment,null,ev.createElement("button",{onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},...c,className:"rounded-lg px-2 py-1 hover:bg-appcolor-300",onClick:()=>{let e=new URL("https://www.taskade.com");e.pathname=`/d/${t}`,e.hash=`#node-${a}`,R4()(e.href)}},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_copylink"})),n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"})))};(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-da0f3eb5-0"})` + display: flex; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + width: ${eI.UiSpacing.getPx(64)}; + ${e=>null!=e.width&&(0,eL.css)` + width: ${e.width}; + `} + ${e=>null!=e.padding&&(0,eL.css)` + padding: ${e.padding}; + `} +`,eL.default.button.withConfig({displayName:"styled__DatePill",componentId:"sc-da0f3eb5-1"})` + ${e1.UiTypography.xs}; + + display: flex; + align-items: center; + column-gap: 4px; + + padding: ${eI.UiSpacing.getPx(.5)} ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(.5)} + ${eI.UiSpacing.getPx(2)}; + + border-radius: 20px; + + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(20)}; +`;let e$G=eL.default.div.withConfig({displayName:"styled__MenuContainer",componentId:"sc-da0f3eb5-2"})` + display: flex; + flex-direction: column; + padding: ${eI.UiSpacing.getPx(3.5)} 0; +`,e$K=eL.default.div.withConfig({displayName:"styled__CalendarPickerWrapper",componentId:"sc-da0f3eb5-3"})` + margin: 0 ${eI.UiSpacing.getPx(3.5)} ${eI.UiSpacing.getPx(3)}; +`,e$Y=eL.default.div.withConfig({displayName:"styled__Footer",componentId:"sc-da0f3eb5-4"})` + display: flex; + padding: 10px ${eI.UiSpacing.getPx(3)} 0; + column-gap: ${eI.UiSpacing.getPx(2)}; +`,e$Q=eL.default.button.withConfig({displayName:"styled__ButtonBase",componentId:"sc-da0f3eb5-5"})` + ${e1.UiTypography.sm}; + ${e1.UiBorderRadius.md}; + + padding: ${eI.UiSpacing.getPx(1.5)} ${eI.UiSpacing.getPx(3)}; + + display: flex; + background: none; + width: 49%; + border: 0; + font-weight: 500; + margin: 0; + outline: 0; + cursor: pointer; + justify-content: center; + + &:focus { + outline: 0; + } +`,e$J=(0,eL.default)(e$Q).withConfig({displayName:"styled__DeleteButton",componentId:"sc-da0f3eb5-6"})` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(30)}; + + &:hover { + color: ${e=>e.theme.textColors.hex(40)}; + } +`,e$X=(0,eL.default)(e$Q).withConfig({displayName:"styled__CancelButton",componentId:"sc-da0f3eb5-7"})` + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(50)}; + + &:hover { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,e$0=(0,eL.default)(e$Q).withConfig({displayName:"styled__SetButton",componentId:"sc-da0f3eb5-8"})` + color: ${e=>e.disabled?e.theme.textColors.hex(60):"#FFF"}; + + background: ${e=>e.disabled?e.theme.primaryColorScheme?.alpha50:e.theme?.primaryColorScheme?.base}; + + &:hover { + background: ${e=>e.disabled?e.theme.primaryColorScheme?.alpha50:e.theme?.primaryColorScheme?.alpha80}; + } +`,e$1=function(e){let{userTimezone:t,dateDuration:a,handleCancel:n,handleDelete:l,handleSave:o}=e,d=ev.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),{pickerProps:c,dispatch:m,output:u}=nx({pickerMode:r.End,startDate:a?.startMoment??null,startTime:a?.toDisplayState().startTime??null,endDate:a?.endMoment??null,endTime:a?.toDisplayState().endTime??null,quirks:{dateDependencyMode:i.MustHaveEnd,disableTime:!1,sameDateNoTimeResolutionStrategy:s.EndDate,autoSwitchMode:!1}});ev.useEffect(()=>{if(null==a){m({type:"update_state",startDate:null,startTime:null,endDate:null,endTime:null});return}let{startDate:e,startTime:t,endDate:n,endTime:l}=a.toDisplayState();m({type:"update_state",startDate:e,startTime:t,endDate:n,endTime:l})},[m,a]);let p=ev.useCallback(()=>{let{startDate:e,startTime:a,endDate:n,endTime:l}=u,r=ez.DateDuration.fromDisplayState({startDate:e,startTime:a,endDate:n,endTime:l,startTimezone:t,endTimezone:t});null!=r&&o(r)},[u,t,o]),g=ev.useCallback(()=>{l()},[l]),f=ev.useCallback(()=>{n()},[n]),h=ev.useMemo(()=>{let{endDate:e}=u;return null==e},[u]),y=ev.useCallback(e=>{e.key!==eI.KeyboardKeys.Escape&&e.nativeEvent.stopImmediatePropagation()},[]),b=eG().localeData().longDateFormat("L"),v=`e.g. ${eG()("2:30 AM","hh:mm A").format("LT")}`;return ev.createElement(e$G,{onClick:d,onMouseDown:e=>{e.stopPropagation()},onKeyDown:y},ev.createElement(e$K,null,ev.createElement(ny,{pickerProps:c,focusPlaceholderDateStart:b,focusPlaceholderDateEnd:b,focusPlaceholderTimeStart:v,focusPlaceholderTimeEnd:v,formatDate:b,formatTime:"LT"})),ev.createElement(e$Y,null,null!=a?ev.createElement(e$J,{type:"button",onClick:g},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})):ev.createElement(e$X,{type:"button",onClick:f},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(e$0,{type:"button",onClick:p,disabled:h},null!=a?ev.createElement(eY.Z,{id:"general.change",defaultMessage:"Change"}):ev.createElement(eY.Z,{id:"general.set",defaultMessage:"Set"}))))},e$2={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TaskDueDateUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TaskDueDateUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"taskDueDateUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},e$5=(0,eL.default)(eI.Menu).withConfig({displayName:"DateDropdown__StyledMenu",componentId:"sc-cb77a2b6-0"})` + display: flex; + flex-direction: column; + background: ${e=>e.theme.appColors.hex(100)}; + border-radius: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + width: ${eI.UiSpacing.getPx(64)}; + ${e=>null!=e.width&&(0,eL.css)` + width: ${e.width}; + `} + ${e=>null!=e.padding&&(0,eL.css)` + padding: ${e.padding}; + `} +`,e$3=function(e){let{task:t,userTimezone:a,dispatch:n,className:l}=e,{document_id:r,node_id:o}=t,i=ev.useRef(null),s=ev.useRef(null),[d,c]=ev.useReducer(eI.popupReducer,{expanded:!1}),m=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:d,placement:"bottom"}),u=(0,eI.useMenuButton)({ref:i,state:d,dispatch:c}),[p]=(0,cs.D)(lp),[g]=(0,cs.D)(e$2),f=ev.useMemo(()=>()=>{d.expanded?c({type:"Collapse"}):c({type:"Expand",payload:"first"})},[d.expanded]),h=ev.useCallback(()=>{d.expanded&&c({type:"Collapse"})},[d.expanded]),y=ev.useCallback(()=>{d.expanded&&c({type:"Collapse"}),p({variables:{input:{clientMutationId:(0,ld.Z)(),projectId:r,nodeIds:[o],dateAttachment:null}},update:e=>{let a=e.readFragment({fragment:e$U,id:e.identify({__typename:"Task",id:t.id})});if(null==a)return;let n=(0,es.ZP)(a,e=>{e.start=null,e.end=null});e.writeFragment({fragment:e$U,id:e.identify({__typename:"Task",id:t.id}),data:n})}}),n({type:"update_duration",payload:{duration:null}})},[n,r,o,d.expanded,p,t.id]),b=ev.useCallback(e=>{d.expanded&&c({type:"Collapse"});let a=(0,ld.Z)(),l=e.toDateRangeDesc();g({variables:{input:{clientMutationId:a,projectId:r,nodeId:o,dateRangeDesc:l}},update:e=>{let a=e.readFragment({fragment:e$U,id:e.identify({__typename:"Task",id:t.id})});if(null==a)return;let n=(0,es.ZP)(a,e=>{e.start=l.start,e.end=l?.end??null});e.writeFragment({fragment:e$U,id:e.identify({__typename:"Task",id:t.id}),data:n})}}),n({type:"update_duration",payload:{duration:e}})},[n,r,o,d.expanded,t.id,g]),v=ev.useMemo(()=>null==t.start?null:ez.DateDuration.fromDateRangeDesc({start:t.start,end:t.end}),[t.end,t.start]),k=null!=v,E=(0,ev.useMemo)(()=>null==v?"":v.toReadableFormat({timezone:a}),[v,a]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...u.props,onClick:f,className:og()(l,"ml-1 flex max-w-fit items-center gap-x-2 rounded-xl px-2 py-2 text-sm hover:bg-appcolor-300",!k&&"text-appcolor-500",{"border-danger text-danger":v?.toRelativeStatus()==="has_ended"})},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:t.is_recurring?"date_repeat":"dd_date"}),ev.createElement("div",{className:"inline-block overflow-hidden text-ellipsis whitespace-nowrap text-xs"},k?E:ev.createElement(eY.Z,{id:"general.add_due_date",defaultMessage:"Add due date"}))),d.expanded&&ev.createElement(eI.Popup,{...m.props,modal:!0,dispatch:c},ev.createElement(e$5,{initialFocus:m.initialFocus,loop:!0},ev.createElement(e$1,{dateDuration:v,userTimezone:a,handleCancel:h,handleDelete:y,handleSave:b}))))};class e$4 extends XV.TextNode{static getType(){return"mention"}static clone(e){return new e$4(e.__text,e.__key)}constructor(e,t){super(e,t)}createDOM(e){let t=super.createDOM(e);return t.classList.add("text-primary","hover:cursor-pointer","hover:underline"),t}}function e$6(e,t){t.attributes?.bold===!0&&e.toggleFormat("bold"),t.attributes?.italic===!0&&e.toggleFormat("italic"),t.attributes?.underline===!0&&e.toggleFormat("underline")}function e$8(e){let t;return e.hasFormat("bold")&&((t={}).bold=!0),e.hasFormat("italic")&&((t={...t}).italic=!0),e.hasFormat("underline")&&((t={...t}).underline=!0),t}function e$7(e){let t=(0,XV.$getRoot)();t.clear();let a=(0,XV.$createParagraphNode)();for(let t of e.ops){let e;if("string"==typeof t.insert&&("\n"!==t.insert||t.attributes?.paragraph!==!0)){if("string"==typeof t.insert&&t.attributes?.mention===!0){let a=function(e){let t=new e$4(e);return t.setMode("token").toggleDirectionless(),t}(t.insert);e$6(a,t),e=a}else if("string"==typeof t.insert&&"string"==typeof t.attributes?.link){let a=(0,XA.$createLinkNode)(t.attributes.link),n=(0,XV.$createTextNode)(t.insert);e$6(n,t),a.append(n),e=a}else{let a=(0,XV.$createTextNode)(t.insert);e$6(a,t),e=a}a.append(e)}}t.append(a)}class e$9 extends XV.TextNode{static getType(){return"hashtag"}static clone(e){return new e$9(e.__text,e.__key)}constructor(e,t){super(e,t)}createDOM(e){let t=super.createDOM(e);return t.classList.add("text-primary","hover:cursor-pointer","hover:underline"),t}}class ePe extends XV.ElementNode{__url;constructor(e,t){super(t),this.__url=(0,sX.normalizeUrl)(e)??e}setURL(e){this.getWritable().__url=(0,sX.normalizeUrl)(e)??e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}static getType(){return"link_inline"}static clone(e){return new ePe(e.__url,e.__key)}createDOM(e){let t=document.createElement("a");return t.setAttribute("href",this.__url),(0,ey3.addClassNamesToElement)(t,e.theme.link),t}updateDOM(e,t){return t.setAttribute("href",this.__url),!0}}function ePt(e){return e instanceof ePe}function ePa(){let e=(0,XV.$getRoot)().getChildAtIndex(0);(0,ei.assert)((0,XV.$isParagraphNode)(e),"expecting first child to be ParagraphNode");let t=new(CI())({ops:[]});for(let a of e.getChildren()){let e;if(a instanceof e$4&&(e={mention:!0}),(0,XA.$isAutoLinkNode)(a)){let t=a.getChildAtIndex(0);(0,XV.$isTextNode)(t)&&(e={...e,...e$8(t)})}else if((0,XA.$isLinkNode)(a)){e={link:a.getURL()};let t=a.getChildAtIndex(0);(0,XV.$isTextNode)(t)&&(e={...e,...e$8(t)})}if((0,XV.$isTextNode)(a)){let t=e$8(a);null!=t&&(e={...e,...t})}let n={insert:a.getTextContent()};null!=e&&(n.attributes=e),t=t.concat(new(CI())({ops:[n]}))}return t.concat(new(CI())({ops:[{insert:"\n",attributes:{paragraph:!0}}]}))}let ePn=ev.forwardRef(function(e,t){let{onChange:a}=e,[n]=(0,XW.useLexicalComposerContext)();return ev.useImperativeHandle(t,()=>({rewrite(e){n.update(()=>{let t=(0,XV.$getSelection)();if((0,XV.$isRangeSelection)(t)){let a=ePa().diff(e),l=(0,XG.$createOffsetView)(n),[r,o]=l.getOffsetsFromSelection(t);r=a.transformPosition(r),o=a.transformPosition(o),e$7(e);let i=(l=(0,XG.$createOffsetView)(n)).createSelectionFromOffsets(r,o);(0,XV.$setSelection)(i)}else e$7(e),(0,XV.$setSelection)(null)},{tag:"external-update"})}}),[n]),ev.useLayoutEffect(()=>n.registerUpdateListener(e=>{let{dirtyElements:t,dirtyLeaves:n,editorState:l,tags:r}=e;!(r.has("external-update")||r.has("history-merge"))&&(0!==t.size||0!==n.size)&&l.read(()=>{let e=ePa();a?.(e)})}),[n,a]),null});var ePl=a(43334);let ePr=function(){let e=ev.useCallback(e=>{let t=(0,sX.extractHashtagsWithIndices)(e);if(0===t.length)return null;let[a,n]=t[0].indices;return{start:a,end:n}},[]),t=ev.useCallback(e=>(function(e){let t=new e$9(e);return t.setMode("normal").toggleDirectionless(),t})(e.getTextContent()),[]);return(0,ePl.useLexicalTextEntity)(e,e$9,t),null},ePo=function(){let[e]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>{let t=e.registerCommand(XV.KEY_ENTER_COMMAND,e=>(e?.preventDefault(),!0),XV.COMMAND_PRIORITY_HIGH);return()=>{t()}},[e]),null};function ePi(e){let t=e.getChildren();for(let a=t.length-1;a>=0;a--)e.insertAfter(t[a]);e.remove()}let ePs=function(){let[e]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>(e.hasNodes([ePe])||(0,ei.assert)(!1,"LinkInlinePlugin: LinkInlineNode not registered on editor"),e.registerNodeTransform(XV.TextNode,e=>{let t=e.getParentOrThrow(),a=e.getPreviousSibling(),n=e.getNextSibling();if(ePt(t)){if(t.getTextContent()===e.getTextContent()){if(t.setURL(t.getTextContent()),(0,sX.extractUrlsWithIndices)(t.getTextContent()).length>0)return;ePi(t);return}let a=(0,sX.extractUrlsWithIndices)(t.getTextContent());if(a.length>0){let{url:n,indices:l}=a[0];if(l[1]0){let{url:t,indices:l}=n[0],r=l[0]a.getTextContent().length;if(r&&o){a.append(e),a.setURL(t);return}}else ePi(a)}if(ePt(n)){let t=`${e.getTextContent()}${n.getTextContent()}`,a=(0,sX.extractUrlsWithIndices)(t);if(a.length>0){let{url:t,indices:l}=a[a.length-1],r=l[0]=e.getTextContent().length;if(r&&o){let[,a]=e.splitText(...l);n.splice(0,0,[a]),n.setURL(t);return}}else ePi(n)}let l=(0,sX.extractUrlsWithIndices)(e.getTextContent());if(0===l.length)return;l.reverse();let r=e;for(let{url:e,indices:t}of l){let a;let n=new ePe(e);[r,a]=r.splitText(...t);let l=(0,XV.$createTextNode)(e);n.append(l),a.replace(n)}})),[e]),null},ePd=function(){let[e]=(0,XW.useLexicalComposerContext)();return ev.useEffect(()=>e.registerCommand(XV.PASTE_COMMAND,t=>(t.preventDefault(),e.update(()=>{let e=(0,XV.$getSelection)(),a=t instanceof InputEvent||t instanceof KeyboardEvent?null:t.clipboardData;null!=a&&(0,XV.$isRangeSelection)(e)&&function(e,t){let a=e.getData("text/plain")||e.getData("text/uri-list");null!=a&&t.insertRawText(a.replaceAll("\n"," "))}(a,e)}),!0),XV.COMMAND_PRIORITY_HIGH),[e]),null},ePc=function(e){let{placeholder:t}=e,[a]=(0,XW.useLexicalComposerContext)(),n=(0,ebs.useLexicalIsTextContentEmpty)(a);return ev.useEffect(()=>{let e=a.getRootElement();null!=e&&(n&&null!=t?e.setAttribute("placeholder",t):e.removeAttribute("placeholder"))},[a,n,t]),null},ePm=eL.default.div.withConfig({displayName:"LexicalEditor__Container",componentId:"sc-937cf2ec-0"})` + ${RQ}; +`,ePu=ev.forwardRef(function(e,t){let{initialDelta:a,className:n,isReadOnly:l,onChange:r,onInlineMarkClick:o,placeholder:i}=e,[s]=ev.useState(a),d=ev.useMemo(()=>({editorState:()=>{e$7(s)},namespace:"LexicalEditor",theme:{text:{italic:"italic",bold:"font-bold",underline:"underline"},link:"hover:cursor-pointer hover:underline text-primary",paragraph:"text-base"},onError:console.error,editable:!l,nodes:[ePe,XA.LinkNode,e$4,e$9]}),[s,l]),c=ev.useCallback((e,t,a)=>{t.update(()=>{let e=(0,XV.$getNodeByKey)(a);e instanceof e$4?o?.({type:"mention",mention:e.__text}):e instanceof e$9?o?.({type:"hashtag",hashtag:e.__text}):e instanceof XA.LinkNode?o?.({type:"link",url:e.__url,target:e.__target}):e instanceof ePe&&o?.({type:"link",url:e.__url,target:null})})},[o]),m=ev.useRef(null);return ev.useImperativeHandle(t,()=>({rewrite(e){m.current?.rewrite(e)}}),[]),ev.createElement(ePm,{className:n},ev.createElement(Xj.LexicalComposer,{initialConfig:d},ev.createElement(XL.RichTextPlugin,{contentEditable:ev.createElement(XO.ContentEditable,{className:"before:absolute before:text-base before:text-textcolor-400 before:content-[attr(placeholder)]"}),placeholder:null,ErrorBoundary:XZ()}),ev.createElement(ePn,{ref:m,onChange:r}),ev.createElement(ePr,null),ev.createElement(ePs,null),ev.createElement(ePo,null),ev.createElement(eyq.HistoryPlugin,null),ev.createElement(eyW.NodeEventPlugin,{nodeType:e$4,eventType:"click",eventListener:c}),ev.createElement(ePc,{placeholder:i}),ev.createElement(ePd,null),ev.createElement(eyW.NodeEventPlugin,{nodeType:e$9,eventType:"click",eventListener:c}),ev.createElement(eyW.NodeEventPlugin,{nodeType:XA.LinkNode,eventType:"click",eventListener:c}),ev.createElement(eyW.NodeEventPlugin,{nodeType:ePe,eventType:"click",eventListener:c})))}),ePp={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"TaskDeltaFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Task"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"text_string"}},{kind:"Field",name:{kind:"Name",value:"delta"}},{kind:"Field",name:{kind:"Name",value:"revision"}}]}}]};var ePg=a(30375);let ePf=(0,lb.C)({initial:"idle",predictableActionArguments:!0,states:{idle:{invoke:{src:"updateApolloCache"},after:{500:{target:"will_sync",cond:(e,t)=>e.lastGoodCollaborationState.editorState.diff(e.editorState).length()>0}},on:{EDITOR_UPDATED:[{target:"will_sync",actions:[ePg.assign({editorState:(e,t)=>t.editorState})],cond:(e,t)=>e.lastGoodCollaborationState.editorState.diff(t.editorState).length()>0},{actions:[ePg.assign({editorState:(e,t)=>t.editorState})]}],TASK_RESET:{target:"resetting",actions:[ePg.assign({task:(e,t)=>t.task,editorState:(e,t)=>new(CI())(t.task.delta.ops),lastGoodCollaborationState:(e,t)=>({editorState:new(CI())(t.task.delta.ops),revision:t.task.revision})})],cond:(e,t)=>e.task.id!==t.task.id}}},will_sync:{after:{500:{target:"syncing"}},on:{EDITOR_UPDATED:{target:"will_sync",actions:[ePg.assign({editorState:(e,t)=>t.editorState})]}}},syncing:{invoke:{src:"submitChangeset",onDone:[{target:"idle",actions:[ePg.assign({lastGoodCollaborationState:(e,t)=>t.data})],cond:(e,t)=>{let a=t.data;return 0===e.editorState.diff(a.editorState).length()}},{target:"resetting",actions:[ePg.assign({lastGoodCollaborationState:(e,t)=>t.data})],cond:(e,t)=>{let a=t.data;return e.editorState.diff(a.editorState).length()>0}}],onError:{target:"sync_error",actions:[ePg.assign({editorState:e=>e.lastGoodCollaborationState.editorState})]}}},sync_error:{invoke:{src:"rewriteEditor",onDone:{target:"idle",actions:[ePg.assign({editorState:e=>e.lastGoodCollaborationState.editorState})]}}},resetting:{invoke:{src:"rewriteEditor",onDone:{target:"idle",actions:[ePg.assign({editorState:e=>e.lastGoodCollaborationState.editorState})]}}}}}),ePh=(0,e$.connect)(function(e){return{siteId:_$(e)}})(function(e){let{task:t,panelDispatch:a,siteId:n}=e,l=(0,eK.Z)(),r=(0,ll.x)(),o=ev.useRef(null),[i]=ev.useState(()=>new(CI())(t.delta.ops)),s=ev.useCallback(async e=>{let t=e.lastGoodCollaborationState.editorState,n=e.lastGoodCollaborationState.revision,l=(0,es.ZP)(e.task,e=>{e.delta={ops:t.ops},e.text_string=(0,lD.textDeltaToString)(t),e.revision=n});r.writeFragment({fragment:ePp,id:r.cache.identify({__typename:"Task",id:e.task.id}),data:l}),a({type:"update_task",payload:{task:l}})},[r,a]),d=ev.useCallback(async e=>{let t=e.lastGoodCollaborationState.editorState.diff(e.editorState).ops,a=e.editorState.diff(e.lastGoodCollaborationState.editorState).ops,l={version:"3",id:e.task.document_id,from:{revision:e.lastGoodCollaborationState.revision},ops:[{p:["nodes",e.task.node_id,"text"],t:"delta",o:{ops:t,inv:a}}],source:{site:n},uuid:(0,O3.SK)()};l.source.release="5.21.0";let r={"X-Requested-With":"XMLHttpRequest",Accept:"application/json","Content-Type":"application/json"},o=u$?.getAnonymousId()??null;null!=o&&(r["X-Anonymous-ID"]=o);let i=await fetch(`/d/${e.task.document_id}/collaborate`,{credentials:"same-origin",method:"POST",headers:r,body:JSON.stringify(l)});(0,ei.assert)(null!=i&&i.ok,"Error making request");let s=await i.json();return function(e,t,a){let n=a.meta.revision,l=new(CI())(t.editorState);for(let r of a.changesets){if(null==r.from){console.warn(`Server changeset without from, assume to be an origin changeset, skipping…`);continue}if(r.from.revisionn){console.warn(`Editor at revision ${n}, unable to apply changeset for revision ${r.from.revision}, queuing it up…`);continue}for(let t of r.ops)"delta"===t.t&&"nodes"===t.p[0]&&t.p[1]===e&&"text"===t.p[2]&&(l=l.compose(new(CI())(t.o.ops)),n=r.to.revision)}return{editorState:l,revision:n}}(e.task.node_id,e.lastGoodCollaborationState,s)},[n]),c=ev.useCallback(async e=>{o.current?.rewrite(e.lastGoodCollaborationState.editorState)},[]),[m,u]=(0,ls.e)(ePf,{context:{editorState:new(CI())(t.delta.ops),task:t,lastGoodCollaborationState:{editorState:new(CI())(t.delta.ops),revision:t.revision}},services:{updateApolloCache:s,submitChangeset:d,rewriteEditor:c}});ev.useEffect(()=>{u({type:"TASK_RESET",task:t})},[u,t]);let p=ev.useCallback(e=>{u({type:"EDITOR_UPDATED",editorState:e})},[u]),g=ev.useCallback(e=>{switch(e.type){case"mention":case"hashtag":break;case"link":window.open(e.url,e.target??"_blank","noopener,noreferrer")}},[]);return ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"flex flex-col transition-colors focus-within:bg-appcolor-200 hover:bg-appcolor-300"},ev.createElement(ePu,{ref:o,className:"py-1.5",initialDelta:i,onChange:p,isReadOnly:!1,placeholder:l.formatMessage({id:"general.untitled",defaultMessage:"Untitled"}),onInlineMarkClick:g})),ev.createElement("div",{className:"mt-1 flex"},ev.createElement("div",{className:og()("flex items-center rounded-full border-[1px] border-appcolor-500 p-0.5 text-xs text-appcolor-500",{"border-success text-success":m.matches("idle"),"border-warning text-warning":m.matches("syncing")})},m.matches("idle")&&ev.createElement(tn.Icon,{icon:"dd_check",className:"h-2 w-2"}),(m.matches("will_sync")||m.matches("syncing"))&&ev.createElement(tn.Icon,{icon:"dd_sync",className:"h-2 w-2"}))))}),ePy=function(e){let{dispatch:t}=e,[a,n]=ev.useState(!1),l=ev.useRef(null),r=ev.useRef(null),o=ev.useRef(null),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:l,arrowElementRef:r,popperElementRef:o,placement:"top",visible:a});return ev.createElement(ev.Fragment,null,ev.createElement("button",{onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},...d,className:"rounded-lg py-1 px-2 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"hide_chat",onClick:()=>{t({type:"close"})}})),a&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})))},ePb=function(e){let{documentId:t,nodeId:a}=e,[n,l]=ev.useState(!1),r=ev.useRef(null),o=ev.useRef(null),i=ev.useRef(null),{arrowProps:s,popperProps:d,referenceProps:c}=(0,eI.useControlledTooltip)({referenceElementRef:r,arrowElementRef:o,popperElementRef:i,placement:"top",visible:n}),m=ev.useMemo(()=>{let e=new URL("https://www.taskade.com");return e.pathname=`/d/${t}`,e.hash=`#node-${a}`,e.href},[t,a]);return null==m?null:ev.createElement(ev.Fragment,null,ev.createElement("a",{onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},...c,className:"cursor-pointer rounded-lg px-2 py-1 hover:bg-appcolor-300",href:m,target:"_blank",rel:"noopener noreferrer"},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_external_link"})),n&&ev.createElement(eI.Tooltip,{arrowProps:s,popperProps:d},ev.createElement(eY.Z,{id:"general.open_in_project",defaultMessage:"Open in project"})))},ePv=function(e){let{state:t,dispatch:a}=e,{task:n}=t,l=(0,eB.a)(sW),r=l.data?.me;if(null==r||null==n)return null;let o=n.document?.shared_preferences?.avatar?.value??null,i=n.document_id,s=n.document?.space?.id;return ev.createElement("div",{className:"h-full w-96 border-l border-appcolor-300"},ev.createElement("div",{className:"flex flex-col gap-y-4"},ev.createElement("div",{className:"flex items-center justify-between border-b border-appcolor-300 px-4 py-3"},ev.createElement("div",{className:"flex items-center gap-x-1"},ev.createElement(e$W,{task:n,documentId:i,dispatch:a}),ev.createElement(e$H,{documentId:i,nodeId:n.node_id}),ev.createElement(ePb,{documentId:i,nodeId:n.node_id})),ev.createElement(ePy,{dispatch:a})),ev.createElement("div",null,ev.createElement("div",{className:"mx-2 px-2 pb-4 pt-2 text-lg"},ev.createElement(ePh,{task:n,panelDispatch:a})),ev.createElement("div",{className:"mt-3 grid max-w-full grid-cols-[25%_75%] grid-rows-4 items-center gap-y-5 px-4"},ev.createElement("div",{className:"text-xs font-medium text-appcolor-500"},ev.createElement(eY.Z,{id:"general.due_date",defaultMessage:"Due Date"})),ev.createElement(e$3,{task:n,dispatch:a,userTimezone:r.timezone??eG().tz.guess()}),ev.createElement("div",{className:"text-xs font-medium text-appcolor-500"},ev.createElement(eY.Z,{id:"general.assignees",defaultMessage:"Assignees"})),ev.createElement(e$Z,{task:n,dispatch:a,currentUserId:r.id}),ev.createElement("div",{className:"text-xs font-medium text-appcolor-500"},ev.createElement(eY.Z,{id:"general.space",defaultMessage:"Space"})),ev.createElement("div",{className:"ml-2 flex h-6 items-center text-xs"},null!=s?ev.createElement(sC.rU,{to:`/spaces/${s}`},ev.createElement("div",{className:"flex items-center hover:text-textcolor-500"},ev.createElement("div",{style:{transform:"var(--menu-item-icon-scale)"}},ev.createElement(e$O,{avatar:n?.document?.space?.preferences?.avatars_v2??null,color:n?.document?.space?.color,name:n?.document?.space?.name??"Untitled",size:"xs"})),ev.createElement("span",{className:"ml-1 w-56 truncate"},n?.document?.space?.name))):ev.createElement(sC.rU,{to:"/shared"},ev.createElement("div",{className:"flex items-center gap-x-0.5 hover:text-textcolor-500"},ev.createElement("div",{style:{transform:"var(--menu-item-icon-scale)"}},ev.createElement(e1.SpaceAvatar,{size:"xs",name:"Shared Workspace"})),ev.createElement("span",null,"Shared Workspace")))),ev.createElement("div",{className:"text-xs font-medium text-appcolor-500"},ev.createElement(eY.Z,{id:"general.project",defaultMessage:"Project"})),ev.createElement("div",{className:"ml-3 flex h-6 items-center text-xs"},ev.createElement(sC.rU,{to:`/d/${i}`},ev.createElement("div",{className:"flex h-6 items-center gap-x-1.5 hover:text-textcolor-500"},null!=o?ev.createElement("span",null,o):ev.createElement(tn.Icon,{className:"h-4 w-4",icon:"dd_project_small"}),ev.createElement("span",{className:"w-56 truncate"},n.document?.info?.title||"Untitled"))))))))},ePk=eL.default.div.withConfig({displayName:"EmptyStateTasks__Wrapper",componentId:"sc-97e13f7-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: auto; + font-size: 14px; + text-align: center; +`,ePE=eL.default.h4.withConfig({displayName:"EmptyStateTasks__Heading",componentId:"sc-97e13f7-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,ePx=eL.default.p.withConfig({displayName:"EmptyStateTasks__Description",componentId:"sc-97e13f7-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,eP_=eL.default.div.withConfig({displayName:"EmptyStateTasks__EmptyImageWrapper",componentId:"sc-97e13f7-3"})` + margin-bottom: 24px; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,ePw=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(ePk,null,ev.createElement(eP_,null,!n&&ev.createElement(lT.VP,null)),ev.createElement(ePE,null,t),ev.createElement(ePx,null,a))},ePN=function(e){var t;let{className:a,op:n}=e;return"string"!=typeof n.insert?null:ev.createElement("span",{className:og()(a,"break-all border-b-[3px] border-b-transparent",{"font-bold":n.attributes?.bold===!0,italic:n.attributes?.italic===!0,underline:n.attributes?.underline===!0}),style:{borderBottomColor:"string"==typeof(t=n.attributes?.highlight)&&"#"===t[0]?t:"transparent"}},n.insert)},ePC=function(e){let{op:t}=e;return"string"==typeof t.insert&&"string"==typeof t.attributes?.link?ev.createElement("a",{className:"text-primary hover:cursor-pointer hover:underline",href:t.attributes.link,onClick:e=>{e.stopPropagation()},target:"_blank",rel:"noopener noreferrer"},ev.createElement(ePN,{op:t})):"string"==typeof t.insert&&t.attributes?.hashtag===!0?ev.createElement(ePN,{className:"text-primary hover:underline",op:t}):"string"==typeof t.insert&&t.attributes?.mention===!0?ev.createElement(ePN,{className:"text-primary hover:underline",op:t}):ev.createElement(ePN,{op:t})},ePM=function(e){let{delta:t,className:a}=e,n=ev.useMemo(()=>(function(e){let t=new(CI())(e),a=e.ops.reduce((e,t)=>"string"!=typeof t.insert?e:`${e}${t.insert}`,"");for(let e of(0,sX.extractHashtagsWithIndices)(a)){let[a,n]=e.indices;t=t.compose(new(CI())({ops:[{retain:a},{retain:n-a,attributes:{hashtag:!0}}]}))}for(let e of(0,sX.extractUrlsWithIndices)(a)){let[a,n]=e.indices;t=t.compose(new(CI())({ops:[{retain:a},{retain:n-a,attributes:{link:(0,sX.normalizeUrl)(e.url)}}]}))}for(let e of(0,sX.extractEmailsWithIndices)(a)){let[a,n]=e.indices;t=t.compose(new(CI())({ops:[{retain:a},{retain:n-a,attributes:{link:`mailto:${e.email}`}}]}))}return t})(t),[t]);return ev.createElement("div",{className:a},n.ops.map((e,t)=>ev.createElement(ePC,{key:t.toString(),op:e})))},ePS=eL.default.img.withConfig({displayName:"AssigneesPill__AvatarCircle",componentId:"sc-a2620900-0"})` + height: 20px; + width: 20px; + border-radius: 50%; + background-color: white; + margin-right: ${e=>e.$isSingleAvatar?"0px":"-5px"}; +`,ePI=eL.default.div.withConfig({displayName:"AssigneesPill__AvatarCircleWrapper",componentId:"sc-a2620900-1"})` + display: flex; + padding-right: ${e=>e.$isSingleAvatar?"5px":"15px"}; +`,ePD=function(e){let{assignees:t,nodeCompleted:a}=e,n=1===t.length,l=(0,ev.useMemo)(()=>t.map(e=>e.handle).join(", "),[t]);return ev.createElement("div",{className:og()("flex h-6 items-center rounded-2xl border-[1px] border-solid border-appcolor-300 bg-appcolor-100 px-2 text-xs hover:text-textcolor-500",{"text-textcolor-400":a})},ev.createElement(ePI,{$isSingleAvatar:n},t.map(e=>{let t=e.avatars_v2?.small?.mdpi.url;return ev.createElement(ePS,{$isSingleAvatar:n,key:e.id,className:"meta-avatar",src:t})})),ev.createElement("span",{className:"inline-block overflow-hidden text-ellipsis whitespace-nowrap"},l))},ePT={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"SearchHitNodeFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SearchHitNode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"task"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"completed"}},{kind:"Field",name:{kind:"Name",value:"start"}},{kind:"Field",name:{kind:"Name",value:"end"}},{kind:"Field",name:{kind:"Name",value:"is_recurring"}}]}}]}}]},eP$=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"TaskBullet__Checkbox",componentId:"sc-9e951875-0"})` + display: flex; + flex-shrink: 0; + width: 20px; + height: 20px; + margin-top: 2px; + -webkit-appearance: none; + + &:after { + display: flex; + flex: 1 0 auto; + align-items: center; + justify-content: center; + height: 100%; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } + + &:after { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + border-radius: 6px; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected.svg":"/../images/check_hover.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected.svg'); + } + } +`,ePP=function(e){let{className:t,node:a,rightPanelDispatch:n}=e,[l]=(0,cs.D)(e$q);return ev.createElement(eP$,{className:t,checked:a.task.completed,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=(0,ld.Z)(),r=!a.task.completed;l({variables:{input:{clientMutationId:t,nodeIds:[a.task.node_id],projectId:a.document_id,completed:r}},update:(e,t)=>{let l=e.readFragment({fragment:ePT,id:e.identify({__typename:"SearchHitNode",id:a.id})});if(null==l)return;let r=t.data?.projectNodesCompletionUpdate?.tasks?.[0];null!=r&&(n({type:"update_task",payload:{task:r}}),e.writeFragment({fragment:ePT,id:e.identify({__typename:"SearchHitNode",id:a.id}),data:(0,es.ZP)(l,e=>{e.task={...e.task,...r}})}))}})}})},ePF=ev.memo(function(e){let{node:t,isSelected:a,handleTaskClick:n,rightPanelDispatch:l}=e,r=(0,eK.Z)(),o=ev.useMemo(()=>new(CI())(t.task.delta.ops),[t.task.delta.ops]),i=ev.useMemo(()=>(function(e){let{start:t,end:a}=e.task;return null!=t?ez.DateDuration.fromDateRangeDesc({start:t,end:a}):null!=a?((0,ei.assert)(!("period"in a),"DurationDesc is not supported"),ez.DateDuration.fromDateRangeDesc({start:a})):null})(t),[t]),s=t.task?.document?.shared_preferences?.avatar?.value??null;return ev.createElement("div",{className:og()("flex cursor-pointer gap-x-2.5 px-8 py-2 hover:bg-appcolor-200",{"bg-appcolor-200":a}),onClick:()=>{n(t)}},ev.createElement(ePP,{node:t,rightPanelDispatch:l}),ev.createElement("div",{className:"flex flex-col gap-y-1.5"},""===t.task.text_string?ev.createElement("span",{className:"text-md text-textcolor-400"},"Untitled"):ev.createElement(ePM,{className:og()("text-base",{"!text-textcolor-400 line-through":t.task.completed}),delta:o}),ev.createElement("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2"},ev.createElement("div",{className:og()("flex h-6 items-center gap-x-1 rounded-2xl border-[1px] border-solid border-appcolor-300 bg-appcolor-100 px-2 text-xs hover:border-appcolor-400 hover:text-appcolor-500",{"border-danger text-danger":i?.toRelativeStatus()==="has_ended","border-textcolor-400 text-textcolor-400":t.task.completed})},ev.createElement(tn.Icon,{className:"h-4 w-4",icon:t.task.is_recurring?"date_repeat":"dd_date"}),i?.toReadableFormat()??r.formatMessage({id:"no_date",defaultMessage:"No Date"})),Array.isArray(t.task.assignees)&&t.task.assignees.length>0&&ev.createElement(ePD,{assignees:t.task.assignees,nodeCompleted:t.task.completed}),ev.createElement("div",{className:og()("flex h-6 items-center gap-x-0.5 rounded-2xl border-[1px] border-solid border-appcolor-300 bg-appcolor-100 px-2 text-xs",{"text-textcolor-400":t.task.completed})},t.task?.document?.space!=null?ev.createElement(ev.Fragment,null,ev.createElement(sC.rU,{to:`/spaces/${t.workspace.id}`},ev.createElement("div",{className:"flex items-center gap-x-0.5 hover:text-textcolor-500"},ev.createElement("div",{style:{transform:"var(--menu-item-icon-scale)"}},ev.createElement(e$O,{avatar:t.task.document.space.preferences?.avatars_v2??null,color:t.task.document.space.color,name:t.task.document.space.name,size:"xs"})),ev.createElement("span",null,t.task.document.space.name))),ev.createElement(tn.Icon,{icon:"default_caret_right"})):ev.createElement(ev.Fragment,null,ev.createElement(sC.rU,{to:"/shared"},ev.createElement("div",{className:"flex items-center gap-x-0.5 hover:text-textcolor-500"},ev.createElement("div",{style:{transform:"var(--menu-item-icon-scale)"}},ev.createElement(e1.SpaceAvatar,{size:"xs",name:"Shared Workspace"})),ev.createElement("span",null,"Shared Workspace"))),ev.createElement(tn.Icon,{icon:"default_caret_right"})),ev.createElement(sC.rU,{to:`/d/${t.document_id}`},ev.createElement("div",{className:"flex items-center gap-x-1.5 hover:text-textcolor-500"},null!=s?ev.createElement("span",null,s):ev.createElement(tn.Icon,{icon:"dd_project",className:"fill-appcolor-500",width:14,height:14}),ev.createElement("span",{className:"whitepsace-normal max-w-xs truncate"},t.task.document?.info?.title||"Untitled")))))))}),ePA=eL.default.div.withConfig({displayName:"SingleSectionView__Container",componentId:"sc-ad76b364-0"})` + ${tM} +`,ePR=function(e){let{searchResult:t,rightPanelDispatch:a,selectedNodeId:n}=e,{data:l}=t,r=l?.search?.edges??[],o=t.data?.search?.pageInfo?.hasNextPage??!1,i=ev.useCallback(()=>{let e=t.data?.search?.pageInfo?.endCursor??null;null!=e&&o&&t.fetchMore({variables:{after:e}})},[o,t]),s=ev.useRef(null),d=e=>{a({type:"show_task",payload:{task:e.task}})};return ev.createElement(ePA,{ref:s,className:"flex flex-col overflow-y-scroll pb-4"},r.filter(e=>null!=e.node).map(e=>ev.createElement(ePF,{key:e.cursor,node:e.node,handleTaskClick:d,isSelected:n===e.node.task.node_id,rightPanelDispatch:a})),r.length>0&&ev.createElement("div",{className:"flex h-12 shrink-0 items-center justify-center"},t.loading&&ev.createElement(eI.Spinner,null),!t.loading&&o&&ev.createElement("div",{className:"flex h-12 shrink-0 items-center justify-center"},ev.createElement("button",{className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-applight-100 hover:bg-primary/75",onClick:i},ev.createElement(eY.Z,{id:"general.load_more",defaultMessage:"Load more"}))),!t.loading&&!o&&ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-appcolor-200 text-xs font-bold text-textcolor-400 hover:cursor-pointer hover:bg-appcolor-300",onClick:()=>{s.current?.scrollTo({top:0,behavior:"smooth"})}},ev.createElement(tn.Icon,{icon:"default_caret_up"}))))},ePj=function(e){let{searchResult:t,rightPanelDispatch:a,selectedNodeId:n}=e,{data:l,loading:r,error:o}=t,i=(0,eK.Z)(),s=l?.search?.edges?.length??0,d=l?.search?.totalCount??0;return ev.useEffect(()=>{null!=o&&uT(o,_I)},[o]),ev.createElement("div",{className:"flex grow flex-col overflow-hidden"},ev.createElement("div",{className:"flex items-center gap-x-4 px-8 pb-2"},ev.createElement("span",{className:"text-xs font-medium text-textcolor-500"},ev.createElement(eY.Z,{id:"general.results_count_for_my_tasks",defaultMessage:"{currentCount, plural, =0 {} one {1 of} other {{currentCount} of} } {totalCount, plural, =0 {No results} one {1 result} other {{totalCount} results} }",values:{currentCount:s,totalCount:d}})),ev.createElement("div",{className:"h-5"},r&&ev.createElement(eI.Spinner,{size:20}))),!r&&null!=o&&ev.createElement("span",{className:"px-8 text-xs font-medium text-danger"},ev.createElement(eY.Z,{id:"generic_error_occurred",defaultMessage:"An error occurred"})),!r&&0===d&&ev.createElement("div",{className:"flex grow flex-col justify-center"},ev.createElement(ePw,{heading:i.formatMessage({id:"general.empty_state_tasks",defaultMessage:"No tasks to display"}),description:i.formatMessage({id:"general.empty_state_my_tasks_description",defaultMessage:"Adjust the filters to see more tasks."})})),ev.createElement(ePR,{searchResult:t,rightPanelDispatch:a,selectedNodeId:n}))},ePO=ev.createContext(void 0),ePU={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CurrentUserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrentUser"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"myTasksV2"}}]}}]}}]},ePZ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"MyTasksV2PreferencesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"myTasksV2"}}]}}]}}]}}]},ePL={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"MyTasksV2PreferencesUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MyTasksV2PreferencesUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"myTasksV2PreferencesUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"preferences"}}]}}]}}]},ePB={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderby"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchOrdering"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"orderby"},value:{kind:"Variable",name:{kind:"Name",value:"orderby"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"document_id"}},{kind:"Field",name:{kind:"Name",value:"workspace"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SearchHitNode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highlights"}},{kind:"Field",name:{kind:"Name",value:"task"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"node_id"}},{kind:"Field",name:{kind:"Name",value:"document_id"}},{kind:"Field",name:{kind:"Name",value:"delta"}},{kind:"Field",name:{kind:"Name",value:"text_string"}},{kind:"Field",name:{kind:"Name",value:"start"}},{kind:"Field",name:{kind:"Name",value:"end"}},{kind:"Field",name:{kind:"Name",value:"is_recurring"}},{kind:"Field",name:{kind:"Name",value:"line_number"}},{kind:"Field",name:{kind:"Name",value:"completed"}},{kind:"Field",name:{kind:"Name",value:"assignees"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}},{kind:"Field",name:{kind:"Name",value:"revision"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"info"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"default"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"hasNextPage"}}]}},{kind:"Field",name:{kind:"Name",value:"filters"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"label"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"values"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"label"}},{kind:"Field",name:{kind:"Name",value:"metadata"}},{kind:"Field",name:{kind:"Name",value:"count"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},ePz={isSidebarClosed:window.innerWidth<993,isFoldersClosed:!1,isAssignmentsClosed:!1,isDueDateClosed:!1,isDueDateSectionClosed:!1,isWorkspaceRootFoldedMap:new Map,filtersMap:new Map},ePV=(e,t)=>{switch(t.type){case"sidebar_open_toggle":return{...e,isSidebarClosed:!e.isSidebarClosed};case"folders_toggle":return{...e,isFoldersClosed:!e.isFoldersClosed};case"assignments_toggle":return{...e,isAssignmentsClosed:!e.isAssignmentsClosed};case"due_date_toggle":return{...e,isDueDateClosed:!e.isDueDateClosed};case"due_date_section_toggle":return{...e,isDueDateSectionClosed:!e.isDueDateSectionClosed};case"workspace_root_toggle":for(let a of t.spaceIds)e.isWorkspaceRootFoldedMap.set(a,t.isFolded);return{...e,isWorkspaceRootFoldedMap:e.isWorkspaceRootFoldedMap};case"init_filters_map":return{...e,filtersMap:t.map}}},ePq=(e,t)=>{switch(t.type){case"show_task":if(null==t.payload.task)return e;return{...e,isOpen:!0,task:{...t.payload.task}};case"close":return{isOpen:!1};case"update_duration":{let{duration:a}=t.payload;return(0,es.ZP)(e,e=>{if(null==e.task)return e;if(null==a)return e.task.start=null,e.task.end=null,e;let t=a.toDateRangeDesc();return e.task.start=t.start,e.task.end=t.end,e})}case"update_assignee":return(0,es.ZP)(e,e=>{let a;if(null==e.task)return e;let n=e.task.assignees??[];a=n.some(e=>e.id===t.payload.assignee.id)?n.filter(e=>e.id!==t.payload.assignee.id):[...n,t.payload.assignee],e.task.assignees=a});case"update_task":return(0,es.ZP)(e,e=>(null==e.task||e.task.node_id!==t.payload.task.node_id||(e.task={...e.task,...t.payload.task}),e));default:return e}},ePW=function(){let e=(0,eB.a)(ePZ),[t,a]=ev.useReducer(ePq,{isOpen:!1}),[n,l]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ePz;return ev.useReducer(ePV,e)}(),r=(0,eF.k6)(),{search:o}=(0,eF.TH)(),i=ev.useMemo(()=>t.isOpen?t.task?.node_id??null:null,[t.isOpen,t.task?.node_id]),{filterby:s}=e$_(),c=ev.useMemo(()=>{let e=s?.dueDateSection==="past_due"?"desc":"asc";return{filterby:{...s,query:"",type:e$k,hideCompleted:!0},orderby:[{sort:w.Date,direction:e}],...egi(o,200)}},[s,o]),[m,u]=ev.useState(()=>0===new URLSearchParams(o).size),p=(0,eB.a)(ePB,{variables:c,fetchPolicy:"network-only",nextFetchPolicy:"cache-first",skip:m,notifyOnNetworkStatusChange:!0}),g=ev.useMemo(()=>{let t=e.data?.me?.preferences?.myTasksV2,a=e.data?.me?.handle??null;return t??{filter:{assigneeType:d.NoAssignees,assignees:null!=a?[a]:void 0,dueDateSection:x.Today}}},[e.data]),{replace:f}=r;ev.useEffect(()=>{let t=new URLSearchParams;if(!m||e.loading)return;for(let e of g.filter.spaceIds??[])t.append("spaceIds",e);for(let e of g.filter.assignees??[])t.append("assignees",e);let a=g.filter.assigneeType??null;null==a||ts()(a)?t.delete("assigneeType"):t.set("assigneeType",a);let n=g.filter.dueDateType??null;null!=n&&"string"==typeof n&&t.set("dueDateType",n);let l=g.filter.dueDateSection??null;null!=l&&"string"==typeof l&&t.set("dueDateSection",l);let r=g.filter.projectType??null;null!=r&&t.set("projectType",r),u(!1),f({pathname:"/my-tasks",search:t.toString()})},[g,f,e.loading,m]);let[h]=(0,cs.D)(ePL),y=ev.useCallback(e=>{h({variables:{input:{clientMutationId:(0,ld.Z)(),...e}},update:(e,t)=>{let a=t.data?.myTasksV2PreferencesUpdate.preferences;if(null==a)return;let n=e.readFragment({fragment:ePU,id:e.identify({__typename:"CurrentUser"})});null!=n&&e.writeFragment({fragment:ePU,id:e.identify({__typename:"CurrentUser"}),data:(0,es.ZP)(n,e=>{e.preferences.myTasksV2=a})})}})},[h]);return(ev.useEffect(()=>{m||y({filter:s})},[s,m,y]),e.loading)?ev.createElement(eI.Spinner,null):ev.createElement(e$E.Provider,{value:{state:n,dispatch:l}},ev.createElement(ePO.Provider,{value:{preferences:g,update:y}},ev.createElement(eT.ql,{title:"My Tasks - Taskade"}),ev.createElement("div",{className:"flex h-[100%]"},ev.createElement(e$j,{searchResult:p,rightPanelDispatch:a}),ev.createElement("div",{className:"flex flex-1 flex-col"},ev.createElement("div",{className:"w-[100%] max-lg:ml-2.5"},ev.createElement(eD6,{isSearchSidebarClosed:n.isSidebarClosed,onClick:()=>{l({type:"sidebar_open_toggle"})}})),ev.createElement(ePj,{searchResult:p,rightPanelDispatch:a,selectedNodeId:i})),ev.createElement("div",null,t.isOpen&&ev.createElement(ePv,{state:t,dispatch:a})))))},ePH=function(e){let{option:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({stopRef:a,name:t.data.key,value:t.data.value});return ev.createElement(sC.rU,{...n.props,to:t.to,className:og()("flex h-8 items-center justify-between bg-none px-4 py-0.5 text-sm text-textcolor-900 hover:bg-appcolor-200 focus:bg-appcolor-200",t.isActive?"font-medium":"font-normal")},ev.createElement("span",{className:"flex-auto text-textcolor-900"},ev.createElement(eY.Z,t.name)),t.isActive&&ev.createElement(lT._J,{className:"flex-none fill-primary"}))},ePG=[{id:"owned:anyone",data:{key:"owned",value:"anyone"},name:(0,te.Em)({id:"general.owned_by_anyone",defaultMessage:"Owned by anyone"}),default:!0},{id:"owned:me",data:{key:"owned",value:"me"},name:(0,te.Em)({id:"general.owned_by_me",defaultMessage:"Owned by me"})},{id:"owned:not-me",data:{key:"owned",value:"not-me"},name:(0,te.Em)({id:"general.not_owned_by_me",defaultMessage:"Not owned by me"})},{id:"member:space-only",data:{key:"member",value:"space-only"},name:(0,te.Em)({id:"general.member_of_spaces",defaultMessage:"Member of spaces"})},{id:"member:project-only",data:{key:"member",value:"project-only"},name:(0,te.Em)({id:"general.not_member_of_spaces",defaultMessage:"Not member of spaces"})}],ePK=function(){let e=ev.useRef(null),t=ev.useRef(null),[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),l=(0,eI.usePopup)({referenceElementRef:e,popupElementRef:t,state:a,placement:"bottom-start"}),r=(0,eI.useMenuButton)({ref:e,state:a,dispatch:n}),o=ev.useCallback(e=>{e.type,n({type:"Collapse"})},[]),i=(0,eF.TH)(),s=ev.useMemo(()=>{let e=new URLSearchParams(i.search);return{owned:e.getAll("owned"),member:e.getAll("member")}},[i.search]),d=ev.useMemo(()=>ePG.map(e=>{let t=new URLSearchParams(i.search);if(t.delete("owned"),t.delete("member"),e.default){let a=t.toString();return{...e,isActive:s[e.data.key][0]===e.data.value||0===s.owned.length&&0===s.member.length,to:(0,sX.isStringNotBlank)(a)?`${i.pathname}?${a}`:i.pathname}}t.set(e.data.key,e.data.value);let a=t.toString();return{...e,isActive:s[e.data.key][0]===e.data.value,to:`${i.pathname}?${a}`}}),[s,i.pathname,i.search]),c=d.find(e=>e.isActive)??d[0];return ev.createElement(ev.Fragment,null,ev.createElement("button",{...r.props,className:"flex cursor-pointer items-center justify-self-end border-none bg-none text-sm text-textcolor-500 shadow-none hover:text-textcolor-900"},ev.createElement(eY.Z,c.name),ev.createElement(lT.tO,{className:"-mt-px ml-0.5"})),a.expanded&&ev.createElement(eI.Popup,{...l.props,dispatch:n,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:o},ev.createElement(eI.Menu,{initialFocus:l.initialFocus,className:"flex min-w-55 flex-col rounded-xl border border-appcolor-200 bg-appcolor-0 py-2 shadow"},d.map(e=>ev.createElement(ePH,{key:e.id,option:e}))))))},ePY=eL.default.div.withConfig({displayName:"EmptyErrorState__Wrapper",componentId:"sc-f3709fe-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; +`,ePQ=eL.default.span.withConfig({displayName:"EmptyErrorState__Message",componentId:"sc-f3709fe-1"})` + margin-top: 12px; + color: #bfbfbf; + font-size: 1.125rem; +`,ePJ=function(e){let{message:t,hideIcon:a}=e;return ev.createElement(ePY,null,!a&&ev.createElement(lT.u7,null),ev.createElement(ePQ,null,t))},ePX=eL.default.div.withConfig({displayName:"EmptyStateRecent__Wrapper",componentId:"sc-99c74ca2-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: 0 auto; + font-size: 14px; + text-align: center; + padding: 32px 32px 160px 32px; + + @media (max-width: 768px) { + max-width: 540px; + padding-bottom: 100px; + } + + @media (max-width: 480px) { + max-width: 100%; + padding-bottom: 100px; + } +`,eP0=eL.default.h4.withConfig({displayName:"EmptyStateRecent__Heading",componentId:"sc-99c74ca2-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,eP1=eL.default.p.withConfig({displayName:"EmptyStateRecent__Description",componentId:"sc-99c74ca2-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,eP2=eL.default.div.withConfig({displayName:"EmptyStateRecent__EmptyImageWrapper",componentId:"sc-99c74ca2-3"})` + margin-bottom: 24px; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,eP5=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(ePX,null,ev.createElement(eP2,null,!n&&ev.createElement(lT.ae,null)),ev.createElement(eP0,null,t),ev.createElement(eP1,null,a))},eP3=eL.default.span.withConfig({displayName:"InfoText__Container",componentId:"sc-8c84fed2-0"})` + color: #666; + font-size: 14px; + margin-top: 5px; +`,eP4=function(e){let{spaceName:t,updatedBy:a,updatedFromNow:n}=e,l=(0,eK.Z)();if(null!=a){let e=l.formatMessage({id:"general.updated_by",description:"e.g. A few seconds ago by @john, a few days ago by @tom",defaultMessage:"{updatedFromNow} by {handle}"},{updatedFromNow:n,handle:a.handle});return null!=t?ev.createElement(eP3,null,e," — ",t):ev.createElement(eP3,null,e)}return ev.createElement(eP3,null,n)},eP6=eL.default.div.withConfig({displayName:"styled__UnreadBadge",componentId:"sc-7b303f04-0"})` + width: 8px; + height: 8px; + border-radius: 50%; + background: ${e=>e.theme.primaryColorScheme?.base}; +`,eP8=(0,eL.default)(lT.hA).withConfig({displayName:"DocumentItem__StyledStarIcon",componentId:"sc-a8fbc071-0"})` + height: 20px; + width: 20px; + + > path { + fill: #f2d750; + } +`,eP7=(0,eL.default)(lT.mq).withConfig({displayName:"DocumentItem__StyledProjectIcon",componentId:"sc-a8fbc071-1"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,eP9=eL.default.div.withConfig({displayName:"DocumentItem__Container",componentId:"sc-a8fbc071-2"})` + display: flex; + flex-direction: row; + align-items: center; + padding: 14px 22px; + :hover { + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f8f8f8"}; + } + position: relative; + + @media (min-width: 768px) { + padding: 14px 32px; + } +`,eFe=eL.default.div.withConfig({displayName:"DocumentItem__ProjectIcon",componentId:"sc-a8fbc071-3"})` + display: flex; + flex-shrink: 0; + width: 50px; + height: 50px; + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1); + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + margin-right: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; + + & > span { + font-size: 26px; + } +`,eFt=eL.default.div.withConfig({displayName:"DocumentItem__ContentWrapper",componentId:"sc-a8fbc071-4"})` + display: flex; + flex: 1; + flex-direction: column; + align-items: flex-start; + justify-content: center; +`,eFa=eL.default.div.withConfig({displayName:"DocumentItem__Top",componentId:"sc-a8fbc071-5"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; + padding-top: 2px; +`,eFn=eL.default.span.withConfig({displayName:"DocumentItem__Title",componentId:"sc-a8fbc071-6"})` + font-size: 17px; + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eFl=eL.default.div.withConfig({displayName:"DocumentItem__StarIconWrapper",componentId:"sc-a8fbc071-7"})` + display: flex; + margin-left: 5px; +`,eFr=eL.default.div.withConfig({displayName:"DocumentItem__ActionWrapper",componentId:"sc-a8fbc071-8"})` + display: flex; + flex-basis: 150px; + justify-content: flex-end; +`,eFo=eL.default.div.withConfig({displayName:"DocumentItem__BottomWrapper",componentId:"sc-a8fbc071-9"})` + display: inherit; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + margin: 6px 0 0; + + & > span { + margin: 0; + } +`,eFi=function(e){let{document:t}=e,{id:a,info:n,space:l,is_unread:r,updated_at:o}=t,{stats:i,updatedBy:s}=n,d=ts()(n.title)?"Untitled":n.title,c=cc()(o).fromNow(),m=`/d/${a}?from=recent`,u=i?.completedCount??0,p=i?.totalCount??0,g=nQ(t),f=l?.color,h=(0,ev.useMemo)(()=>eu()(f)?void 0:{primaryColor:f},[f]);return ev.createElement(eI.ThemeProvider,{theme:h},ev.createElement(sC.rU,{id:a,to:m,key:`document-list-item-${a}`},ev.createElement(eP9,null,r&&null!=l&&ev.createElement(eP6,{style:{position:"absolute",left:"12px",top:"36px"}}),ev.createElement(eFe,null,null!=g?ev.createElement("span",null,g):ev.createElement(eP7,null)),ev.createElement(eFt,null,ev.createElement(eFa,null,ev.createElement(eFn,null,d),null!=t.starred_at&&ev.createElement(eFl,null,ev.createElement(eP8,{selected:null!=t.starred_at}))),ev.createElement(eFo,null,ev.createElement(eP4,{spaceName:l?.name,updatedBy:s,updatedFromNow:c}))),ev.createElement(eFr,null,ev.createElement(pl,{percentCompleted:p>0?u/p*100:0})))))},eFs=function(e){let{data:t,error:a,loading:n,location:l}=e,r=(0,eK.Z)();if(n)return ev.createElement(eI.Spinner,{height:319});if(a)return ev.createElement(ePJ,{message:r.formatMessage({id:"general.recent_projects_error_loading",defaultMessage:"There is an error loading recent projects. Please try again later"}),hideIcon:!0});let o=t?.recentProjects?.edges??[],i=t?.recentProjects?.totalCount??0;return 0===i?ev.createElement(eP5,{heading:r.formatMessage({id:"general.empty_state_recent_projects",defaultMessage:"No recent projects"}),description:r.formatMessage({id:"general.empty_state_recent_projects_description",defaultMessage:"Recently accessed projects will show up here."})}):ev.createElement("div",{className:"mb-5"},o.map(e=>{let t=e?.node;return null==t?null:ev.createElement(eFi,{key:t.id,document:t})}),ev.createElement(eNH,{pathname:l.pathname,search:l.search,hash:l.hash,totalCount:i,itemPerPage:20}))},eFd=function(e){let{location:t}=e,{search:a}=t,n=egi(a,20),l=ego(a),r={...n,...l},{data:o,loading:i,error:s}=(0,eB.a)(egl,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",variables:r});return ev.createElement(ev.Fragment,null,ev.createElement(eT.ql,null,ev.createElement("title",null,"Recent - Taskade")),ev.createElement(eD6,null),ev.createElement(eF.AW,{exact:!0,path:"/recent",render:e=>ev.createElement(eDS,null,ev.createElement(ePK,e))}),ev.createElement(eFs,{data:o,error:s,loading:i,location:t}))},eFc="project",eFm="task";(0,te.Em)({id:"general.projects",defaultMessage:"Projects"}),(0,te.Em)({id:"general.tasks",defaultMessage:"Tasks"}),(0,te.Em)({id:"general.comments",defaultMessage:"Comments"});let eFu=ev.createContext(void 0),eFp=(0,la.ZP)` + query MembershipsQuery { + memberships(filterby: { archived: false }) { + totalCount + edges { + node { + id + order + space { + id + name + parent_id + color + preferences { + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + } + } + } + } + } + } + } + } + } + } +`;function eFg(){let e=(0,eF.k6)();return{filterby:ev.useMemo(()=>{let t;let a=new URLSearchParams(e.location.search);switch(a.get("hideCompleted")){case"true":t=!0;break;case"false":t=!1}return{query:a.get("q")??"",type:a.get("type")??void 0,spaceIds:a.getAll("spaceIds")??void 0,projectIds:a.getAll("projectIds")??void 0,assignees:a.getAll("assignees")??void 0,assigneeType:a.get("assigneeType")??void 0,hideCompleted:t}},[e.location.search])}}let eFf=function(e){let{avatar:t,count:a,inputField:n,inputId:l,isChecked:r,label:o}=e,i=t?.small?.mdpi?.url;return ev.createElement("div",{className:"flex"},n,ev.createElement("label",{className:"flex h-max w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:l},ev.createElement("div",{className:"flex items-center"},null!=i&&ev.createElement("img",{className:"mr-2 inline-block h-5 w-5 rounded-full",src:i}),o,a>0&&ev.createElement("span",{className:"ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600"},a)),r&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},eFh=function(e){let{inputField:t,inputId:a,isChecked:n,label:l}=e;return ev.createElement("div",{className:"flex"},t,ev.createElement("label",{className:"flex h-max w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:a},ev.createElement("div",{className:"flex items-center"},ev.createElement("div",{className:"mr-2 flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"assigned_nobody",className:"text-appcolor-500"})),ev.createElement("span",{className:"text-sm"},l)),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},eFy=function(e){let{getValues:t,isAssignmentsClosed:a,onChangeAssignees:n,onChangeAssigneeType:l,register:r,searchFilterValue:o,toggleClick:i}=e,s=(0,eB.a)(sW),d=s.data?.me,c=(0,eK.Z)();if(null==o||null==d)return null;let m=[...o.keys()].filter(e=>e!==d.handle).sort(),u=[d.handle,...m],p=c.formatMessage({id:"general.me",defaultMessage:"Me"}),g=c.formatMessage({id:"general.unassigned",defaultMessage:"Unassigned"});return ev.createElement(ev.Fragment,null,ev.createElement("h3",{className:"mb-1 flex cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700",onClick:i},ev.createElement(tn.Icon,{className:"cursor-pointer rounded-full hover:bg-appcolor-400",icon:a?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.assigned_to",defaultMessage:"Assigned to"})),!a&&ev.createElement(ev.Fragment,null,ev.createElement(eFh,{label:g,inputId:"no-assignees-filter",inputField:ev.createElement("input",{...r("assigneeType"),type:"checkbox",id:"no-assignees-filter",value:"no_assignees",className:"hidden",onChange:l}),isChecked:"no_assignees"===t("assigneeType")}),u.map(e=>ev.createElement(eFf,{key:e,avatar:o.get(e)?.metadata?.avatars_v2,label:d.handle===e?p:e,inputId:`assignee-${e}`,inputField:ev.createElement("input",{...r("assignees"),type:"checkbox",id:`assignee-${e}`,value:e,className:"hidden",onChange:n}),isChecked:t("assignees").includes(e),count:o.get(e)?.count??0}))))},eFb=function(e){let{space:t,count:a,isChecked:n,inputField:l,onFolderFold:r,folderFoldedMap:o}=e;return ev.createElement("div",{className:"flex w-full items-center justify-between rounded-lg py-1.5 pl-7 pr-3 hover:bg-appcolor-200"},ev.createElement("div",{className:"relative flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:o.get(t.id)?"default_caret_right":"default_caret_down",className:"duration-250 absolute -left-5 mr-2 cursor-pointer rounded-full text-appcolor-500 opacity-0 transition ease-in-out hover:text-appcolor-700 group-hover/fold:opacity-100",onClick:e=>{r(e,t.id)}}),ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement(nA,{space:t,size:"xs",className:"shrink-0"}))),l,ev.createElement("label",{htmlFor:`space-${t.id}`,className:"ml-2 flex w-full cursor-pointer items-center"},ev.createElement("div",{className:"flex items-center"},ev.createElement("span",{className:"max-w-[10rem] overflow-hidden text-ellipsis whitespace-nowrap text-sm max-[1040px]:max-w-[8rem]"},t.name),ev.createElement("span",{className:og()("ml-2 h-5 rounded-full border-[1px] border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600",{hidden:0===a})},a))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"shrink-0 fill-appcolor-500"}))},eFv=function(e){let{spaceId:t,count:a,isChecked:n,inputField:l,onFolderFold:r,folderFoldedMap:o}=e;return ev.createElement("div",{className:"flex w-full items-center rounded-lg pl-7 pr-3 hover:bg-appcolor-200"},ev.createElement("div",{className:"flex w-full items-center"},ev.createElement("div",{className:"relative flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:o.get(t)?"default_caret_right":"default_caret_down",className:"duration-250 absolute -left-5 mr-2 cursor-pointer rounded-full text-appcolor-500 opacity-0 transition ease-in-out hover:text-appcolor-700 group-hover/fold:opacity-100",onClick:e=>{r(e,t)}}),ev.createElement(tn.Icon,{icon:"home",width:16,height:16,className:"shrink-0 text-appcolor-500"})),l,ev.createElement("label",{htmlFor:`space-${t}`,className:"ml-2 flex h-8 grow cursor-pointer items-center justify-between"},ev.createElement("div",{className:"flex items-center text-sm"},ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"}),ev.createElement("span",{className:"ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600"},a)))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"shrink-0 fill-appcolor-500"}))},eFk=function(e){let{inputField:t,projectId:a,isChecked:n,filterValue:l}=e,{label:r,count:o,metadata:i}=l,s=i?.projectAvatar??null,d=`project-${a}`;return ev.createElement("div",{className:"flex w-full items-center justify-between rounded-lg py-1.5 pl-10 pr-3 hover:bg-appcolor-200",key:a},t,ev.createElement("label",{htmlFor:d,className:"flex w-full cursor-pointer items-center justify-between rounded-lg"},ev.createElement("div",{className:"flex max-w-[80%] items-center"},ev.createElement("span",{className:"text-ellipsis whitespace-nowrap break-all text-sm"},null!=s?ev.createElement("div",null,s):ev.createElement(tn.Icon,{icon:"dd_project",width:16,height:16,className:"text-appcolor-500"})),ev.createElement("span",{className:"ml-2 max-w-[80%] overflow-hidden text-ellipsis whitespace-nowrap text-sm max-lg:max-w-[30rem]"},r.length>0?r:"Untitled Project"),ev.createElement("span",{className:og()("ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600",{hidden:0===o})},o)),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},eFE=function(e){let{inputField:t,count:a,isChecked:n}=e;return ev.createElement("div",{className:"flex w-full items-center justify-between rounded-lg py-1.5 pl-5 pr-3 hover:bg-appcolor-200"},t,ev.createElement("label",{htmlFor:"hideCompleted",className:"flex w-full cursor-pointer items-center justify-between"},ev.createElement("div",{className:"flex items-center"},ev.createElement("div",{className:"flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"dd_show_completed",className:"text-appcolor-500",width:16,height:16})),ev.createElement("div",{className:"ml-2 text-sm"},ev.createElement(eY.Z,{id:"general.not_completed",defaultMessage:"Not Completed"}),ev.createElement("span",{className:"ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600"},a))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})))},eFx=function(e){let{inputField:t,label:a,count:n}=e,l=(0,eF.k6)(),r=(0,eK.Z)(),o=a;switch(a){case"project":o=r.formatMessage({id:"general.project",defaultMessage:"Project"});break;case"task":o=r.formatMessage({id:"general.task",defaultMessage:"Task"});break;case"comment":o=r.formatMessage({id:"general.comment",defaultMessage:"Comment"})}let i=null!=new URLSearchParams(l.location.search).get("type");return ev.createElement("label",{className:"flex w-full cursor-pointer items-center rounded-lg py-1.5 pl-5 pr-3 text-sm hover:bg-appcolor-200",htmlFor:a},ev.createElement("div",{className:"mr-2 flex h-5 w-5 items-center justify-center"},t),o,i&&ev.createElement("span",{className:"ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600"},n))},eF_=function(e){let{spaceHomeAndFolderIds:t,workspaceTree:a,isChecked:n,onFold:l,onSpaceFilterChange:r,onFormChange:o,workspaceRootFoldedMap:i}=e;return ev.createElement("div",{className:"flex w-full items-center justify-between rounded-lg py-1.5 pl-5 pr-3 hover:bg-appcolor-200"},ev.createElement("div",{className:"relative flex grow cursor-pointer items-center",onClick:e=>{r(e,t,n,!0),o()}},ev.createElement(tn.Icon,{icon:i.get(t[0])?"default_caret_right":"default_caret_down",className:"duration-250 absolute -left-5 mr-2 cursor-pointer rounded-full text-appcolor-500 opacity-0 transition ease-in-out hover:text-appcolor-700 group-hover/fold:opacity-100",onClick:e=>{l(e,t[0])}}),ev.createElement("div",{className:"flex h-5 w-5 items-center"},ev.createElement(nA,{space:a.homeFolder.space,size:"xs",className:"shrink-0 scale-90 cursor-default"})),ev.createElement("div",{className:"ml-2 flex items-center"},ev.createElement("span",{className:"max-w-[10rem] overflow-hidden text-ellipsis whitespace-nowrap text-sm max-[1040px]:max-w-[8rem]"},a.homeFolder.space.name),ev.createElement("span",{className:og()("ml-2 h-5 rounded-full border border-appcolor-400 bg-appcolor-200 px-2 text-xs leading-4 text-textcolor-600",{hidden:0===a.count})},a.count))),n&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"}))},eFw=ev.forwardRef(function(e,t){let{searchResult:a}=e,{state:n,dispatch:l}=function(){let e=ev.useContext(eFu);return(0,ei.assert)(null!=e,"SearchContextProvider not available"),e}(),r=(0,eF.k6)(),{isSidebarClosed:o,isTypeClosed:i,isStatusClosed:s,isFoldersClosed:d,isAssignmentsClosed:c,isWorkspaceRootFoldedMap:m,isFolderFoldedMap:u,filtersMap:p,folderProjectsMap:g}=n,{filterby:f}=eFg(),{data:h}=(0,eB.a)(eFp,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-and-network"}),y=ev.useMemo(()=>({type:f.type??eFc,spaceIds:f.spaceIds??[],projectIds:f.projectIds??[],hideCompleted:f.hideCompleted??!1,assignees:f.assignees??[],assigneeType:f.assigneeType??void 0}),[f]),{register:b,getValues:v,setValue:k,reset:E}=(0,sz.cI)({defaultValues:y}),{workspaceTrees:x}=ev.useMemo(()=>(function(e){let t={},a=new Map;for(let n of e)if(null==n.space.parent_id){let e=n.space.id,l=a.get(e)?.folders??new Map;for(let a of t[e]??[])l.set(a.space.id,a);let r={id:e,order:n.order,homeFolder:n,folders:l,count:0};a.set(e,r),delete t[e]}else{let e=n.space.parent_id,l=a.get(e);null==l?null==t[e]?t[e]=[n]:t[e]=[...t[e]??[],n]:l.folders.set(n.space.id,n)}return{workspaceTrees:a}})(h?.memberships?.edges?.map(e=>e.node)??[]),[h?.memberships?.edges]);ev.useEffect(()=>{if(a.loading)return;let e=new Map,t=new Map,n=new Map,r=new Map,o=new Map,i=new Map;for(let[e]of x)x.get(e).count=0;for(let l of a.data?.search?.filters??[])switch(l.id){case"type":for(let t of l.values)o.set(t.id,t),e.set(l.id,o);break;case"workspace":for(let t of l.values)for(let[a]of(n.set(t.id,t),e.set(l.id,n),x))x.has(t.id)&&t.id===a&&(x.get(t.id).count+=t.count),x.get(a)?.folders.get(t.id)!=null&&(x.get(a).count+=t.count);break;case"document":for(let a of l.values){r.set(a.id,a),e.set(l.id,r);let n=a.metadata?.spaceId??null;if(null!=n){let e=t.get(n)??[];t.set(n,[...e,a.id])}}break;case"completed":for(let t of l.values)"notCompleted"===t.id&&e.set("completed",new Map([[t.id,t]]));break;case"assignees":for(let e of l.values)i.set(e.id,e);e.set(l.id,i);break;default:continue}l({type:"init_folder_projects_map",map:t}),l({type:"init_filters_map",map:e}),0===m.size&&l({type:"workspace_root_toggle",spaceIds:Array.from(x.keys()),isFolded:!0}),0===u.size&&l({type:"folder_fold_toggle",spaceIds:Array.from(x.keys()),isFolded:!0})},[a.data?.search?.filters,a.loading,x,m.size,l,u.size]);let _=e=>{"Enter"===e.key&&E()},w=ev.useCallback((e,t)=>{(null==m.get(t)||!0===m.get(t))&&l({type:"workspace_root_toggle",spaceIds:[t],isFolded:!1}),!1===m.get(t)&&l({type:"workspace_root_toggle",spaceIds:[t],isFolded:!0})},[l,m]),N=ev.useCallback((e,t)=>{(null==u.get(t)||!0===u.get(t))&&l({type:"folder_fold_toggle",spaceIds:[t],isFolded:!1}),!1===u.get(t)&&l({type:"folder_fold_toggle",spaceIds:[t],isFolded:!0})},[l,u]);ev.useImperativeHandle(t,()=>({handleResetOnSearch:_}));let C=()=>{let e=v("type"),t=new URLSearchParams(ts()(f.query)?{type:e}:{q:f.query,type:e});for(let e of v("spaceIds"))t.append("spaceIds",e);for(let e of v("projectIds"))t.append("projectIds",e);for(let e of(v("hideCompleted")&&t.set("hideCompleted","true"),v("assignees")))t.append("assignees",e);let a=v("assigneeType");null!=a&&!1!==a?t.set("assigneeType",a):t.delete("assigneeType"),r.push({pathname:"/search",search:t.toString()})},M=ev.useCallback((e,t)=>{t!==eFm&&k("hideCompleted",!1),k("type",t),k("spaceIds",[]),k("projectIds",[]),k("assignees",[]),k("assigneeType",void 0),l({type:"workspace_root_toggle",spaceIds:Array.from(x.keys()),isFolded:!0})},[k,x,l]),S=ev.useCallback((e,t,a,n)=>{let l=new Set(v("spaceIds")),r=new Set(v("projectIds"));if(n&&!1===a)for(let e of t)for(let t of((p.get("workspace")?.get(e)?.count??0)>0&&l.add(e),g.get(e)??[]))r.add(t);else if(n&&!0===a)for(let e of t)for(let t of(l.delete(e),g.get(e)??[]))r.delete(t);else if(l.has(t[0]))for(let e of t)for(let t of(l.delete(e),g.get(e)??[]))r.delete(t);else for(let e of t)for(let t of(l.add(e),g.get(e)??[]))r.add(t);k("spaceIds",Array.from(l)),k("projectIds",Array.from(r))},[v,g,k,p]),I=ev.useCallback(e=>{let t=new Set(v("assignees"));v("assigneeType");let a=e.target?.value,n=e.target?.checked;null!=a&&(n?t.add(a):t.delete(a)),k("assignees",Array.from(t))},[v,k]),D=ev.useCallback(e=>{let t=e.target?.value,a=e.target?.checked;null!=t&&(a?k("assigneeType",t):k("assigneeType",void 0))},[k]);return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:`fixed left-0 top-0 z-10 h-full w-full bg-[#000] opacity-40 lg:hidden ${o?"hidden":"visible"}`,onClick:()=>{l({type:"filter_toggle"})}}),ev.createElement("div",{className:`visible z-20 flex w-80 flex-col overflow-y-auto border-r border-appcolor-300 px-3 py-4 max-lg:absolute max-lg:right-0 max-lg:h-full max-lg:w-[70%] max-lg:bg-appcolor-100 ${o?"hidden":"visible"}`},ev.createElement("span",{className:"mb-4 mt-0.5 px-2 text-base font-medium"},ev.createElement(eY.Z,{id:"general.filters",defaultMessage:"Filters"})),ev.createElement("form",{onChange:C},ev.createElement("div",null,ev.createElement("div",{className:"flex items-center"},ev.createElement("button",{className:"flex w-full",onClick:e=>{l({type:"type_toggle"}),e.preventDefault()}},ev.createElement("h3",{className:"mb-1 flex w-full cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700"},ev.createElement(tn.Icon,{className:"cursor-pointer rounded-full hover:bg-appcolor-400",icon:i?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.type",defaultMessage:"Type"})))),!i&&ev.createElement("div",{className:"mb-4"},[eFc,eFm,"comment"].map(e=>ev.createElement(eFx,{key:p.get("type")?.get(e)?.id??e,inputField:ev.createElement(e$I,{...b("type"),onChange:t=>M(t,e),id:p.get("type")?.get(e)?.label??e,value:p.get("type")?.get(e)?.id??e,className:"cursor-pointer text-appcolor-400 group-hover:border-primary"}),label:p.get("type")?.get(e)?.label??e,count:p.get("type")?.get(e)?.count??0}))),"task"===v("type")&&ev.createElement("div",{className:"mb-4"},ev.createElement("button",{className:"flex w-full",onClick:e=>{l({type:"status_toggle"}),e.preventDefault()}},ev.createElement("h3",{className:"mb-1 flex w-full cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700"},ev.createElement(tn.Icon,{icon:s?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.status",defaultMessage:"Status"}))),!s&&ev.createElement(eFE,{inputField:ev.createElement("input",{...b("hideCompleted"),type:"checkbox",id:"hideCompleted",className:"hidden"}),count:p.get("completed")?.get("notCompleted")?.count??0,isChecked:v("hideCompleted")})),ev.createElement("button",{className:"flex w-full",onClick:e=>{l({type:"folders_toggle"}),e.preventDefault()}},ev.createElement("h3",{className:"mb-1 flex w-full cursor-pointer items-center gap-x-1 text-xs uppercase text-appcolor-500 hover:text-appcolor-700"},ev.createElement(tn.Icon,{icon:d?"default_caret_right":"default_caret_down"}),ev.createElement(eY.Z,{id:"general.workspace_and_folders",defaultMessage:"Workspace & Folders"}))),!d&&ev.createElement("div",{className:"group/fold mb-4"},ev.createElement("div",{className:"flex w-full cursor-pointer items-center justify-between rounded-lg py-1.5 pl-5 pr-3 hover:bg-appcolor-300",onClick:()=>{k("spaceIds",[]),k("projectIds",[]),C()}},ev.createElement("div",{className:"flex items-center rounded-lg"},ev.createElement("div",{className:"mr-2 flex h-5 w-5 items-center justify-center"},ev.createElement(tn.Icon,{icon:"dd_filter_workspace",className:"text-appcolor-500"})),ev.createElement("span",{className:"text-sm"},ev.createElement(eY.Z,{id:"general.all",defaultMessage:"All"}))),ts()(v("spaceIds"))&&ts()(v("projectIds"))&&ev.createElement(tn.Icon,{icon:"dd_check",className:"fill-appcolor-500"})),[...x.keys()].map(e=>{let t=x.get(e);if(0===t.count)return null;let{homeFolder:a,folders:n}=t,l=Array.from(n.keys());l.unshift(t.id);let r=!0;for(let e of l)if(!v("spaceIds").includes(e)&&(p.get("workspace")?.get(e)?.count??0)>0){r=!1;break}let o=a.space.id,i=p.get("workspace")?.get(o)?.count??0;return ev.createElement(ev.Fragment,{key:t.id},ev.createElement(eF_,{spaceHomeAndFolderIds:l,workspaceTree:t,isChecked:r,onSpaceFilterChange:S,onFold:w,onFormChange:C,workspaceRootFoldedMap:m}),i>0&&!m.get(o)&&ev.createElement(eFv,{inputField:ev.createElement("input",{...b("spaceIds"),type:"checkbox",onChange:e=>S(e,[o]),value:o,id:`space-${o}`,className:"hidden"}),spaceId:t.id,isChecked:v("spaceIds").includes(o),count:p.get("workspace")?.get(o)?.count??0,onFolderFold:N,folderFoldedMap:u}),g.get(o)?.map(e=>{if(p.get("document")?.get(e)?.count===0||m.get(t.id)||u.get(o))return null;let a=p.get("document")?.get(e);return null==a?null:ev.createElement(eFk,{key:e,inputField:ev.createElement("input",{...b("projectIds"),type:"checkbox",value:e,id:`project-${e}`,className:"hidden"}),projectId:e,filterValue:a,isChecked:v("projectIds").includes(e)})}),[...n.keys()].map(e=>{let a=n.get(e);return!p.get("workspace")?.has(e)||m.get(t.id)||null==a?null:ev.createElement(ev.Fragment,null,ev.createElement(eFb,{key:e,inputField:ev.createElement("input",{...b("spaceIds"),type:"checkbox",onChange:t=>S(t,[e]),value:e,id:`space-${e}`,className:"hidden"}),space:a.space,isChecked:v("spaceIds").includes(e),count:p.get("workspace")?.get(e)?.count??0,onFolderFold:N,folderFoldedMap:u}),g.get(e)?.map(e=>{let t=p.get("document")?.get(e);return null==t||u.get(a.space.id)?null:ev.createElement(eFk,{key:e,inputField:ev.createElement("input",{...b("projectIds"),type:"checkbox",value:e,id:`project-${e}`,className:"hidden"}),projectId:e,filterValue:t,isChecked:v("projectIds").includes(e)})}))}))})),ev.createElement(eFy,{getValues:v,isAssignmentsClosed:c,onChangeAssignees:I,onChangeAssigneeType:D,register:b,searchFilterValue:p.get("assignees"),toggleClick:e=>{l({type:"assignments_toggle"}),e.preventDefault()}})))))}),eFN=eL.default.div.withConfig({displayName:"SearchEmptyState__Wrapper",componentId:"sc-16a6ce8c-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: 0 auto; + font-size: 14px; + text-align: center; + height: 100%; + padding: 32px 32px 160px 32px; + + @media (max-width: 768px) { + max-width: 540px; + padding-bottom: 100px; + } + + @media (max-width: 480px) { + max-width: 100%; + padding-bottom: 100px; + } +`,eFC=eL.default.h4.withConfig({displayName:"SearchEmptyState__Heading",componentId:"sc-16a6ce8c-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,eFM=eL.default.p.withConfig({displayName:"SearchEmptyState__Description",componentId:"sc-16a6ce8c-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,eFS=eL.default.div.withConfig({displayName:"SearchEmptyState__EmptyImageWrapper",componentId:"sc-16a6ce8c-3"})` + margin-bottom: 24px; + opacity: 40%; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,eFI=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(eFN,null,ev.createElement(eFS,null,!n&&ev.createElement(lT.ke,null)),ev.createElement(eFC,null,t),ev.createElement(eFM,null,a))},eFD=function(e){let{avatar:t,color:a,name:n,size:l}=e,r=(0,ev.useMemo)(()=>null==a?void 0:{primaryColor:a},[a]),o=t?.__typename==="SpaceAvatarsV2Custom"?t?.small?.hdpi.url:void 0,i=t?.__typename==="SpaceAvatarsV2Emoji"?t?.emoji:void 0;return ev.createElement(eI.ThemeProvider,{theme:r},null!=o?ev.createElement(e1.SpaceAvatar,{size:l,src:o,alt:n}):ev.createElement(e1.SpaceAvatar,{size:l,name:i??n}))},eFT=eL.default.div.withConfig({displayName:"styled__PaginationWrapper",componentId:"sc-201984ba-0"})` + margin-bottom: -30px; +`,eF$=eL.default.div.withConfig({displayName:"styled__ProjectAvatar",componentId:"sc-201984ba-1"})` + display: flex; + width: 50px; + height: 50px; + align-items: center; + justify-content: center; + align-self: flex-start; + flex-shrink: 0; + background: ${e=>e.theme.isNightMode?"url('/images/project_bg_dark.svg')":"url('/images/project_bg_light.svg')"} + no-repeat 0 0; + + & .default-icon { + display: flex; + width: 24px; + height: 24px; + background: url('/images/project_icon.svg') no-repeat 0 0; + } + & .project-avatar { + display: flex; + font-size: 24px; + line-height: 24px; + } +`,eFP=eL.default.img.withConfig({displayName:"styled__UserAvatar",componentId:"sc-201984ba-2"})` + display: flex; + flex: 1 0 auto; + width: 36px; + height: 36px; + border-radius: 50px; + background: transparent; +`,eFF=eL.default.div.withConfig({displayName:"styled__Details",componentId:"sc-201984ba-3"})` + display: flex; + margin-top: 8px; +`,eFA=eL.default.div.withConfig({displayName:"styled__CommentFrom",componentId:"sc-201984ba-4"})` + display: flex; + align-items: flex-end; + position: relative; + color: ${e=>e.theme.appColors.hex(10)}; + font-weight: 500; + margin-bottom: 5px; +`,eFR=eL.default.span.withConfig({displayName:"styled__CommentTime",componentId:"sc-201984ba-5"})` + display: flex; + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.xs}; + font-weight: normal; + margin-left: 8px; + margin-bottom: 3px; +`,eFj=eL.default.div.withConfig({displayName:"styled__Pill",componentId:"sc-201984ba-6"})` + display: inline-flex; + align-items: center; + align-self: flex-start; + white-space: wrap; + border-radius: 30px; + padding: 2px 12px 2px 8px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.xs}; + + & svg { + flex-shrink: 0; + color: ${e=>e.theme.appColors.hex(50)}; + } + + & > div:first-child { + margin-right: 6px; + transform: scale(0.9); + } +`,eFO=eL.default.div.withConfig({displayName:"styled__InlineProjectName",componentId:"sc-201984ba-7"})` + display: inline; + color: ${e=>e.theme.appColors.hex(10)}; + margin-left: 4px; +`,eFU=eL.default.div.withConfig({displayName:"styled__InlineProjectAvatar",componentId:"sc-201984ba-8"})` + display: inline-flex; + width: 20px; + height: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; + flex-shrink: 0; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(80)}; + font-size: 12px; + line-height: 12px; +`,eFZ=(0,eL.default)(sC.rU).withConfig({displayName:"styled__ResultLinkComment",componentId:"sc-201984ba-9"})` + display: grid; + grid-template-columns: auto 2fr auto; + align-items: flex-start; + padding: 8px 32px; + margin-bottom: 4px; + + &:hover { + background: ${e=>e.theme.appColors.hex(90)}; + } +`,eFL=(0,eL.default)(sC.rU).withConfig({displayName:"styled__ResultLink",componentId:"sc-201984ba-10"})` + display: grid; + grid-template-columns: auto 2fr auto; + align-items: center; + padding: 8px 32px; + margin-bottom: 4px; + + &:hover { + background: ${e=>e.theme.appColors.hex(90)}; + } +`,eFB=eL.default.div.withConfig({displayName:"styled__ResultContent",componentId:"sc-201984ba-11"})` + display: flex; + flex-direction: column; + padding-left: 20px; +`,eFz=eL.default.div.withConfig({displayName:"styled__ProjectName",componentId:"sc-201984ba-12"})` + display: flex; + word-break: break-word; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.md}; + padding-bottom: 8px; +`,eFV=eL.default.div.withConfig({displayName:"styled__QueryMatch",componentId:"sc-201984ba-13"})` + word-break: break-word; + border-left: 2px solid ${e=>e.theme.appColors.hex(70)}; + padding-left: 8px; + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + font-style: italic; + + & em { + font-style: normal; + font-weight: 500; + color: ${e=>e.theme.textColors.hex(10)}; + } + & span { + color: ${e=>e.theme.appColors.hex(50)}; + white-space: pre-wrap; + } +`,eFq=eL.default.div.withConfig({displayName:"styled__Results",componentId:"sc-201984ba-14"})` + display: flex; + flex-direction: column; + margin-bottom: 20px; +`,eFW=eL.default.div.withConfig({displayName:"styled__ResultsList",componentId:"sc-201984ba-15"})` + margin: 10px 0 0; +`,eFH=eL.default.div.withConfig({displayName:"styled__SummaryWrapper",componentId:"sc-201984ba-16"})` + font-size: 15px; + color: #999; + margin: 10px 32px 0; + + & > strong { + color: ${e=>e.theme.textColors.hex(10)}; + } +`,eFG=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"styled__Checkbox",componentId:"sc-201984ba-17"})` + display: flex; + flex-shrink: 0; + width: 20px; + height: 20px; + margin-top: 2px; + -webkit-appearance: none; + + &:after { + display: flex; + flex: 1 0 auto; + align-items: center; + justify-content: center; + height: 100%; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } + + &:after { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + border-radius: 6px; + } + + &[disabled] { + pointer-events: none; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected.svg":"/../images/check_hover.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected.svg'); + } + } +`,eFK=eL.default.span.withConfig({displayName:"styled__PillText",componentId:"sc-201984ba-18"})` + margin-left: 3px; + font-size: 13px; + line-height: 13px; +`,eFY=(0,eI.getColorScheme)(eI.ThemeColors.danger),eFQ=eL.default.div.withConfig({displayName:"styled__PillContainer",componentId:"sc-201984ba-19"})` + display: inline-flex; + align-items: center; + border: 0; + padding: 1px 8px; + background: transparent; + cursor: pointer; + white-space: nowrap; + border-radius: 30px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(10)}; + + ${e=>e.$hasEnded&&(0,eL.css)` + border: 1px solid ${eFY?.base}; + background: ${eFY?.alpha10}; + color: ${eFY?.base}; + `} + + & .meta-avatar { + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + } +`,eFJ=eL.default.div.withConfig({displayName:"styled__NoResultsWrapper",componentId:"sc-201984ba-20"})` + display: flex; + flex-direction: column; + text-align: center; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +`,eFX=eL.default.div.withConfig({displayName:"styled__EmptyImageWrapper",componentId:"sc-201984ba-21"})` + margin-bottom: 24px; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,eF0=eL.default.h4.withConfig({displayName:"styled__Heading",componentId:"sc-201984ba-22"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; +`,eF1=function(e){let{edge:t}=e,a=t?.node?.metadata?.workspace_color,n=t?.node?.metadata?.document_avatar?.value??null,l=ev.useMemo(()=>null==a?void 0:{primaryColor:a},[a]);if(null==t.node)return null;let{author:r,comment:o,document_id:i,highlights:s,metadata:d,node:c}=t.node;if(null==o||null==r)return null;let m=CT()(s),u=r.avatars_v2?.small?.mdpi.url;return ev.createElement(eI.ThemeProvider,{theme:l},ev.createElement(eFZ,{to:{pathname:`/d/${i}`,hash:`#node-${c.id}`}},ev.createElement(eFP,{src:u}),ev.createElement(eFB,null,ev.createElement(eFA,null,r.handle,ev.createElement(eFR,null,cc()(o.created_at).fromNow())),ev.createElement(eFV,null,null!=m&&m?.ops.map((e,t)=>e?.attributes?.highlight?ev.createElement("em",{key:t},e.insert):ev.createElement("span",{key:t},e.insert)),null==m&&ev.createElement("span",null,t.node.comment?.body.text)),ev.createElement(eFF,null,ev.createElement(eFj,null,ev.createElement(eFD,{avatar:d.workspace_avatar,color:d.workspace_color,name:d.workspace_name,size:"xs"}),d.workspace_name,ev.createElement(tn.Icon,{icon:"default_caret_right"}),null==n?ev.createElement(tn.Icon,{icon:"dd_project_small"}):ev.createElement(eFU,null,n),ev.createElement(eFO,{className:"max-w-xs truncate"},d.document_title||"Untitled"))))))},eF2=function(e){let{edge:t}=e,a=t?.node?.metadata?.workspace_color,n=t?.node?.metadata?.document_avatar?.value??null,l=ev.useMemo(()=>null==a?void 0:{primaryColor:a},[a]);if(null==t.node)return null;let{document_id:r,highlights:o,metadata:i,node:s}=t.node,d=CT()(o),c=i.document_node_total_count,m=i.document_node_completed_count,u="node"===t.node.type&&ts()(t.node.node.ancestors);return ev.createElement(eI.ThemeProvider,{theme:l},ev.createElement(eFL,{to:{pathname:`/d/${r}`,hash:`#node-${s.id}`}},ev.createElement(eF$,null,null==n?ev.createElement("span",{className:"default-icon"}):ev.createElement("span",{className:"project-avatar"},n)),ev.createElement(eFB,null,ev.createElement(eFz,null,i.document_title||"Untitled"),!u&&ev.createElement(eFV,null,null!=d&&d.ops.map((e,t)=>e?.attributes?.highlight?ev.createElement("em",{key:t},e.insert):ev.createElement("span",{key:t},e.insert)),null==d&&ev.createElement("span",null,t.node.node.text.string)),ev.createElement(eFF,null,ev.createElement(eFj,null,ev.createElement(eFD,{avatar:i.workspace_avatar,color:i.workspace_color,name:i.workspace_name,size:"xs"}),i.workspace_name,ev.createElement(tn.Icon,{icon:"default_caret_right"}),null==n?ev.createElement(tn.Icon,{icon:"dd_project_small"}):ev.createElement(eFU,null,n),ev.createElement(eFO,{className:"max-w-xs truncate"},i.document_title||"Untitled")))),u&&ev.createElement(pl,{percentCompleted:c>0?m/c*100:0})))};function eF5(e){let{start:t,end:a}=e;if(null==a)return null;let n=t,l=a;return null==n&&(n=a,l=null),ez.DateDuration.fromDateRangeDesc({start:n,end:l})}let eF3=function(e){let{event:t}=e,a=ev.useMemo(()=>eF5(t),[t]),n=ev.useMemo(()=>null==a?"":a.toReadableFormat(),[a]);return null==a?null:ev.createElement(eFQ,{style:{marginRight:"5px"},$hasEnded:"has_ended"===a.toRelativeStatus()},ev.createElement(tn.Icon,{icon:t.is_recurring?"addon_date_repeat":"addon_date"}),ev.createElement(eFK,null,n))},eF4=(0,eL.default)(sC.rU).withConfig({displayName:"styledTaskResults__ResultLink",componentId:"sc-82c429ce-0"})` + display: grid; + grid-template-columns: auto 2fr auto; + align-items: center; + padding: 8px 32px; + + &:hover { + background: ${e=>e.theme.appColors.hex(90)}; + } +`,eF6=eL.default.div.withConfig({displayName:"styledTaskResults__TaskWrapper",componentId:"sc-82c429ce-1"})` + display: flex; + gap: 12px; +`,eF8=eL.default.div.withConfig({displayName:"styledTaskResults__TaskContent",componentId:"sc-82c429ce-2"})` + display: flex; + flex-direction: column; + padding-top: 2px; +`;eL.default.div.withConfig({displayName:"styledTaskResults__ResultContent",componentId:"sc-82c429ce-3"})` + display: flex; + flex-direction: column; +`;let eF7=eL.default.div.withConfig({displayName:"styledTaskResults__QueryMatch",componentId:"sc-82c429ce-4"})` + word-break: break-word; + color: ${e=>e.theme.textColors.hex(10)}; + text-decoration: ${e=>e.$completed?"line-through":"none"}; + ${e1.UiTypography.md}; + + & em { + font-style: normal; + font-weight: 500; + } + & span { + white-space: pre-wrap; + } +`,eF9=eL.default.div.withConfig({displayName:"styledTaskResults__Details",componentId:"sc-82c429ce-5"})` + display: flex; + margin-top: 8px; +`,eAe=eL.default.div.withConfig({displayName:"styledTaskResults__Pill",componentId:"sc-82c429ce-6"})` + display: inline-flex; + align-items: center; + align-self: flex-start; + white-space: wrap; + border-radius: 30px; + padding: 2px 12px 2px 8px; + background: ${e=>e.theme.appColors.hex(100)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.xs}; + + & svg { + flex-shrink: 0; + color: ${e=>e.theme.appColors.hex(50)}; + } + + & > div:first-child { + margin-right: 6px; + transform: scale(0.9); + } +`,eAt=eL.default.div.withConfig({displayName:"styledTaskResults__ProjectAvatar",componentId:"sc-82c429ce-7"})` + display: inline-flex; + width: 20px; + height: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; + flex-shrink: 0; + border-radius: 10px; + background-color: ${e=>e.theme.appColors.hex(80)}; + font-size: 12px; + line-height: 12px; +`,eAa=eL.default.div.withConfig({displayName:"styledTaskResults__ProjectName",componentId:"sc-82c429ce-8"})` + display: inline; + color: ${e=>e.theme.appColors.hex(10)}; + margin-left: 4px; +`,eAn=(0,la.ZP)` + mutation ProjectNodesCompletionUpdateMutation($input: ProjectNodesCompletionUpdateInput!) { + projectNodesCompletionUpdate(input: $input) { + clientMutationId + tasks { + node_id + completed + end + start + } + } + } +`,eAl=(0,la.ZP)` + query search($filterby: SearchFiltering!, $first: Int, $after: String) { + search(filterby: $filterby, first: $first, after: $after) { + edges { + cursor + node { + id + document_id + workspace { + type + id + } + type + metadata { + document_avatar { + type + value + } + document_node_completed_count + document_node_total_count + document_role + document_title + workspace_avatar { + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + } + } + } + ... on SpaceAvatarsV2Emoji { + emoji + } + } + workspace_color + workspace_name + workspace_role + view_path + isDocumentStale + } + ... on SearchHitNode { + node + highlights + } + ... on SearchHitComment { + node + comment + highlights + author { + ...BasicUserFields + } + } + } + } + totalCount + filters { + id + label + type + values { + id + label + metadata + count + } + } + } + } + ${up} +`,eAr=function(e){let{className:t,completed:a,documentId:n,nodeId:l,allowCheck:r}=e,[o]=(0,cs.D)(eAn),i=(0,eF.TH)(),{filterby:s}=eFg(),d=ev.useMemo(()=>({filterby:s,...egi(i.search,10)}),[i.search,s]);return ev.createElement(eFG,{className:t,checked:a,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=(0,ld.Z)();o({variables:{input:{clientMutationId:t,nodeIds:[l],projectId:n,completed:!a}},optimisticResponse:{__typename:"Mutation",projectNodesCompletionUpdate:{__typename:"ProjectNodesCompletionUpdatePayload",clientMutationId:t,tasks:[{node_id:l,end:null,start:null,completed:!a}]}},update:(e,t)=>{let{data:a}=t;if(null==a)return;let r=e.readQuery({query:eAl,variables:d});if(null==r)return;let o=p6()(a.projectNodesCompletionUpdate.tasks,e=>e.node_id===l);if(o<0)return;let i=p6()(r.search.edges,e=>e?.node?.document_id===n&&e?.node?.node?.id===l);if(i<0)return;let s=a.projectNodesCompletionUpdate.tasks[o],c=(0,es.ZP)(r,e=>{let t=e?.search?.edges?.[i]?.node;return null==t||(t.node.completed=s.completed,null!=t.node.event&&(null!=s.end&&(t.node.event.end=s.end),null!=s.start&&(t.node.event.start=s.start))),e});e.writeQuery({query:eAl,variables:d,data:c})}})},disabled:!r})},eAo=function(e){let{edge:t}=e,a=t?.node?.metadata?.workspace_color,n=t?.node?.metadata?.document_avatar?.value??null,l=ev.useMemo(()=>null==a?void 0:{primaryColor:a},[a]);if(null==t.node)return null;let{document_id:r,highlights:o,metadata:i,node:s}=t.node,d=CT()(o),c=lm({role:{project:i.document_role,workspace:i.workspace_role},action:{project:"check",workspace:"check_project"}});return ev.createElement(eI.ThemeProvider,{theme:l},ev.createElement(eF4,{to:{pathname:`/d/${r}`,hash:`#node-${s.id}`}},ev.createElement(eF6,null,ev.createElement(eAr,{completed:s.completed,documentId:r,nodeId:s.id,allowCheck:c}),ev.createElement(eF8,null,ev.createElement(eF7,{$completed:s.completed},null!=d&&d?.ops.map((e,t)=>e?.attributes?.highlight?ev.createElement("em",{key:t},e.insert):ev.createElement("span",{key:t},e.insert)),null==d&&ev.createElement("span",null,t.node.node.text.string)),ev.createElement(eF9,null,null!=s.event&&ev.createElement(eF3,{event:s.event}),ev.createElement(eAe,null,ev.createElement(eFD,{avatar:i.workspace_avatar,color:i.workspace_color,name:i.workspace_name,size:"xs"}),i.workspace_name,ev.createElement(tn.Icon,{icon:"default_caret_right"}),null==n?ev.createElement(tn.Icon,{icon:"dd_project_small"}):ev.createElement(eAt,null,n),ev.createElement(eAa,{className:"max-w-xs truncate"},i.document_title||"Untitled")))))))},eAi=function(e){let{totalCount:t,query:a}=e;return ev.createElement(eFH,null,ts()(a)?ev.createElement(eY.Z,{id:"general.results_for_no_query",defaultMessage:"{totalCount} results",values:{totalCount:t}}):ev.createElement(eY.Z,{id:"general.results_for_query",defaultMessage:"{totalCount, plural, =0 {No results} one {1 result} other {{totalCount} results} } for ''{query}''",values:{totalCount:t,query:a,strong:e=>ev.createElement("strong",null,e)}}))},eAs=function(e){let t;let{data:a,error:n,loading:l,query:r,type:o,pageNumber:i}=e,s=(0,eF.TH)();if(l)return ev.createElement(eFH,null,"Searching...");if(null!=n)return ev.createElement(eFH,null,ev.createElement(eY.Z,{id:"general.errors.were_sorry_but_theres_been_a_problem_please_try_again",defaultMessage:"We're sorry, but there's been a problem. Please try again."}));let d=a?.search;if(null==d)return ev.createElement(eAi,{query:r,totalCount:0});switch(o){case"project":t=eF2;break;case"task":t=eAo;break;case"comment":t=eF1;break;default:return null}let{edges:c,totalCount:m}=d,u=(function(e,t){if(null==e)return t;let a=(10*e-10).toString(),n=t.findIndex(e=>e.cursor===a);return -1===n?t:t.slice(n,n+10)})(i,c).filter(e=>e.node?.metadata.isDocumentStale!==!0);return ev.createElement(ev.Fragment,null,u.length>0?ev.createElement(eFq,null,ev.createElement(eAi,{query:r,totalCount:m}),ev.createElement(eFW,null,u?.map((e,a)=>ev.createElement(t,{edge:e,key:a.toString()}))),ev.createElement(eFT,null,ev.createElement(eNH,{pathname:s.pathname,search:s.search,hash:s.hash,totalCount:m,itemPerPage:10}))):ev.createElement(eFJ,null,ev.createElement(eFX,null,ev.createElement(lT.VP,null)),ev.createElement(eF0,null,ev.createElement(eY.Z,{id:"general.empty_state_search_result",defaultMessage:"No results for ''{query}''",values:{query:r,strong:e=>ev.createElement("strong",null,e)}}))))},eAd={isSidebarClosed:window.innerWidth<993,isTypeClosed:!1,isStatusClosed:!1,isAssignmentsClosed:!1,isFoldersClosed:!1,isWorkspaceRootFoldedMap:new Map,isFolderFoldedMap:new Map,folderProjectsMap:new Map,filtersMap:new Map},eAc=(e,t)=>{switch(t.type){case"filter_toggle":return{...e,isSidebarClosed:!e.isSidebarClosed};case"type_toggle":return{...e,isTypeClosed:!e.isTypeClosed};case"status_toggle":return{...e,isStatusClosed:!e.isStatusClosed};case"folders_toggle":return{...e,isFoldersClosed:!e.isFoldersClosed};case"assignments_toggle":return{...e,isAssignmentsClosed:!e.isAssignmentsClosed};case"workspace_root_toggle":for(let a of t.spaceIds)e.isWorkspaceRootFoldedMap.set(a,t.isFolded);return{...e,isWorkspaceRootFoldedMap:e.isWorkspaceRootFoldedMap};case"folder_fold_toggle":for(let a of t.spaceIds)e.isFolderFoldedMap.set(a,t.isFolded);return{...e,isFolderFoldedMap:e.isFolderFoldedMap};case"init_folder_projects_map":return{...e,folderProjectsMap:t.map};case"init_filters_map":return{...e,filtersMap:t.map}}},eAm=eL.default.div.withConfig({displayName:"Search__SearchContainer",componentId:"sc-6b13d86-0"})` + display: flex; + min-width: 300px; + margin-left: 32px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + border-radius: 10px; + justify-content: space-between; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + &:focus-within { + border-color: ${e=>e.theme.appColors.hex(60)}; + } + + @media (min-width: 992px) { + min-width: 600px; + max-width: 600px; + } + + & > input { + display: flex; + flex: 1; + background: none; + box-shadow: none; + border: 0; + padding: 11px 12px 11px 5px; + color: ${e=>e.theme.textColors.hex(10)}; + ${e1.UiTypography.sm}; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +`,eAu=(0,eL.default)(tn.Icon).withConfig({displayName:"Search__SearchIcon",componentId:"sc-6b13d86-1"})` + margin: 0 5px 0 10px; + color: ${e=>e.theme.textColors.hex(70)}; +`,eAp=eL.default.div.withConfig({displayName:"Search__CommandKMessageContainer",componentId:"sc-6b13d86-2"})` + width: 100%; + padding: 16px 22px; + font-size: 14px; + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + + @media (min-width: 768px) { + padding: 16px 32px; + } +`,eAg=(0,eL.default)(e1.Shortcut.Combo).withConfig({displayName:"Search__StyledCombo",componentId:"sc-6b13d86-3"})` + display: inline-flex; +`,eAf=(0,eL.default)(lT.Im).withConfig({displayName:"Search__StyledSearchFilterIcon",componentId:"sc-6b13d86-4"})` + path { + fill: #fff; + } +`,eAh=(0,e$.connect)(function(e){return{user:t7(e)}}),eAy=function(){let e=(0,eK.Z)(),t=(0,eF.k6)(),{search:a}=(0,eF.TH)(),[n,l]=ev.useState(a),[r,o]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eAd;return ev.useReducer(eAc,e)}(),{filterby:i}=eFg(),[s,d]=ev.useState(i.query||""),c=ev.useMemo(()=>{if(!ts()(i))return{filterby:i,...egi(a,10)}},[a,i]),m=ev.useMemo(()=>{let{page:e}=tL.parse(a);return ts()(e)||Number.isNaN(e)?null:Math.max(1,Number(e))},[a]),u=i.type===eFm?"cache-first":"network-only",p=(0,eB.a)(eAl,{variables:c,fetchPolicy:"network-only",nextFetchPolicy:u,skip:null==new URLSearchParams(t.location.search).get("type")&&ts()(i.query)});a!==n&&(d(i.query||""),l(a));let g=()=>{o({type:"filter_toggle"})},f=ev.useRef(null);return ev.createElement(eFu.Provider,{value:{state:r,dispatch:o}},ev.createElement(eT.ql,null,ev.createElement("title",null,"Search - Taskade")),ev.createElement("div",{className:"flex h-[100%]"},ev.createElement(eFw,{ref:f,searchResult:p}),ev.createElement("div",{className:"flex flex-1 flex-col"},ev.createElement("div",{className:"w-[100%] max-lg:ml-2.5"},ev.createElement(eD6,{isSearchSidebarClosed:r.isSidebarClosed,onClick:g,isEmptySearchQuery:ts()(i.query)})),ev.createElement("div",{className:`flex flex-1 flex-col overflow-y-auto p-2.5 ${r.isSidebarClosed?"":"position: relative"}`},ev.createElement(eAm,null,ev.createElement(eAu,{icon:"dd_search"}),ev.createElement("input",{className:"mousetrap",value:s,onChange:e=>{d(e.target.value)},onKeyPress:e=>{if("Enter"===e.key){e.preventDefault();let a=i.type??"project";t.push({pathname:"/search",search:ts()(s.trim())?new URLSearchParams({type:a}).toString():new URLSearchParams({q:s,type:a}).toString()})}f.current?.handleResetOnSearch(e)},placeholder:e.formatMessage({id:"general.search_all_projects_comments_workspaces",defaultMessage:"Search all projects, comments, and workspaces..."}),autoFocus:!0}),!ts()(i.type)&&ev.createElement(eAf,{onClick:g,className:"mr-4 hidden cursor-pointer max-lg:block"})),!ts()(i.type)&&ev.createElement(eAs,{...p,query:i.query,type:i.type,pageNumber:m}),ts()(i.type)&&ev.createElement(ev.Fragment,null,ev.createElement(eAp,null,ev.createElement(eY.Z,{id:"general.search_screen_footer_instructions",defaultMessage:`💡 You can use {shortcut} to jump between projects.`,values:{shortcut:ev.createElement(eAg,{fontSize:"12px",padding:"5px",gap:"4px"},ev.createElement(e1.Shortcut.Key,null,eI.ModifierKeys.ModSymbol),ev.createElement(e1.Shortcut.Key,null,"K"))}})),ev.createElement(eFI,{heading:e.formatMessage({id:"general.empty_state_search",defaultMessage:"Global Search"}),description:e.formatMessage({id:"general.empty_state_search_description",defaultMessage:"Search across all your workspaces, folders, and projects."})}))))))},eAb=eAh(function(e){return null==e.user?ev.createElement(eF.l_,{to:"/login"}):ev.createElement(eAy,e)}),eAv=function(e){let{url:t}=e,a=ev.useRef(null),[n,l]=ev.useState(!1),r=ev.useCallback(()=>{l(!1)},[]);return ev.useEffect(()=>{let e=new(hF())(a.current);return e.on("success",()=>{l(!0)}),()=>{e.destroy()}},[]),ev.createElement("button",{type:"button",className:"ril__toolbarItemChild ril__builtinButton ril__copylinkButton text-sm","data-clipboard-text":t,onBlur:r,onMouseOut:r,ref:a},ev.createElement("span",null,n?ev.createElement(eY.Z,{id:"general.copied",defaultMessage:"Copied!"}):ev.createElement(eY.Z,{id:"general.copy_link",defaultMessage:"Copy Link"})))},eAk=function(e){let{url:t}=e;return ZM.PDFObject.supportsPDFs()?ev.createElement("div",{className:"pdf-preview"},ev.createElement(ZM.PDFObject,{width:"100%",height:"100vh",url:t,pdfOpenParams:{view:"Fit"}})):ev.createElement("div",{className:"pdf-preview"},ev.createElement("div",{className:"pdf-preview-unavailable"},ev.createElement(eY.Z,{id:"general.pdf_preview_is_not_available",defaultMessage:"PDF Preview is not available"}),ev.createElement("a",{href:t,rel:"noopener noreferrer",target:"_blank"},ev.createElement(eY.Z,{id:"general.view_pdf",defaultMessage:"View PDF"}))))},eAE=function(e){let{url:t}=e;return Zo.Z.canPlay(t)?ev.createElement(Zo.Z,{width:"80%",height:"80%",url:t,controls:!0}):ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(lT.Kn,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-white"},ev.createElement(eY.Z,{id:"general.no_preview",defaultMessage:"No Preview"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.youtube_source_is_not_viewable",defaultMessage:"Youtube source is not viewable."})))},eAx=new Map([["mp3","audio/mp3"],["wav","audio/wav"]]),eA_=new Map([["mov",null],["mkv","video/mp4"],["mp4","video/mp4"],["ogg","video/ogg"],["ogv","video/ogg"],["webm","video/webm"]]);function eAw(e,t){if(null==e)return null;let{extension:a,s3KeyOriginal:n}=e.data.fileDesc,l=$k(e.data.fileDesc),r=jj(n),o=(0,cx.getMediaKeyParts)(n);if(null!=o&&"youtube"===o.location){let e="https://youtube.com/watch?v="+o.id,a=[ev.createElement("button",{className:"whitespace-nowrap text-sm font-medium transition duration-150 ease-in-out",onClick:t,key:"askai"},ev.createElement("div",{className:"px-2"},ev.createElement(tn.Icon,{className:"-mt-1 mr-2 scale-90 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ask_ai",defaultMessage:"Ask AI"})))),ev.createElement(eAv,{key:"copy",url:e})];return{title:"Youtube",mainCustomContent:ev.createElement(eAE,{url:e}),enableZoom:!1,toolbarButtons:a}}let i=[ev.createElement("button",{className:"whitespace-nowrap text-sm font-medium transition duration-150 ease-in-out",onClick:t,key:"askai"},ev.createElement("div",{className:"px-2"},ev.createElement(tn.Icon,{className:"-mt-1 mr-2 scale-90 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ask_ai",defaultMessage:"Ask AI"})))),ev.createElement(eAv,{key:"copy",url:r}),ev.createElement("a",{key:"download",className:"ril__toolbarItemChild ril__builtinButton ril__downloadButton text-sm text-white",href:r,rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.download",defaultMessage:"Download"})))];if("application/pdf"===e.data.fileDesc.mimetype)return{title:l,mainCustomContent:ev.createElement(eAk,{url:r}),toolbarButtons:i,enableZoom:!1};if(cx.ImageMimeTypes.has(e.data.fileDesc.mimetype))return function(e){let t=$k(e.data.fileDesc),{namespace:a,id:n,extension:l}=e.data.fileDesc;if(null==t)return null;let r=jj(jR(a,n,"h_400,w_400","xhdpi",l)),o=[ev.createElement(eAv,{key:"copy",url:r}),ev.createElement("a",{key:"download",className:"ril__toolbarItemChild ril__builtinButton ril__downloadButton text-sm text-white",href:r,rel:"noopener noreferrer",target:"_blank"},ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.download",defaultMessage:"Download"})))];return{title:t,mainSrc:r,enableZoom:!0,toolbarButtons:o}}(e);if(eA_.has(a)){let e=eA_.get(a)??void 0,t=ev.createElement("video",{controls:!0,autoPlay:!0},ev.createElement("source",{src:r,type:e}));return{title:l,mainSrc:r,enableZoom:!1,mainCustomContent:t,toolbarButtons:i}}if(eAx.has(a)){let e=eAx.get(a)??void 0,t=ev.createElement("audio",{controls:!0,autoPlay:!0},ev.createElement("source",{src:r,type:e}));return{title:l,mainSrc:r,enableZoom:!1,mainCustomContent:t,toolbarButtons:i}}return{title:l,mainSrc:r,enableZoom:!1,mainCustomContent:ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(lT.Kn,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-white"},ev.createElement(eY.Z,{id:"general.no_preview",defaultMessage:"No Preview"})),ev.createElement("p",{className:"flex flex-col text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.file_type_not_supported_for_viewing",defaultMessage:"File type not supported for viewing."}))),toolbarButtons:i}}let eAN=(0,d9.oM)({name:"dialogs.spaceMediaPreview",initialState:{isOpen:!1},reducers:{toggleSpaceMediaPreviewDialog(e,t){if(e.isOpen||null==t.payload)return{isOpen:!1};let{spaceMedias:a,spaceId:n}=t.payload;return{spaceId:n,spaceMedias:a,index:t.payload.index??0,isOpen:!0}},setMediaIndex:(e,t)=>null==t.payload?e:{...e,index:t.payload.index}}}),eAC=null;"undefined"!=typeof window&&(eAC=a(92879).Z);let eAM=(0,eL.default)(function(e){return ev.cloneElement(e.children,{wrapperClassName:e.className})}).withConfig({displayName:"SpaceMediaPreviewDialogBody__WrappedLightbox",componentId:"sc-5c78c209-0"})` + .ril__inner { + top: 60px; + + border-top-left-radius: 0px; + border-top-right-radius: 0px; + } + + .pdf-preview { + display: flex; + & > .pdfobject-container { + width: 100%; + } + } + + .pdf-preview-unavailable { + display: flex; + flex: 1 1 auto; + flex-direction: column; + align-items: center; + align-self: center; + color: ${e=>e.theme.appColors.hex(10)}; + & > a { + color: ${e=>e.theme.primaryColorScheme?.base}; + } + } +`,eAS=function(e){let{spaceId:t,spaceMedias:a,index:n,onExit:l}=e,r=(0,e$.useDispatch)(),o=a.length,i=o>n?a[n]:void 0,s=ev.useCallback(()=>{l()},[l]),d=ev.useCallback(e=>{null!=i&&(l(),r(Pw.actions.toggleMediaAiDialog({spaceId:t,spaceMedia:i})),e.stopPropagation())},[r,l,i,t]),c=ev.useMemo(()=>null==i?null:eAw(i,d),[d,i]),m=ev.useMemo(()=>1===o?null:eAw(a[(n+1)%o],d),[d,n,a,o]),u=ev.useMemo(()=>1===o?null:eAw(a[(n+o-1)%o],d),[d,n,a,o]),p=ev.useCallback(()=>{r(eAN.actions.setMediaIndex({index:(n+1)%o}))},[r,n,o]),g=ev.useCallback(()=>{r(eAN.actions.setMediaIndex({index:(n+o-1)%o}))},[r,n,o]);if(null==eAC)return null;if(null==c)return ev.createElement("div",{className:"flex h-96 items-center justify-center text-lg"},ev.createElement(eY.Z,{id:"general.no_preview_available",defaultMessage:"No preview available."}));let{title:f,toolbarButtons:h,mainCustomContent:y,mainSrc:b,enableZoom:v}=c;return ev.createElement("div",null,ev.createElement(eAM,null,ev.createElement(eAC,{imagePadding:60,imageTitle:f,mainCustomContent:y,nextCustomContent:m?.mainCustomContent,prevCustomContent:u?.mainCustomContent,mainSrc:b,nextSrc:m?.mainSrc,prevSrc:u?.mainSrc,onCloseRequest:s,onMovePrevRequest:g,onMoveNextRequest:p,toolbarButtons:h,enableZoom:v})))},eAI=(0,e$.connect)(function(e){return e.dialogs.spaceMediaPreview})(function(e){let t=(0,e$.useDispatch)(),{isOpen:a,spaceMedias:n,index:l,spaceId:r}=e,o=ev.useCallback(()=>{t(eAN.actions.toggleSpaceMediaPreviewDialog())},[t]);return null==n||null==l||null==r?null:ev.createElement(eI.ModalDialog,{isOpen:a,close:o,backdropOpacity:eI.ModalDialogOpacity.Translucent},e=>{let{exit:t}=e;return ev.createElement(eAS,{spaceMedias:n,index:l,onExit:t,spaceId:r})})}),eAD=(0,la.ZP)` + query MembershipPreferencesQuery($spaceID: ID!) { + membership(space_id: $spaceID) { + id + preferences { + notifications { + browser + email + mobile + } + } + } + } +`,eAT=(0,la.ZP)` + mutation SpaceNotificationUpdateMutation($input: SpaceNotificationUpdateInput!) { + spaceNotificationUpdate(input: $input) { + clientMutationId + membership { + id + preferences { + notifications { + browser + email + mobile + } + } + } + } + } +`,eA$=eL.default.div.withConfig({displayName:"Radio__Container",componentId:"sc-9a10f428-0"})` + display: flex; + flex-direction: row; + align-items: center; +`,eAP=eL.default.input.withConfig({displayName:"Radio__BaseRadio",componentId:"sc-9a10f428-1"})` + position: absolute; + opacity: 0; + cursor: pointer; + height: 0; + width: 0; +`,eAF=(0,eL.default)(lT.Hm).withConfig({displayName:"Radio__StyledCheckmark",componentId:"sc-9a10f428-2"})` + display: none; + & path { + fill: #fff; + } +`,eAA=eL.default.div.withConfig({displayName:"Radio__CheckmarkContainer",componentId:"sc-9a10f428-3"})` + display: flex; + justify-content: center; + align-items: center; + width: 24px; + height: 24px; + border-radius: 50%; + cursor: pointer; + ${e=>e.checked?(0,eL.css)` + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + ${eAF} { + display: block; + } + `:(0,eL.css)` + border: 1px solid ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; + :hover { + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; + + ${eAF} { + display: block; + & path { + fill: ${e=>e.theme?.primaryColorScheme?.base}; + } + } + `} +`;eL.default.div.withConfig({displayName:"Radio__SelectedCheckmarkContainer",componentId:"sc-9a10f428-4"})` + display: flex; + justify-content: center; + align-items: center; + width: 24px; + height: 24px; + border-radius: 50%; + border: 1px solid ${e=>e.theme?.primaryColorScheme?.base}; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + ${eAF} { + display: block; + } +`;let eAR=function(e){let{onClick:t,name:a,checked:n,value:l}=e;return ev.createElement(eA$,null,ev.createElement(eAA,{checked:n,onClick:t,value:l},ev.createElement(eAF,null)),ev.createElement(eAP,{type:"radio",checked:n,name:a,value:l}))},eAj=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__FlexContainer",componentId:"sc-55c6d004-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 5px; + padding: 40px 60px; + background: ${e=>e.theme.appColors.hex(100)}; +`,eAO=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__BodyContainer",componentId:"sc-55c6d004-1"})` + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-bottom: 40px; +`,eAU=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__Row",componentId:"sc-55c6d004-2"})` + width: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + margin 10px 0; +`,eAZ=(0,eL.default)(eAU).withConfig({displayName:"SpaceNotificationDialogBody__TopRow",componentId:"sc-55c6d004-3"})` + margin 0; +`,eAL=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__PlatformCell",componentId:"sc-55c6d004-4"})` + flex-basis: 40%; +`,eAB=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__Cell",componentId:"sc-55c6d004-5"})` + display: flex; + justify-content: flex-end; + align-items: center; + flex-basis: 20%; +`,eAz=(0,eL.default)(eAB).withConfig({displayName:"SpaceNotificationDialogBody__RadioCell",componentId:"sc-55c6d004-6"})` + margin-right: 7px; +`,eAV=eL.default.h1.withConfig({displayName:"SpaceNotificationDialogBody__HeaderTitle",componentId:"sc-55c6d004-7"})` + font-weight: 500; + font-size: 24px; + line-height: 32px; + margin-bottom: 4px; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eAq=eL.default.p.withConfig({displayName:"SpaceNotificationDialogBody__HeaderSubtitle",componentId:"sc-55c6d004-8"})` + text-align: center; + margin-bottom: 30px; + font-size: 16px; + line-height: 22px; + color: ${e=>e.theme.isNightMode?"#cccccc":"#666666"}; +`,eAW=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__Column",componentId:"sc-55c6d004-9"})` + display: flex; + flex-direction: column; + justify-content: flex-start; +`,eAH=eL.default.p.withConfig({displayName:"SpaceNotificationDialogBody__HeaderText",componentId:"sc-55c6d004-10"})` + margin: 0; + font-size: 1rem; + color: #999999; + font-weight: 400; +`,eAG=(0,eL.default)(eAH).withConfig({displayName:"SpaceNotificationDialogBody__TitleText",componentId:"sc-55c6d004-11"})` + font-weight: 500; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eAK=eL.default.p.withConfig({displayName:"SpaceNotificationDialogBody__SubtitleText",componentId:"sc-55c6d004-12"})` + margin: 0; + font-size: 0.8125rem; + color: ${e=>e.theme.isNightMode?"#cccccc":"#666666"}; +`,eAY=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__HorizontalRule",componentId:"sc-55c6d004-13"})` + width: 100%; + height: 1px; + background-color: ${e=>e.theme?.isNightMode?"#333333":"#e5e5e5"}; + margin-bottom: 10px; + margin-top: 8px; +`,eAQ=eL.default.button.withConfig({displayName:"SpaceNotificationDialogBody__StyledButton",componentId:"sc-55c6d004-14"})` + width: 100%; + font-size: 18px; + line-height: 24px; + font-weight: 500; + padding: 14px 16px; + color: #fff; + cursor: pointer; + background-color: ${e=>e.theme?.primaryColorScheme?.base}; + border: none; + border-radius: 12px; + transition: background-color 120ms ease-in-out; + &:hover { + background-color: ${e=>e.theme?.primaryColorScheme?.alpha80}; + } + &:focus { + outline: 0; + } +`,eAJ=eL.default.div.withConfig({displayName:"SpaceNotificationDialogBody__Footer",componentId:"sc-55c6d004-15"})` + position: absolute; + text-align: center; + width: 100%; + height: 40px; + left: 0; + bottom: -60px; + font-weight: 500; + color: #fff; + ${e1.UiTypography.sm} + padding: 0 1.875rem; +`,eAX=eL.default.a.withConfig({displayName:"SpaceNotificationDialogBody__Anchor",componentId:"sc-55c6d004-16"})` + color: ${e=>e.theme.primaryColorScheme?.base}; + + &:hover { + color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } + &:visited { + color: ${e=>e.theme.primaryColorScheme?.base}; + } +`,eA0=function(e){let{space:t}=e,a=t.name,n=t.id,[l]=(0,cs.D)(eAT),{loading:r,error:o,data:i}=(0,eB.a)(eAD,{variables:{spaceID:n}}),s=t?.color,d=(0,ev.useMemo)(()=>null!=s?{primaryColor:s}:void 0,[s]),[c,m]=(0,ev.useState)(""),[u,p]=(0,ev.useState)(""),[g,f]=(0,ev.useState)(""),h=i?.membership?.preferences.notifications;(0,ev.useEffect)(()=>{null!=h&&(f(h.email),m(h.mobile),p(h.browser))},[h]);let y=(0,ev.useCallback)(e=>{f(e.currentTarget.getAttribute("value"))},[]),b=(0,ev.useCallback)(e=>{p(e.currentTarget.getAttribute("value"))},[]),v=(0,ev.useCallback)(e=>{m(e.currentTarget.getAttribute("value"))},[]);return r?ev.createElement(eAj,null,ev.createElement(eI.Spinner,null)):null!=o?ev.createElement(eAj,null,o.message):ev.createElement(eI.ThemeProvider,{theme:d},ev.createElement(eAj,null,ev.createElement(eAV,null,t.is_subspace?ev.createElement(eY.Z,{id:"general.notifications.folder_notifications",defaultMessage:"Folder Notifications"}):ev.createElement(eY.Z,{id:"general.notifications.workspace_notifications",defaultMessage:"Workspace Notifications"})),ev.createElement(eAq,null,ev.createElement(eY.Z,{id:"general.notifications.notification_preferences_for_workspace",defaultMessage:"Notification Preferences for {title}",values:{strong:e=>ev.createElement("strong",null,e),title:a}})),ev.createElement(eAO,null,ev.createElement(eAZ,null,ev.createElement(eAL,null,ev.createElement(eAG,null,ev.createElement(eY.Z,{id:"general.notifications.platform",defaultMessage:"Platform"}))),ev.createElement(eAB,null,ev.createElement(eAH,null,ev.createElement(eY.Z,{id:"general.notifications.browser",defaultMessage:"Browser"}))),ev.createElement(eAB,null,ev.createElement(eAH,null,ev.createElement(eY.Z,{id:"general.notifications.mobile",defaultMessage:"Mobile"}))),ev.createElement(eAB,null,ev.createElement(eAH,null,ev.createElement(eY.Z,{id:"general.notifications.email",defaultMessage:"Email"})))),ev.createElement(eAY,null),ev.createElement(eAU,null,ev.createElement(eAL,null,ev.createElement(eAW,null,ev.createElement(eAG,null,ev.createElement(eY.Z,{id:"general.notifications.watch",defaultMessage:"Watch"})),ev.createElement(eAK,null,ev.createElement(eY.Z,{id:"general.notifications.all_project_updates",defaultMessage:"All project updates."})))),ev.createElement(eAz,null,ev.createElement(eAR,{name:"browser",checked:"watched"===u,value:"watched",onClick:b})),ev.createElement(eAz,null,ev.createElement(eAR,{name:"mobile",checked:"watched"===c,value:"watched",onClick:v})),ev.createElement(eAz,null,ev.createElement(eAR,{name:"email",checked:"watched"===g,value:"watched",onClick:y}))),ev.createElement(eAU,null,ev.createElement(eAL,null,ev.createElement(eAW,null,ev.createElement(eAG,null,ev.createElement(eY.Z,{id:"general.notifications.mention",defaultMessage:"Mention"})),ev.createElement(eAK,null,ev.createElement(eY.Z,{id:"general.notifications.mentions_only",defaultMessage:"Mentions only."})))),ev.createElement(eAz,null,ev.createElement(eAR,{name:"browser",checked:"mentioned"===u,value:"mentioned",onClick:b})),ev.createElement(eAz,null,ev.createElement(eAR,{name:"mobile",checked:"mentioned"===c,value:"mentioned",onClick:v})),ev.createElement(eAz,null,ev.createElement(eAR,{name:"email",checked:"mentioned"===g,value:"mentioned",onClick:y}))),ev.createElement(eAU,null,ev.createElement(eAL,null,ev.createElement(eAW,null,ev.createElement(eAG,null,ev.createElement(eY.Z,{id:"general.notifications.ignore",defaultMessage:"Ignore"})),ev.createElement(eAK,null,ev.createElement(eY.Z,{id:"general.notifications.no_notifications",defaultMessage:"No notifications."})))),ev.createElement(eAz,null,ev.createElement(eAR,{name:"browser",checked:"ignored"===u,value:"ignored",onClick:b})),ev.createElement(eAz,null,ev.createElement(eAR,{name:"mobile",checked:"ignored"===c,value:"ignored",onClick:v})),ev.createElement(eAz,null,ev.createElement(eAR,{name:"email",checked:"ignored"===g,value:"ignored",onClick:y})))),ev.createElement(eAQ,{onClick:()=>{l({variables:{input:{clientMutationId:(0,ld.Z)(),spaceID:n,changes:[{key:"mobile",value:c},{key:"browser",value:u},{key:"email",value:g}]}}}),e.exit()}},ev.createElement(eY.Z,{id:"general.notifications.save",defaultMessage:"Save"})),ev.createElement(eAJ,null,ev.createElement(eY.Z,{id:"general.notifications.footer",defaultMessage:"Manage all your notification preferences from one page, click here to access global notifications.",values:{link:e=>ev.createElement(eAX,{href:"/settings/notifications"},e)}}))))},eA1=function(e){let{space:t}=e,a=(0,e$.useDispatch)(),n=(0,e$.useSelector)(so);return ev.createElement(eI.ModalDialog,{isOpen:n,close:()=>{a(rv())}},e=>{let{exit:a}=e;return ev.createElement(eA0,{space:t,exit:a})})},eA2=[{id:"featured",iconName:"automate_discover_featured",name:(0,te.Em)({id:"automation.template.category.featured",defaultMessage:"Featured"})},{id:"project_management",iconName:"automate_discover_project_management",name:(0,te.Em)({id:"automation.template.category.project_management",defaultMessage:"Project Management"})},{id:"marketing",iconName:"automate_discover_marketing",name:(0,te.Em)({id:"automation.template.category.marketing",defaultMessage:"Marketing"})},{id:"content_creation",iconName:"automate_discover_content_creation",name:(0,te.Em)({id:"automation.template.category.content_creation",defaultMessage:"Content Creation"})},{id:"communication",iconName:"automate_discover_communication",name:(0,te.Em)({id:"automation.template.category.communication",defaultMessage:"Communication"})},{id:"form_collection",iconName:"automate_discover_form_collection",name:(0,te.Em)({id:"automation.template.category.form_collection",defaultMessage:"Form Collection"})},{id:"reporting",iconName:"automate_discover_reporting",name:(0,te.Em)({id:"automation.template.category.reporting",defaultMessage:"Reporting"})},{id:"sales",iconName:"automate_discover_sales",name:(0,te.Em)({id:"automation.template.category.sales",defaultMessage:"Sales"})}],eA5=[{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"comment.created"},actions:[{pieceName:"@taskade/automade-piece-slack",actionName:"chat.postMessage"}],description:(0,te.Em)({id:"automation.template.featured.comment_created_post_message",defaultMessage:"Send a Slack notification for new Taskade comments, enhancing team communication."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.generate"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.featured.summary_report",defaultMessage:"Generate a summary for completed tasks and create a new task in Taskade with this summary."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.due"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.featured.task_suggestions",defaultMessage:"Get AI-driven suggestions for due tasks and create a new task in Taskade with these suggestions."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.featured.form_response_follow_up",defaultMessage:"Create tasks for Google Forms responses with AI insights, organizing follow-ups in Taskade."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"comment.created"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.featured.comment_analysis",defaultMessage:"Analyze new comments with AI and create actionable tasks in Taskade, enhancing team collaboration."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"project.create"}],description:(0,te.Em)({id:"automation.template.featured.task_completed_project_create",defaultMessage:"Automatically initiate a new project in Taskade when a task is completed."})},{category:"featured",trigger:{type:"WEBHOOK"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"project.create"}],description:(0,te.Em)({id:"automation.template.featured.webhook_project_create",defaultMessage:"Create new Taskade projects automatically via incoming webhooks."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"comment.created"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.respond"}],description:(0,te.Em)({id:"automation.template.featured.comment_created_respond",defaultMessage:"Use Taskade AI for automated responses or content generation based on comments."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"project.create"},{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"}],description:(0,te.Em)({id:"automation.template.featured.project_review_meeting",defaultMessage:"Sets up a project review meeting in Taskade with an AI-generated agenda on task completion."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"comment.created"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.generate"}],description:(0,te.Em)({id:"automation.template.featured.comment_created_ai_generate",defaultMessage:"Performs an AI-driven risk analysis for new comments in a project."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.due"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"}],description:(0,te.Em)({id:"automation.template.featured.task_due_ai_ask",defaultMessage:"Sends an AI-generated summary and deadline reminder for due tasks in Taskade."})},{category:"featured",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.featured.form_response_task",defaultMessage:"Handles new Google Forms responses by creating follow-up tasks in Taskade with AI insights."})},{category:"reporting",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-piece-googlesheets",actionName:"googlesheets.addNewRow"}],description:(0,te.Em)({id:"automation.template.reporting.task_completed_new_row",defaultMessage:"Log completed Taskade tasks in Google Sheets, creating detailed task reports."})},{category:"reporting",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-googlesheets",triggerName:"new_row_found"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.generate"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.reporting.data_analysis_task",defaultMessage:"Generate an AI report and create a Taskade task for analysis when new data is added to Google Sheets."})},{category:"reporting",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation_template.reporting_new_response_create_task",defaultMessage:"Automatically create a task in Taskade to analyze and report on new Google Forms responses."})},{category:"reporting",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-googlesheets",triggerName:"new_row_found"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation_template.reporting.new_row_create_task",defaultMessage:"Automatically create a Taskade task to review and analyze new rows added in Google Sheets."})},{category:"reporting",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-surveymonkey",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation_template.reporting.survey_response_report",defaultMessage:"Automatically generate a Taskade task for reporting on new SurveyMonkey survey responses."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-piece-mailchimp",actionName:"addMemberToList"}],description:(0,te.Em)({id:"automation_template.reporting.task_completed_add_member",defaultMessage:"Automatically update MailChimp lists with Taskade task completions, streamlining email campaigns."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-surveymonkey",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.marketing.survey_response_analysis",defaultMessage:"Automatically create a task in Taskade to analyze new SurveyMonkey responses for marketing insights."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-calendly",triggerName:"invitee_created"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.marketing.event_marketing_strategy",defaultMessage:"Generate marketing strategies in Taskade for new Calendly events using AI suggestions."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-slack",triggerName:"new_message"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.marketing.marketing_communication_plan",defaultMessage:"Create marketing communication tasks in Taskade for key messages received in Slack."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-googlesheets",triggerName:"new_row_found"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.generate"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.marketing.data_drive_marketing_insights",defaultMessage:"Use AI to analyze new data in Google Sheets and create Taskade tasks for data-driven marketing strategies."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"project.create"}],description:(0,te.Em)({id:"automation.template.marketing.webflow_submission_marketing",defaultMessage:"Initiate a comprehensive marketing project in Taskade in response to new form submissions on Webflow."})},{category:"marketing",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-typeform",triggerName:"new_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-openai",actionName:"ai.ask"},{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.marketing.typeform_marketing_analysis",defaultMessage:"Analyze Typeform submissions using AI and create tasks in Taskade for strategic marketing planning."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.due"},actions:[{pieceName:"@taskade/automade-piece-wordpress",actionName:"create_post"}],description:(0,te.Em)({id:"automation.template.project_mgt.task_due_create_post",defaultMessage:"Automate WordPress content updates when Taskade tasks are due, aligning content with project deadlines."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.post_completion_review",defaultMessage:"Create a review task in Taskade when a project task is completed, ensuring thorough follow-up."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"comment.created"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.comment_follow_up",defaultMessage:"Create a follow-up task in Taskade whenever a new comment is posted, ensuring no feedback is overlooked."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-slack",triggerName:"new_message"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.slack_message_follow_up",defaultMessage:"Create a Taskade task for every important Slack message, ensuring no communication is missed."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-calendly",triggerName:"invitee_created"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.new_meeting_prep",defaultMessage:"Create a task in Taskade for meeting preparation whenever a new Calendly event is scheduled."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-googlesheets",triggerName:"new_row_found"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.sheets_data_review",defaultMessage:"Automatically create a Taskade task to review and action new data added to Google Sheets."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation_template.project_mgt.form_response_analysis",defaultMessage:"Generate a Taskade task for each new response in Google Forms, ensuring prompt action on received data."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mg.webflow_submission_handling",defaultMessage:"Automate task creation in Taskade for each new form submission on Webflow, streamlining web-based inquiries."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-typeform",triggerName:"new_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.typeform_submission_review",defaultMessage:"Create a task in Taskade to review each new submission from Typeform, ensuring efficient response management."})},{category:"project_management",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.project_mgt.webflow_form_analyis",defaultMessage:"Automatically create a Taskade task to analyze and act on new form submissions from Webflow, enhancing website interaction management."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.due"},actions:[{pieceName:"@taskade/automade-piece-wordpress",actionName:"create_post"}],description:(0,te.Em)({id:"automation.template.cc.task_due_create_post",defaultMessage:"Automatically publish a draft post in WordPress when a content creation task in Taskade is due."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.content_review",defaultMessage:"Upon task completion, create a new task in Taskade for content review and finalization."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.content_ideas_from_forms",defaultMessage:"Generate content creation tasks in Taskade based on new responses from Google Forms, fueling creative ideas."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-slack",triggerName:"chat.postMessageDirect"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.slack_message_inspired_content",defaultMessage:"Create tasks in Taskade for content ideas stemming from direct messages in Slack."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-surveymonkey",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.survey_response_content_ideas",defaultMessage:"Transform new SurveyMonkey responses into content creation tasks in Taskade, leveraging feedback for creative insights."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.webflow_submission_inspired_content",defaultMessage:"Use new form submissions from Webflow to inspire and create content tasks in Taskade."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-typeform",triggerName:"new_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.typeform_inspired_content_ideas",defaultMessage:"Create content generation tasks in Taskade based on insights from new Typeform submissions."})},{category:"content_creation",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.content_ideas_from_webflow",defaultMessage:"Generate Taskade tasks for content creation inspired by Webflow form submissions."})},{category:"content_creation",trigger:{type:"WEBHOOK"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.cc.webhook_inspired_content",defaultMessage:"Utilize webhooks to create tasks in Taskade for dynamic content creation based on various online interactions."})},{category:"form_collection",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.form.response_analysis_task",defaultMessage:"Automatically create a task in Taskade to analyze new responses from Google Forms."})},{category:"form_collection",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-typeform",triggerName:"new_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.form.typeform_submission_review",defaultMessage:"Create a task in Taskade for each new Typeform submission, ensuring prompt response and review."})},{category:"form_collection",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.form.google_forms_data_processing",defaultMessage:"Create a Taskade task for each new Google Forms response to process and analyze the collected data."})},{category:"form_collection",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-surveymonkey",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.form.survey_analysis",defaultMessage:"Automate Taskade task creation for new SurveyMonkey responses to streamline data analysis."})},{category:"form_collection",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.form.webflow_form_submission_review",defaultMessage:"Create tasks in Taskade for each Webflow form submission, ensuring efficient follow-up and processing."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-mailchimp",triggerName:"addMemberToList"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.new_lead_follow_up",defaultMessage:"Create a task in Taskade to follow up with new leads added to the MailChimp list, enhancing lead management."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-calendly",triggerName:"invitee_created"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"project.create"}],description:(0,te.Em)({id:"automation.template.sales.sales_meeting_prep",defaultMessage:"Automatically initiate a sales project in Taskade for each new Calendly invitee, preparing for effective sales meetings."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-slack",triggerName:"new_message"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.opportunity_assess",defaultMessage:"Generate a Taskade task for assessing potential sales opportunities from new messages in Slack."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-googlesheets",triggerName:"new_row_found"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.data_review",defaultMessage:"Create tasks in Taskade to review and act on new sales data added to Google Sheets."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-typeform",triggerName:"new_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.lead_qualification",defaultMessage:"Use new Typeform submissions to create tasks in Taskade for lead qualification and follow-up."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.webflow_inquiry_response",defaultMessage:"Generate tasks in Taskade for responding to sales inquiries received through Webflow forms."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-surveymonkey",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.customer_feedback",defaultMessage:"Create a Taskade task to analyze customer feedback from SurveyMonkey surveys for sales strategy development."})},{category:"sales",trigger:{type:"WEBHOOK"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.webhook_triggered_sales",defaultMessage:"Use webhooks to create dynamic sales tasks in Taskade, responding to various online triggers."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-slack",triggerName:"chat.postMessageDirect"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.direct_message_sales",defaultMessage:"Automatically create tasks in Taskade for follow-up on direct sales-related messages received in Slack."})},{category:"sales",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.sales.google_forms_leads",defaultMessage:"Generate tasks in Taskade for lead qualification based on responses received from Google Forms."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.completed"},actions:[{pieceName:"@taskade/automade-piece-slack",actionName:"chat.postMessage"}],description:(0,te.Em)({id:"automation.template.com.update_team",defaultMessage:"Send a message to a Slack channel when a task in Taskade is completed, updating the team instantly."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"task.due"},actions:[{pieceName:"@taskade/automade-piece-twilio",actionName:"send_sms"}],description:(0,te.Em)({id:"automation.template.com.task_due_reminder",defaultMessage:"Send an SMS via Twilio to remind stakeholders when a Taskade task is due."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-internalpiece-taskade",triggerName:"new_email_received"},actions:[{pieceName:"@taskade/automade-piece-mailchimp",actionName:"addMemberToList"}],description:(0,te.Em)({id:"automation.template.com.extracted_email",defaultMessage:"Add a contact to a MailChimp list based on new email tasks created in Taskade."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-slack",triggerName:"new_message"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.slack_message_analysis",defaultMessage:"Create a task in Taskade to analyze and respond to important Slack messages."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-webflow",triggerName:"new_form_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.webflow_submission_response",defaultMessage:"Automatically create a task in Taskade for responding to new submissions on Webflow."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-google-forms",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.google_forms_response_handling",defaultMessage:"Generate a task in Taskade for each new response on Google Forms to ensure timely follow-up."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-typeform",triggerName:"new_submission"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.typeform_submission_review",defaultMessage:"Create tasks in Taskade to review and act upon new submissions from Typeform."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-calendly",triggerName:"invitee_created"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.meeting_preparation",defaultMessage:"Automatically create a Taskade task to prepare for new meetings scheduled in Calendly."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-surveymonkey",triggerName:"new_response"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.survey_response_engagement",defaultMessage:"Develop tasks in Taskade to engage and analyze responses from SurveyMonkey surveys."})},{category:"communication",trigger:{type:"PIECE_TRIGGER",pieceName:"@taskade/automade-piece-googlesheets",triggerName:"new_row_found"},actions:[{pieceName:"@taskade/automade-internalpiece-taskade",actionName:"task.create"}],description:(0,te.Em)({id:"automation.template.com.google_sheets_inquiry_follow_up",defaultMessage:"Organize follow-up actions in Taskade for new entries in Google Sheets."})}],eA3={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowCreateFromTemplate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowCreateFromTemplateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowCreateFromTemplate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flow"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},eA4={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PiecesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"logoUrl"}},{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"authDesc"}},{kind:"Field",name:{kind:"Name",value:"actions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}}]}},{kind:"Field",name:{kind:"Name",value:"triggers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},eA6={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowCreateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"flow"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]},eA8=function(e){let{spaceId:t,onExit:a}=e,n=(0,eF.k6)(),[l,{loading:r}]=(0,cs.D)(eA6),o=async()=>{let e=await l({variables:{input:{clientMutationId:(0,ld.Z)(),name:"",spaceId:t}}}),r=e.data?.flowCreate.flow.id;null!=r&&(a(),n.push(`/f/${r}`))};return ev.createElement("button",{className:"flex h-52 w-full shrink flex-col items-center justify-center gap-4 rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-6 transition duration-300 ease-in-out hover:scale-105 hover:shadow-sm",onClick:o},r?ev.createElement(eI.Spinner,null):ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"dd_new"})),ev.createElement(eY.Z,{id:"general.create_automation",defaultMessage:"Start from scratch"})))},eA7=function(e){let{template:t,pieces:a,onSelectTemplate:n}=e,[l,r]=ev.useState(!1),o=ev.useMemo(()=>{let e=t.trigger;if("PIECE_TRIGGER"!==e.type)return null;{let t=e.pieceName,n=a.find(e=>e.name===t);return null==n?null:n.logoUrl}},[a,t.trigger]),i=t.actions[0],s=a.find(e=>e.name===i.pieceName),d=null!=s?s.logoUrl:null,c=async()=>{r(!0),await n(t),r(!1)};return ev.createElement("button",{onClick:c,disabled:l,className:"group flex h-52 w-full flex-col justify-between whitespace-normal rounded-xl border border-appcolor-300 bg-appcolor-100 px-4 py-6 text-left transition duration-300 ease-in-out hover:scale-105 hover:border-appcolor-400 hover:shadow-sm"},ev.createElement("div",{className:"flex flex-col gap-y-3"},ev.createElement("div",{className:"flex items-center gap-1"},ev.createElement("div",{className:"h-8 w-8"},null!=o?ev.createElement("img",{src:o}):ev.createElement(tn.Icon,{className:"text-appcolor-500",icon:"automate_flow"})),ev.createElement(tn.Icon,{className:"text-textcolor-400",icon:"caret_next"}),null!=d&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"h-8 w-8"},ev.createElement("img",{src:d})),t.actions.length>1&&ev.createElement("div",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-solid border-appcolor-300 bg-appcolor-200 text-xs font-bold text-appcolor-500"},"+",t.actions.length-1))),ev.createElement("p",{className:"text-sm text-appcolor-600"},ev.createElement(eY.Z,t.description))),ev.createElement("div",{className:"w-full rounded-2xl border border-solid border-appcolor-400 bg-appcolor-100 py-2 text-center text-sm transition duration-500 ease-in-out group-hover:border-primary group-hover:bg-primary"},ev.createElement(eY.Z,{id:"general.use_automation",defaultMessage:"Use Automation"})))},eA9=function(e){let{spaceId:t,onExit:a}=e,n=T_((0,eL.useTheme)()),l=(0,eB.a)(eA4),r=l.data?.pieces??[],[o]=(0,cs.D)(eA3),i=(0,eF.k6)(),s=async e=>{let a=await o({variables:{input:{clientMutationId:(0,ld.Z)(),template:eW().omit(e,["description","category"]),spaceId:t,name:""}}}),n=a.data?.flowCreateFromTemplate.flow.id;null!=n&&i.push(`/f/${n}`)};return l.loading||null==r?ev.createElement("div",{className:"flex h-full items-center"},ev.createElement(eI.Spinner,null)):ev.createElement("div",{className:"flex h-full w-full flex-col",style:n},ev.createElement("div",{className:"flex items-center gap-x-2 border-b-2 border-appcolor-200 px-5 py-2"},ev.createElement(tn.Icon,{icon:"automate_flow"}),ev.createElement("span",{className:"text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.automations",defaultMessage:"Automations"})),ev.createElement("div",{className:"ml-auto flex items-center gap-2 text-sm"},ev.createElement("a",{href:"https://www.taskade.com/contact/automation",target:"_blank",rel:"noopener noreferrer",className:"duration-250 flex items-center gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-1.5 transition ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"ai_brainstorm",className:"shrink-0"}),ev.createElement(eY.Z,{id:"automation.submit_your_feedback",defaultMessage:"Submit Your Feedback"})),ev.createElement("a",{href:"https://www.taskade.com/feedback/automations",target:"_blank",rel:"noopener noreferrer",className:"duration-250 flex items-center gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-1.5 transition ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"automate_discover_communication",className:"shrink-0"}),ev.createElement(eY.Z,{id:"automation.report_issues",defaultMessage:"Report Issues"})),ev.createElement("a",{href:"https://help.taskade.com/hc/en-us/articles/24799834857363-Getting-Started",target:"_blank",rel:"noopener noreferrer",className:"duration-250 flex items-center gap-2 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-4 py-1.5 transition ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"dd_help",className:"shrink-0"}),ev.createElement(eY.Z,{id:"automation.learn_more",defaultMessage:"Learn More"})))),ev.createElement("div",{className:"w-full flex-grow overflow-hidden py-4"},ev.createElement(evR.mQ,{className:"flex h-full overflow-hidden"},ev.createElement(evR.td,{className:"flex w-72 shrink-0 flex-col gap-px px-4"},eA2.map(e=>ev.createElement(evR.OK,{key:e.id,id:e.id,className:e=>{let{isSelected:t}=e;return`flex cursor-pointer items-center gap-x-2 rounded-xl px-4 py-2 text-sm hover:bg-appcolor-200 ${t&&"bg-appcolor-200"}`}},ev.createElement(tn.Icon,{icon:e.iconName}),ev.createElement(eY.Z,e.name)))),ev.createElement(evR.FE,{items:eA2},e=>ev.createElement(evR.x4,{id:e.id,className:"flex h-full w-full flex-col overflow-y-auto overflow-x-clip px-4 py-2"},ev.createElement("h2",{className:"mb-4 text-lg"},ev.createElement(eY.Z,e.name)),ev.createElement("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3"},ev.createElement(eA8,{spaceId:t,onExit:a}),eA5.filter(t=>t.category===e.id).map((e,t)=>ev.createElement(eA7,{key:t,pieces:r,template:e,onSelectTemplate:s}))))))))},eRe=(0,d9.oM)({name:"dialogs.createFlow",initialState:{isOpen:!1},reducers:{toggleCreateFlowDialog:(e,t)=>null==t.payload||e.isOpen?{isOpen:!1}:{isOpen:!0,spaceId:t.payload.spaceId}}}),eRt=(0,e$.connect)(function(e){return e.dialogs.createFlow})(function(e){let{isOpen:t,spaceId:a}=e,n=(0,e$.useDispatch)(),l=()=>{n(eRe.actions.toggleCreateFlowDialog())};return t&&null!=a?ev.createElement(eI.ModalDialog,{className:"h-full max-h-dialog w-full max-w-7xl overflow-auto rounded-xl border border-solid border-appcolor-300 bg-appcolor-0",backdropOpacity:eI.ModalDialogOpacity.Translucent,close:l,isOpen:t,autofocus:!1},()=>ev.createElement(eA9,{spaceId:a,onExit:l})):null}),eRa={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"scim_token"}},{kind:"Field",name:{kind:"Name",value:"spaces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"peopleGroups"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"spaceVisibilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"peopleGroupMembers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"people"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},eRn=(0,la.ZP)` + mutation SpaceVisibilityUpdateMutation($input: SpaceVisibilityUpdateInput!) { + spaceVisibilityUpdate(input: $input) { + clientMutationId + spaces { + id + } + } + } +`,eRl=(0,la.ZP)` + mutation WorkspaceAvatarDeleteMutation($input: WorkspaceAvatarDeleteInput!) { + workspaceAvatarDelete(input: $input) { + clientMutationId + ok + } + } +`,eRr=(0,la.ZP)` + mutation WorkspaceUpdateMutation($input: WorkspaceUpdateInput!) { + workspaceUpdate(input: $input) { + space { + id + name + color + visibility + preferences { + avatars { + small { + hdpi { + url + } + } + default { + hdpi { + url + } + } + } + avatars_v2 { + ... on SpaceAvatarsV2Emoji { + emoji + } + ... on SpaceAvatarsV2Custom { + small { + hdpi { + url + size { + width + height + } + } + } + default { + hdpi { + url + size { + width + height + } + } + } + } + } + } + } + } + } +`;function eRo(e){let t=fH(e.type);return`avatar.${t}`}async function eRi(e,t){let a=eRo(t),n=await fB("/web-api/uploads/request-data",{"Content-Type":"application/json"},JSON.stringify({type:"space_avatar",spaceID:e,includeS3Policy:"true",filename:a,filesize:t.size}));if(!n.ok)throw Error();return n.json()}async function eRs(e,t){let{token:a,s3Policy:n,s3URL:l,awsUploadAPIBaseURL:r}=e.payload,o=eRo(t),{formData:i,s3ObjectKey:s}=uo(fq(t.dataURL),n,o);if(!(await fB(l,{},i)).ok)throw Error();return{payload:{awsUploadAPIBaseURL:r,s3ObjectKey:s,token:a}}}async function eRd(e){let{token:t,s3ObjectKey:a,awsUploadAPIBaseURL:n}=e.payload,l=await fB(`${n}/uploads`,{"uploads-authorization-jwt":t,"Content-Type":"application/json"},JSON.stringify({body:{s3ObjectKey:a}}));if(!l.ok)throw Error();return l.json()}async function eRc(e,t){let a=await fB(`/web-api/spaces/${e}/avatar`,{"Content-Type":"application/json"},JSON.stringify({awsResponse:t})),n=await a.json();if(!a.ok)throw Error(n.details);return n}async function eRm(e,t){try{let a=await eRi(e,t),n=await eRs(a,t),l=await eRd(n);return await eRc(e,l)}catch(e){return null}}let eRu={id:"form",context:{fields:{},errors:[]},initial:"idle",states:{idle:{initial:"valid",on:{ERRING:{actions:["erring"]},TYPING:{actions:["typing"]},SUBMIT:{actions:["submit"],target:"submitting"}},states:{valid:{},invalid:{}}},submitting:{invoke:{src:"submitting",onDone:{target:"submitted",actions:(0,lv.assign)((e,t)=>{let{data:a}=t;return{workspace:a}})},onError:{target:"idle.invalid",actions:(0,lv.assign)((e,t)=>{let{data:a}=t;return(0,es.ZP)(e,e=>(eu()(a.errors)?e.errors=[a]:e.errors=a.errors,e))})}}},submitted:{type:"final",invoke:{src:"submitted"}}}},eRp={actions:{erring:(0,lv.assign)((e,t)=>{let{field:a,value:n}=t.payload;return(0,es.ZP)(e,e=>{let t=p6()(e.errors,{field:a});return -1===t?eu()(n)||e.errors.push(n):eu()(n)?e.errors.splice(t,1):e.errors[t]=n,e})}),submit:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.errors=[],e))),typing:(0,lv.assign)((e,t)=>{let{field:a,value:n}=t.payload;return(0,es.ZP)(e,e=>(e.fields[a]=n,e))})}},eRg=(0,lb.J)(eRu,eRp),eRf=eL.default.div.withConfig({displayName:"FieldAvatar__FlexContainer",componentId:"sc-a460aaaa-0"})` + display: flex; + justify-items: start; +`,eRh=eL.default.div.withConfig({displayName:"FieldAvatar__ErrorContainer",componentId:"sc-a460aaaa-1"})` + margin-top: 10px; +`;function eRy(e){let{deleteAvatar:t,emoji:a,error:n,name:l,onError:r,onDeleteAvatarChange:o,onAvatarChange:i,onEmojiChange:s,url:d,value:c}=e,m=(0,ev.useRef)(),u=(0,ev.useCallback)(e=>{s(e),o(!1)},[o,s]),p=(0,ev.useCallback)(e=>{let{details:t}=e;i(null),r("avatar",{field:"avatar",message:t}),m.current&&m.current.resetImage()},[i,r]),g=(0,ev.useCallback)(()=>{i({avatarEditor:m.current}),s(null),o(!1),eu()(n)||r("avatar",null)},[n,i,o,s,r]),f=(0,ev.useCallback)(()=>{confirm("Are you sure you want to delete the avatar?")&&(i(null),s(null),o(!0),null!=m.current&&m.current.resetImage())},[i,o,s]);return ev.createElement(eRf,{className:"workspace-avatar"},n&&ev.createElement(eRh,null,ev.createElement("input",{name:l,type:"hidden",className:"is-invalid form-control",value:"Please upload an image with at least 100x100 pixels."}),ev.createElement(rO,null,n.message)),ev.createElement("fieldset",{className:"form-group"},ev.createElement(hs,{ref:m,emoji:a,onDeleteButtonClick:f,onEmojiPick:u,onImageLoadFailure:p,onImageLoadSuccess:g,hasNewImage:!eu()(c),imageURL:eu()(c)&&!t?d:null})),ev.createElement("input",{type:"hidden",name:"emoji",value:a}),ev.createElement("input",{type:"hidden",name:"deleteAvatar",value:t}))}eRy.propTypes={deleteAvatar:l7().bool,emoji:l7().string,error:l7().shape({message:l7().string.isRequired}),name:l7().string.isRequired,onAvatarChange:l7().func.isRequired,onDeleteAvatarChange:l7().func.isRequired,onEmojiChange:l7().func.isRequired,onError:l7().func.isRequired,url:l7().string,value:l7().shape({avatarEditor:l7().object.isRequired})},eRy.defaultProps={deleteAvatar:!1,emoji:null,error:void 0,url:null,value:null};let eRb=eL.default.button.withConfig({displayName:"GeneralTab__UpdateButton",componentId:"sc-ff0e1b6c-0"})` + color: #fff; + background-color: ${e=>e.theme.primaryColorScheme?.base}; + padding: ${eI.UiSpacing.getPx(2)} ${eI.UiSpacing.getPx(3)}; + margin-right: ${eI.UiSpacing.getPx(3)}; + min-height: ${eI.UiSpacing.getPx(4)}; + width: ${eI.UiSpacing.getRem(20)}; + ${e1.UiBorderRadius.md}; + ${e1.UiTypography.xs}; + pointer: cursor; + &:hover { + background-color: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,eRv=function(e){let{exit:t,role:a,space:n}=e,{data:l}=(0,eB.a)(eRa),r=Eu({role:a,action:"manage_settings"}),o=ev.useRef(null),{errors:i,fields:s,handleAvatarChange:d,handleColorChange:c,handleDeleteAvatarChange:m,handleError:u,handleEmojiChange:p,handleNameChange:g,handleVisibilityChange:f,handlePeopleGroupVisibilityChange:h,handleSubmit:y,submitting:b}=function(e){let{space:t,exit:a,canEditVisibility:n}=e,[l]=(0,cs.D)(eRr),[r]=(0,cs.D)(eRl),[o]=(0,cs.D)(eRn),i=t?.visibility??null,[s,d]=(0,ls.e)(eRg,{context:{fields:{avatar:null,color:t.color,deleteAvatar:!1,emoji:t?.preferences?.avatars_v2?.emoji??null,name:t.name,visibility:n?i:void 0,peopleGroupVisibilities:[]}},services:{submitting:async(e,a)=>{let{clientMutationId:n,deleteAvatarClientMutationId:i,spaceVisibilityUpdateClientMutationId:s}=a.payload,{avatar:d,color:c,deleteAvatar:m,emoji:u,name:p,visibility:g,peopleGroupVisibilities:f}=e.fields,h=d?.avatarEditor?.getImage()??null;if(!eu()(h)){let e=await eRm(t.id,h);if(eu()(e))throw Error("Failed to upload avatar!")}if(m){let e=await r({variables:{input:{clientMutationId:i,spaceId:t.id}}});if(eu()(e))throw Error("Failed to delete the avatar!")}let y=await l({variables:{input:{clientMutationId:n,spaceID:t.id,color:c,name:p,emoji:u,visibility:g}}}),b=y.data.workspaceUpdate.space;if(y.error){let e=Error("Failed to update space!");throw e.code=400,e.payload={errors:y.error.undefined.graphQLErrors},e}if(f.length>0&&null==(null!=g?await o({variables:{input:{clientMutationId:s,peopleGroupVisibilities:f.map(e=>({...e,role:null}))}},refetchQueries:[{query:eRa}]}):await o({variables:{input:{clientMutationId:s,peopleGroupVisibilities:f}},refetchQueries:[{query:eRa}]})))throw Error("Failed to update folder visibility!");return b},submitted:()=>{a()}}}),{fields:c,errors:m}=s.context,u=(0,ev.useMemo)(()=>{let e={};for(let t of m){let{field:a}=t;e[a]=t}return e},[m]),p=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"avatar",value:e}})},[d]),g=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"color",value:e}})},[d]),f=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"deleteAvatar",value:e}})},[d]),h=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"emoji",value:e}})},[d]),y=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"name",value:e}})},[d]),b=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"visibility",value:e}})},[d]),v=(0,ev.useCallback)(e=>{d({type:"TYPING",payload:{field:"peopleGroupVisibilities",value:e}})},[d]);return{errors:u,fields:c,handleAvatarChange:p,handleDeleteAvatarChange:f,handleEmojiChange:h,handleError:(0,ev.useCallback)((e,t)=>{d({type:"ERRING",payload:{field:e,value:t}})},[d]),handleColorChange:g,handleNameChange:y,handleSubmit:(0,ev.useCallback)(()=>{d({type:"SUBMIT",payload:{clientMutationId:(0,ld.Z)(),deleteAvatarClientMutationId:(0,ld.Z)(),spaceVisibilityUpdateClientMutationId:(0,ld.Z)()}})},[d]),handleVisibilityChange:b,handlePeopleGroupVisibilityChange:v,submitting:s.matches("submitting")}}({space:n,exit:t,canEditVisibility:r});ev.useEffect(()=>{o?.current?.focus()},[]),ev.useEffect(()=>{let e=[];for(let t of l?.organization?.peopleGroups?.edges??[])e.push({spaceId:n.id,peopleGroupId:t.node.id,role:t.node?.spaceVisibilities?.edges?.find(e=>e.node.space.id===n.id)?.node?.role??null});h(e)},[h,l?.organization?.peopleGroups?.edges,n.id]);let v=ev.useMemo(()=>{let e=n?.preferences?.avatars_v2;return null==e||"SpaceAvatarsV2Emoji"===e.__typename?null:e.default?.hdpi?.url},[n?.preferences?.avatars_v2]),k=ev.useCallback((e,t,a)=>{let n=[];for(let e of s.peopleGroupVisibilities)e.peopleGroupId===t.id?n.push(Object.assign({},e,{role:a})):n.push(e);h(n)},[h,s.peopleGroupVisibilities]);return ev.createElement("form",{className:"flex h-full flex-col"},ev.createElement("div",{className:"flex h-5/6 flex-grow flex-col overflow-y-auto px-4 py-4"},ev.createElement("label",{htmlFor:"workspace-name",className:"text-sm font-medium text-textcolor-900"},ev.createElement(eY.Z,{id:"general.name",defaultMessage:"Name"})),ev.createElement("div",{className:"mb-1 mt-1"},ev.createElement("input",{ref:o,type:"text",name:"name",id:"space-name",className:"w-9/12 rounded-md border border-solid border-appcolor-400 bg-appcolor-100 px-2 py-2 text-sm text-textcolor-900","aria-describedby":"name-description",onChange:e=>{let{value:t}=e.target;g(t)},value:s.name})),ev.createElement("div",{className:"mt-4"},ev.createElement("label",{className:"text-sm font-medium text-textcolor-900"},ev.createElement(eY.Z,{id:"general.icon",defaultMessage:"Icon"})),ev.createElement("div",{className:"mb-1 mt-1"},ev.createElement(eRy,{deleteAvatar:s.deleteAvatar,emoji:s.emoji,error:i.avatar,name:"avatar",onAvatarChange:d,onDeleteAvatarChange:m,onEmojiChange:p,onError:u,value:s.avatar,url:v}))),ev.createElement("div",{className:"mt-4"},ev.createElement("label",{className:"text-sm font-medium text-textcolor-900"},ev.createElement(eY.Z,{id:"general.color",defaultMessage:"Color"})),ev.createElement("div",{className:"mb-2 mt-1"},ev.createElement(fc,{name:"color",onChange:c,value:s.color}))),n.is_subspace&&r&&n.parent_membership?.space?.id!=null&&ev.createElement("div",{className:"mt-4"},ev.createElement("label",{className:"text-sm font-medium text-textcolor-900"},ev.createElement(eY.Z,{id:"general.team_access",defaultMessage:"Team Access"})),ev.createElement("div",{className:"mb-1 mt-1"},ev.createElement(fD,{onChange:f,value:s.visibility,workspaceName:n.parent_membership?.space?.name??"",parentSpaceId:n.parent_membership?.space?.id}))),n.is_subspace&&l?.organization!=null&&l?.organization?.peopleGroups!=null&&n.parent_membership?.space?.id!=null&&null==s.visibility&&l.organization.peopleGroups.edges.length>0&&ev.createElement("div",{className:"mt-5"},ev.createElement("label",{className:"text-sm font-medium text-textcolor-900"},ev.createElement(eY.Z,{id:"general.group_access",defaultMessage:"Group Access"})),ev.createElement("div",{className:"mb-1 mt-1 flex w-full flex-col"},l?.organization?.peopleGroups?.edges.map(e=>ev.createElement("div",{key:e.node.id,className:"flex w-full flex-row items-center py-1"},ev.createElement("span",{className:"mr-1 w-full text-ellipsis text-sm text-appcolor-900"},e.node.name),ev.createElement(ex7,{value:s.peopleGroupVisibilities.find(t=>t.peopleGroupId===e.node.id)?.role??null,space:n,peopleGroup:e.node,onChange:k})))))),ev.createElement("div",{className:"flex flex-grow-0 border-0 border-t border-solid border-appcolor-300 px-4 py-4"},ev.createElement(eRb,{onClick:e=>{e.preventDefault(),y()},disabled:b},b?ev.createElement(eI.Spinner,{color:"#fff",size:14}):ev.createElement(eY.Z,{id:"general.update",defaultMessage:"Update"})),ev.createElement("button",{onClick:e=>{e.preventDefault(),t()},className:"w-20 cursor-pointer rounded-md border border-solid border-appcolor-300 px-3 py-2 text-xs text-textcolor-900 hover:bg-appcolor-200"},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"}))))},eRk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceProjectDefaultsUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpacePreferencesProjectDefaultsUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spacePreferencesProjectDefaultsUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectDefaults"}}]}}]}}]}}]}}]},eRE=function(e){let{space:t}=e,a=gV(),n=(0,e$.useDispatch)(),[l]=(0,cs.D)(eRk),r=t.preferences?.projectDefaults?.hideCompleted,o=t.preferences?.projectDefaults?.hideChat,i=t.preferences?.projectDefaults?.disableShareLink,s=()=>{a.isPaywallEnabled&&n(d4())};return ev.createElement("div",null,ev.createElement("button",{className:og()("flex w-full whitespace-normal px-4 py-3 text-left",a.isPaywallEnabled?"cursor-pointer":"cursor-default"),onClick:s},ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"flex items-center"},ev.createElement("span",{className:"mr-1 text-sm font-medium text-appcolor-900"},ev.createElement(eY.Z,{id:"general.enable_hide_completed",defaultMessage:"Enable hide completed"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-900",icon:"dd_help",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/360042895033","_blank","noopener,noreferrer")}}),a.isPaywallEnabled&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:s})),ev.createElement("span",{className:"mt-1 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"general.folder_enable_hide_completed_description",defaultMessage:"Enable hide completed for every project in this folder."}))),ev.createElement(e1.Switch,{className:og()("ml-auto",a.isPaywallEnabled?"pointer-events-none":"cursor-pointer"),checked:r??!1,onChange:e=>{l({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:t.id,hideCompleted:e}}})}})),ev.createElement("button",{className:og()("flex w-full whitespace-normal px-4 py-3 text-left",a.isPaywallEnabled?"cursor-pointer":"cursor-default"),onClick:s},ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"flex items-center"},ev.createElement("span",{className:"mr-1 text-sm font-medium text-appcolor-900"},ev.createElement(eY.Z,{id:"general.hide_chat",defaultMessage:"Hide Chat"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-900",icon:"dd_help",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/1500000956841--How-to-Chat-on-Taskade","_blank","noopener,noreferrer")}}),a.isPaywallEnabled&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:s})),ev.createElement("span",{className:"mt-1 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"general.folder_enable_hide_chat_description",defaultMessage:"Hide chat panel by default for all project members in this folder."}))),ev.createElement(e1.Switch,{className:og()("ml-auto",a.isPaywallEnabled?"pointer-events-none":"cursor-pointer"),checked:o??!1,onChange:e=>{l({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:t.id,hideChat:e}}})}})),ev.createElement("button",{className:og()("flex w-full whitespace-normal px-4 py-3 text-left",a.isPaywallEnabled?"cursor-pointer":"cursor-default"),onClick:s},ev.createElement("div",{className:"flex flex-col"},ev.createElement("div",{className:"flex items-center"},ev.createElement("span",{className:"mr-1 text-sm font-medium text-appcolor-900"},ev.createElement(eY.Z,{id:"general.turn_off_share_link",defaultMessage:"Disable share link"})),ev.createElement(tn.Icon,{className:"h-4 cursor-pointer fill-appcolor-500 hover:fill-appcolor-900",icon:"dd_help",onClick:()=>{window.open("https://help.taskade.com/hc/en-us/articles/360016024673--Share-a-Project-Add-Collaborators","_blank","noopener,noreferrer")}}),a.isPaywallEnabled&&ev.createElement(e1.UpgradeBadge,{className:"ml-2",onClick:s})),ev.createElement("span",{className:"mt-1 text-xs text-appcolor-500"},ev.createElement(eY.Z,{id:"general.folder_turn_off_share_link_description",defaultMessage:"For new projects created in this folder, project collaborators can only be invited via email."}))),ev.createElement(e1.Switch,{className:og()("ml-auto",a.isPaywallEnabled?"pointer-events-none":"cursor-pointer"),checked:i??!1,onChange:e=>{l({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:t.id,disableShareLink:e}}})}})))},eRx=[{name:"general",messageDescriptor:{id:"general.general",defaultMessage:"General"},iconName:"dd_settings"},{name:"security",messageDescriptor:{id:"general.security",defaultMessage:"Security"},iconName:"share_password"}],eR_=eL.default.div.withConfig({displayName:"EditSpaceDialogBody__Wrapper",componentId:"sc-a2070f8c-0"})` + display: flex; + height: ${e=>e.$isSubspace?"640px":"512px"}; + width: 768px; + + border-radius: 12px; + overflow: hidden; +`,eRw=eL.default.span.withConfig({displayName:"EditSpaceDialogBody__SidebarText",componentId:"sc-a2070f8c-1"})` + ${e=>e.$isCurrentPage&&(0,eL.css)` + border-left: 2px solid ${e.theme.primaryColorScheme?.base}; + `} +`,eRN=function(e){let{exit:t,role:a,space:n,selectedTab:l}=e,r=(0,eK.Z)(),[o,i]=ev.useState(l),s=ev.useMemo(()=>{let e=r.formatMessage({id:"general.folder_settings",defaultMessage:"Folder Settings"});return`${e}`},[r]);return ev.createElement(gz,{spaceId:n.id,spaceType:n.type,spaceIsSubspace:n.is_subspace},ev.createElement("div",{className:"flex items-center border-0 border-b border-solid border-appcolor-300 px-4 py-4 text-center"},ev.createElement("div",{className:"flex-none pt-1"},ev.createElement(nA,{space:n,size:"lg"})),ev.createElement("div",{className:"flex flex-1 flex-col items-start truncate pl-2"},ev.createElement("span",{className:"text-md w-full truncate text-left font-medium text-textcolor-900",title:n.name},n.name),ev.createElement("span",{className:"text-xs text-textcolor-600"}," ",s))),ev.createElement(eR_,{onKeyDown:e=>{e.key===eI.KeyboardKeys.Escape&&(e.stopPropagation(),e.preventDefault(),t())},$isSubspace:n.is_subspace},ev.createElement("div",{className:"h-full w-3/12 border-0 border-r border-solid border-appcolor-300 bg-appcolor-100"},ev.createElement("nav",{className:"mt-3"},eRx.map(e=>ev.createElement("div",{key:e.name,onClick:()=>{i(e.name)}},ev.createElement(eRw,{$isCurrentPage:e.name===o,className:og()(e.name===o?"bg-appcolor-200 pl-3":"pl-3.5 hover:bg-appcolor-200","mx-2 my-1 flex cursor-pointer items-center py-2 text-sm text-textcolor-900")},ev.createElement(tn.Icon,{icon:e.iconName}),ev.createElement("div",{className:"pl-2"},ev.createElement(eY.Z,e.messageDescriptor))))))),ev.createElement("div",{className:"h-full w-9/12"},"general"===o&&ev.createElement(eRv,{exit:t,role:a,space:n}),"security"===o&&ev.createElement(eRE,{space:n}))))},eRC=(0,e$.connect)(function(e){return{isOpen:e.dialogs.editSpace.isOpen}})(function(e){let{isOpen:t,role:a,space:n}=e,l=(0,e$.useDispatch)(),r=ev.useCallback(()=>{l(En.actions.toggleEditSpaceDialog(!1))},[l]);return t?ev.createElement(eI.ModalDialog,{autofocus:!1,isOpen:!!t,close:r,className:"w-11/12 md:max-w-3xl"},e=>{let{exit:l}=e;return ev.createElement(eRN,{exit:l,role:a,space:n,selectedTab:t})}):null}),eRM=(0,la.ZP)` + mutation WorkspaceMemberRemoveMutation($input: WorkspaceMemberRemoveInput!) { + workspaceMemberRemove(input: $input) { + clientMutationId + ok + } + } +`,eRS=eL.default.div.withConfig({displayName:"LeaveSpaceDialogBody__FlexContainer",componentId:"sc-749e695e-0"})` + pointer-events: fill; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + width: 100%; + max-width: 540px; + margin: 0 auto; + position: relative; + border-radius: 10px; + padding: 24px 30px; + background: ${e=>e.theme.appColors.hex(100)}; +`,eRI=eL.default.h1.withConfig({displayName:"LeaveSpaceDialogBody__Header",componentId:"sc-749e695e-1"})` + ${e1.ArticleTypography.heading3} + font-weight: 500; + padding: 0 0 10px; + color: ${e=>e.theme.textColors.hex(10)}; +`,eRD=function(e){let{handleLeave:t,handleToggle:a,leaving:n,spaceName:l,isSubspace:r}=function(e){let{membership:t,exit:a}=e,{space:n}=t,l=(0,eF.k6)(),r=[{query:kf}],o=n.parent_membership?.space?.id;n.is_subspace&&null!=o&&(r.push({query:lu,variables:lg(!1,o)}),r.push({query:kg,variables:{spaceID:o,first:100,filterby:{archived:!1,hasMembership:!1,visibility:"public"}}}));let[i,{loading:s}]=(0,cs.D)(eRM,{awaitRefetchQueries:!0,refetchQueries:r});return{handleLeave:ev.useCallback(async()=>{let e=await i({variables:{input:{clientMutationId:(0,ld.Z)(),memberID:t.id}}});a(!0),e.data?.workspaceMemberRemove?.ok&&null!=o?l.push(`/spaces/${o}`):l.push("/")},[a,l,t,o,i]),handleToggle:()=>{a()},leaving:s,spaceName:n.name,isSubspace:n.is_subspace}}(e);return n?ev.createElement(eRS,null,ev.createElement(eI.Spinner,null)):ev.createElement(eRS,null,ev.createElement(eRI,null,ev.createElement(eY.Z,{id:"general.leave_workspace_header",defaultMessage:"Leave {spaceName}",values:{spaceName:l}})),ev.createElement(rP,null,r?ev.createElement(eY.Z,{id:"general.leave_folder_confirmation",defaultMessage:"Are you sure you want to leave {spaceName}? You will lose access to all projects in this folder.",values:{spaceName:l}}):ev.createElement(eY.Z,{id:"general.leave_workspace_confirmation",defaultMessage:"Are you sure you want to leave {spaceName}? You will lose access to all projects in this workspace.",values:{spaceName:l}})),ev.createElement(rF,null,ev.createElement(rj,{onClick:a},ev.createElement(eY.Z,{id:"general.cancel",defaultMessage:"Cancel"})),ev.createElement(rR,{onClick:t},ev.createElement(eY.Z,{id:"general.leave",defaultMessage:"Leave"}))))},eRT=(0,e$.connect)(function(e){return{isOpen:ec()(e,["modal","spaceLeave","isOpen"],!1)}},function(e){return(0,ek.DE)({onToggle:ry},e)})(function(e){let{isOpen:t,onToggle:a,membership:n}=e;return Eu({role:n.role,action:"leave"})&&t?ev.createElement(eI.ModalDialog,{isOpen:t,close:a},e=>{let{exit:t}=e;return ev.createElement(eRD,{exit:t,membership:n})}):null}),eR$=function(e){let{membership:t}=e,{role:a,space:n}=t,l=Eu({role:a,action:"delete"}),r=Eu({role:a,action:"leave"}),o=Eu({role:a,action:"edit"}),i=Eu({role:a,action:"create_project"});return ev.createElement(ev.Fragment,null,l&&ev.createElement(eNd,{role:a,space:n}),r&&ev.createElement(eRT,{membership:t}),o&&ev.createElement(eRC,{role:a,space:n}),i&&ev.createElement(ep4,{space:n}),ev.createElement(eA1,{space:n}),i&&ev.createElement(H5,null),ev.createElement(PN,null),ev.createElement(eAI,null),ev.createElement(euL,null),ev.createElement(epf,null),ev.createElement(eRt,null))},eRP=function(e){let{spaceID:t}=e,a=(0,e$.useDispatch)(),n=(0,ev.useRef)(!1),l=(0,ev.useCallback)(()=>{let e=BO.PresenceCommand.encode({type:BO.PresenceType.AVAILABLE,spaceId:t}).finish();a({type:r_,payload:{eventName:"PRESENCE_COMMAND",args:[new Blob([e])]}})},[a,t]);return(0,ev.useEffect)(()=>{let e=async function(){let e=await BZ()(a);e.connected&&(a(zH(e.id)),l(),n.current=!0);let t=()=>{a(zH(e.id)),l(),n.current=!0},r=e=>{a(zG(BO.PresenceEvent.decode(new Uint8Array(e))))},o=()=>{a(zK()),n.current=!1};return e.on("connect",t),e.on("PRESENCE_EVENT",r),e.on("disconnect",o),()=>{e.removeListener("connect",t),e.removeListener("PRESENCE_EVENT",r),e.removeListener("disconnect",o)}}();return()=>{e.then(e=>{e()})}},[a,l]),(0,ev.useEffect)(()=>()=>{let e=BO.PresenceCommand.encode({type:BO.PresenceType.UNAVAILABLE,spaceId:t}).finish();a(zK()),a({type:r_,payload:{eventName:"PRESENCE_COMMAND",args:[new Blob([e])]}}),n.current=!1},[t,a]),null},eRF={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceMemberCountQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"spaceID"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"membership"},arguments:[{kind:"Argument",name:{kind:"Name",value:"space_id"},value:{kind:"Variable",name:{kind:"Name",value:"spaceID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BasicUserParts"}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},eRA=function(){let e=(0,e$.useDispatch)(),t=(0,eF.UO)(),a=(0,eF.TH)(),n=ev.useMemo(()=>null!=t.subspaceID?t.subspaceID:null!=t.spaceID?t.spaceID:II(a.pathname),[a.pathname,t.spaceID,t.subspaceID]),{data:l}=(0,eB.a)(eRF,null!=n?{variables:{spaceID:n}}:{skip:!0}),r=l?.membership?.space?.memberships,o=l?.membership?.role??"viewer",i=Eu({role:o,action:"add_user"}),s=(0,ev.useMemo)(()=>r?.map(e=>e.user)??[],[r]);return"viewer"===o?null:ev.createElement(Cv,{allow:i,onClick:()=>{e(fF(n))},placement:"top",users:s})},eRR=eL.default.div.withConfig({displayName:"Badge__TrialBadge",componentId:"sc-d0b6071d-0"})` + display: flex; + align-items: center; + padding: 3px 8px 3px 6px; + margin-left: 8px; + border-radius: 5px; + color: ${e=>e.theme.appColors.hex(10)}; + ${e1.UiTypography.xxs}; + background: ${e=>e.theme.appColors.hex(80)}; + letter-spacing: 0.04rem; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + white-space: nowrap; + font-weight: 500; + + & > a { + color: ${e=>e.theme.appColors.hex(10)}; + } +`,eRj=function(e){let{space:t}=e,a=t.is_trial,n=t.preferences?.trialEndedAt??null,l="";if(null!=n){let e=n-cc()().unix();e{s(!0)},onMouseLeave:()=>{s(!1)}},ev.createElement("a",{href:"/upgrade",rel:"noopener noreferrer",target:"_blank"},ev.createElement(eY.Z,{id:"general.badge_trial_ends_in",defaultMessage:"⚡️ Unlimited Trial"}))),d&&ev.createElement(eI.Tooltip,{arrowProps:r,popperProps:o},ev.createElement(eY.Z,{id:"general.trial_ends_in",defaultMessage:"This workspace has {trialTimeLeft} remaining on the Unlimited trial. Click to learn more.",values:{trialTimeLeft:l}}))):null},eRO=function(e){let{spaceId:t}=e,[a,n]=(0,ev.useState)(!0),l=(0,e$.useDispatch)(),{data:r,loading:o}=(0,eB.a)(egw,t?{variables:{spaceID:t}}:{skip:!0}),{data:i}=(0,eB.a)(ED),s=i?.me?.appSumo,d=s?.taskadePlanType??"free";if(o)return null;let c=r?.membership;if(null==c)return null;let m=e0(),u=c.space.taskadePlan,p=u.type,g=c.role,f=fR.Vl.getFeature("ai.generation.fair-use").plans[u.type],h=IP(u.usage["ai.generation.fair-use"]??0,f);if("unlimited"===h.remaining||h.remaining>0||"mac_app_store"===m||"windows_app_store"===m||"owner"!==g||"free"!==p||!a)return null;let y=()=>{l(d4())};return ev.createElement("div",{className:"mt-3 flex w-full items-center rounded-lg bg-upgrade px-3 py-2 text-sm text-black"},ev.createElement("span",{className:"inline"},ev.createElement(tn.Icon,{icon:"upgrade_filled",className:"-mt-1 mr-1 scale-80"}),"free"!==d?ev.createElement(eY.Z,{id:"paywall.please_activate_this_workspace",defaultMessage:"Please activate this workspace to unlock all premium features.",values:{link:e=>ev.createElement("a",{className:"border-b border-solid border-black font-medium transition duration-150 ease-in-out hover:opacity-70",href:"/settings/plans"},e)}}):ev.createElement(eY.Z,{id:"paywall.you_are_out_of_credits_for_the_month",defaultMessage:"You are out of credits for this month. Upgrade now to get unlimited AI credits.",values:{link:e=>ev.createElement("button",{className:"border-b border-solid border-black font-medium transition duration-150 ease-in-out hover:opacity-70",onClick:y},e)}})),ev.createElement("button",{className:"ml-auto flex items-center justify-center transition duration-150 ease-in-out hover:opacity-50",onClick:()=>{n(!1)}},ev.createElement(tn.Icon,{icon:"modal_close"})))},eRU=new tV.fK.Entity("memberships",{user:tW,space:ip}),eRZ=new tV.fK.Array(eRU),eRL="@@taskade/space/UPDATE_LIST_ON_ARCHIVE",eRB="SPACE_FETCH_DOCUMENTS",eRz="SPACE_SET_DOCUMENTS_FETCH_STATUS",eRV="SPACE_SET_DOCUMENT_LIST",eRq="SPACE_ADD_DOCUMENT",eRW="@@taskade/space/ARCHIVE",eRH="SPACE_REMOVE_DOCUMENT",eRG="SPACE_FETCH_MEMBERSHIPS",eRK="@@taskade/space/SET_AVATAR_UPLOAD_STATUS",eRY="SPACE_SET_MEMBERSHIPS_FETCH_STATUS",eRQ="SPACE_SET_MEMBERSHIP_LIST";function eRJ(e,t,a){return{type:eRz,payload:{spaceID:e,fetchStatus:t,documentStatus:a}}}function eRX(e){return{type:eRG,payload:{spaceID:e}}}function eR0(e,t){return{type:eRY,payload:{spaceID:e,fetchStatus:t}}}function eR1(e,t,a){return{type:eRQ,payload:{spaceID:e,memberships:t,fetchStatus:a}}}function eR2(e,t){return{type:eRK,payload:{spaceID:e,uploadStatus:t}}}function eR5(e,t){return{type:eRW,payload:{spaceID:e,archived:t}}}function eR3(e,t){return{type:eRL,payload:{spaceID:e,archived:t}}}let eR4=(0,la.ZP)` + mutation ArchiveSpaceMutation($input: ArchiveSpaceInput!) { + archiveSpace(input: $input) { + clientMutationId + ok + archivedSpace { + id + archived_at + } + } + } +`,eR6=function(e){let{children:t,onClick:a,name:n,value:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({onClick:a,stopRef:r,name:n,value:l});return ev.createElement(cF,o.props,t)},eR8=function(e){let{onClick:t,space:a}=e,n=!eu()(a.archived_at);return ev.createElement(eR6,{onClick:t,name:"archive"},n?ev.createElement(tn.Icon,{icon:"dd_restore"}):ev.createElement(tn.Icon,{icon:"dd_archive"}),n?ev.createElement(eY.Z,{id:"general.restore",defaultMessage:"Restore"}):ev.createElement(eY.Z,{id:"general.archive",defaultMessage:"Archive"}))},eR7=function(e){let{spaceID:t}=e;return ev.createElement(sC.rU,{to:`/settings/billing/${t}`},ev.createElement(eR6,{name:"billing"},ev.createElement(tn.Icon,{icon:"dd_billing"}),ev.createElement(eY.Z,{id:"general.billing",defaultMessage:"Billing"})))},eR9=function(e){let{onClick:t,isSubspace:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({onClick:t,stopRef:n,name:"delete"});return ev.createElement(cF,{...l.props,$warning:!0},ev.createElement(tn.Icon,{icon:"dd_delete"}),a?ev.createElement(eY.Z,{id:"general.delete_folder",defaultMessage:"Delete folder"}):ev.createElement(eY.Z,{id:"general.delete_workspace",defaultMessage:"Delete workspace"}))},eje=function(e){let{onClick:t,isSubspace:a}=e,n=ev.useRef(null),l=(0,eI.useMenuItem)({onClick:t,stopRef:n,name:"leave"});return ev.createElement(cF,{...l.props,$warning:!0},ev.createElement(tn.Icon,{icon:"dd_leave"}),a?ev.createElement(eY.Z,{id:"general.leave_folder",defaultMessage:"Leave folder"}):ev.createElement(eY.Z,{id:"general.leave_workspace",defaultMessage:"Leave workspace"}))},ejt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"DocumentUnreadFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Document"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}}]}}]},eja={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceMarkAsReadMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMarkAsReadInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceMarkAsRead"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}}]}}]}}]}}]},ejn=dw.z.object({__typename:dw.z.literal("DocumentConnection"),edges:dw.z.array(dw.z.object({node:dw.z.union([dw.z.object({__typename:dw.z.literal("Document"),id:dw.z.string()}),dw.z.object({__ref:dw.z.string()})])}))}),ejl=function(e){let{space:t}=e,[a]=(0,cs.D)(eja),n=ev.useCallback(()=>{a({variables:{input:{clientMutationId:(0,ld.Z)(),spaceID:t.id}},update(e){e.modify({id:e.identify({__typename:"Space",id:t.id}),fields:{documents_v2(t,a){let{readField:n}=a;if(!ejn.safeParse(t).success)return t;for(let a of t.edges){let t=n("id",a.node),l=e.readFragment({fragment:ejt,id:e.identify({__typename:"Document",id:t})});null!=l&&e.writeFragment({fragment:ejt,id:e.identify({__typename:"Document",id:t}),data:(0,es.ZP)(l,e=>{e.is_unread=!1})})}return t}}})}})},[t.id,a]);return ev.createElement(eR6,{onClick:n,name:"mark_as_read"},ev.createElement(tn.Icon,{icon:"dd_check"}),ev.createElement(eY.Z,{id:"activity.mark_as_read",defaultMessage:"Mark as Read"}))},ejr=function(e){let{spaceID:t}=e;return ev.createElement(sC.rU,{to:`/settings/billing/${t}`},ev.createElement(eR6,{name:"settings"},ev.createElement(tn.Icon,{icon:"dd_settings"}),ev.createElement(eY.Z,{id:"general.settings",defaultMessage:"Settings"})))},ejo=eL.default.div.withConfig({displayName:"styled__StyledBreadcrumbs",componentId:"sc-7dd0c2c1-0"})` + display: flex; + align-items: center; + + & > * { + display: none; + } + & > .active-path { + display: flex; + } + + @media (min-width: 768px) { + & > * { + display: flex; + transform: scale(0.9); + margin-left: -4px; + } + } +`,eji=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"styled__StyledBreadcrumbIcon",componentId:"sc-7dd0c2c1-1"})` + margin: 0 5px; + color: ${e=>e.theme.appColors.hex(50)}; + transform: rotate(-90deg) scale(0.9); +`,ejs=eL.default.span.withConfig({displayName:"styled__StyledTitleValue",componentId:"sc-7dd0c2c1-2"})` + display: flex; + max-width: 100%; + margin-left: 8px; + color: ${e=>e.theme.isNightMode?"#fff":"#333"}; + font-size: 16px; + line-height: 20px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +`,ejd=eL.default.div.withConfig({displayName:"styled__InviteOnly",componentId:"sc-7dd0c2c1-3"})` + display: inline-flex; + color: ${e=>e.theme.appColors.hex(50)}; + margin-left: 0.25rem; + align-items: center; +`,ejc=(0,eL.default)(tn.Icon).attrs({icon:"caret_down"}).withConfig({displayName:"styled__StyledCaretIcon",componentId:"sc-7dd0c2c1-4"})` + margin-left: 3px; + fill: ${e=>e.theme.isNightMode?"#ccc":"#666"}; +`,ejm=eL.default.div.withConfig({displayName:"styled__StyledSpaceTitle",componentId:"sc-7dd0c2c1-5"})` + display: flex; + align-items: center; + + &:hover { + ${ejs}, + ${ejc} { + opacity: 0.7; + } + } +`,eju=eL.default.button.withConfig({displayName:"styled__StyledDropdownToggle",componentId:"sc-7dd0c2c1-6"})` + border: 0; + padding: 0; + background: none; + cursor: pointer; + + &:focus { + outline: 0; + } +`,ejp=eL.default.hr.withConfig({displayName:"styled__StyledDivider",componentId:"sc-7dd0c2c1-7"})` + margin: var(--menu-item-divider-margin); + background-color: ${e=>e.theme.appColors.hex(70)}; +`,ejg=(0,eL.default)(eI.Menu).withConfig({displayName:"styled__StyledMenu",componentId:"sc-7dd0c2c1-8"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,ejf=function(e){let{space:t}=e;if(t.is_subspace&&t.parent_membership?.space==null)return ev.createElement(ev.Fragment,null,ev.createElement(sC.rU,{to:"/shared"},ev.createElement(ejm,null,ev.createElement(ejs,null,ev.createElement(eY.Z,{id:"general.shared_with_me",defaultMessage:"Shared with me"})))),ev.createElement(eji,null));if(!0===t.is_subspace){let e=t.parent_membership?.space;return null==e?null:ev.createElement(ev.Fragment,null,ev.createElement(sC.rU,{to:`/spaces/${e.id}`,className:"items-center"},ev.createElement(ejm,null,ev.createElement(nA,{space:e,size:"sm"}),ev.createElement(ejs,null,e.name)),ev.createElement(eji,null)))}return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex max-w-lg items-center"},ev.createElement(nA,{space:t,size:"sm",className:"flex-none"}),ev.createElement(ejs,{title:t.name},t.name)),ev.createElement(eji,null))},ejh=function(){let e=(0,e$.useDispatch)();return ev.createElement(eR6,{name:"upgrade",onClick:()=>{e(d4())}},ev.createElement(tn.Icon,{icon:"sidebar_upgrade",className:"text-upgrade"}),ev.createElement("span",{className:"!overflow-visible text-upgrade"},ev.createElement(eY.Z,{id:"general.upgrade",defaultMessage:"Upgrade"})))},ejy=function(e){let{role:t,space:a,onClickMembers:n}=e,l=(0,eF.k6)(),[r]=(0,cs.D)(eR4),o=(0,e$.useDispatch)(),[i,s]=ev.useState(!1),d=ev.useRef(null),c=ev.useRef(null),m=ev.useRef(null),{arrowProps:u,popperProps:p,referenceProps:g}=(0,eI.useControlledTooltip)({referenceElementRef:d,arrowElementRef:c,popperElementRef:m,placement:"bottom",visible:i}),f=ev.useCallback(async()=>{let e=(0,ld.Z)(),t={archived:null==a.archived_at,id:a.id,clientMutationId:e};try{let e=a.parent_membership?.space.id,n=await r({variables:{input:t},optimisticResponse:{__typename:"Mutation",archiveSpace:{__typename:"ArchiveSpacePayload",clientMutationId:t.clientMutationId,ok:!0,archivedSpace:{__typename:"Space",id:a.id,archived_at:t.archived?new Date().toISOString():null}}},refetchQueries:[{query:lu,variables:lg(!1,e)}]}),i=n.data?.archiveSpace.archivedSpace??null;if(null==i)return;if(o(eR5(a.id,null!=i.archived_at)),null!=i.archived_at){if(null!=e){l.push(`/spaces/${e}`);return}l.push("/recent")}}catch(e){o(eR5(a.id,null==a.archived_at))}},[r,o,l,a.archived_at,a.id,a.parent_membership?.space.id]),[h,y]=ev.useReducer(eI.popupReducer,{expanded:!1}),b=ev.useRef(null),v=ev.useRef(null),k=ev.useCallback(()=>{b.current?.focus()},[]);(0,eI.usePopupEvents)({state:h,onCollapse:k});let E=(0,eI.usePopup)({referenceElementRef:b,popupElementRef:v,state:h,placement:"bottom-start"}),x=(0,eI.useMenuButton)({dispatch:y,ref:b,state:h}),_=ev.useCallback(()=>{y({type:"Collapse"})},[]),{id:w}=a,N="unlimited"===a.type,{is_subspace:C}=a,M=a.parent_membership?.space,S=pW({role:t,action:"leave"}),I=pW({role:t,action:"delete"}),D=pW({role:t,action:"archive"}),T=pW({role:t,action:"manage_role"}),$=pW({role:t,action:"edit"}),P=!C&&N&&pW({role:t,action:"manage_billing"}),F=!C&&pW({role:t,action:"manage_settings"}),A=!C&&d6()&&!N&&pW({role:t,action:"manage_settings"});return ev.createElement(ev.Fragment,null,ev.createElement(ejo,null,ev.createElement(ejf,{space:a}),ev.createElement(eju,{className:"active-path",type:"button",...x.props},ev.createElement(ejm,null,C?ev.createElement(nA,{space:a,size:"sm"}):ev.createElement(tn.Icon,{icon:"home",className:"text-appcolor-500"}),ev.createElement(ejs,null,C?a.name:ev.createElement(eY.Z,{id:"general.home",defaultMessage:"Home"}),null!=M&&C&&null==a.visibility&&ev.createElement(ejd,{...g,onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)}},ev.createElement(tn.Icon,{icon:"access_invite"}),i&&ev.createElement(eI.Tooltip,{arrowProps:u,popperProps:p},ev.createElement(eY.Z,{id:"general.only_visible_to_you_and_people_you_invite",defaultMessage:"Only visible to you and people you invite"})))),ev.createElement(ejc,null)))),h.expanded&&ev.createElement(eI.Popup,{...E.props,dispatch:y,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:_},ev.createElement(ejg,{initialFocus:E.initialFocus,loop:!0},A&&ev.createElement(ejh,null),P&&d6()&&ev.createElement(eR7,{spaceID:w}),$&&ev.createElement(eR6,{onClick:()=>{o(En.actions.toggleEditSpaceDialog("general"))},name:"edit"},ev.createElement(tn.Icon,{icon:"dd_edit"}),ev.createElement(eY.Z,{id:"general.edit",defaultMessage:"Edit"})),$&&ev.createElement(eR6,{onClick:()=>{o(En.actions.toggleEditSpaceDialog("security"))},name:"security"},ev.createElement(tn.Icon,{icon:"share_password"}),ev.createElement(eY.Z,{id:"general.security",defaultMessage:"Security"})),T&&ev.createElement(eR6,{onClick:n,name:"members"},ev.createElement(tn.Icon,{icon:"dd_members"}),ev.createElement(eY.Z,{id:"general.members",defaultMessage:"Members"})),ev.createElement(eR6,{onClick:()=>{o(rv())},name:"notifications"},ev.createElement(tn.Icon,{icon:"dd_notifications"}),ev.createElement(eY.Z,{id:"general.notifications",defaultMessage:"Notifications"})),ev.createElement(ejl,{space:a}),ev.createElement(ejp,null),F&&ev.createElement(ejr,{spaceID:w}),D&&ev.createElement(eR8,{onClick:f,space:a}),C&&I&&ev.createElement(eR9,{onClick:e=>{a.is_subspace?o(rb()):l.push(`/settings/billing/${a.id}`)},isSubspace:C}),S&&ev.createElement(eje,{onClick:()=>{o(ry())},isSubspace:C})))))},ejb=(0,e$.connect)(null,function(e){return(0,ek.DE)({toggleSpaceInviteModalDialog:fF},e)})(function(e){let{role:t,space:a,toggleSpaceInviteModalDialog:n}=e;return ev.createElement("div",{className:"flex flex-col px-4"},ev.createElement(eRO,{spaceId:a.id}),ev.createElement("div",{className:"flex h-12 py-2"},Ic()&&ev.createElement(eDJ,null),ev.createElement(IS,{desktopHidden:!0}),ev.createElement(ejy,{onClickMembers:function(){n(a.id)},role:t,space:a}),ev.createElement(eRj,{space:a}),ev.createElement("div",{className:"flex flex-1 items-center justify-end gap-0.5"},ev.createElement(eRA,null),ev.createElement(e_A,null)),ev.createElement("div",{className:"flex items-center"},ev.createElement(Sz,null),ev.createElement(Ii,null))))}),ejv=function(e){let{spaceId:t}=e,a=`/spaces/${t}/settings`;return ev.createElement(eDD,null,ev.createElement(eDT,null,ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${a}/members`},ev.createElement(eY.Z,{id:"general.Members",defaultMessage:"Members"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${a}/folders`},ev.createElement(eY.Z,{id:"general.Folders",defaultMessage:"Folders"}))))},ejk=(0,la.ZP)` + query CurrentSpaceQuery($spaceID: ID) { + membership(space_id: $spaceID) { + id + role + space { + id + name + color + is_subspace + is_trial + type + visibility + documents_v2 { + totalCount + } + } + } + } +`,ejE=function(e){let{match:t}=e,a=t.params.spaceId,{data:n,loading:l}=(0,eB.a)(ejk,{variables:{spaceID:a}}),r=n?.membership,o=r?.space,i=ev.useMemo(()=>({primaryColor:o?.color}),[o]);return l?ev.createElement(eI.Spinner,{height:319}):null==r?ev.createElement(eN0,null,ev.createElement(eN1,null,ev.createElement(eY.Z,{id:"general.no_workspace_access",defaultMessage:"You do not have access to this workspace"})),ev.createElement(eN2,null,ev.createElement(eY.Z,{id:"general.no_workspace_access_description",defaultMessage:"To get access, you must be invited by a workspace member."}))):!o.is_subspace&&pW({role:r.role,action:"manage_settings"})?ev.createElement(eI.ThemeProvider,{theme:i},ev.createElement(eT.ql,{title:`${o.name} - Taskade`}),ev.createElement(ejb,{space:o,users:[],role:r.role}),ev.createElement(eRP,{spaceID:o.id}),ev.createElement(ejv,{spaceId:o.id}),ev.createElement(eF.rs,null,ev.createElement(eF.AW,{path:"/spaces/:spaceID/settings/members",render:()=>ev.createElement(eF.l_,{to:`/settings/billing/${o.id}/members`})})),ev.createElement(eF.rs,null,ev.createElement(eF.AW,{path:"/spaces/:spaceID/settings/folders",render:()=>ev.createElement(eF.l_,{to:`/settings/billing/${o.id}/folders`})})),r&&ev.createElement(eR$,{membership:r})):ev.createElement(eN0,null,ev.createElement(eN1,null,ev.createElement(eY.Z,{id:"general.no_workspace_manage_settings_permissions",defaultMessage:"You do not have permissions to access this page."})))},ejx=(0,eL.default)(lT.hA).withConfig({displayName:"DocumentItem__StyledStarIcon",componentId:"sc-9e4241e5-0"})` + height: 20px; + width: 20px; + + > path { + fill: #f2d750; + } +`,ej_=(0,eL.default)(lT.mq).withConfig({displayName:"DocumentItem__StyledProjectIcon",componentId:"sc-9e4241e5-1"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,ejw=(0,eL.default)(tn.Icon).withConfig({displayName:"DocumentItem__StyledLeaveIcon",componentId:"sc-9e4241e5-2"})` + color: ${eI.ThemeColors.danger}; + margin-bottom: ${eI.UiSpacing.getPx(3)}; +`,ejN=eL.default.span.withConfig({displayName:"DocumentItem__TooltipText",componentId:"sc-9e4241e5-3"})` + color: #cccccc; +`,ejC=eL.default.div.withConfig({displayName:"DocumentItem__Container",componentId:"sc-9e4241e5-4"})` + display: flex; + flex-direction: row; + align-items: center; + padding: 14px 22px; + :hover { + background: ${e=>e.theme.isNightMode?"#272C30":"#f8f8f8"}; + } + position: relative; + + @media (min-width: 768px) { + padding: 14px 32px; + } +`,ejM=eL.default.div.withConfig({displayName:"DocumentItem__ProjectIcon",componentId:"sc-9e4241e5-5"})` + display: flex; + flex-shrink: 0; + width: 50px; + height: 50px; + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1); + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + margin-right: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; + + & > span { + font-size: 26px; + } +`,ejS=eL.default.div.withConfig({displayName:"DocumentItem__ContentWrapper",componentId:"sc-9e4241e5-6"})` + display: flex; + flex: 1; + flex-direction: column; + align-items: flex-start; + justify-content: center; +`,ejI=eL.default.div.withConfig({displayName:"DocumentItem__Top",componentId:"sc-9e4241e5-7"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; + padding-top: 2px; +`,ejD=eL.default.span.withConfig({displayName:"DocumentItem__Title",componentId:"sc-9e4241e5-8"})` + font-size: 17px; + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,ejT=eL.default.div.withConfig({displayName:"DocumentItem__StarIconWrapper",componentId:"sc-9e4241e5-9"})` + display: flex; + margin-left: 5px; +`,ej$=eL.default.div.withConfig({displayName:"DocumentItem__ActionWrapper",componentId:"sc-9e4241e5-10"})` + display: flex; + flex-basis: 150px; + justify-content: flex-end; +`,ejP=eL.default.div.withConfig({displayName:"DocumentItem__BottomWrapper",componentId:"sc-9e4241e5-11"})` + display: inherit; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + margin: 6px 0 0; + + & > span { + margin: 0; + } +`,ejF=function(e){let{document:t,handleLeaveDocument:a}=e,{id:n,info:l,space:r,is_unread:o,updated_at:i}=t,[s,d]=ev.useState(!1),c=ev.useRef(null),m=ev.useRef(null),u=ev.useRef(null),{referenceProps:p,arrowProps:g,popperProps:f}=(0,eI.useControlledTooltip)({referenceElementRef:c,arrowElementRef:m,popperElementRef:u,visible:s,placement:"top"}),h=ev.useCallback(()=>{d(!0)},[d]),y=ev.useCallback(()=>{d(!1)},[d]),{stats:b,updatedBy:v}=l,k=ts()(l.title)?"Untitled":l.title,E=cc()(i).fromNow(),x=`/d/${n}?from=shared`,_=b?.completedCount??0,w=b?.totalCount??0,N=nQ(t),C=r?.color,M=(0,ev.useMemo)(()=>eu()(C)?void 0:{primaryColor:C},[C]);return ev.createElement(eI.ThemeProvider,{theme:M},ev.createElement(sC.rU,{id:n,to:x,key:`document-list-item-${n}`},ev.createElement(ejC,null,o&&null!=r&&ev.createElement(eP6,{style:{position:"absolute",left:"12px",top:"36px"}}),ev.createElement(ejM,null,null!=N?ev.createElement("span",null,N):ev.createElement(ej_,null)),ev.createElement(ejS,null,ev.createElement(ejI,null,ev.createElement(ejD,null,k),null!=t.starred_at&&ev.createElement(ejT,null,ev.createElement(ejx,{selected:null!=t.starred_at}))),ev.createElement(ejP,null,ev.createElement(eP4,{spaceName:r?.name,updatedBy:v,updatedFromNow:E}))),ev.createElement("div",{...p,onClick:e=>{e.preventDefault(),a(n)},onMouseEnter:h,onMouseLeave:y},ev.createElement(ejw,{icon:"dd_leave"})),s&&ev.createElement(eI.Tooltip,{arrowProps:g,popperProps:f},ev.createElement(ejN,null,ev.createElement(eY.Z,{id:"general.leave_project",defaultMessage:"Leave Project"}))),ev.createElement(ej$,null,ev.createElement(pl,{percentCompleted:w>0?_/w*100:0})))))},ejA=eL.default.div.withConfig({displayName:"SharedEmptyState__Wrapper",componentId:"sc-cde1f99d-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: 0 auto; + font-size: 14px; + text-align: center; + height: 100%; + padding: 32px 32px 160px 32px; + + @media (max-width: 768px) { + max-width: 540px; + padding-bottom: 100px; + } + + @media (max-width: 480px) { + max-width: 100%; + padding-bottom: 100px; + } +`,ejR=eL.default.h4.withConfig({displayName:"SharedEmptyState__Heading",componentId:"sc-cde1f99d-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,ejj=eL.default.p.withConfig({displayName:"SharedEmptyState__Description",componentId:"sc-cde1f99d-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,ejO=eL.default.div.withConfig({displayName:"SharedEmptyState__EmptyImageWrapper",componentId:"sc-cde1f99d-3"})` + margin-bottom: 24px; + opacity: 40%; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,ejU=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(ejA,null,ev.createElement(ejO,null,!n&&ev.createElement(lT.Nj,null)),ev.createElement(ejR,null,t),ev.createElement(ejj,null,a))},ejZ=(0,la.ZP)` + query RecentProjectsQuery($first: Int, $after: String, $filterby: RecentProjectsFiltering) { + recentProjects(first: $first, after: $after, filterby: $filterby) { + edges { + cursor + node { + id + edit_path + has_move_permission + has_leave_permission + is_owner + is_unread + info + pinned_at + role { + project + workspace + } + shared_preferences + space { + id + name + color + } + starred_at + templated_at + updated_at + user { + ...BasicUserFields + } + } + } + totalCount + } + } + ${up} +`,ejL=eL.default.div.withConfig({displayName:"Shared__ListWrapper",componentId:"sc-efa3ced1-0"})` + margin-bottom: 20px; +`,ejB=function(e){let{location:t}=e,{search:a}=t,n={...egi(a,20),filterby:{member:"project-only"}},{loading:l,error:r,data:o}=(0,eB.a)(ejZ,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",variables:n}),[i]=(0,cs.D)(MN,{refetchQueries:[{query:ejZ,variables:n}]}),s=e=>{i({variables:{id:e}})},d=(0,eK.Z)();if(l)return ev.createElement(eI.Spinner,{height:319});if(r)return ev.createElement(ev.Fragment,null,ev.createElement(eD6,null),ev.createElement(ePJ,{message:d.formatMessage({id:"general.shared_projects_error_loading",defaultMessage:"There was an error loading shared projects. Please try again later"}),hideIcon:!0}));let c=o?.recentProjects?.edges??[],m=o?.recentProjects?.totalCount??0;return 0===m?ev.createElement(ev.Fragment,null,ev.createElement(eD6,null),ev.createElement(ejU,{heading:d.formatMessage({id:"general.empty_state_shared_projects",defaultMessage:"There are no shared projects"}),description:d.formatMessage({id:"general.empty_state_shared_projects_description",defaultMessage:"Projects where you have project-only access are displayed here."})})):ev.createElement(ev.Fragment,null,ev.createElement(eT.ql,null,ev.createElement("title",null,"Shared with me - Taskade")),ev.createElement(eD6,null),ev.createElement(ejL,null,c.map(e=>{let{node:t}=e;return null==t?null:ev.createElement(ejF,{key:t.id,document:t,handleLeaveDocument:s})}),ev.createElement(eNH,{pathname:t.pathname,search:t.search,hash:t.hash,totalCount:m,itemPerPage:20})))},ejz=function(e){let{location:t,spaceID:a}=e,n=ev.useMemo(()=>"true"===tL.parse(t.search).userIsNew,[t.search]),l=(0,e$.useSelector)(_P),r=(0,e$.useDispatch)();return ev.useEffect(()=>{l&&(n&&r({type:sp,payload:{userIsNew:!0}}),r(fF(a)),r({type:su,payload:{spaceIsNew:!1}}))},[]),null},ejV=eL.default.div.withConfig({displayName:"Chip",componentId:"sc-3321894f-0"})` + min-height: 30px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + color: ${e=>e.theme.isNightMode?"#eee":"#333"}; + border-radius: 30px; + padding: 0 8px; + cursor: pointer; + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f8f8f8"}; + border: 1px solid ${e=>e.theme.isNightMode?"#242A2F":"#e5e5e5"}; + font-size: 14px; + + &:hover { + background: ${e=>e.theme.isNightMode?"#242A2F":"#e5e5e5"}; + } + + & > img { + margin-right: 5px; + height: 20px; + width: 20px; + } + & > div { + display: flex; + align-items: center; + justify-content: center; + } + + & svg { + margin-right: 8px; + } +`,ejq=function(e){let{onClick:t}=e;return ev.createElement(ejV,{onClick:t},ev.createElement(eY.Z,{id:"general.clear",defaultMessage:"Clear"}))},ejW=(0,eL.default)(lT.k1).withConfig({displayName:"TagChip__StyledIconTag",componentId:"sc-65f7cfad-0"})` + margin-right: 10px; + ${function(e){let t=erp(e.color);return(0,eL.css)` + & path:first-child { + fill: ${t}; + stroke: ${t}; + } + & path:last-child { + stroke: ${t}; + } + `}} +`,ejH=eL.default.span.withConfig({displayName:"TagChip__Label",componentId:"sc-65f7cfad-1"})` + padding: 0; +`,ejG=function(e){let{onClick:t,tag:a}=e,{color:n,label:l,key:r}=a,o=(0,ev.useCallback)(()=>{t(r)},[r,t]);return ev.createElement(ejV,{onClick:o},ev.createElement("div",null,ev.createElement(ejW,{color:n})),ev.createElement(ejH,null,l))},ejK=eL.default.img.withConfig({displayName:"UserChip__StyledImg",componentId:"sc-85284dca-0"})` + height: 24px; + width: 24px; + border-radius: 50%; + margin-right: 12px; +`,ejY=eL.default.span.withConfig({displayName:"UserChip__Label",componentId:"sc-85284dca-1"})` + padding: 0; +`,ejQ=function(e){let{onClick:t,user:a}=e,{handle:n,iconURL:l}=a,r=(0,ev.useCallback)(()=>{t(n)},[n,t]);return ev.createElement(ejV,{onClick:r},ev.createElement(ejK,{src:l}),ev.createElement(ejY,null,n))},ejJ=og()("w-full h-7 px-5 flex flex-row items-center justify-between bg-appcolor-0 cursor-pointer hover:bg-appcolor-200 focus:bg-appcolor-200"),ejX=og()("mt-2.5 mx-5 mb-0.5 text-textcolor-500 text-2xs uppercase"),ej0=function(e){let{onSelect:t,user:a}=e,{handle:n,isSelected:l,iconURL:r}=a,o=ev.useRef(null),i=ev.useCallback(e=>{e.preventDefault(),t(n)},[n,t]),s=(0,eI.useMenuItem)({onClick:i,stopRef:o,name:"user",value:a.handle});return ev.createElement("button",{...s.props,className:ejJ},ev.createElement("div",{className:"flex h-7 w-full flex-row items-center justify-start overflow-hidden break-words"},ev.createElement("img",{src:r,className:"mr-2 h-6 w-6 flex-none rounded-full"}),ev.createElement("span",{className:"flex-auto text-left text-sm text-textcolor-900"},ev.createElement(eY.Z,{id:"general.assigned_to_me",defaultMessage:"Assigned to Me"})),l&&ev.createElement(lT.MM,{className:"h-7 flex-none text-primary"})))},ej1=(0,eL.default)(lT.k1).withConfig({displayName:"TagDropdownFilterMenuItem__StyledIconTag",componentId:"sc-b870ae75-0"})` + width: 24px; + margin-right: 8px; + display: flex; + justify-content: center; + + ${function(e){let t=erp(e.color);return(0,eL.css)` + & path:first-child { + fill: ${t}; + stroke: ${t}; + } + & path:last-child { + stroke: ${t}; + } + `}} +`,ej2=function(e){let{onSelect:t,tag:a}=e,{label:n,color:l,key:r,isSelected:o}=a,i=ev.useRef(null),s=ev.useCallback(e=>{e.preventDefault(),t(r)},[r,t]),d=(0,eI.useMenuItem)({onClick:s,stopRef:i,name:"tag",value:a.key});return ev.createElement("button",{...d.props,className:ejJ},ev.createElement("div",{className:"flex h-7 w-full flex-row items-center justify-start overflow-hidden break-words"},ev.createElement(ej1,{color:l,className:"flex-none"}),ev.createElement("span",{className:"flex-auto overflow-hidden overflow-ellipsis py-1.5 text-left text-sm text-textcolor-900"},n),o&&ev.createElement(lT.MM,{className:"h-7 flex-none text-primary"})))},ej5=eL.default.span.withConfig({displayName:"UserDropdownFilterMenuItem__Label",componentId:"sc-b4597727-0"})` + margin-right: 5px; + color: ${e=>e.theme.isNightMode?"#eee":"#333"}; + text-overflow: ellipsis; + overflow: hidden; + ${e1.UiTypography.sm}; +`,ej3=eL.default.span.withConfig({displayName:"UserDropdownFilterMenuItem__SubLabel",componentId:"sc-b4597727-1"})` + color: #999; + padding-right: 10px; + ${e1.UiTypography.xs}; +`,ej4=function(e){let{onSelect:t,user:a}=e,{defaultName:n,handle:l,iconURL:r,isSelected:o}=a,i=ev.useCallback(e=>{e.preventDefault(),t(l)},[l,t]),s=ev.useRef(null),d=(0,eI.useMenuItem)({onClick:i,stopRef:s,name:"user",value:a.handle});return ev.createElement("button",{...d.props,className:ejJ},ev.createElement("div",{className:"flex w-full flex-row items-center justify-start overflow-hidden whitespace-nowrap break-words"},ev.createElement("img",{src:r,className:"mr-2 h-6 w-6 flex-none rounded-full"}),ev.createElement("div",{className:"flex-auto text-left"},ev.createElement(ej5,null,l),ev.createElement(ej3,null,n)),o&&ev.createElement(lT.MM,{className:"h-7 flex-none text-primary"})))},ej6=function(e){return ev.createElement("div",{className:"sticky top-0 rounded-xl bg-appcolor-0 px-3 py-2.5"},ev.createElement("input",{className:"h-9 w-full rounded-xl border border-appcolor-300 bg-appcolor-0 px-3 text-textcolor-900 focus:border-appcolor-400",type:"text",placeholder:"Filter",...e}))},ej8=eL.default.div.withConfig({displayName:"UserTagDropdownFilterMenu__ScrollbarWrapper",componentId:"sc-d3bdd792-0"})` + max-height: 360px; + overflow-y: auto; + ${tS} +`,ej7=function(e){let{isTasks:t,self:a,handleTagClick:n,handleUserClick:l,handleSelfClick:r,isProjectArchiveView:o}=e,[i,s]=(0,ev.useState)(""),d=T_((0,eI.useTheme)()),{users:c,tags:m}=(0,ev.useMemo)(()=>{let t={users:[],tags:[]};for(let a of e.users){let{handle:e}=a;e.includes(i)&&t.users.push(a)}for(let a of e.tags){let{label:e}=a;e.includes(i)&&t.tags.push(a)}return t},[i,e.users,e.tags]);return ev.createElement(eI.Menu,{initialFocus:e.initialFocus,className:"flex w-72 flex-col rounded-xl border border-appcolor-200 bg-appcolor-0 shadow",style:d,loop:!0},ev.createElement("div",{className:"pb-2.5",onClick:e=>{e.stopPropagation()}},o&&ev.createElement(ej6,{value:i,onChange:e=>{s(e.target.value)}}),ev.createElement(ej8,null,o&&ev.createElement(ev.Fragment,null,null!=a&&ev.createElement(ej0,{user:a,onSelect:r}),!ts()(c)&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:ejX},ev.createElement(eY.Z,{id:"general.assigned_to",defaultMessage:"Assigned to"})),c.map(e=>ev.createElement(ej4,{key:e.handle,onSelect:l,user:e})))),!t&&!ts()(m)&&ev.createElement(ev.Fragment,null,ev.createElement("div",{className:ejX},ev.createElement(eY.Z,{id:"general.tags",defaultMessage:"Tags"})),m.map(e=>ev.createElement(ej2,{key:e.label,tag:e,onSelect:n}))))))},ej9=function(e){let{isTasks:t,isActive:a,users:n,tags:l,self:r,handleTagClick:o,handleUserClick:i,handleSelfClick:s,isProjectArchiveView:d}=e,c=T_((0,eI.useTheme)()),m=ev.useRef(null),u=ev.useRef(null),[p,g]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),f=(0,eI.usePopup)({referenceElementRef:m,popupElementRef:u,state:p,placement:"bottom-start"}),h=(0,eI.useMenuButton)({ref:m,state:p,dispatch:g}),y=ev.useCallback(e=>{e.type,g({type:"Collapse"})},[]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{className:og()("flex h-8 cursor-pointer flex-row items-center rounded-3xl px-3 text-sm",a||p.expanded?"bg-primary text-white hover:bg-primary/80":"bg-appcolor-100 text-textcolor-600 hover:bg-appcolor-300 hover:text-textcolor-800"),type:"button",style:c,...h.props},ev.createElement(lT.Im,{className:"mr-2 h-8"}),ev.createElement("span",null,ev.createElement(eY.Z,{id:"general.filter",defaultMessage:"Filter"}))),p.expanded&&ev.createElement(eI.Popup,{...f.props,dispatch:g,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:y},ev.createElement(ej7,{initialFocus:p.initialFocus,isTasks:t,isProjectArchiveView:d,handleTagClick:o,handleUserClick:i,handleSelfClick:s,self:r,users:n,tags:l}))))},eOe=(0,la.ZP)` + query UserTagDropdownSpaceQuery($spaceID: ID!) { + membership(space_id: $spaceID) { + id + space { + id + memberships { + id + user { + ...BasicUserFields + } + } + tags(first: null) { + edges { + node { + id + key + preferences { + color + } + raw_key + } + } + } + } + } + } + ${up} +`,eOt=eL.default.div.withConfig({displayName:"FilterBar__Wrapper",componentId:"sc-3f2bb0d2-0"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + flex-wrap: wrap; + padding: 0 22px; + + @media (min-width: 768px) { + padding: 0 32px; + } + + > * { + margin-right: 5px; + margin-bottom: 10px; + } +`,eOa=eL.default.div.withConfig({displayName:"FilterBar__LoadingWrapper",componentId:"sc-3f2bb0d2-1"})` + display: flex; + min-height: 30px; + color: ${e=>e.theme?.isNightMode?"#ccc":"#999"}; + padding-left: 30px; +`,eOn=eL.default.div.withConfig({displayName:"FilterBar__ErrorWrapper",componentId:"sc-3f2bb0d2-2"})` + display: flex; + min-height: 30px; + color: #eb6461; +`,eOl=function(e){let{documentStatus:t,spaceID:a,isTasks:n}=e,l=(0,eF.k6)(),r=(0,eF.TH)(),{data:o,error:i,loading:s}=(0,eB.a)(sN),{loading:d,error:c,data:m}=(0,eB.a)(eOe,{variables:{spaceID:a}}),u=r.search,p=o?.me,g=m?.membership?.space,f=(0,ev.useMemo)(()=>new URLSearchParams(u),[u]),h=(0,ev.useMemo)(()=>{let e;let t=[],a=[];if(null!=g){let n=new Set(f.getAll("assignee")),l=new Set(f.getAll("label"));for(let e of g.tags.edges){let{node:a}=e;t.push({id:a.id,label:a.raw_key,key:a.key,color:a.preferences?.color,isSelected:l.has(a.key)})}for(let t of g.memberships){let{user:l}=t;p?.id===l.id?e={id:l.id,handle:l.handle,defaultName:l.default_name,iconURL:l.avatars_v2?.small?.mdpi.url,isSelected:n.has(l.handle)}:a.push({id:l.id,handle:l.handle,defaultName:l.default_name,iconURL:l.avatars_v2?.small?.mdpi.url,isSelected:n.has(l.handle)})}}let n=t.filter(e=>e.isSelected),l=a.filter(e=>e.isSelected);return e?.isSelected&&l.push(e),{self:e,tags:t,selectedTags:n,users:a,selectedUsers:l}},[p,f,g]),y=e=>{let t=new URLSearchParams(u),a=new Set(t.getAll("label"));if(a.has(e)?a.delete(e):a.add(e),t.delete("label"),t.has("page")&&t.delete("page"),a.size>0)for(let e of a)t.append("label",e);l.push({search:t.toString()})},b=e=>{let t=new URLSearchParams(u),a=new Set(t.getAll("assignee"));if(a.has(e)?a.delete(e):a.add(e),t.delete("assignee"),a.size>0)for(let e of a)t.append("assignee",e);l.push({search:t.toString()})};if(d)return ev.createElement(eOa,null,ev.createElement(eI.Spinner,{height:"30",width:"30"}));if(c)return ev.createElement(eOn,null,c.message);if(s)return ev.createElement(eOa,null,ev.createElement(eI.Spinner,{height:"30",width:"30"}));if(i)return ev.createElement(eOn,null,i.message);let v=f.has("assignee")||f.has("label");return ev.createElement(eOt,null,ev.createElement(ej9,{isTasks:n,isActive:v,tags:h.tags,users:h.users,self:h.self,handleUserClick:b,handleTagClick:y,handleSelfClick:()=>{let e=p?.handle;null!=e&&b(e)},isProjectArchiveView:t!==iM}),h.selectedUsers.map(e=>ev.createElement(ejQ,{key:e.id,onClick:b,user:e})),h.selectedTags.map(e=>ev.createElement(ejG,{key:e.id,tag:e,onClick:y})),v&&ev.createElement(ejq,{onClick:()=>{let e=new URLSearchParams(u);e.delete("assignee"),e.delete("label"),l.push({search:e.toString()})}}))},eOr=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({stopRef:e,name:"browse_templates"});return ev.createElement("a",{href:"/templates",rel:"noopener noreferrer",target:"_blank"},ev.createElement(cF,t.props,ev.createElement(tn.Icon,{icon:"dd_browsetemplates"}),ev.createElement(eY.Z,{id:"general.browse_templates",defaultMessage:"Browse templates"})))},eOo=function(e){let{onClick:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({onClick:t,stopRef:a,name:"ai_generator",value:"ai_generator"});return ev.createElement("button",{...n.props,className:"flex h-7 cursor-pointer items-center pl-3 pr-3 text-sm hover:bg-appcolor-300 focus:bg-appcolor-300"},ev.createElement("div",{className:"animate-color-rainbow"},ev.createElement(tn.Icon,{className:"mr-2 scale-90",icon:"dd_ai"})),ev.createElement("div",{className:"text-moving-rainbow truncate"},ev.createElement(eY.Z,{id:"general.ai_project_studio",defaultMessage:"AI Project Studio"})))},eOi=function(e){let{onClick:t}=e,a=ev.useRef(null),n=(0,eI.useMenuItem)({onClick:t,stopRef:a,name:"import"});return ev.createElement(cF,n.props,ev.createElement(tn.Icon,{icon:"dd_import"}),ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"}))},eOs=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({stopRef:e,name:"new_project"}),a=(0,eF.$B)("/:type(spaces|subspaces)/:spaceId/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents)?");if(null==a)return null;let n=(a.params.subspaceId||a.params.spaceId)??"",l=`/spaces/${n}/new`;return ev.createElement(sC.rU,{to:l},ev.createElement(cF,t.props,ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement(eY.Z,{id:"general.start_blank",defaultMessage:"Start Blank"})))},eOd=(0,la.ZP)` + query TemplateChoicesQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + role + space { + id + templates(first: 10) { + edges { + node { + id + info + edit_path + shared_preferences + preferences { + view + } + role { + project + workspace + } + } + } + } + } + } + } +`,eOc=(0,la.ZP)` + mutation CreateDocumentMutation($input: DocumentInput!) { + createDocument(document: $input) { + id + view_path + } + } +`,eOm=eL.default.div.withConfig({displayName:"NewFromTemplateItem__EmojiWrapper",componentId:"sc-845f564c-0"})` + display: flex; + width: 20px; + height: 20px; + justify-content: center; + font-size: 18px; + line-height: 21px; + margin-right: var(--menu-item-gap); + align-self: flex-start; +`,eOu=function(e){let{template:t}=e,a=ev.useRef(null),n=(0,eF.k6)(),l=(0,e$.useDispatch)(),r=(0,eK.Z)(),o=(0,eI.useMenuItem)({stopRef:a,name:"new_from_template",value:t.id}),i=(0,eF.$B)("/:type(spaces|subspaces)/:spaceId/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents)?"),s=(i?.params.subspaceId||i?.params.spaceId)??"",d=nQ(t),c=t.info.title||"Untitled",[m,{data:u,error:p}]=(0,cs.D)(eOc);ev.useEffect(()=>{null!=u&&n.push(`/d/${u.createDocument.id}`)},[u,n]),ev.useEffect(()=>{if(null==p)return;let e=`${t.id}-${(0,ld.Z)()}`,a=r.formatMessage({id:"generic_error_occurred",defaultMessage:"An error occurred"});l((0,l3.error)({position:"br",autoDismiss:5,dismissible:!1,uid:e,message:a}))},[p,l,r,t.id]);let g=ev.useCallback(()=>{m({variables:{input:{view:t.preferences?.view??t.shared_preferences?.view??void 0,spaceID:s,template:{type:"document",id:t.id}}}})},[m,s,t.id,t.preferences?.view,t.shared_preferences?.view]);return null==i?null:ev.createElement(cF,{...o.props,onClick:g},null!=d?ev.createElement(eOm,null,d):ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement("span",null,c))},eOp=function(){let e=ev.useRef(null),t=(0,eI.useMenuItem)({stopRef:e,name:"new_template,"}),a=(0,eF.$B)("/:type(spaces|subspaces)/:spaceId/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents)?"),n=(a?.params.subspaceId||a?.params?.spaceId)??"",l=(0,ev.useMemo)(()=>({pathname:`/spaces/${n}/new/template`}),[n]);return ev.createElement(sC.rU,{to:l},ev.createElement(cF,t.props,ev.createElement(tn.Icon,{icon:"dd_new"}),ev.createElement(eY.Z,{id:"general.create_a_template",defaultMessage:"Create a template"})))},eOg=eL.default.div.withConfig({displayName:"TemplateSection__Separator",componentId:"sc-40cac551-0"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.isNightMode?"#333333":"#e5e5e5"}; +`,eOf=eL.default.div.withConfig({displayName:"TemplateSection__SectionTitle",componentId:"sc-40cac551-1"})` + font-size: 12px; + margin: 0 20px 5px; + color: ${e=>e.theme.textColors.hex(50)}; + text-transform: uppercase; +`,eOh=eL.default.div.withConfig({displayName:"TemplateSection__ErrorMessage",componentId:"sc-40cac551-2"})` + max-width: 280px; +`,eOy=function(){let e=(0,eF.$B)("/:type(spaces|subspaces)/:spaceId/:hasSubspace(subspaces)?/:subspaceId?"),t=(e?.params?.hasSubspace!=null&&e?.params?.subspaceId||e?.params?.spaceId)??null,{data:a,loading:n,error:l}=(0,eB.a)(eOd,{variables:{spaceId:t},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:null==t});if(n)return ev.createElement(ev.Fragment,null,ev.createElement(eOg,null),ev.createElement(eOf,null,"Templates"),ev.createElement(eI.Spinner,null));if(null!=l)return ev.createElement(ev.Fragment,null,ev.createElement(eOg,null),ev.createElement(eOf,null,"Templates"),ev.createElement(eOh,null,"There was an error loading the templates. Please try again."));let r=a?.membership?.space?.templates?.edges??[];return ev.createElement(ev.Fragment,null,ev.createElement(eOg,null),ev.createElement(eOf,null,"Templates"),ev.createElement(eOp,null),r.length>0&&r.map(e=>{let t=e.node;return null==t?null:ev.createElement(eOu,{key:t.id,template:t})}))},eOb=(0,eL.default)(eI.Menu).withConfig({displayName:"NewDropdownMenu__StyledMenu",componentId:"sc-f4feb38a-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + width: 240px; + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.appColors.hex(100)}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eOv=function(e){let{initialFocus:t,spaceId:a}=e,n=(0,e$.useDispatch)();return ev.createElement(eOb,{initialFocus:t,loop:!0},ev.createElement(eOo,{onClick:()=>{n(Nj.actions.toggleAiCreateProjectDialog({spaceId:a}))}}),ev.createElement(eOs,null),ev.createElement(eOi,{onClick:()=>{n(NU())}}),ev.createElement(eOy,null),ev.createElement(eOr,null))},eOk=eL.default.button.withConfig({displayName:"NewDropdown__DropdownToggle",componentId:"sc-cc4f9f94-0"})` + background: ${e=>e.theme.primaryColorScheme?.base}; + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + } +`,eOE=function(e){let{role:t}=e,[a,n]=ev.useReducer(eI.popupReducer,{expanded:!1}),l=ev.useRef(null),r=ev.useRef(null),o=ev.useCallback(()=>{l.current?.focus()},[]);(0,eI.usePopupEvents)({state:a,onCollapse:o});let i=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:a,placement:"bottom-end"}),s=(0,eI.useMenuButton)({dispatch:n,ref:l,state:a}),d=ev.useCallback(()=>{n({type:"Collapse"})},[]),c=Eu({role:t,action:"create_project"}),m=(0,eF.$B)("/:type(spaces|subspaces)/:spaceId/:documentTypeOrSubspace(tasks|roadmap|templates|archive|subspaces|media|agents)?/:subspaceId?/:documentType(tasks|roadmap|templates|archive|media|agents)?");if(!c||null==m)return null;let u=(m.params.subspaceId||m.params.spaceId)??"";return ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"flex items-center text-sm text-applight-0"},ev.createElement(eOk,{className:"flex h-7 items-center gap-x-1 rounded-full px-5 font-semibold transition-colors duration-300 ease-in-out",...s.props},ev.createElement(tn.Icon,{className:"scale-90",icon:"header_new"}),ev.createElement(eY.Z,{id:"general.new_project",defaultMessage:"New Project"}))),a.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:n,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(eOv,{initialFocus:i.initialFocus,spaceId:u}))))},eOx=function(e){let{role:t,space:a}=e,n=T_((0,eL.useTheme)()),l=d6(),r=ev.useMemo(()=>a.is_subspace?null!=a.parent_membership?`/spaces/${a.parent_membership.space.id}/subspaces/${a.id}`:`/subspaces/${a.id}`:`/spaces/${a.id}`,[a]);return ev.createElement(eDD,{style:n},ev.createElement(eDT,{className:"space-step3"},ev.createElement(eD$,{exact:!0,activeClassName:"active",to:r},ev.createElement(eY.Z,{id:"general.projects",defaultMessage:"Projects"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/tasks`},ev.createElement(eY.Z,{id:"general.tasks",defaultMessage:"Tasks"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/agents`},ev.createElement(eY.Z,{id:"general.agents",defaultMessage:"Agents"})),l&&ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/flows`},ev.createElement(eY.Z,{id:"general.automations",defaultMessage:"Automations"}),ev.createElement(SV,{date:"2024-2-15"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/media`},ev.createElement(eY.Z,{id:"general.media",defaultMessage:"Media"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/roadmap`},ev.createElement(eY.Z,{id:"general.roadmap",defaultMessage:"Roadmap"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/templates`},ev.createElement(eY.Z,{id:"general.templates",defaultMessage:"Templates"})),ev.createElement(eD$,{exact:!0,activeClassName:"active",to:`${r}/archive`},ev.createElement(eY.Z,{id:"general.completed",defaultMessage:"Completed"}))),ev.createElement(eDP,null,ev.createElement(eOE,{role:t})))},eO_=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)();return ev.createElement("button",{className:"mt-8 flex animate-color-rainbow items-center gap-3 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-1 pl-2 pr-3 text-sm font-semibold transition duration-300 ease-in-out hover:scale-105 hover:bg-appcolor-200 hover:shadow-lg",onClick:()=>{a(TN.actions.toggleCreateSpaceAgentDialog({spaceId:t}))}},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"ai_add",className:"text-appcolor-400"})),ev.createElement("span",{className:"transition duration-300 ease-in-out hover:text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.create_agent",defaultMessage:"Create agent"})))},eOw=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)();return ev.createElement("button",{className:"flex w-full items-center gap-4 rounded-xl px-4 py-1 text-sm transition duration-150 ease-in-out hover:bg-appcolor-100",onClick:()=>{a(TN.actions.toggleCreateSpaceAgentDialog({spaceId:t}))}},ev.createElement("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"dd_new"})),ev.createElement(eY.Z,{id:"agent.create_agent",defaultMessage:"Create agent"}))},eON=function(e){let{onLoadMoreCb:t}=e,a=ev.useRef(null),n=ev.useCallback(e=>{e[0].isIntersecting&&t()},[t]);return ev.useEffect(()=>{let e=a.current;if(null==e)return;let t=new IntersectionObserver(n);return t.observe(e),()=>{t.unobserve(e),t.disconnect()}},[n]),ev.createElement("div",{ref:a,className:"h-10"},ev.createElement(eI.Spinner,null))},eOC=function(e){let{menuGroupDispatch:t,agent:a,membershipRole:n}=e,l=ev.useRef(null),r=ev.useRef(null),[o,i]=ev.useState(!1),[s,d]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),c=(0,eI.usePopup)({referenceElementRef:l,popupElementRef:r,state:s,placement:"bottom-start"}),m=(0,eI.useMenuButton)({ref:l,state:s,dispatch:d}),u=pW({role:n,action:"edit_space_agent"}),p=pW({role:n,action:"copy_space_agent"}),g=pW({role:n,action:"delete_space_agent"});return ev.createElement("div",{onMouseDown:()=>{i(!0)},onMouseUp:()=>{i(!1)},className:og()("transition duration-150 ease-in-out group-hover/actions:opacity-100",{"opacity-100":o||s.expanded,"opacity-0":!o&&!s.expanded})},ev.createElement("button",{...m.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),s.expanded?d({type:"Collapse"}):d({type:"Expand",payload:"first"})},className:"flex h-8 w-8 items-center justify-center rounded-xl text-appcolor-500 hover:text-appcolor-800 data-[expanded=true]:text-appcolor-800","data-expanded":s.expanded},ev.createElement(tn.Icon,{icon:"header_more"})),s.expanded&&ev.createElement(eI.Popup,{...c.props,dispatch:d,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:t},ev.createElement(eI.Menu,{className:"flex w-48 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0,initialFocus:c.initialFocus},u&&ev.createElement(Up,{name:"edit",value:a.id,className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300 focus:bg-appcolor-300"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_edit"}),ev.createElement(eY.Z,{id:"agent.edit_agent",defaultMessage:"Edit agent"})),p&&ev.createElement(Up,{name:"copy",value:a.id,className:"flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300 focus:bg-appcolor-300"},ev.createElement(tn.Icon,{className:"shrink-0 scale-80",icon:"dd_copy"}),ev.createElement(eY.Z,{id:"agent.copy_agent",defaultMessage:"Copy agent"})),g&&ev.createElement(Up,{name:"delete",value:a.id,className:"flex items-center gap-x-2 px-3 py-1 text-sm text-danger hover:bg-appcolor-300 focus:bg-appcolor-300"},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_delete"}),ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))))},eOM=function(e){let{agent:t,size:a}=e;if(null==t.data.avatar)return ev.createElement(tn.Icon,{icon:"dd_ai"});if("emoji"===t.data.avatar.type)return ev.createElement(e1.AgentAvatar,{name:t.data.avatar.data.value,size:"lg"});if("custom"!==t.data.avatar.type)return ev.createElement(tn.Icon,{icon:"dd_ai"});let n=Td(t.data.avatar.data.file,"h_100,w_100","hdpi");return null==n?ev.createElement(tn.Icon,{icon:"dd_ai"}):ev.createElement(e1.AgentAvatar,{src:n,size:a})},eOS=function(e){let{agent:t,handleCopyAgent:a,handleDeleteAgent:n,membershipRole:l}=e,r=(0,e$.useDispatch)(),o=pW({role:l,action:"edit_space_agent"}),i=pW({role:l,action:"copy_space_agent"}),s=pW({role:l,action:"delete_space_agent"}),d=ev.useCallback(e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o&&r(TS.actions.toggleEditSpaceAgentDialog({agentId:t.id}))},[t.id,r,o]),c=ev.useCallback(e=>{if("Activate"===e.type){let{name:t,value:l}=e.payload;switch(t){case"copy":a(l);break;case"delete":n(l);break;case"edit":d()}}},[a,n,d]);return ev.createElement("div",{onClick:e=>{r(Uy.actions.toggleSpaceAgentChatDialog({agent:t})),e.stopPropagation()},className:"text-md group/actions flex w-full cursor-pointer items-center gap-4 rounded-xl px-4 py-1 transition duration-150 ease-in-out hover:bg-appcolor-100"},ev.createElement("div",{className:"flex flex-1 items-center gap-x-4 "},ev.createElement("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(eOM,{agent:t,size:"lg"})),ev.createElement("p",{className:"overflow flex overflow-hidden text-ellipsis whitespace-nowrap text-sm text-textcolor-900"},0===t.name.length?"Untitled":t.name)),ev.createElement("div",{className:"flex items-center gap-2"},o&&ev.createElement("button",{type:"button",className:"flex h-8 items-center gap-1 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 px-2 py-2 text-sm text-appcolor-600 opacity-0 transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-300 hover:text-appcolor-800 group-hover/actions:opacity-100",onClick:d},ev.createElement(tn.Icon,{className:"shrink-0",icon:"agent_edit"}),ev.createElement(eY.Z,{id:"agent.edit_agent",defaultMessage:"Edit agent"})),(o||i||s)&&ev.createElement(eOC,{agent:t,membershipRole:l,menuGroupDispatch:c})))};class eOI extends Error{description;constructor(e,t){super(e),this.description=t}}let eOD=(0,te.Em)({id:"general.workspace_required",defaultMessage:"Workspace Required"}),eOT=(0,te.Em)({id:"general.spaces.at_least_one_workspace_to_move_copy_save_agents",defaultMessage:"You must have at least one workspace with edit permission to copy, move or create agents."}),eO$={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentCopyMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentCopyInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentCopy"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"agent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]},eOP=(0,lb.C)({context:{agentId:null,workspaceTrees:null,memberships:null,error:null},tsTypes:{},schema:{context:{},events:{},services:{}},id:"copydialog",initial:"loading",states:{loading:{invoke:{id:"loadWorkspaceTrees",src:"loadWorkspaceTrees",onDone:[{actions:"handleWorkspaceTreesLoaded",target:"#copydialog.loaded"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},loaded:{always:[{cond:"isCopying",target:"#copydialog.active"},{target:"#copydialog.erred"}]},active:{on:{COPY:{target:"#copydialog.copying"}}},copying:{invoke:{id:"copying",src:"copying",onDone:[{target:"#copydialog.end"}],onError:[{actions:"handleErred",target:"#copydialog.erred"}]}},erred:{},end:{entry:"exit"}}},{guards:{isCopying:e=>{let{agentId:t}=e;return null!=t}},actions:{handleErred:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.error=t.data,e))),handleWorkspaceTreesLoaded:(0,lv.assign)((e,t)=>(0,es.ZP)(e,e=>(e.workspaceTrees=t.data.workspaceTrees,e.memberships=t.data.memberships,e)))}}),eOF=function(e){let{agentId:t,currentSpaceId:a,exit:n}=e,l=(0,e$.useDispatch)(),r=(0,eK.Z)(),o=ev.useMemo(()=>({agentId:t}),[t]),i=(0,ll.x)(),[s]=(0,cs.D)(eO$),[d,c]=(0,ls.e)(eOP,{actions:{exit:()=>{n()}},context:o,services:{copying:async(e,n)=>{let{memberships:r}=e,{spaceId:o}=n.payload;if(null==r)throw Error("Memberships required");let d=r.find(e=>e.space.id===o);if(null==d)throw Error("Membership required");if(null==t)throw Error("agentId required");let c=(0,ld.Z)();await s({variables:{input:{clientMutationId:c,agentId:t,spaceId:o}}});let{cache:m}=i;o===a?m.evict({fieldName:"spaceAgents",args:{filterby:{spaceId:a}}}):m.evict({fieldName:"spaceAgents",args:{filterby:{spaceId:o}}}),m.gc();let u=function(e){let t=e.space;(0,ei.assert)(null!=t);let a=`agent-copied-to-${t.id}-${(0,ld.Z)()}`,n=e.space.parent_membership,l=`/spaces/${t.id}`;return null==n&&t.is_subspace&&(l=`/subspaces/${t.id}`),null!=n&&t.is_subspace&&(l=`/spaces/${n.space.id}/subspaces/${t.id}`),{uid:a,position:"br",autoDismiss:5,dismissible:!1,children:ev.createElement("div",{className:"notification-message"},ev.createElement(eY.Z,{id:"general.copy_agent_success_notification",defaultMessage:"Agent has been copied to {toSpaceName}",values:{space:e=>ev.createElement(sC.rU,{to:`${l}/agents`},e),toSpaceName:t.name}}))}}(d);l((0,l3.success)(u))},loadWorkspaceTrees:async()=>{let e=await i.query({query:gT,fetchPolicy:"network-only"}),t=e.errors?.[0];if(null!=t)throw t;let a=e.data?.me?.memberships??[],n=[];for(let e of a)null!=e&&null==e.space.archived_at&&n.push(e);if(0===n.length)throw new eOI(r.formatMessage(eOD),r.formatMessage(eOT));return{workspaceTrees:pI(n),memberships:n}}}}),m=ev.useCallback(()=>{n()},[n]),u=ev.useCallback(e=>{c({type:"COPY",payload:{spaceId:e.id,spaceName:e.name}})},[c]);if(d.matches("loading")||d.matches("end")||d.matches("copying"))return ev.createElement("div",{className:"p-16"},ev.createElement(eI.Spinner,{width:400}));if(d.matches("active"))return ev.createElement("div",{className:"flex max-h-96 w-full max-w-sm flex-col gap-4 rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 p-8"},ev.createElement("div",{className:"flex flex-col gap-1"},ev.createElement("div",null,ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},ev.createElement(eY.Z,{id:"general.copy_agent",defaultMessage:"Copy Agent"})),ev.createElement("p",{className:"mb-5 text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.copy_agent.description",defaultMessage:"Choose a workspace or folder to copy the agent to."}))),ev.createElement("div",{className:"mb-2"},ev.createElement(e1.Overline,null,ev.createElement(eY.Z,{id:"general.copy_to",defaultMessage:"Copy To"})))),ev.createElement(p3,{onSelect:u,workspacesTree:d.context.workspaceTrees??[]}));let p=d.context.error?.message??"Unknown Error",g=d.context.error instanceof eOI?d.context.error.description:null;return ev.createElement("div",{className:"flex flex-col items-center p-16"},ev.createElement("h1",{className:"mb-3 text-lg font-semibold"},p),null!=g&&ev.createElement("p",{className:"text-sm"},g),ev.createElement("button",{onClick:m,className:"mt-7 w-96 rounded-xl bg-primary p-3 font-semibold uppercase hover:bg-primary/90"},ev.createElement(eY.Z,{id:"general.close",defaultMessage:"Close"})))},eOA=function(e){let{state:t,onClose:a}=e;return t.isOpen?ev.createElement(eI.ModalDialog,{close:a,isOpen:t.isOpen},e=>{let{exit:a}=e;return ev.createElement(eOF,{agentId:t.agentId,currentSpaceId:t.currentSpaceId,exit:a})}):null},eOR={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceAgentDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgentDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},eOj={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SpaceAgentsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceAgentFiltering"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceAgents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"}},{kind:"Field",name:{kind:"Name",value:"startCursor"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]},eOO=function(e){let{space:t,membership:a}=e,n=t.id,l=(0,eK.Z)(),r=(0,eB.a)(eOj,{variables:{filterby:{spaceId:n}}}),o=T_((0,eL.useTheme)()),[i,s]=ev.useState({isOpen:!1}),[d]=(0,cs.D)(eOR),c=ev.useCallback(e=>{s({isOpen:!0,agentId:e,currentSpaceId:n})},[n]),m=ev.useCallback(()=>{s({isOpen:!1})},[]),u=async e=>{let t=l.formatMessage({id:"general.confirm_delete_agent",defaultMessage:"Are you sure you want to delete the agent?"});confirm(t)&&await d({variables:{input:{clientMutationId:(0,ld.Z)(),agentId:e}},refetchQueries:[eOj]})},p=Eu({role:a.role,action:"create_space_agent"}),g=r.data?.spaceAgents?.edges??[],f=r.data?.spaceAgents?.pageInfo?.hasNextPage??!1,h=r.data?.spaceAgents?.pageInfo?.endCursor??null,y=g.map(e=>e.node),{fetchMore:b}=r,v=ev.useCallback(()=>{b({variables:{after:h}})},[h,b]);return r.loading?ev.createElement(eI.Spinner,null):0===y.length?ev.createElement("div",{className:"flex h-full items-center justify-center",style:o},ev.createElement("div",{className:"flex max-w-md flex-col items-center text-center"},ev.createElement(lT.H7,{className:"mb-8 text-appcolor-500"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"agent.create_your_first_agent",defaultMessage:"Create your first agent!"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"agent.build_an_agent_and_personalize",defaultMessage:"Build and train your virtual workforce and team: Craft personas, enrich with knowledge, build custom AI commands, select tools like web browsing, and more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/22256943362323",target:"_blank",rel:"noopener noreferrer"},e)}})),p&&ev.createElement(eO_,{spaceId:n}),ev.createElement("a",{href:"https://www.youtube.com/watch?v=7-EOl0lW_4c",target:"_blank",rel:"noopener noreferrer"},ev.createElement("img",{className:"mt-8 rounded-xl",src:"/images/onboarding/ai-custom-agent.gif"})))):ev.createElement("div",{className:"ml-5 mr-5 flex flex-col items-start gap-y-1",style:o},p&&ev.createElement(eOw,{spaceId:n}),ev.createElement("div",{className:"flex w-full flex-col"},y.map((e,t)=>ev.createElement(eOS,{key:t,agent:e,handleDeleteAgent:u,handleCopyAgent:c,membershipRole:a.role})),f&&ev.createElement(eON,{onLoadMoreCb:v})),ev.createElement(Ub,null),ev.createElement(eOA,{state:i,onClose:m}))},eOU=function(e){let{handleClick:t}=e;return ev.createElement("button",{className:"mt-8 flex items-center gap-3 rounded-xl border border-solid border-appcolor-300 bg-appcolor-100 py-1 pl-2 pr-3 text-sm font-semibold transition duration-300 ease-in-out hover:scale-105 hover:bg-appcolor-200 hover:shadow-lg",onClick:t},ev.createElement("div",{className:"flex items-center gap-4"},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-appcolor-200"},ev.createElement(tn.Icon,{icon:"ai_add",className:"text-appcolor-400"})),ev.createElement("span",{className:"transition duration-300 ease-in-out hover:text-appcolor-500"},ev.createElement(eY.Z,{id:"flow.create_automation",defaultMessage:"Create Automation"}))))},eOZ={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowDisableMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowDisableInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowDisable"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eOL={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowEnableMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowEnableInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowEnable"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eOB={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FlowsQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filterby"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowFiltering"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flows"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filterby"},value:{kind:"Variable",name:{kind:"Name",value:"filterby"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"trigger"}}]}},{kind:"Field",name:{kind:"Name",value:"is_complete"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}}]}},{kind:"Field",name:{kind:"Name",value:"usage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"monthly"}}]}}]}}]}}]},eOz=function(e){let{value:t,name:a,children:n,warning:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a});return ev.createElement("button",{...o.props,className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"text-danger":l})},n)},eOV=function(e){let{handleDeleteFlow:t,flow:a}=e,n=ev.useRef(null),l=ev.useRef(null),[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),i=(0,eI.usePopup)({referenceElementRef:n,popupElementRef:l,state:r,placement:"bottom-start"}),s=(0,eI.useMenuButton)({ref:n,state:r,dispatch:o}),d=ev.useCallback(e=>{if("Activate"===e.type){let{name:n}=e.payload;"delete"===n&&t(a.id)}o({type:"Collapse"})},[a.id,t]);return ev.createElement("div",null,ev.createElement("button",{...s.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),r.expanded?o({type:"Collapse"}):o({type:"Expand"})},className:"flex h-10 w-10 items-center justify-center rounded-xl text-textcolor-500 hover:text-textcolor-700"},ev.createElement(tn.Icon,{icon:"header_more"})),r.expanded&&ev.createElement(eI.Popup,{...i.props,dispatch:o,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o({type:"Collapse"})}},ev.createElement(eI.MenuGroupContext.Provider,{value:d},ev.createElement(eI.Menu,{className:"flex w-48 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",loop:!0},ev.createElement(eOz,{name:"delete",warning:!0},ev.createElement(tn.Icon,{className:"shrink-0",icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"}))))))},eOq=function(e){let{flow:t,space:a,pieces:n,isAllowedToEdit:l,isAllowedToDelete:r,handleDeleteFlow:o}=e,[i,s]=(0,cs.D)(eOL),[d,c]=(0,cs.D)(eOZ),m=(0,eK.Z)(),u=ev.useMemo(()=>{let e=t.data.trigger;if("EMPTY"===e.type)return null;if("WEBHOOK"===e.type)return"https://assets.taskade.com/taskade.png";let a=n.find(t=>t.name===e.settings.pieceName);return a?.logoUrl},[t.data.trigger,n]),p=ev.useMemo(()=>{let e=t.data.trigger,a=[],l=e.nextAction;for(;null!=l;){let e=n.find(e=>e.name===l?.settings.pieceName);null!=e&&a.push(e?.logoUrl),l=l.nextAction}return a},[t.data.trigger,n]),g=t.data.enabled,f=async()=>{try{if(g){let e=(0,ld.Z)();await d({variables:{input:{clientMutationId:e,id:t.id}},optimisticResponse:{__typename:"Mutation",flowDisable:{__typename:"FlowDisablePayload",clientMutationId:e,ok:!0}},update:(e,n)=>{let{data:l}=n;if(null==l)return;let r=e.readQuery({query:eOB,variables:{filterby:{spaceId:a.id}}});if(null==r)return;let o=r.flows.edges.findIndex(e=>e.node.id===t.id);if(-1===o)return;let i=r.flows.edges[o],s=(0,es.ZP)(i.node.data,e=>{e.enabled=!l.flowDisable.ok});r=Ml()(r,{flows:{edges:{[o]:{$set:{__typename:"FlowEdge",cursor:i.cursor,node:{...i.node,data:s}}}}}}),e.writeQuery({query:eOB,variables:{filterby:{spaceId:a.id}},data:r})}})}else{let e=(0,ld.Z)();await i({variables:{input:{clientMutationId:e,id:t.id}},optimisticResponse:{__typename:"Mutation",flowEnable:{__typename:"FlowEnablePayload",clientMutationId:e,ok:!0}},update:(e,n)=>{let{data:l}=n;if(null==l)return;let r=e.readQuery({query:eOB,variables:{filterby:{spaceId:a.id}}});if(null==r)return;let o=r.flows.edges.findIndex(e=>e.node.id===t.id);if(-1===o)return;let i=r.flows.edges[o],s=(0,es.ZP)(i.node.data,e=>{e.enabled=l.flowEnable.ok});r=Ml()(r,{flows:{edges:{[o]:{$set:{__typename:"FlowEdge",cursor:i.cursor,node:{...i.node,data:s}}}}}}),e.writeQuery({query:eOB,variables:{filterby:{spaceId:a.id}},data:r})}})}}catch(e){}},h=s.error??c.error;return ev.createElement("div",{className:"group flex w-full items-center justify-between gap-4 rounded-xl px-5 py-3 transition duration-150 ease-in-out hover:bg-appcolor-100"},ev.createElement(sC.rU,{to:`/f/${t.id}`,onClick:e=>{if(!l){e.preventDefault();return}},className:"flex w-full cursor-pointer text-left"},ev.createElement("div",{className:"flex w-full gap-3"},ev.createElement("div",{className:"flex min-w-36 items-center gap-1"},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center"},null!=u?ev.createElement("img",{src:u}):ev.createElement(tn.Icon,{className:"text-appcolor-500",icon:"automate_flow"})),ev.createElement(tn.Icon,{className:"text-textcolor-400",icon:"caret_next"}),p.length>0?ev.createElement(ev.Fragment,null,p.slice(0,1).map((e,a)=>ev.createElement("div",{key:`${t.id}${a}`,className:"flex h-8 w-8 items-center justify-center"},ev.createElement("img",{src:e}))),p.length>1&&ev.createElement("div",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-solid border-appcolor-300 bg-appcolor-200 text-xs font-bold text-appcolor-500"},"+",p.length-1)):ev.createElement(tn.Icon,{className:"text-appcolor-500",icon:"automate_flow"})),ev.createElement("div",{className:"flex flex-grow items-center gap-1"},ev.createElement("p",{className:"overflow text-md w-full overflow-hidden text-ellipsis whitespace-nowrap font-medium text-textcolor-900"},0===t.name.length?ev.createElement("span",{className:"text-appcolor-500 group-hover:text-appcolor-800"},ev.createElement(eY.Z,{id:"automation.untitled",defaultMessage:"Untitled"})):t.name),ev.createElement("p",{className:"whitespace-nowrap text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.flow_edited_at",defaultMessage:"Edited {updated_at}",values:{updated_at:elE.ou.fromISO(t.updated_at).toRelativeCalendar()}}))))),ev.createElement("div",{className:"flex items-center gap-3"},null!=h&&ev.createElement(HE.R,{className:"flex cursor-help text-danger",tooltipContent:ev.createElement("div",{className:"px-1 text-center"},(0,ei.getMessageFromError)(h)??ev.createElement(eY.Z,{id:"general.an_error_occurred",defaultMessage:"An error occurred"}))},ev.createElement(tn.Icon,{className:"shrink-0",icon:"automate_warning"})),ev.createElement(evC,{checked:g,onChange:f,disabled:null!=h,spaceType:a.type,disabledTooltipMessage:t.is_complete&&null==h?null:m.formatMessage({id:"automation.please_complete_all_steps_to_turn_on",defaultMessage:"Please complete all steps to turn on."})}),r&&ev.createElement(eOV,{flow:t,handleDeleteFlow:o})))},eOW=function(e){let{onLoadMoreCb:t}=e,a=ev.useRef(null),n=ev.useCallback(e=>{e[0].isIntersecting&&t()},[t]);return ev.useEffect(()=>{let e=a.current;if(null==e)return;let t=new IntersectionObserver(n);return t.observe(e),()=>{t.unobserve(e),t.disconnect()}},[n]),ev.createElement("div",{ref:a,className:"h-10"},ev.createElement(eI.Spinner,null))},eOH={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"FlowDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flowDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eOG={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PiecesQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pieces"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"logoUrl"}},{kind:"Field",name:{kind:"Name",value:"version"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"authDesc"}},{kind:"Field",name:{kind:"Name",value:"actions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"expectedOutput"}}]}},{kind:"Field",name:{kind:"Name",value:"triggers"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"displayName"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"props"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]}}]}}]},eOK=function(e){let{space:t,membership:a}=e,n=(0,eK.Z)(),l=T_((0,eL.useTheme)()),r=(0,e$.useDispatch)(),o=(0,eB.a)(eOB,{variables:{filterby:{spaceId:t.id}},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),i=(0,eB.a)(eOG),s=ev.useMemo(()=>i.loading||null==i.data?null:i.data.pieces,[i.data,i.loading]),d=Eu({role:a.role,action:"create_space_flow"}),c=Eu({role:a.role,action:"edit_space_flow"}),m=Eu({role:a.role,action:"delete_space_flow"}),[u]=(0,cs.D)(eOH),p=async e=>{let a=n.formatMessage({id:"general.confirm_delete_flow",defaultMessage:"Are you sure you want to delete the flow?"});if(confirm(a)){let a=(0,ld.Z)();await u({variables:{input:{clientMutationId:a,flowId:e}},optimisticResponse:{__typename:"Mutation",flowDelete:{__typename:"FlowDeletePayload",clientMutationId:a,ok:!0}},update:a=>{let n=a.readQuery({query:eOB,variables:{filterby:{spaceId:t.id}}});if(null==n)return;let l=n.flows.edges.findIndex(t=>t.node.id===e);-1!==l&&(n=Ml()(n,{flows:{edges:{$splice:[[l,1]]}}}),a.writeQuery({query:eOB,variables:{filterby:{spaceId:t.id}},data:n}))}})}},g=async()=>{r(eRe.actions.toggleCreateFlowDialog({spaceId:t.id}))},f=o.data?.flows.edges??[],h=o.data?.flows?.pageInfo?.endCursor??null,y=o.data?.flows?.pageInfo?.hasNextPage??!1;o.data?.flows?.usage?.monthly;let{fetchMore:b}=o,v=ev.useCallback(()=>{b({variables:{after:h}})},[h,b]),k=f.map(e=>e.node);return o.loading||i.loading||null==s?ev.createElement(eI.Spinner,null):0===k.length?ev.createElement("div",{className:"flex h-full items-center justify-center",style:l},ev.createElement("div",{className:"flex max-w-md flex-col items-center text-center"},ev.createElement(lT.Nf,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"automation.create_your_first_automation",defaultMessage:"Create your first automation!"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"automation.streamline_taskade_ai_workflow_by_automating_tasks",defaultMessage:"Streamline your workflow by automating tasks. Connect Taskade AI with third-party apps to setup triggers and actions. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/24799834857363-Getting-Started",target:"_blank",rel:"noopener noreferrer"},e)}})),d&&ev.createElement(eOU,{handleClick:g}),ev.createElement("img",{className:"mt-8 rounded-xl",src:"/images/onboarding/ai-automation.gif"}))):ev.createElement(ev.Fragment,null,ev.createElement("div",{className:"mx-5 flex h-full flex-col gap-y-1",style:l},d&&ev.createElement("button",{className:"flex w-full items-center gap-4 rounded-xl px-3.5 py-4 text-sm text-appcolor-500 hover:bg-appcolor-100 hover:text-appcolor-800",onClick:g},ev.createElement("div",{className:"flex items-center gap-4"},ev.createElement("div",{className:"flex h-8 w-8 items-center justify-center transition duration-150 ease-in-out"},ev.createElement(tn.Icon,{icon:"dd_new"})),ev.createElement("span",{className:"transition duration-150 ease-in-out"},ev.createElement(eY.Z,{id:"automation.add_automation",defaultMessage:"Add automation"})))),ev.createElement("div",{className:"flex flex-col gap-y-2"},k.map((e,a)=>ev.createElement(eOq,{key:a,space:t,flow:e,isAllowedToEdit:c,isAllowedToDelete:m,handleDeleteFlow:p,pieces:s}))),y&&ev.createElement(eOW,{onLoadMoreCb:v})),ev.createElement(ev_,null))},eOY={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceMediaDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceMediaDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceMediaDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"ok"}}]}}]}}]},eOQ=function(e){let{value:t,name:a,children:n,disabled:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a,disabled:l});return ev.createElement("button",{className:og()("flex items-center gap-x-2 px-3 py-1 text-sm hover:bg-appcolor-300",{"opacity-50":l}),...o.props},n)},eOJ=function(e){let{initialFocus:t,onSelect:a,membershipRole:n}=e,l=ev.useCallback(async e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"resync":case"delete":a(t)}}},[a]),r=pW({role:n,action:"delete_media"});return ev.createElement(eI.MenuGroupContext.Provider,{value:l},ev.createElement(eI.Menu,{className:"flex w-48 flex-col rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 py-2",initialFocus:t,loop:!0},ev.createElement(eOQ,{name:"resync"},ev.createElement(tn.Icon,{className:"shrink-0 scale-80",icon:"dd_restore"}),ev.createElement("span",{className:"truncate"},ev.createElement(eY.Z,{id:"ai.resync_ai",defaultMessage:"Resync AI"}))),r&&ev.createElement(eOQ,{name:"delete"},ev.createElement(tn.Icon,{className:"shrink-0 scale-80 text-danger",icon:"dd_delete"}),ev.createElement("span",{className:"truncate text-danger"},ev.createElement(eY.Z,{id:"general.delete",defaultMessage:"Delete"})))))},eOX=function(e){let{className:t,popupState:a,popupDispatch:n,spaceMedia:l,membershipRole:r}=e,o=(0,e$.useDispatch)(),i=ev.useRef(null),s=ev.useRef(null),d=(0,eI.usePopup)({referenceElementRef:i,popupElementRef:s,state:a,placement:"bottom-end"}),c=(0,eI.useMenuButton)({ref:i,state:a,dispatch:n}),[m]=(0,cs.D)(eOY),u=ev.useCallback(e=>{switch(e){case"resync":break;case"delete":{if(!window.confirm("Are you sure you want to delete this media?"))return;let e=(0,ld.Z)();m({variables:{input:{clientMutationId:e,spaceMediaId:l.id}},refetchQueries:[Hk],optimisticResponse:{spaceMediaDelete:{clientMutationId:e,ok:!0}}})}}n({type:"Collapse"})},[n,l.id,m]);return ev.createElement("div",{className:t},ev.createElement("div",{className:"flex items-center gap-2"},l.canAskAi&&ev.createElement("div",{className:"whitespace-nowrap rounded-xl border border-solid border-appcolor-300 bg-appcolor-0 px-4 py-2 text-sm font-medium transition duration-150 ease-in-out hover:border-appcolor-400 hover:bg-appcolor-0",onClick:e=>{o(Pw.actions.toggleMediaAiDialog({spaceId:l.space_id,spaceMedia:l})),e.stopPropagation()}},ev.createElement(tn.Icon,{className:"-mt-1 mr-2 scale-90 animate-color-rainbow",icon:"dd_ai"}),ev.createElement("span",{className:"text-moving-rainbow"},ev.createElement(eY.Z,{id:"general.ask_ai",defaultMessage:"Ask AI"}))),ev.createElement("button",{...c.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),a.expanded?n({type:"Collapse"}):n({type:"Expand"})},className:"flex items-center px-2 py-1 text-appcolor-500 transition duration-150 ease-in-out hover:text-appcolor-800"},ev.createElement(tn.Icon,{icon:"header_more"})),a.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:n,modal:!0},ev.createElement(eOJ,{initialFocus:a.initialFocus,onSelect:u,membershipRole:r}))))},eO0=function(e){let{className:t,spaceMedia:a}=e,{s3KeyOriginal:n}=a.data.fileDesc,l=(0,wo.a)(["ogp",n],async()=>{let e=`https://files.taskade.com/${n}`,t=await fetch(e,{credentials:"same-origin",method:"GET"});if(!t.ok){let e=new ei.FetchError(t);throw await e.toTaskadeError()??e}return await t.json()},{cacheTime:864e5,staleTime:1/0}),r=l.data?.ogTitle,o=ev.useMemo(()=>{if(null!=r)return r;let e=(0,cx.getMediaLocationDesc)(a.data.fileDesc.id);return null==e?"Youtube (Unknown)":"youtube"!==e.type?"Unknown":`Youtube (${e.id})`},[r,a.data.fileDesc.id]),i=l.data?.ogImage?.[0]?.url??"/images/file-placeholder2.png",s=cc()(a.created_at).format("MM/DD/YY");return ev.createElement("div",{className:t},ev.createElement("div",{className:"flex-none"},ev.createElement("img",{className:"h-10 w-10 rounded-lg object-cover",alt:o,title:o,src:i})),ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1"},ev.createElement("p",{className:"truncate text-sm font-semibold text-appcolor-900"},o),ev.createElement("p",{className:"text-xs text-appcolor-500"},null!=a.user?ev.createElement(eY.Z,{id:"general.space_media_created_at_with_user",defaultMessage:"Added by {handle} on {createdAt}",values:{createdAt:s,handle:a.user.handle}}):ev.createElement(eY.Z,{id:"general.space_media_created_at",defaultMessage:"Added on {createdAt}",values:{createdAt:s}}))))},eO1=function(e){let{className:t,spaceMedia:a}=e,n=(0,eK.Z)(),l=Td(a.data.fileDesc,"h_200,w_200","xhdpi")??"/images/file-placeholder2.png",r=$k(a.data.fileDesc)??n.formatMessage({id:"general.untitled",defaultMessage:"Untitled"}),o=cc()(a.created_at).format("MM/DD/YY");return ev.createElement("div",{className:t},ev.createElement("div",{className:"flex-none"},ev.createElement("img",{className:"h-10 w-10 rounded-lg object-cover",alt:r,title:r,src:l})),ev.createElement("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1"},ev.createElement("p",{className:"truncate text-sm font-semibold text-appcolor-900"},r),ev.createElement("p",{className:"text-xs text-appcolor-500"},null!=a.user?ev.createElement(eY.Z,{id:"general.space_media_created_at_with_user",defaultMessage:"Added by {handle} on {createdAt}",values:{createdAt:o,handle:a.user.handle}}):ev.createElement(eY.Z,{id:"general.space_media_created_at",defaultMessage:"Added on {createdAt}",values:{createdAt:o}}))))},eO2=function(e){let{spaceMedia:t}=e,a=og()("flex gap-4",e.className),n=(0,cx.computeMediaKind)(t.data.fileDesc.mimetype);return"webpage"===n||"youtube"===n?ev.createElement(eO0,{className:a,spaceMedia:t}):ev.createElement(eO1,{className:a,spaceMedia:t})},eO5=function(e){let{media:t,index:a,onPreview:n,membershipRole:l}=e,[r,o]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"});return ev.createElement("div",{className:"group mx-5 flex cursor-pointer items-center justify-stretch gap-4 rounded-xl px-4 py-3 transition duration-150 ease-in-out hover:bg-appcolor-200 dark:hover:bg-appcolor-100",onClick:()=>{n(a)}},ev.createElement(eO2,{className:"min-w-0 flex-1",spaceMedia:t}),ev.createElement(eOX,{className:og()("flex-none",r.expanded?"flex":"hidden group-hover:flex"),spaceMedia:t,popupState:r,popupDispatch:o,membershipRole:l}))},eO3=function(e){let{space:t}=e,a=t.id,n=T_((0,eL.useTheme)()),l=(0,e$.useDispatch)(),r=(0,eB.a)(Hk,{variables:{spaceID:a,orderby:{sort:M.CreatedAt,direction:"desc"}},fetchPolicy:"network-only",notifyOnNetworkStatusChange:!0}),o=e=>{l(eAN.actions.toggleSpaceMediaPreviewDialog({spaceId:a,spaceMedias:s,index:e}))},i=r.data?.membership?.space.media.pageInfo.hasNextPage,s=(r.data?.membership?.space?.media.edges??[]).map(e=>e.node),d=r.data?.membership?.role??"outsider";return 0===s.length&&r.loading?ev.createElement(eI.Spinner,null):0===s.length?ev.createElement("div",{className:"flex h-full items-center justify-center",style:n},ev.createElement("div",{className:"flex max-w-sm flex-col items-center text-center"},ev.createElement(lT.UC,{className:"mb-8"}),ev.createElement("p",{className:"mb-2 flex flex-col text-lg font-bold text-appcolor-1000"},ev.createElement(eY.Z,{id:"general.upload_files_chat_ai",defaultMessage:"Upload files and chat with AI!"})),ev.createElement("p",{className:"text-sm text-appcolor-500"},ev.createElement(eY.Z,{id:"general.files_attached_will_appear_here",defaultMessage:"Files attached to tasks appear here. Chat with your documents, ask AI and discover new insights. Learn more.",values:{Link:e=>ev.createElement("a",{className:"text-primary hover:text-primary/80",href:"https://help.taskade.com/hc/en-us/articles/20682829845651--AI-File-Chat-PDF-CSV-Docs#3----method--2--attachments",target:"_blank",rel:"noopener noreferrer"},e)}})),ev.createElement("img",{className:"mt-4 rounded-xl",src:"/images/onboarding/ai-media-manager.gif"}))):ev.createElement("div",{style:n},s.map((e,t)=>ev.createElement(eO5,{key:e.id,media:e,index:t,spaceId:a,onPreview:o,membershipRole:d})),r.loading&&ev.createElement(eI.Spinner,null),!r.loading&&i&&ev.createElement("div",{className:"flex h-12 shrink-0 items-center justify-center"},ev.createElement("button",{className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-applight-100 hover:bg-primary/75",onClick:()=>{if(!i)return;let e=r.data?.membership?.space.media.pageInfo.endCursor;null!=e&&r.fetchMore({variables:{after:e}})}},ev.createElement(eY.Z,{id:"general.load_more",defaultMessage:"Load more"}))))},eO4=eL.default.div.withConfig({displayName:"EmptyStateCompleted__Wrapper",componentId:"sc-6a3bae09-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: 0 auto; + font-size: 14px; + text-align: center; + padding: 32px 32px 160px 32px; + + @media (max-width: 768px) { + max-width: 540px; + padding-bottom: 100px; + } + + @media (max-width: 480px) { + max-width: 100%; + padding-bottom: 100px; + } +`,eO6=eL.default.h4.withConfig({displayName:"EmptyStateCompleted__Heading",componentId:"sc-6a3bae09-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,eO8=eL.default.p.withConfig({displayName:"EmptyStateCompleted__Description",componentId:"sc-6a3bae09-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,eO7=eL.default.div.withConfig({displayName:"EmptyStateCompleted__EmptyImageWrapper",componentId:"sc-6a3bae09-3"})` + margin-bottom: 24px; + opacity: 40%; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,eO9=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(eO4,null,ev.createElement(eO7,null,!n&&ev.createElement(lT.ke,null)),ev.createElement(eO6,null,t),ev.createElement(eO8,null,a))},eUe=eL.default.div.withConfig({displayName:"EmptyStateCreateNew__Wrapper",componentId:"sc-db51f483-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; +`,eUt=eL.default.span.withConfig({displayName:"EmptyStateCreateNew__Message",componentId:"sc-db51f483-1"})` + margin-top: 12px; + color: #bfbfbf; + font-size: 1.125rem; +`,eUa=eL.default.div.withConfig({displayName:"EmptyStateCreateNew__ButtonText",componentId:"sc-db51f483-2"})` + max-width: 200px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`,eUn=eL.default.div.withConfig({displayName:"EmptyStateCreateNew__CreateButton",componentId:"sc-db51f483-3"})` + display: flex; + justify-content: center; + align-items: center; + border-radius: 30px; + color: #fff; + background: ${e=>e.theme.primaryColorScheme?.base}; + transition: background-color ease-in-out 0.2s; + border: 0; + height: 34px; + margin-top: 15px; + padding: 0px 20px; + ${e1.UiTypography.sm}; + + &:focus { + outline: 0; + color: #fff; + } + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + color: #fff; + cursor: pointer; + } + + & svg { + margin-right: 0.25rem; + } + + span { + padding-right: 7px; + } + + > a { + display: flex; + align-items: center; + } +`,eUl=function(e){let{hideIcon:t,toLink:a,allowCreateProject:n}=e;return ev.createElement(eUe,null,!t&&ev.createElement(lT.u7,null),n?ev.createElement(ev.Fragment,null,ev.createElement(eUt,null,ev.createElement(eY.Z,{id:"general.create_new_project",defaultMessage:"Create a new project to get started."}),"\uD83C\uDF08"),ev.createElement(eUn,null,ev.createElement(sC.rU,{to:a,style:{color:"inherit",textDecoration:"inherit"}},ev.createElement("div",null,ev.createElement(tn.Icon,{icon:"dd_export_text"})),ev.createElement(eUa,null,ev.createElement(eY.Z,{id:"general.start_from_blank_project",defaultMessage:"Start with blank project"}))))):ev.createElement(eUt,null,ev.createElement(eY.Z,{id:"general.viewer_new_project",defaultMessage:"No projects here."})," \uD83C\uDF08"))},eUr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SpaceOrderingUpdateMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SpaceOrderingUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spaceOrderingUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"membership"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderby"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sort"}},{kind:"Field",name:{kind:"Name",value:"direction"}}]}}]}}]}}]}}]}}]},eUo=function(e){let t=ev.useRef(null),{props:a}=(0,eI.useMenuItem)({stopRef:t,name:e.name});return ev.createElement(sC.rU,{...a,className:e.className,to:e.to,onClick:e.onClick},e.children)},eUi=eL.default.div.withConfig({displayName:"SortDropdown__Separator",componentId:"sc-438c7c34-0"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eUs={sort:"recent",direction:"desc"};function eUd(e){switch(e){case"created":case"created_at":return"created";case"recent":case"updated_at":default:return"recent";case"title":return"title";case"ended_at":case"due":return"due"}}let eUc=new Map([["recent",{type:"sort",value:"recent",descriptor:(0,te.Em)({id:"general.last_modified",defaultMessage:"Last Modified"})}],["title",{type:"sort",value:"title",descriptor:(0,te.Em)({id:"general.project_name",defaultMessage:"Project Name"})}],["created",{type:"sort",value:"created",descriptor:(0,te.Em)({id:"general.date_created",defaultMessage:"Date Created"})}],["due",{type:"sort",value:"due",descriptor:(0,te.Em)({id:"general.due_date",defaultMessage:"Due Date"})}]]),eUm=eUc.get(eUs.sort),eUu=new Map([["asc",{type:"direction",value:"asc",descriptor:(0,te.Em)({id:"general.ascending",defaultMessage:"Ascending"})}],["desc",{type:"direction",value:"desc",descriptor:(0,te.Em)({id:"general.descending",defaultMessage:"Descending"})}]]);function eUp(e,t,a){let n=(0,es.ZP)(t,e=>{let{type:t,value:n}=a;return e[t]=n,e});return(0,es.ZP)(e,e=>{for(let t of c_)t in e&&delete e[t];let{sort:t,direction:a}=n;return e.sort=`${t}-${a}`,e})}let eUg=function(e){let t=(0,ll.x)(),{location:a,match:n,membership:l}=e,r=l?.preferences?.orderby??eUs,{search:o}=a,i=(0,ev.useMemo)(()=>tL.parse(o),[o]),s=(0,ev.useMemo)(()=>{let e=tZ()(i.sort)?i.sort[0]:i.sort;if(null==e)return r;let t=e.match(/^(.+)-(.+)$/);if(null==t)return r;let a=t[1];if(!eUc.has(a))return r;let n=t[2];return eUu.has(n)?{sort:a,direction:n}:r},[i,r]),d=ev.useRef(null),c=ev.useRef(null),[m,u]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),p=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:m,placement:"bottom-start"}),g=(0,eI.useMenuButton)({ref:d,state:m,dispatch:u}),f=ev.useCallback(e=>{e.type,u({type:"Collapse"})},[]),h=T_((0,eI.useTheme)()),y=n.params.subspaceID||n.params.spaceID,b=e=>{let a=l?.id;if(null==a||!a.endsWith(y))return;let n={sort:pO(s.sort),direction:s.direction};"direction"===e.type?n[e.type]=e.value:"sort"===e.type&&(n[e.type]=pO(e.value));let r=(0,ld.Z)();t.mutate({mutation:eUr,variables:{input:{clientMutationId:r,spaceId:y,orderby:n}},optimisticResponse:{__typename:"Mutation",spaceOrderingUpdate:{__typename:"SpaceOrderingUpdatePayload",clientMutationId:r,membership:{id:a,__typename:"Membership",preferences:{__typename:"MembershipPreferences",orderby:{__typename:"Ordering",sort:n.sort??s.sort,direction:n.direction??eUm.value}}}}}})},v=eUc.get(eUd(s.sort))??eUm;return ev.createElement(ev.Fragment,null,ev.createElement("button",{...g.props,className:"mx-5 flex h-8 cursor-pointer flex-row items-center bg-transparent text-textcolor-500 hover:text-textcolor-900 focus:outline-none md:mx-8"},ev.createElement("span",{className:"text-xs font-normal uppercase"},ev.createElement(eY.Z,v.descriptor)),ev.createElement(lT.tO,{className:"ml-px -translate-y-px",fill:"currentColor",stroke:"currentColor"})),m.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:u,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:f},ev.createElement(eI.Menu,{initialFocus:p.initialFocus,loop:!0,className:"flex min-w-[12rem] flex-col rounded-lg border border-appcolor-200 bg-appcolor-0 py-2 shadow",style:h},Array.from(eUc.values(),e=>{let{type:t,value:a,descriptor:n}=e,l=eUp(i,s,e),r=eUd(s[t]??"")===eUd(a);return ev.createElement(eUo,{key:a,className:og()("flex h-7 w-full cursor-pointer flex-row items-center justify-between border-none bg-none px-1 pl-5 pr-4 text-sm text-textcolor-900 hover:bg-appcolor-200 focus:outline-none",r&&"font-medium"),onClick:()=>b(e),name:t,value:a,to:{search:tL.stringify(l)}},ev.createElement(eY.Z,n),r&&ev.createElement(lT.MM,{className:"ml-auto flex h-7 text-primary"}))}),ev.createElement(eUi,null),Array.from(eUu.values(),e=>{let{type:t,value:a,descriptor:n}=e,l=eUp(i,s,e),r=s[t]===a;return ev.createElement(eUo,{key:a,className:og()("flex h-7 w-full cursor-pointer flex-row items-center justify-between border-none bg-none px-1 pl-5 pr-4 text-sm text-textcolor-900 hover:bg-appcolor-200 focus:outline-none",r&&"font-medium"),onClick:()=>b(e),name:t,value:a,to:{search:tL.stringify(l)}},ev.createElement(eY.Z,n),r&&ev.createElement(lT.MM,{className:"ml-auto flex h-7 text-primary"}))})))))},eUf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ArchiveDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"archived"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"archiveDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"archived"},value:{kind:"Variable",name:{kind:"Name",value:"archived"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"archived_at"}}]}}]}}]},eUh={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}]}]}}]},eUy=function(e){let t=ev.useRef(null),{props:a}=(0,eI.useMenuItem)({stopRef:t,name:e.name});return ev.createElement("button",{...a,type:"button",className:e.className},e.children)},eUb=function(e){let{document:t,documentID:a,spaceID:n,spaceQuery:l,title:r,isArchived:o}=e,i=(0,e$.useDispatch)(),s=(0,ll.x)(),d=ev.useRef(null),c=ev.useRef(null),[m,u]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),p=(0,eI.usePopup)({referenceElementRef:d,popupElementRef:c,state:m,placement:"bottom-start"}),g=(0,eI.useMenuButton)({ref:d,state:m,dispatch:u}),f=Ck({role:t.role,action:{workspace:"move_project"}}),h=Ck({role:t.role,action:{workspace:"archive_project"}}),y=Ck({role:t.role,action:{project:"delete",workspace:"delete_project"}}),b=ev.useCallback(e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"share":i(fP(a));break;case"copy":i(p_(a,{spaceID:n,isTemplate:!0}));break;case"move":i(xl(a,{spaceID:n}));break;case"restore":case"complete":s.mutate({mutation:eUf,optimisticResponse:{__typename:"Mutation",archiveDocument:{id:a,archived_at:"complete"===t?new Date().toString():null,__typename:"Document"}},update:e=>{let t=e.readQuery(l),n=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==a),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({...l,data:n})},variables:{id:a,archived:"complete"===t}});break;case"delete":Mw(null,r,{onApprove(){s.mutate({mutation:eUh,optimisticResponse:{__typename:"Mutation",deleteDocument:!0},update:(e,t)=>{let{data:{deleteDocument:n}}=t;if(n){let t=e.readQuery(l),n=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==a),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({...l,data:n})}},variables:{id:a}})}})}u({type:"Collapse"})}},[s,i,a,n,l,r]),v=og()("flex w-full max-w-[15rem] items-center p-[var(--menu-item-padding)] text-sm text-textcolor-900 hover:bg-appcolor-300"),k=og()("transform-[var(--menu-item-icon-scale)] mr-[var(--menu-item-gap)]");return ev.createElement(ev.Fragment,null,ev.createElement("button",{...g.props,className:"ml-1.5 flex h-10 w-10 items-center justify-center rounded-lg border-none bg-none text-primary shadow-none hover:bg-appcolor-300 focus:outline-none",onClick:e=>{g.props.onClick(e),e.preventDefault(),e.stopPropagation()}},ev.createElement(tn.Icon,{icon:"header_more"})),m.expanded&&ev.createElement(eI.Popup,{...p.props,dispatch:u,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:b},ev.createElement(eI.Menu,{className:"flex min-w-55 flex-col rounded-lg border border-appcolor-300 bg-appcolor-0 py-3 shadow"},ev.createElement(eUy,{className:v,name:"share"},ev.createElement(tn.Icon,{icon:"dd_share",className:k}),ev.createElement(eY.Z,{id:"general.share",defaultMessage:"Share"})),ev.createElement(eUy,{className:v,name:"copy"},ev.createElement(tn.Icon,{icon:"dd_copy",className:k}),ev.createElement(eY.Z,{id:"general.copy_template",defaultMessage:"Copy Template"})),f&&ev.createElement(eUy,{className:v,name:"move"},ev.createElement(tn.Icon,{icon:"dd_move",className:k}),ev.createElement(eY.Z,{id:"general.move",defaultMessage:"Move"})),ev.createElement("div",{className:"m-[var(--menu-item-divider-margin)] w-full border-t border-appcolor-300"}),h&&(o?ev.createElement(eUy,{className:v,name:"restore"},ev.createElement(tn.Icon,{icon:"dd_complete",className:k}),ev.createElement(eY.Z,{id:"general.restore",defaultMessage:"Restore"})):ev.createElement(eUy,{className:v,name:"complete"},ev.createElement(tn.Icon,{icon:"dd_complete",className:k}),ev.createElement(eY.Z,{id:"general.complete",defaultMessage:"Complete"}))),y&&ev.createElement(eUy,{className:v,name:"delete"},ev.createElement(tn.Icon,{icon:"dd_delete",className:k}),ev.createElement(eY.Z,{id:"general.delete_template",defaultMessage:"Delete Template"}))))))},eUv=eL.default.button.withConfig({displayName:"styled__Button",componentId:"sc-cf851f4e-0"})` + display: flex; + background: none; + margin: 0 0 2px; + padding: 5px 10px; + box-shadow: none; + cursor: pointer; + outline: 0; + border: 0; + width: 100%; + justify-content: center; + + & > span { + font-size: 26px; + } + + &:focus { + outline: 0; + } +`,eUk=(0,eL.default)(lT.mq).withConfig({displayName:"styled__StyledProjectIcon",componentId:"sc-cf851f4e-1"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,eUE=eL.default.div.withConfig({displayName:"styled__Wrapper",componentId:"sc-cf851f4e-2"})` + display: flex; + flex-shrink: 0; + width: 50px; + height: 50px; + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1); + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + margin-right: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; + transition: transform 0.2s ease-in-out; + + & > span { + font-size: 26px; + } + + &:hover { + transform: scale(1.15); + } +`;eL.default.span.withConfig({displayName:"styled__Description",componentId:"sc-cf851f4e-3"})` + width: 100%; + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`;let eUx=(0,eL.default)(e1.Overline).withConfig({displayName:"styled__SectionHeader",componentId:"sc-cf851f4e-4"})` + color: ${e=>e.theme.textColors.hex("50")}; + margin: 15px 0; + width: 100%; +`;eL.default.h4.withConfig({displayName:"styled__HeaderText",componentId:"sc-cf851f4e-5"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + width: 100%; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`;let eU_=eL.default.div.withConfig({displayName:"styled__TemplateIcon",componentId:"sc-cf851f4e-6"})` + display: flex; + margin: 0 auto; + height: 70px; + margin-bottom: 7px; + border-radius: 16px; + font-size: 32px; + line-height: 40px; + justify-content: center; + align-items: center; + background: ${e=>e.theme.isNightMode?e.theme.appColors.hex(90):e.theme.appColors.hex(100)}; + transition: transform 0.1s ease-in-out; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); + color: ${e=>e.theme.textColors.hex(0)}; + + & svg { + transform: scale(1.3); + } + + &:hover { + transform: scale(1.1); + cursor: pointer; + } +`,eUw=eL.default.div.withConfig({displayName:"styled__TemplateItem",componentId:"sc-cf851f4e-7"})` + text-align: center; + min-width: 125px; + + span, + div { + color: ${e=>e.theme.textColors.hex(0)}; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +`;eL.default.div.withConfig({displayName:"styled__CreateButton",componentId:"sc-cf851f4e-8"})` + display: flex; + justify-content: center; + align-items: center; + border-radius: 30px; + align-self: flex-start; + color: #fff; + background: ${e=>e.theme.primaryColorScheme?.base}; + transition: background-color ease-in-out 0.2s; + border: 0; + height: 34px; + margin-top: 15px; + padding: 0px 20px; + ${e1.UiTypography.sm}; + + &:focus { + outline: 0; + color: #fff; + } + + &:hover { + background: ${e=>e.theme.primaryColorScheme?.alpha80}; + color: #fff; + cursor: pointer; + } + + & svg { + margin-right: 0.25rem; + } + + span { + padding-right: 7px; + } + + > a { + display: flex; + align-items: center; + } +`;let eUN=eL.default.div.withConfig({displayName:"styled__Note",componentId:"sc-cf851f4e-9"})` + display: flex; + padding: 8px 12px; + margin: auto 30px 20px; + background: ${e=>e.theme.appColors.hex(90)}; + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + border-radius: 10px; + color: ${e=>e.theme.textColors.hex(10)}; + flex-wrap: wrap; + + ${e1.UiTypography.sm}; +`,eUC=function(e){let{document:t}=e,a=nQ(t),[n,l]=ev.useReducer(eI.popupReducer,{expanded:!1}),r=ev.useRef(null),o=ev.useRef(null),i=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:n,placement:"bottom",computeModifiersCallback:tr}),s=(0,eI.useMenuButton)({state:n,ref:r,dispatch:l}),[d]=(0,cs.D)(Ko),[c]=(0,cs.D)(Kr),m=Ck({role:t.role,action:{project:"edit",workspace:"edit_project"}}),u=(0,ev.useCallback)(e=>{e.preventDefault(),n.expanded?l({type:"Collapse"}):l({type:"Expand",payload:"first"})},[n.expanded]),p=(0,ev.useCallback)(async e=>{if(l({type:"Collapse"}),null!=e){let a=(0,ld.Z)();await d({optimisticResponse:{__typename:"Mutation",projectAvatarEmojiSave:{__typename:"ProjectAvatarEmojiSavePayload",clientMutationId:a,document:{__typename:"Document",id:t.id,shared_preferences:{...t.shared_preferences,avatar:{type:"emoji",value:e.native}}}}},variables:{input:{clientMutationId:a,documentId:t.id,emoji:e.native}}})}},[t,d,l]),g=ev.useMemo(()=>{if(null!=nQ(t))return async()=>{l({type:"Collapse"});let e=(0,ld.Z)();await c({optimisticResponse:{__typename:"Mutation",projectAvatarDelete:{__typename:"ProjectAvatarDeletePayload",clientMutationId:e,document:{__typename:"Document",id:t.id,shared_preferences:{...t.shared_preferences,avatar:null}}}},variables:{input:{clientMutationId:e,documentId:t.id}}})}},[c,t,l]);return m?ev.createElement(eUE,null,ev.createElement(eUv,{...s.props,onClick:u,disabled:!m},null!=a?ev.createElement("span",null,a):ev.createElement(eUk,null)),n.expanded&&ev.createElement(gp,{dispatch:l,onEmojiPick:p,onEmojiRemove:g,popupProps:i.props})):ev.createElement(eUE,null,null!=a?ev.createElement("span",null,a):ev.createElement(eUk,null))},eUM=eL.default.div.withConfig({displayName:"Bottom__BottomWrapper",componentId:"sc-40958ca5-0"})` + display: inherit; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + + button { + margin-top: 5px; + } +`,eUS=eL.default.div.withConfig({displayName:"Bottom__Container",componentId:"sc-40958ca5-1"})` + display: contents; +`,eUI=function(e){let{document:t}=e,{id:a,tags:n,space:l}=t,r=(0,eF.TH)(),o=(0,eF.k6)(),i=t.info?.updatedBy??null,s=null!=t.updated_at?cc()(t.updated_at).fromNow():"",d=(0,ev.useCallback)(e=>{let t=tL.parse(r.search);t=ely(t,"label",e.key);let a=tL.stringify(t),n=ts()(a)?void 0:`?${a}`;o.push({search:n})},[o,r.search]);return ev.createElement(eUM,null,null!=l&&ev.createElement(eUS,null,ev.createElement(elR,{projectId:a,role:t.role,spacePlanType:l.taskadePlanType}),ev.createElement(ery,{onSelect:d,tags:n}),ev.createElement(er4,{documentTags:n,documentId:a,role:t.role,spaceId:l.id}),ev.createElement(eP4,{updatedBy:i,updatedFromNow:s})))},eUD=eL.default.button.withConfig({displayName:"EditTemplateButton__Button",componentId:"sc-1cc074b0-0"})` + display: flex; + align-items: center; + justify-content: center; + margin: 0 0 0 6px; + padding: 0; + background: none; + box-shadow: none; + border-radius: 10px; + cursor: pointer; + outline: 0; + border: 0; + color: ${e=>e.theme.primaryColorScheme?.base}; + width: 40px; + height: 40px; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,eUT=function(e){let{path:t}=e,a=(0,eF.k6)(),{arrowProps:n,popperProps:l,referenceProps:r,setVisible:o,visible:i}=(0,eI.useTooltip)({placement:"top"}),s=(0,ev.useCallback)(e=>{e.preventDefault(),a.push(t)},[a,t]),d=(0,ev.useCallback)(()=>{o(!0)},[o]),c=(0,ev.useCallback)(()=>{o(!1)},[o]);return ev.createElement(eUD,{...r,onClick:s,onMouseEnter:d,onMouseLeave:c},ev.createElement(tn.Icon,{icon:"dd_edit"}),i&&ev.createElement(eI.Tooltip,{arrowProps:n,popperProps:l},ev.createElement(eY.Z,{id:"general.edit_template",defaultMessage:"Edit Template"})))},eU$=eL.default.button.withConfig({displayName:"UseTemplateButton__Button",componentId:"sc-2f99c802-0"})` + display: flex; + align-items: center; + justify-content: center; + margin: 0 0 0 6px; + padding: 0; + background: none; + box-shadow: none; + border-radius: 10px; + cursor: pointer; + outline: 0; + border: 0; + color: ${e=>e.theme.primaryColorScheme?.base}; + width: 40px; + height: 40px; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,eUP=function(e){let{documentID:t,spaceID:a}=e,n=(0,eF.k6)(),{arrowProps:l,popperProps:r,referenceProps:o,setVisible:i,visible:s}=(0,eI.useTooltip)({placement:"top"}),d=(0,ev.useCallback)(e=>{e.preventDefault(),n.push(`/spaces/${a}/new/from/${t}`)},[t,n,a]),c=(0,ev.useCallback)(()=>{i(!0)},[i]),m=(0,ev.useCallback)(()=>{i(!1)},[i]);return ev.createElement(eU$,{...o,onClick:d,onMouseEnter:c,onMouseLeave:m},ev.createElement(tn.Icon,{icon:"dd_project"}),s&&ev.createElement(eI.Tooltip,{arrowProps:l,popperProps:r},ev.createElement(eY.Z,{id:"general.use_template",defaultMessage:"Use Template"})))},eUF=eL.default.div.withConfig({displayName:"TemplateItem__Container",componentId:"sc-e47a7818-0"})` + display: flex; + flex-direction: row; + align-items: center; + padding: 14px 22px; + :hover { + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f8f8f8"}; + } + position: relative; + + @media (min-width: 768px) { + padding: 14px 32px; + } +`,eUA=eL.default.div.withConfig({displayName:"TemplateItem__ContentWrapper",componentId:"sc-e47a7818-1"})` + display: flex; + flex: 1; + flex-direction: column; + align-items: flex-start; + justify-content: center; +`,eUR=eL.default.div.withConfig({displayName:"TemplateItem__Top",componentId:"sc-e47a7818-2"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; +`,eUj=eL.default.span.withConfig({displayName:"TemplateItem__Title",componentId:"sc-e47a7818-3"})` + font-size: 17px; + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eUO=eL.default.div.withConfig({displayName:"TemplateItem__ActionWrapper",componentId:"sc-e47a7818-4"})` + display: flex; + flex-basis: 150px; + justify-content: flex-end; +`,eUU=function(e){let{spaceID:t,document:a,spaceQuery:n}=e,l=Eu({role:a.role.workspace,action:"create_project"}),r=Ck({role:a.role,action:{project:"edit",workspace:"edit_workspace"}}),{id:o,info:i,archived_at:s,is_unread:d}=a,[c,m]=(0,ev.useState)(!1),u=(0,eq.isEmpty)(i.title)?"Untitled":i?.title??"",p=!(0,eq.isNil)(s);return ev.createElement(ev.Fragment,null,ev.createElement(sC.rU,{id:o,to:`/d/${o}`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1)},ev.createElement(eUF,null,d&&ev.createElement(eP6,{style:{position:"absolute",left:"12px",top:"36px"}}),ev.createElement(eUC,{document:a}),ev.createElement(eUA,null,ev.createElement(eUR,null,ev.createElement(eUj,null,u)),ev.createElement(eUI,{document:a})),ev.createElement(eUO,null,c&&ev.createElement(ev.Fragment,null,l&&ev.createElement(eUP,{documentID:o,spaceID:t}),r&&ev.createElement(eUT,{path:a.view_path}),ev.createElement(eUb,{title:u,document:a,spaceID:t,documentID:o,isArchived:p,spaceQuery:n}))))))};function eUZ(e){return!(ts()(ec()(e,["filterby","assignees"]))&&ts()(ec()(e,["filterby","tags"])))}let eUL={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateDocumentMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DocumentInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"document"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"view_path"}}]}}]}}]},eUB={list:"view_list",board:"view_board",mindmap:"view_mindmap",actionsheet:"view_actionsheet"},eUz={list:(0,te.Em)({id:"general.space_create_list_title",defaultMessage:"New List"}),board:(0,te.Em)({id:"general.space_create_board_title",defaultMessage:"New Board"}),mindmap:(0,te.Em)({id:"general.space_create_mindmap_title",defaultMessage:"New Mind Map"}),actionsheet:(0,te.Em)({id:"general.space_create_actionsheet_title",defaultMessage:"New Action Sheet"})},eUV=function(e){let{className:t,spaceId:a,view:n}=e,l=(0,eF.k6)(),[r,{loading:o}]=(0,cs.D)(eUL),i=async()=>{let e=await r({variables:{input:{spaceID:a,view:n}}}),t=e?.data?.createDocument?.id;null!=t&&l.push(`/d/${t}`)};return ev.createElement("div",{onClick:i,className:t},!0===o?ev.createElement("div",{className:"m-auto"},ev.createElement(eI.Spinner,null)):ev.createElement(ev.Fragment,null,ev.createElement(tn.Icon,{icon:eUB[n],className:"shrink-0 text-appcolor-500"}),ev.createElement("p",{className:"item-title truncate text-sm font-medium "},ev.createElement(eY.Z,eUz[n]))))},eUq=eL.default.div.withConfig({displayName:"CreationBar__Container",componentId:"sc-fab1d06d-0"})` + ${tS} + overflow-x: auto; +`,eUW=eL.default.div.withConfig({displayName:"CreationBar__AiBarItem",componentId:"sc-fab1d06d-1"})` + backdrop-filter: blur(7px); + position: relative; + + &:before { + content: ''; + position: absolute; + inset: -1px; + border-radius: 1rem; + pointer-events: none; + padding: 2px; + background-image: linear-gradient(0deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-mask: + linear-gradient(#fff 0 0) content-box, + linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + animation: rotateonce 5s linear 1 forwards; + } + + &:hover::before { + animation: rotateforever 3s linear infinite; + } + + @keyframes rotateforever { + 100% { + filter: hue-rotate(360deg); + } + } + + @keyframes rotateonce { + 0% { + filter: hue-rotate(0deg); + } + 80% { + filter: hue-rotate(180deg); + } + 100% { + filter: hue-rotate(360deg); + opacity: 0; + } + } + + @keyframes rainbowIconOne { + 0% { + color: #4fcf70; + } + 25% { + color: #fad648; + } + 50% { + color: #a767e5; + } + 75% { + color: #12bcfe; + } + 99% { + color: #44ce7b; + } + 100% { + color: inherit; + } + } + + & svg { + animation: rainbowIconOne 3s linear infinite 1 forwards; + } + + &:hover { + & svg { + animation: rainbowIconOne 3s linear infinite; + } + & .rainbow { + background: linear-gradient(to right, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b); + -webkit-background-clip: text; + background-clip: text; + background-size: 200% 100%; + animation: movingGradient 3s linear infinite; + -webkit-text-fill-color: transparent; + + @keyframes movingGradient { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } + } + } + } +`,eUH=function(e){let{spaceId:t}=e,a=(0,e$.useDispatch)(),n=og()("flex w-full py-4 px-4 gap-x-3 cursor-pointer rounded-2xl border border-appcolor-400 hover:bg-appcolor-100 dark:hover:bg-appdark-100 items-center bg-applight-0 dark:bg-appdark-0/60");return ev.createElement(eUq,{className:"ml-9 mr-5 flex justify-between gap-x-2"},ev.createElement(eUW,{onClick:()=>{a(Nj.actions.toggleAiCreateProjectDialog({spaceId:t}))},className:n},ev.createElement(tn.Icon,{icon:"dd_ai",className:"shrink-0 text-appcolor-500"}),ev.createElement("p",{className:"item-title rainbow truncate text-sm font-medium"},ev.createElement(eY.Z,{id:"general.space_create_project_with_ai",defaultMessage:"Create with AI"}))),ev.createElement(eUV,{className:n,spaceId:t,view:"list"}),ev.createElement(eUV,{className:n,spaceId:t,view:"board"}),ev.createElement(eUV,{className:n,spaceId:t,view:"mindmap"}),ev.createElement("div",{onClick:()=>{a(NU())},className:n},ev.createElement(tn.Icon,{icon:"dd_import",className:"shrink-0 text-appcolor-500"}),ev.createElement("p",{className:"item-title truncate text-sm font-medium"},ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"}))))};var eUG=a(15882);let eUK=(0,evk.cn)({selectedItems:new Set,wrapperElement:null}),eUY=(0,eUG.j)(e=>{var t;return t=e(eUK),(0,lb.C)({context:t,schema:{context:{},events:{}},tsTypes:{},id:"selection",initial:"idle",states:{idle:{on:{ON_SELECT:{target:"#selection.selecting"},REGISTER_ELEMENT:{actions:"registerElement"}}},selected:{invoke:{src:e=>t=>{let a=a=>{if(2===a.button){t("OPEN_CONTEXT_MENU");return}if(0!==a.button||null==e.wrapperElement)return;let n=z8(a),l=(0,Vn.iz)(e.wrapperElement),r=null!=l&&z6(n,l.marginBox);r||t("CLEAR_SELECTION");let o=a.shiftKey;r&&o||t("CLEAR_SELECTION")};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)}},on:{CLEAR_SELECTION:{actions:"clearSelectedItems",target:"#selection.idle"},ON_SELECT:{target:"#selection.selecting"},OPEN_CONTEXT_MENU:{target:"#selection.openContextMenu"}}},openContextMenu:{on:{MENU_ITEM_SELECTED:{actions:"clearSelectedItems",target:"#selection.idle"},EXIT_CONTEXT_MENU:{target:"#selection.selected"}}},selecting:{invoke:{src:(e,t)=>a=>{if("ON_SELECT"!==t.type)return;let{documentId:n}=t.payload;if(1===e.selectedItems.size&&e.selectedItems.has(n)){a("CLEAR_SELECTION");return}a(e.selectedItems.has(n)?{type:"REMOVE_SELECTABLE",payload:{documentId:n}}:{type:"ADD_SELECTABLE",payload:{documentId:n}})}},on:{CLEAR_SELECTION:{actions:"clearSelectedItems",target:"#selection.idle"},ADD_SELECTABLE:{actions:"addSelectable",target:"#selection.selected"},REMOVE_SELECTABLE:{actions:"removeSelectable",target:"#selection.selected"}}}}},{actions:{registerElement:(0,lv.assign)((e,t)=>{let{element:a}=t.payload;return(0,es.ZP)(e,e=>{e.wrapperElement=a})}),addSelectable:(0,lv.assign)((e,t)=>{let{documentId:a}=t.payload,n=e.selectedItems.has(a);return(0,es.ZP)(e,e=>{if(!n)return e.selectedItems.add(a),e})}),removeSelectable:(0,lv.assign)((e,t)=>{let{documentId:a}=t.payload;return(0,es.ZP)(e,e=>(e.selectedItems.delete(a),e))}),clearSelectedItems:(0,lv.assign)(e=>(0,es.ZP)(e,e=>(e.selectedItems=new Set,e)))}})}),eUQ=(0,evk.cn)(e=>e(eUY).context.selectedItems),eUJ=ev.createContext(void 0),eUX=eL.default.div.withConfig({displayName:"Bottom__BottomWrapper",componentId:"sc-ffb00cef-0"})` + display: inherit; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + + button { + margin-top: 5px; + } +`,eU0=function(e){let{document:t}=e,a=t.info?.updatedBy??null,n=null!=t.updated_at?cc()(t.updated_at).fromNow():"";return ev.createElement(eUX,null,null!=t.space&&ev.createElement(er8,{documentId:t.id,assignments:t.assignments,sharedPreferences:t.shared_preferences,space:t.space,tags:t.tags,role:t.role,disableBacklinks:!0,projectName:t.info?.title??"",isTemplate:!1}),ev.createElement(eP4,{updatedBy:a,updatedFromNow:n}))},eU1=eL.default.button.withConfig({displayName:"CompleteProjectButton__CompleteRestoreButton",componentId:"sc-6dc33102-0"})` + margin: 0 0 0 6px; + padding: 0; + background: none; + box-shadow: none; + border-radius: 10px; + cursor: pointer; + outline: 0; + border: 0; + color: ${e=>e.theme.primaryColorScheme?.base}; + width: 40px; + height: 40px; + + &:focus { + outline: 0; + } + + &:hover { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,eU2=(0,eL.default)(lT.DQ).withConfig({displayName:"CompleteProjectButton__StyledIconProjectComplete",componentId:"sc-6dc33102-1"})` + > path { + stroke: ${e=>e.theme.primaryColorScheme?.base}; + fill: ${e=>e.theme.primaryColorScheme?.base}; + } +`,eU5=(0,eL.default)(lT.XR).withConfig({displayName:"CompleteProjectButton__StyledIconProjectRestore",componentId:"sc-6dc33102-2"})` + > path { + stroke: ${e=>e.theme.primaryColorScheme?.base}; + } +`,eU3=function(e){let{isArchived:t,onClick:a}=e,{arrowProps:n,popperProps:l,referenceProps:r,setVisible:o,visible:i}=(0,eI.useTooltip)({placement:"top"}),s=(0,ev.useCallback)(()=>{o(!0)},[o]),d=(0,ev.useCallback)(()=>{o(!1)},[o]);return ev.createElement(ev.Fragment,null,ev.createElement(eU1,{...r,onMouseEnter:s,onMouseLeave:d,onClick:a},t?ev.createElement(eU5,null):ev.createElement(eU2,null)),i&&ev.createElement(eI.Tooltip,{arrowProps:n,popperProps:l},t?ev.createElement(eY.Z,{id:"general.restore",defaultMessage:"Restore"}):ev.createElement(eY.Z,{id:"general.mark_as_complete",defaultMessage:"Mark as Complete"})))},eU4=eL.default.button.withConfig({displayName:"MenuItem__Button",componentId:"sc-c28d1f11-0"})` + display: flex; + align-items: center; + background: ${e=>e.theme.appColors.hex(100)}; + color: ${e=>e.theme.textColors.hex(10)}; + padding: var(--menu-item-padding); + ${e1.UiTypography.sm}; + width: 100%; + + &:hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + &:focus { + background: ${e=>e.theme.appColors.hex(80)}; + } +`,eU6=function(e){let{value:t,name:a,children:n,$warning:l}=e,r=ev.useRef(null),o=(0,eI.useMenuItem)({stopRef:r,value:t,name:a});return ev.createElement(eU4,{...o.props,className:`${l&&" !text-danger"}`},n)},eU8=(0,eL.default)(eI.Menu).withConfig({displayName:"DocumentActionDropdown__StyledMenu",componentId:"sc-a9f56cd0-0"})` + display: flex; + flex-direction: column; + padding: var(--menu-padding); + min-width: var(--menu-min-width); + border-radius: var(--menu-border-radius); + background: ${e=>e.theme.backgroundColorHex}; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eU7=(0,eL.default)(tn.Icon).withConfig({displayName:"DocumentActionDropdown__StyledIcon",componentId:"sc-a9f56cd0-1"})` + margin-right: var(--menu-item-gap); + transform: var(--menu-item-icon-scale); +`,eU9=eL.default.div.withConfig({displayName:"DocumentActionDropdown__Separator",componentId:"sc-a9f56cd0-2"})` + width: 100%; + margin: var(--menu-item-divider-margin); + border-top: 1px solid ${e=>e.theme.appColors.hex(70)}; +`,eZe=function(e){let{initialFocus:t,popupDispatch:a,document:n,documentID:l,isPinned:r,spaceQuery:o,isStarred:i,spaceID:s,isTemplate:d,isArchived:c,title:m,setHoverToFalse:u}=e,p=(0,e$.useDispatch)(),[g]=(0,cs.D)(ME),[f]=(0,cs.D)(Mx),[h]=(0,cs.D)(eUf),[y]=(0,cs.D)(eUh),b=ev.useCallback(e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"share":p(fP(l));break;case"pin":g({optimisticResponse:{__typename:"Mutation",pinDocument:{id:l,pinned_at:r?null:new Date().toString(),__typename:"Document"}},update:e=>{let t=e.readQuery(o),a=(0,es.ZP)(t,e=>{let{edges:t}=e.membership.space.documents_v2;if(r){let e=t.findIndex(e=>e.node.id===l),a=t.splice(e,1)[0];t.unshift(a)}else{let e=t.findIndex(e=>e.node.id===l),a=t.findIndex(e=>eu()(e.node.pinned_at)&&e.node.id!==l),n=t.splice(e,1)[0];a<=0?t.push(n):t.splice(a-1,0,n)}return e});e.writeQuery({...o,data:a})},variables:{id:l,pinned:!r}});break;case"star":f({optimisticResponse:{__typename:"Mutation",starDocument:{__typename:"Document",id:l,starred_at:i?null:new Date().toString()}},variables:{id:l,starred:!i}});break;case"copy":p(p_(l,{spaceID:s,isTemplate:d}));break;case"move":p(xl(l,{spaceID:s}));break;case"template":p(p_(l,{isTemplate:!0,spaceID:s}));break;case"complete":h({optimisticResponse:{__typename:"Mutation",archiveDocument:{id:n.id,archived_at:c?null:new Date().toString(),__typename:"Document"}},update:e=>{let t=e.readQuery(o),a=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==n.id),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({...o,data:a})},variables:{id:n.id,archived:!c}});break;case"delete":Mw(null,m,{onApprove(){y({optimisticResponse:{__typename:"Mutation",deleteDocument:!0},update:(e,t)=>{let{data:{deleteDocument:a}}=t;if(a){let t=e.readQuery(o),a=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==n.id),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({...o,data:a})}},variables:{id:n.id}})}})}u(),a({type:"Collapse"})}},[h,y,p,n.id,l,c,r,i,d,g,a,u,s,o,f,m]),v=lm({role:n.role,action:{workspace:"pin_project"}}),k=lm({role:n.role,action:{workspace:"move_project"}}),E=lm({role:n.role,action:{workspace:"archive_project"}}),x=lm({role:n.role,action:{project:"delete",workspace:"delete_project"}});return ev.createElement(eI.MenuGroupContext.Provider,{value:b},ev.createElement(eU8,{initialFocus:t,loop:!0},ev.createElement(eU6,{name:"share"},ev.createElement(ev.Fragment,null,ev.createElement(eU7,{icon:"dd_share"}),ev.createElement(eY.Z,{id:"general.share",defaultMessage:"Share"}))),v&&ev.createElement(eU6,{name:"pin"},ev.createElement(ev.Fragment,null,ev.createElement(eU7,{icon:"dd_pin"}),r?ev.createElement(eY.Z,{id:"general.unpin",defaultMessage:"Unpin"}):ev.createElement(eY.Z,{id:"general.pin",defaultMessage:"Pin"}))),ev.createElement(eU6,{name:"star"},ev.createElement(ev.Fragment,null,ev.createElement(eU7,{icon:"dd_star"}),i?ev.createElement(eY.Z,{id:"general.unstar",defaultMessage:"Unstar"}):ev.createElement(eY.Z,{id:"general.star",defaultMessage:"Star"}))),ev.createElement(eU6,{name:"copy"},ev.createElement(ev.Fragment,null,ev.createElement(eU7,{icon:"dd_copy"}),ev.createElement(eY.Z,{id:"general.copy",defaultMessage:"Copy"}))),k&&ev.createElement(eU6,{name:"move"},ev.createElement(ev.Fragment,null,ev.createElement(eU7,{icon:"dd_move"}),ev.createElement(eY.Z,{id:"general.move",defaultMessage:"Move"}))),ev.createElement(eU6,{name:"template"},ev.createElement(ev.Fragment,null,ev.createElement(eU7,{icon:"dd_addtotemplates"}),ev.createElement(eY.Z,{id:"general.add_to_templates",defaultMessage:"Add to Templates"}))),(E||x)&&ev.createElement(ev.Fragment,null,ev.createElement(eU9,null),E&&ev.createElement(eU6,{name:"complete"},ev.createElement(eU7,{icon:"dd_complete"}),c?ev.createElement(eY.Z,{id:"general.restore",defaultMessage:"Restore"}):ev.createElement(eY.Z,{id:"general.complete",defaultMessage:"Complete"})),x&&ev.createElement(eU6,{name:"delete",$warning:!0},ev.createElement(eU7,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.delete_project",defaultMessage:"Delete Project"})))))},eZt=eL.default.button.withConfig({displayName:"DocumentActionDropdown__Button",componentId:"sc-f2ee0cab-0"})` + color: ${e=>e.theme.primaryColorScheme?.base}; +`,eZa=function(e){let{document:t,documentID:a,isPinned:n,spaceQuery:l,isStarred:r,spaceID:o,isArchived:i,title:s,setHoverToFalse:d}=e,c=ev.useRef(null),m=ev.useRef(null),[u,p]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),g=(0,eI.usePopup)({referenceElementRef:c,popupElementRef:m,state:u,placement:"bottom-start"}),f=(0,eI.useMenuButton)({ref:c,state:u,dispatch:p});return ev.createElement(ev.Fragment,null,ev.createElement(eZt,{...f.props,onClick:e=>{e.preventDefault(),e.stopPropagation(),u.expanded?p({type:"Collapse"}):p({type:"Expand"})},className:"ml-1.5 h-10 w-10 rounded-xl hover:bg-appcolor-300"},ev.createElement(tn.Icon,{icon:"header_more"})),u.expanded&&ev.createElement(eI.Popup,{...g.props,dispatch:p,modal:!0,onBackdropClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),d(),p({type:"Collapse"})}},ev.createElement(eZe,{initialFocus:g.initialFocus,popupDispatch:p,document:t,documentID:a,isPinned:n,spaceQuery:l,isStarred:r,spaceID:o,isArchived:i,title:s,setHoverToFalse:d})))},eZn=(0,eL.default)(lT.hA).withConfig({displayName:"DocumentItem__StyledStarIcon",componentId:"sc-ea62a22c-0"})` + height: 20px; + width: 20px; + + > path { + fill: #f2d750; + } +`,eZl=eL.default.div.withConfig({displayName:"DocumentItem__Container",componentId:"sc-ea62a22c-1"})` + position: relative; + display: flex; + flex-direction: row; + align-items: center; + padding: 14px 22px; + + @media (min-width: 768px) { + padding: 14px 32px; + } + :hover { + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f8f8f8"}; + } +`,eZr=eL.default.div.withConfig({displayName:"DocumentItem__ContentWrapper",componentId:"sc-ea62a22c-2"})` + display: flex; + flex: 1; + flex-direction: column; + align-items: flex-start; + justify-content: center; +`,eZo=eL.default.div.withConfig({displayName:"DocumentItem__Top",componentId:"sc-ea62a22c-3"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; +`,eZi=eL.default.span.withConfig({displayName:"DocumentItem__Title",componentId:"sc-ea62a22c-4"})` + font-size: 17px; + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eZs=eL.default.div.withConfig({displayName:"DocumentItem__StarIconWrapper",componentId:"sc-ea62a22c-5"})` + display: flex; + margin-left: 5px; +`,eZd=eL.default.div.withConfig({displayName:"DocumentItem__ActionWrapper",componentId:"sc-ea62a22c-6"})` + display: flex; + flex-basis: 150px; + justify-content: flex-end; +`,eZc=function(e){let{spaceID:t,document:a,spaceQuery:n}=e,l=Ck({role:a.role,action:{workspace:"archive_project",project:"archive"}}),[r]=(0,cs.D)(eUf),{id:o,info:i,starred_at:s,pinned_at:d,archived_at:c,is_unread:m}=a,u=ev.useMemo(()=>(0,evk.cn)(e=>e(eUQ).has(o)),[o]),p=(0,evv.Dv)(u),g=ev.useContext(eUJ),[f,h]=(0,ev.useState)(!1),y=(0,eq.isEmpty)(i.title)?"Untitled":i?.title??"",b=!(0,eq.isNil)(s),v=!(0,eq.isNil)(d),k=!(0,eq.isNil)(c),E=i?.stats?.completedCount??0,x=i?.stats?.totalCount??0,_=e=>{h(e)},w=ev.useCallback(e=>{e.dataTransfer.setData("application/vnd.taskade.project",o)},[o]),N=ev.useCallback(e=>{e.shiftKey&&0===e.button&&e.preventDefault()},[]),C=ev.useCallback(e=>{if(e.shiftKey&&0===e.button){g?.selectDocument(o),e.preventDefault();return}},[g,o]);return ev.createElement(sC.rU,{to:`/d/${o}`,onDragStart:w,onMouseDown:N,onClick:C,id:o,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},ev.createElement(eZl,{className:og()(p&&"bg-applight-200 dark:bg-appdark-100")},m&&ev.createElement(eP6,{style:{position:"absolute",left:"12px",top:"36px"}}),ev.createElement(eUC,{document:a}),ev.createElement(eZr,null,ev.createElement(eZo,null,ev.createElement(eZi,null,y),b&&ev.createElement(eZs,null,ev.createElement(eZn,{selected:b}))),ev.createElement(eU0,{document:a})),ev.createElement(eZd,null,f?ev.createElement(ev.Fragment,null,l&&ev.createElement(eU3,{isArchived:k,onClick:e=>{e.preventDefault(),e.stopPropagation(),r({optimisticResponse:{__typename:"Mutation",archiveDocument:{id:o,archived_at:k?null:new Date().toString(),__typename:"Document"}},update:e=>{let t=e.readQuery(n),a=(0,es.ZP)(t,e=>(e.membership.space.documents_v2.edges=e.membership.space.documents_v2.edges.filter(e=>e.node.id!==o),e.membership.space.documents_v2.totalCount>0&&(e.membership.space.documents_v2.totalCount-=1),e));e.writeQuery({...n,data:a})},variables:{id:o,archived:!k}})}}),ev.createElement(eZa,{title:y,document:a,spaceID:t,documentID:o,isStarred:b,isPinned:v,isArchived:k,spaceQuery:n,setHoverToFalse:()=>{h(!1)}})):ev.createElement(pl,{percentCompleted:x>0?E/x*100:0}))))},eZm=function(e){let{name:t,value:a,children:n}=e,l=ev.useRef(null),r=(0,eI.useMenuItem)({stopRef:l,name:t,value:a});return ev.createElement("div",{className:og()("flex w-48 items-center gap-x-2 px-3 py-2 text-sm hover:cursor-pointer",{"bg-appcolor-300":r.navigated}),...r.props},n)},eZu={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectsDeleteMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectsDeleteInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectsDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}}]}}]}}]},eZp=function(e){let{spaceId:t,spaceRole:a,handleMenuItemSelected:n}=e,l=(0,evv.Dv)(eUQ),r=(0,e$.useDispatch)(),o=(0,eF.TH)(),[i]=(0,cs.D)(eZu),s=Eu({role:a,action:"move_project"}),d=Eu({role:a,action:"delete_project"}),c=ev.useCallback(()=>{r(gO.actions.toggleCopyDocumentsDialog({spaceId:t,documentIds:Array.from(l)}))},[r,l,t]),m=ev.useCallback(async()=>{let e=Array.from(l),t=e.length;if(0===t)return;let a=1===t?"project":"projects",n=`Delete ${t} ${a}`,r="";for(;null!=r&&r.trim()!==n;)r=prompt(`Are you sure you want to delete ${t} ${a}? Please type '${n}' to confirm.`);if(null==r)return;let{query:s,variables:d}=pZ(o,null),c=(0,ld.Z)();await i({optimisticResponse:{projectsDelete:{__typename:"ProjectsDeletePayload",clientMutationId:c}},variables:{input:{clientMutationId:c,ids:e}},update:(a,n)=>{if(null==s||null==d)return;let l=a.readQuery({query:s,variables:d}),r=(0,es.ZP)(l,a=>(a.membership.space.documents_v2.edges=a.membership.space.documents_v2.edges.filter(t=>!e.includes(t.node.id)),a.membership.space.documents_v2.totalCount>=t&&(a.membership.space.documents_v2.totalCount-=t),a));a.writeQuery({query:s,data:r,variables:d})}})},[o,i,l]),u=ev.useCallback(()=>{r(xX.actions.toggleMoveDocumentsDialog({spaceId:t,documentIds:Array.from(l)}))},[r,l,t]),p=ev.useCallback(e=>{if("Activate"===e.type){let{name:t}=e.payload;switch(t){case"copy":c();break;case"delete":m();break;case"move":u()}n()}},[c,m,n,u]);return 0===l.size?null:ev.createElement(eI.Menu,null,ev.createElement(eI.MenuGroupContext.Provider,{value:p},ev.createElement("div",{className:"flex w-48 flex-col rounded-lg border-[1px] border-appcolor-300 bg-appcolor-0 py-2 shadow-md"},ev.createElement(eZm,{name:"copy"},ev.createElement(tn.Icon,{icon:"dd_copy"}),ev.createElement(eY.Z,{id:"general.copy_multiple_projects",defaultMessage:"Copy {count, plural, =0 {no projects} one {{count} project} other {{count} projects}}",values:{count:l.size}})),s&&ev.createElement(eZm,{name:"move"},ev.createElement(tn.Icon,{icon:"dd_move"}),ev.createElement(eY.Z,{id:"general.move_multiple_projects",defaultMessage:"Move {count, plural, =0 {no projects} one {{count} project} other {{count} projects}}",values:{count:l.size}})),d&&ev.createElement(eZm,{name:"delete"},ev.createElement(tn.Icon,{icon:"dd_delete"}),ev.createElement(eY.Z,{id:"general.delete_multiple_projects",defaultMessage:"Delete {count, plural, =0 {no projects} one {{count} project} other {{count} projects}}",values:{count:l.size}})))))},eZg=function(e){let{spaceId:t,spaceRole:a}=e,[n,l]=(0,evv.KO)(eUY),r=ev.useRef(null),[o,i]=ev.useState(null),s=ev.useCallback(()=>{l("EXIT_CONTEXT_MENU"),i(null)},[l]);ev.useEffect(()=>{null!=r.current&&l({type:"REGISTER_ELEMENT",payload:{element:r.current}})},[l]);let d=ev.useCallback(e=>{l({type:"ON_SELECT",payload:{documentId:e}})},[l]),c=ev.useMemo(()=>({selectDocument:d}),[d]);return ev.createElement(eUJ.Provider,{value:c},ev.createElement("div",{ref:r,onContextMenu:e=>{n.matches("openContextMenu")&&(e.preventDefault(),i({x:e.clientX,y:e.clientY}))}},e.children),null!=o&&ev.createElement(egO,{coordinates:o,close:s},ev.createElement(eZp,{handleMenuItemSelected:()=>{l("MENU_ITEM_SELECTED")},spaceId:t,spaceRole:a})))},eZf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"OnboardSpaceTourMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CurrentUserPreferencesUpdateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserPreferencesUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onboardSpaceTour"}}]}}]}}]}}]}}]},eZh=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Welcome to Your First Workspace \uD83D\uDC4B"),ev.createElement("br",null),ev.createElement("div",{className:"relative",style:{paddingTop:"56.25%"}},ev.createElement("iframe",{className:"absolute left-0 top-0 h-full w-full",src:"https://www.youtube-nocookie.com/embed/ITXyJivODnc?rel=0&controls=1",title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})," ")," ",ev.createElement("br",null),ev.createElement("p",{className:"text-sm"},"Ready to organize like a pro? Discover how Taskade's unique hierarchy and structure brings order to chaos."))},eZy=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Navigate Workspaces & Folders")," ",ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83E\uDDE0 Command Center (Top-Left Corner)"),ev.createElement("p",{className:"mb-3"},"Access Recent Projects, My Tasks, Global Calendar, Starred Projects, Shared with Me, and Global Search."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83C\uDF10 Workspaces"),ev.createElement("p",{className:"mb-3"},"Your central hub for projects and folders. Easily switch and invite your team."," "),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCC1 Folders"),ev.createElement("p",{className:"mb-3"},"Organize projects and teams. Secure and private. Drag and drop to rearrange workspaces and folders"),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDDB1️ Organize"),ev.createElement("p",{className:"mb-3"},"Easily reorder workspaces and move folders between them, adapting to your project needs. Drag projects within workspaces for seamless organization."))},eZb=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Explore Your Workspace Tabs"),ev.createElement("br",null),ev.createElement("iframe",{className:"aspect-video w-full",src:"https://www.youtube-nocookie.com/embed/7-EOl0lW_4c?rel=0&controls=1",title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCDD Projects & Tasks"),ev.createElement("p",{className:"mb-3"},"Your central hub for teamwork. View and manage your space in one place."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83E\uDD16 Custom AI Agents"),ev.createElement("p",{className:"mb-3"},"Create, train, and customize your virtual workforce and team."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"⚡️ Automations"),ev.createElement("p",{className:"mb-3"},"Streamline your workflows, connect your favorite apps, and assign AI Agents to help complete your tasks."),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83D\uDCCE Media Manager"),ev.createElement("p",{className:"mb-3"},"Interact with uploaded files and Ask AI for new insights."))},eZv=function(){return ev.createElement("div",{className:"text-sm"},ev.createElement("h1",{className:"pb-4 text-lg font-bold text-appcolor-800"},"Generate Your First Project"),ev.createElement("br",null),ev.createElement("iframe",{className:"aspect-video w-full",src:"https://www.youtube-nocookie.com/embed/R-l2k70K3pY?rel=0&controls=1",title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"✨ AI-Powered Project Creation"),ev.createElement("p",null,"Generate task lists, mind maps, and workflows in an instant. From flow charts to design sprints, the possibilities are limitless.")," ",ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"\uD83E\uDDE0 Import Documents with AI"),ev.createElement("p",null,"Upload and transform PDFs, CSVs, and more into dynamic projects. AI brings your static files to life!")," ",ev.createElement("br",null),ev.createElement("h2",{className:"text-md pb-2 font-semibold"},"✅ Manage Your Projects"),ev.createElement("p",{className:"mb-3"},"Assign tasks, set deadlines, and make each project your own. Welcome to unparalleled productivity.")," ")},eZk=function(e){let[t,a]=(0,ev.useState)(!0),[n,l]=(0,ev.useState)("Next →"),[r]=(0,ev.useState)(0),o=(0,ev.useRef)(null),i=(0,ll.x)(),s=async()=>{a(!1);let t=(0,ld.Z)();await i.mutate({mutation:eZf,variables:{input:{clientMutationId:t,onboardSpaceTour:!1}},optimisticResponse:{__typename:"Mutation",currentUserPreferencesUpdate:{__typename:"CurrentUserPreferencesUpdatePayload",clientMutationId:t,currentUser:{id:e.currentUserId,preferences:{__typename:"CurrentUserPreferences",onboardSpaceTour:!1}}}}})};ev.useEffect(()=>{let e=document.querySelector("body");if(e){let t=og()("overflow-hidden");return e.classList.add(t),()=>{let e=document.querySelector("body");e&&e.classList.remove(t)}}},[]);let d=[{element:"body",intro:ev.createElement(eZh,null),tooltipClass:og()("introjs-forcedOverlay bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full max-w-md")},{element:".space-step2",intro:ev.createElement(eZy,null),tooltipClass:og()("mt-10 bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full min-w-fit")},{element:".space-step3",intro:ev.createElement(eZb,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full max-w-sm")},{element:".space-step4",intro:ev.createElement(eZv,null),tooltipClass:og()("bg-appcolor-0 rounded-xl border border-solid border-appcolor-300 drop-shadow-md w-full max-w-sm")}];return ev.createElement(efM.R,{enabled:t,ref:o,steps:d,initialStep:r,onExit:s,onChange:e=>{l(0===e?"Start Tour →":"Next →")},options:{nextLabel:n,showButtons:!0,showStepNumbers:!1,keyboardNavigation:!0,showBullets:!0,overlayOpacity:.7,disableInteraction:!1}})},eZE=(0,eL.default)(eI.Overline).withConfig({displayName:"ProjectListings__Text",componentId:"sc-27e9a4f3-0"})` + margin: 0 22px; + color: #999; + + @media (min-width: 768px) { + margin: 0 32px; + } +`,eZx=eL.default.div.withConfig({displayName:"ProjectListings__PinnedItemWrapper",componentId:"sc-27e9a4f3-1"})` + margin-top: 20px; +`,eZ_=(0,eL.default)(eZx).withConfig({displayName:"ProjectListings__OtherItemWrapper",componentId:"sc-27e9a4f3-2"})``,eZw=function(e){let{documentStatus:t,location:a,match:n,space:l,history:r}=e,{search:o}=a,{id:i}=l,s=(0,eK.Z)(),d=(0,eB.a)(sW),c=d.data?.me,m=(0,ev.useMemo)(()=>pU(i,t,o,null,null),[t,o,i]),u=(0,ev.useMemo)(()=>({query:zf,variables:m}),[m]),{data:p,loading:g,error:f}=(0,eB.a)(zf,{variables:m,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),h=`/spaces/${i}/new`,y=p?.membership,b=p?.membership?.space?.documents_v2?.edges??[],v=p?.membership?.space?.documents_v2?.totalCount??0,{pinnedProjects:k,otherProjects:E}=(0,ev.useMemo)(()=>{let e=[],t=[];return b.forEach(a=>{let n=a.node??null;null!=n&&(n?.pinned_at?e.push(n):t.push(n))}),{pinnedProjects:e,otherProjects:t}},[b]),x=p?.membership?.role,_=Eu({role:x,action:"create_project"});return g?ev.createElement(eI.Spinner,{height:319}):null!=f?ev.createElement(efB,{message:"There was a problem loading your projects."}):0===v?t===iC?ev.createElement(eO9,{heading:s.formatMessage({id:"general.empty_state_projects",defaultMessage:"No completed projects!"}),description:s.formatMessage({id:"general.empty_state_projects_description",defaultMessage:"Projects marked as completed will show up here."})}):eUZ(m)?ev.createElement(ePJ,{message:`${s.formatMessage({id:"general.filtered_create_new_project",defaultMessage:"No projects to be shown for the chosen filter."})} 🌈`}):ev.createElement(ev.Fragment,null,_&&ev.createElement(eUH,{spaceId:i}),ev.createElement(eUl,{toLink:h,allowCreateProject:_})):ev.createElement(eZg,{spaceId:i,spaceRole:x},ev.createElement("div",{className:"space-step4 mb-5 pb-15"},ev.createElement(eUH,{spaceId:i}),null!=c&&c.preferences.onboardSpaceTour&&ev.createElement(eZk,{currentUserId:c.id}),0!==k.length?ev.createElement(eZx,null,ev.createElement(eZE,null,ev.createElement(eY.Z,{id:"general.pinned",defaultMessage:"Pinned"})),k.map(e=>null!=e.templated_at?ev.createElement(eUU,{spaceQuery:u,key:e.id,spaceID:i,document:e}):ev.createElement(eZc,{spaceQuery:u,key:e.id,spaceID:i,document:e}))):null,ev.createElement(eZ_,null,0!==E.length?ev.createElement(eUg,{history:r,location:a,match:n,membership:y}):null,E.map(e=>null!=e.templated_at?ev.createElement(eUU,{spaceQuery:u,key:e.id,spaceID:i,document:e}):ev.createElement(eZc,{spaceQuery:u,key:e.id,spaceID:i,document:e}))),ev.createElement(eNH,{pathname:a.pathname,search:a.search,hash:a.hash,totalCount:v,itemPerPage:20})))};var eZN=a(72939),eZC=a(74209);let eZM=(0,eL.default)(lT.mq).withConfig({displayName:"Avatar__StyledProjectIcon",componentId:"sc-bd5fcdf6-0"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,eZS=function(e){let t=e.emoji??null;return null==t?ev.createElement(eZM,null):ev.createElement("span",null,t)},eZI=function(e){let{item:t,itemContext:a,getItemProps:n,getResizeProps:l}=e,{left:r,right:o}=l(),i={"is-resizing":a.resizing,"is-dragging":a.dragging,"is-selected":a.selected},{percentCompleted:s}=t;return ev.createElement("div",n({className:og()("roadmap-item-wrapper",i)}),a.useResizeHandle&&ev.createElement("div",r,ev.createElement("span",null)),ev.createElement("div",{className:og()("roadmap-item",{"is-resizing":a.resizing,"is-dragging":a.dragging,"is-selected":a.selected}),style:{height:a.dimensions.height,overflow:"hidden",paddingLeft:3,textOverflow:"ellipsis",whiteSpace:"nowrap"}},ev.createElement(eZS,{emoji:t.emoji}),ev.createElement("div",{className:"roadmap-details"},ev.createElement("div",{className:"roadmap-item-title"},ev.createElement("span",null,a.title),ev.createElement("div",{className:"roadmap-item-progress"},ev.createElement("span",{style:{width:`${s}%`}}))))),a.useResizeHandle&&ev.createElement("div",o,ev.createElement("span",null)))},eZD=eL.default.div.withConfig({displayName:"Roadmap__FooterNote",componentId:"sc-fb0647bb-0"})` + display: flex; + padding: 20px 0; + text-align: center; + align-items: center; + justify-content: center; + font-size: 15px; + color: #999; + & > span { + margin-left: 4px; + margin-right: 4px; + } +`,eZT=eL.default.div.withConfig({displayName:"Roadmap__Container",componentId:"sc-fb0647bb-1"})` + display: flex; + flex-direction: column; + flex: 1; +`,eZ$=eL.default.div.withConfig({displayName:"Roadmap__TimelineWrapper",componentId:"sc-fb0647bb-2"})` + padding: 0 22px; + + @media (min-width: 768px) { + padding: 0 32px; + } + + .react-calendar-timeline { + .roadmap-today { + background: ${e=>e.theme.primaryColorScheme?.base} !important; + } + .rct-item { + /* Handle Bars */ + .rct-item-handler { + > span { + background: ${e=>e.theme.isNightMode?"#384147":"#e5e5e5"}; + } + } + + &:hover { + border: 1px solid ${e=>e.theme.isNightMode?"#272C30":"#e5e5e5"}; + } + + .roadmap-item { + border: 1px solid ${e=>e.theme.appColors.hex(80)}; + background: ${e=>e.theme.appColors.hex(100)}; + } + + &.is-selected { + border: 1px solid ${e=>e.theme.isNightMode?"#384147":"#e5e5e5"}; + & .roadmap-item { + border-color: ${e=>e.theme.isNightMode?"#384147":"#ccc"}; + } + } + /* States: Ends */ + } + .roadmap-item { + & > span { + display: flex; + font-size: 20px; + line-height: 20px; + justify-content: center; + margin-left: 5px; + } + & > svg { + margin-left: 12px; + transform: scale(0.8); + } + & > .roadmap-details { + > .roadmap-item-title { + color: ${e=>e.theme.textColors.hex(10)}; + } + .roadmap-item-progress { + background: ${e=>e.theme.isNightMode?"#272C30":"#e5e5e5"}; + > span { + background: ${e=>e.theme.primaryColorScheme?.base}; + } + } + } + } + + .rct-vl { + border-right: 1px solid ${e=>e.theme.isNightMode?"#272C30":"#e5e5e5"}; + } + .rct-dateHeader { + color: ${e=>e.theme.textColors.hex(10)}; + } + } +`,eZP=function(e){var t;let{data:a,defaultTimeEnd:n,defaultTimeStart:l,moveResizeValidator:r,onItemDoubleClick:o,onItemMove:i,onItemResize:s,onTimeChange:d,space:c,timezone:m}=e,u=[{id:c.id,title:c.name},{id:2,title:""},{id:3,title:""},{id:4,title:""},{id:5,title:""}],p=(t=ec()(a,["membership","space","documents_v2","edges"],[]),us()(t,(e,t)=>{let{start:a,end:n}=t.node.shared_preferences;if(eu()(a)||eu()(n))return e;let{completedCount:l,totalCount:r}=t.node.info.stats,o=Cj(a).tz(m),i=Cj(n).tz(m),s=eG()(o.format(m0),m0),d=eG()(i.format(m0),m0);return[...e,{id:t.node.id,group:c.id,title:t.node.info.title||"Untitled",start_time:s,end_time:d,percentCompleted:r>0?l/r*100:0,emoji:nQ(t.node)}]},[]));return ev.createElement(eZT,null,ev.createElement(eZ$,null,ev.createElement(eZC.ZP,{canResize:"both",defaultTimeStart:l,defaultTimeEnd:n,groups:u,items:p,itemHeightRatio:.8,itemRenderer:eZI,lineHeight:60,minZoom:2592e5,maxZoom:7776e6,moveResizeValidator:r,onItemDoubleClick:o,onItemMove:i,onItemResize:s,onTimeChange:d,rightSidebarWidth:0,sidebarWidth:0,stackItems:!0,useResizeHandle:!0},ev.createElement(eZC.AY,null,ev.createElement(eZC.Lw,null,e=>{let{styles:t}=e;return ev.createElement("div",{className:"roadmap-today",style:t})})))),ev.createElement(eZD,null,ev.createElement(eY.Z,{id:"general.ctrl_to_zoom_and_double_click_to_open_project",defaultMessage:"Hold + scroll to zoom and double click to open project.",values:{control:()=>ev.createElement(eI.Shortcut.Combo,null,ev.createElement(eI.Shortcut.Key,null,eI.ModifierKeys.ModSymbol))}})),p.length<=2&&ev.createElement(eUN,null,ev.createElement(eY.Z,{id:"general.roadmap_description",defaultMessage:"\uD83D\uDCA1 Projects with a due date will be shown here."})))},eZF={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProjectDueDateAddMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProjectDueDateAddInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectDueDateAdd"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]}}]},eZA=function(e){let t=(0,eF.k6)(),a=t=>{let{data:a}=e,n=(a.membership?.space.documents_v2?.edges??[]).find(e=>e?.node?.id===t);return n?.node},{user:n}=e,l=n?.timezone||eG().tz.guess()||"Etc/UTC";return ev.createElement(eZP,{...e,moveResizeValidator:(e,t,a)=>{let n=eG()(a);return n.hour()>12?n.add(1,"days").startOf("day").valueOf():n.startOf("day").valueOf()},onItemDoubleClick:e=>{let n=a(e);null!=n&&t.push(n.view_path)},onItemResize:(t,n,l)=>{let{client:r,user:o}=e,i=a(t);if(null==i)return;let s=i.shared_preferences;if(null==s.start)return;let d=ez.DateDuration.fromDateRangeDesc({start:s.start,end:s.end});if("right"===l){let e=eG()(n).startOf("day"),t=d.startMoment;(0,ei.assert)(t.isSameOrBefore(e));let a=e.diff(t);d._duration=elE.nL.fromMillis(a)}else if("left"===l){let e=eG()(n).startOf("day"),t=d.endMoment;(0,ei.assert)(e.isSameOrBefore(t));let a=t.diff(e);d._startMoment=e,d._duration=elE.nL.fromMillis(a)}else throw new ei.AssertionError("Invalid edge");let c=o?.timezone||eG().tz.guess()||"Etc/UTC",{start:m,end:u}=d.toDateRangeDesc({startDesc:{timezone:c},endDesc:{timezone:c}});(0,ei.assert)(null==u||"date"in u);let p=(0,ld.Z)();r.mutate({mutation:eZF,optimisticResponse:{__typename:"Mutation",projectDueDateAdd:{__typename:"ProjectDueDateAddPayload",clientMutationId:p,document:{__typename:"Document",id:i.id,shared_preferences:{...s,start:m,end:u}}}},variables:{input:{clientMutationId:p,documentID:i.id,start:m,end:u}}})},onItemMove:(t,n)=>{let{client:l,user:r}=e,o=a(t);if(null==o)return;let i=o.shared_preferences;if(null==i.start)return;let s=ez.DateDuration.fromDateRangeDesc({start:i.start,end:i.end});s._startMoment=eG()(n).startOf("day");let d=r?.timezone||eG().tz.guess()||"Etc/UTC",{start:c,end:m}=s.toDateRangeDesc({startDesc:{timezone:d},endDesc:{timezone:d}});(0,ei.assert)(null==m||"date"in m);let u=(0,ld.Z)();l.mutate({mutation:eZF,variables:{input:{clientMutationId:u,documentID:o.id,start:c,end:m}},optimisticResponse:{__typename:"Mutation",projectDueDateAdd:{__typename:"ProjectDueDateAddPayload",clientMutationId:u,document:{__typename:"Document",id:o.id,shared_preferences:{...i,start:c,end:m}}}}})},timezone:l})};class eZR extends ev.Component{constructor(e){super(e);let t=eG()().startOf("day"),a=t.clone().add(-3,"days"),n=t.clone().add(3,"days");this.state={originalStart:a,originalEnd:n,queryStart:t.clone().add(-15,"days"),queryEnd:t.clone().add(16,"days")}}getNextQueryRange(e,t){let{queryStart:a,queryEnd:n}=this.state;if(en){let a=t.diff(e,"days"),n=a>60?90:2*a,l=eG()((e.valueOf()+t.valueOf())/2);return{queryStart:l.clone().startOf("day").add(-n,"days"),queryEnd:l.clone().startOf("day").add(n+1,"days")}}return{queryStart:a,queryEnd:n}}handleOnTimeChange=(e,t,a)=>{let n=eG()(e),l=eG()(t),{queryStart:r,queryEnd:o}=this.getNextQueryRange(n,l);this.setState({queryStart:r,queryEnd:o},()=>a(e,t))};render(){let{documentStatus:e,location:t,space:a,user:n}=this.props,{originalStart:l,originalEnd:r,queryStart:o,queryEnd:i}=this.state,{search:s}=t,{id:d}=a,c=pU(d,e,s,{startedAt:o,endedAt:i},null);return ev.createElement(eZN.A,{query:zf,variables:c,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"},e=>ev.createElement(eZA,{...e,defaultTimeStart:l,defaultTimeEnd:r,onTimeChange:this.handleOnTimeChange,space:a,user:n,client:e.client}))}}let eZj=(0,e$.connect)(function(e){return{user:t7(e)}})(eZR),eZO={"Past Due":(0,te.Em)({id:"general.past_due",defaultMessage:"Past Due"}),Today:(0,te.Em)({id:"general.today",defaultMessage:"Today"}),Upcoming:(0,te.Em)({id:"general.upcoming",defaultMessage:"Upcoming"}),"No Date":(0,te.Em)({id:"general.no_date",defaultMessage:"No Date"})},eZU=eL.default.div.withConfig({displayName:"styled__Container",componentId:"sc-126527dc-0"})` + margin-top: 10px; + + & .task-item:last-child { + margin-bottom: 12px; + } +`,eZZ=eL.default.button.withConfig({displayName:"styled__Heading",componentId:"sc-126527dc-1"})` + display: flex; + flex-direction: column; + width: 100%; + padding: 0 22px; + border: 0; + background: none; + + @media (min-width: 768px) { + padding: 0 32px; + } + + &:hover { + cursor: ${e=>null!=e.onClick?"pointer":"auto"}; + } + + & .heading-row { + display: flex; + width: 100%; + align-items: center; + color: ${e=>e.theme.textColors.hex(10)}; + font-weight: 500; + padding: 0 0 4px; + ${e1.UiTypography.sm}; + } + + &:focus { + outline: 0; + } +`,eZL=eL.default.div.withConfig({displayName:"styled__TotalCount",componentId:"sc-126527dc-2"})` + ${e1.UiTypography.xxs} + + border-radius: 50px; + padding: 3px 10px; + margin-left: 8px; + color: ${e=>e.theme.textColors.hex(10)}; + background-color: ${e=>e.theme.appColors.hex(80)}; + + ${eZZ}:hover & { + background: ${e=>e.theme.appColors.hex(70)}; + } +`,eZB=eL.default.span.withConfig({displayName:"styled__IconCaretWrapper",componentId:"sc-126527dc-3"})` + display: flex; + width: 30px; + height: 30px; + align-items: center; + justify-content: center; + background: none; + border: 0; + color: ${e=>e.theme.appColors.hex(60)}; + cursor: pointer; + margin-right: 4px; + + & svg { + transform: ${e=>e.$isFolded?"rotate(180deg)":"rotate(270deg)"}; + transition: transform cubic-bezier(0.22, 0.61, 0.36, 1) 200ms; + } + + ${eZZ}:hover & { + & svg { + color: ${e=>e.theme.appColors.hex(10)}; + } + } + + &:focus { + outline: 0; + } +`,eZz=eL.default.span.withConfig({displayName:"styled__Divider",componentId:"sc-126527dc-4"})` + display: flex; + height: 1px; + width: calc(100% - 34px); + margin-left: auto; + background: -webkit-linear-gradient( + left, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 1) 0%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0.5) 50%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 80%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 100% + ); + background: -moz-linear-gradient( + left, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 1) 0%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0.5) 50%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 80%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 100% + ); + background: -ms-linear-gradient( + left, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 1) 0%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0.5) 50%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 80%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 100% + ); + background: -o-linear-gradient( + left, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 1) 0%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0.5) 50%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 80%, + rgba(${e=>e.theme.isNightMode?"51,51,51":"229,229,229"}, 0) 100% + ); + transition: background-color ease-in-out 200ms; +`,eZV=function(e){let{isFolded:t}=e,a=ev.useRef(null),n=ev.useRef(null),l=ev.useRef(null),[r,o]=(0,ev.useState)(!1),{arrowProps:i,popperProps:s,referenceProps:d}=(0,eI.useControlledTooltip)({referenceElementRef:a,arrowElementRef:n,popperElementRef:l,placement:"top",visible:r});return ev.createElement(ev.Fragment,null,ev.createElement(eZB,{...d,onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},$isFolded:t},ev.createElement(tn.Icon,{icon:"caret_prev"})),r&&ev.createElement(eI.Tooltip,{arrowProps:i,popperProps:s},t?ev.createElement(eY.Z,{id:"general.expand",defaultMessage:"Expand"}):ev.createElement(eY.Z,{id:"general.collapse",defaultMessage:"Collapse"})))},eZq=eL.default.span.withConfig({displayName:"styled__PillText",componentId:"sc-76d4536d-0"})` + margin-left: 3px; + font-size: 13px; + line-height: 13px; +`,eZW=(0,eI.getColorScheme)(eI.ThemeColors.danger),eZH=eL.default.div.withConfig({displayName:"styled__PillContainer",componentId:"sc-76d4536d-1"})` + display: inline-flex; + align-items: center; + border: 0; + padding: 1px 8px; + background: transparent; + cursor: pointer; + white-space: nowrap; + border-radius: 30px; + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + background: ${e=>e.theme.appColors.hex(80)}; + color: ${e=>e.theme.textColors.hex(10)}; + + ${e=>e.$hasEnded&&(0,eL.css)` + border: 1px solid ${eZW?.base}; + background: ${eZW?.alpha10}; + color: ${eZW?.base}; + `} + + & .meta-avatar { + border: 1px solid ${e=>e.theme.appColors.hex(70)}; + } +`,eZG=eL.default.img.withConfig({displayName:"AssigneesPill__AvatarCircle",componentId:"sc-1f752c35-0"})` + height: 20px; + width: 20px; + border-radius: 50%; + background-color: white; + margin-right: ${e=>e.$isSingleAvatar?"0px":"-5px"}; +`,eZK=eL.default.div.withConfig({displayName:"AssigneesPill__AvatarCircleWrapper",componentId:"sc-1f752c35-1"})` + display: inline-flex; + margin-right: ${e=>e.$isSingleAvatar?"3px":"8px"}; +`,eZY=function(e){let{assignees:t}=e,a=1===t.length,n=(0,ev.useMemo)(()=>t.map(e=>e.handle).join(", "),[t]);return ev.createElement(eZH,null,ev.createElement(eZK,{$isSingleAvatar:a},t.map(e=>{let t=e.avatars_v2?.small?.mdpi.url;return ev.createElement(eZG,{$isSingleAvatar:a,key:e.id,className:"meta-avatar",src:t})})),ev.createElement(eZq,null,n))},eZQ=function(e){let{task:t}=e,a=(0,eK.Z)(),n=ev.useMemo(()=>eF5(t),[t]);return ev.createElement(eZH,{style:{marginRight:"5px"},$hasEnded:n?.toRelativeStatus()==="has_ended"},ev.createElement(tn.Icon,{icon:t.is_recurring?"addon_date_repeat":"addon_date"}),ev.createElement(eZq,null,n?.toReadableFormat()??a.formatMessage({id:"no_date",defaultMessage:"No Date"})))},eZJ=eL.default.span.withConfig({displayName:"NodeSpan",componentId:"sc-5a3a318a-0"})` + border-bottom: 5px solid ${e=>(function(e){return"string"==typeof e&&"#"===e[0]?e:"transparent"})(e.highlight)}; + font-weight: ${e=>e.bold?"bold":"inherit"}; + font-style: ${e=>e.italic?"italic":"none"}; + text-decoration: ${e=>e.underline?"underline":"none"}; + + .paragraph { + white-space: pre-wrap; + } +`,eZX=(0,la.ZP)` + mutation ProjectNodesCompletionUpdateMutation($input: ProjectNodesCompletionUpdateInput!) { + projectNodesCompletionUpdate(input: $input) { + clientMutationId + tasks { + id + document_id + assignees { + ...BasicUserFields + } + node_id + completed + text_string + end + start + line_number + } + } + } + ${up} +`,eZ0=eL.default.input.attrs({type:"checkbox"}).withConfig({displayName:"TaskBullet__Checkbox",componentId:"sc-8d1b736c-0"})` + display: flex; + flex-shrink: 0; + width: 20px; + height: 20px; + margin-top: 2px; + -webkit-appearance: none; + + &:after { + display: flex; + flex: 1 0 auto; + align-items: center; + justify-content: center; + height: 100%; + + content: ''; + + transition: all ease-in-out 0.15s; + -webkit-transition: all ease-in-out 0.15s; + -moz-transition: all ease-in-out 0.15s; + } + + &:hover { + cursor: pointer; + } + + &:after { + border: 1px solid ${e=>e.theme.appColors.hex(60)}; + border-radius: 6px; + } + + &:not(:checked) { + &:hover { + &:after { + content: url(${e=>e.theme.isNightMode?"/../images/check_selected.svg":"/../images/check_hover.svg"}); + } + } + } + + &:checked { + &:after { + content: url('/../images/check_selected.svg'); + } + } +`,eZ1=function(e){let{className:t,task:a}=e,[n]=(0,cs.D)(eZX);return ev.createElement(eZ0,{className:t,checked:a.completed,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=(0,ld.Z)(),l=!a.completed;n({variables:{input:{clientMutationId:t,nodeIds:[a.node_id],projectId:a.document_id,completed:l}},optimisticResponse:{__typename:"Mutation",projectNodesCompletionUpdate:{__typename:"ProjectNodesCompletionUpdatePayload",clientMutationId:t,tasks:[{...a,completed:l}]}}})}})},eZ2=eL.default.div.withConfig({displayName:"TaskItem__Container",componentId:"sc-674aeeec-0"})` + display: flex; + flex-direction: column; + padding: 5px 22px 5px 56px; + + :hover { + background: ${e=>e.theme.appColors.hex(80)}; + } + + @media (min-width: 768px) { + padding: 5px 32px 5px 66px; + } +`,eZ5=eL.default.div.withConfig({displayName:"TaskItem__Content",componentId:"sc-674aeeec-1"})` + display: flex; + + & > *:first-child { + margin-right: 10px; + } +`,eZ3=eL.default.span.withConfig({displayName:"TaskItem__Text",componentId:"sc-674aeeec-2"})` + display: flex; + align-items: baseline; + color: ${e=>e.completed||e.emptyTask?e.theme.textColors.hex(50):e.theme.textColors.hex(10)}; + text-decoration: ${e=>e.completed?"line-through":"default"}; + text-decoration-color: ${e=>e.theme.textColors.hex(50)}; + min-height: 24px; + word-break: break-word; +`,eZ4=eL.default.div.withConfig({displayName:"TaskItem__Action",componentId:"sc-674aeeec-3"})` + display: flex; + margin-left: 30px; + + & span { + color: ${e=>e.$completed?e.theme.textColors.hex(50):""}; + } + & img { + -webkit-filter: ${e=>e.$completed?"grayscale(1)":""}; + filter: ${e=>e.$completed?"grayscale(1)":""}; + } + + & > div { + background: ${e=>e.$completed?"none":e.theme.appColors.hex(90)}; + border-color: ${e=>e.$completed?e.theme.appColors.hex(80):e.theme.appColors.hex(70)}; + color: ${e=>e.$completed?e.theme.appColors.hex(50):""}; + & svg { + color: ${e=>e.$completed?e.theme.appColors.hex(60):""}; + } + } +`,eZ6=(0,eL.default)(eZH).withConfig({displayName:"TaskItem__Metadata",componentId:"sc-674aeeec-4"})` + margin-left: 5px; + padding: 0 8px 0 4px; + & > a { + display: flex; + align-items: center; + margin-left: 0; + color: ${e=>e.theme.textColors.hex(10)}; + &:hover { + color: ${e=>e.theme.textColors.hex(50)}; + } + + & > div:first-of-type { + transform: var(--menu-item-icon-scale); + margin-right: 4px; + } + & > svg:first-of-type { + transform: var(--menu-item-icon-scale); + margin-right: 2px; + } + } +`,eZ8=(0,eL.default)(tn.Icon).attrs({icon:"dd_caret"}).withConfig({displayName:"TaskItem__StyledCaretIcon",componentId:"sc-674aeeec-5"})` + color: ${e=>e.theme.textColors.hex(40)}; +`,eZ7=function(e){let{fromParam:t,task:a}=e,n=a.document_id,l=a.node_id,r=a.document??null,o=a.document?.space??null,i=a.document?.space?.color,s=(0,ev.useMemo)(()=>null==i?void 0:{primaryColor:i},[i]);return ev.createElement(sC.rU,{to:{pathname:`/d/${n}`,hash:`#node-${l}`,search:null!=t?`?from=${t}`:void 0}},ev.createElement(eI.ThemeProvider,{theme:s},ev.createElement(eZ2,{className:"task-item"},ev.createElement(eZ5,null,ev.createElement(eZ1,{task:a}),ev.createElement(eZ3,{completed:a.completed,emptyTask:!a.text_string},!a.text_string&&"Untitled",a.text_string&&a.delta?.ops?.map(e=>ev.createElement(eZJ,e.attributes,ev.createElement(Pa,{value:e.insert??""}))))),ev.createElement(eZ4,{$completed:a.completed},ev.createElement(eZQ,{task:a}),null!=a.assignees&&!(0,eq.isEmpty)(a.assignees)&&ev.createElement(eZY,{assignees:a.assignees}),ev.createElement(eZ6,null,null!=o&&ev.createElement(sC.rU,{to:{pathname:`/spaces/${o.id}`}},o.preferences?.avatars_v2==null&&ev.createElement(e1.SpaceAvatar,{size:"xs",name:o.name}),o.preferences?.avatars_v2?.__typename==="SpaceAvatarsV2Emoji"&&ev.createElement(e1.SpaceAvatar,{size:"xs",name:o.preferences.avatars_v2.emoji}),o.preferences?.avatars_v2?.__typename==="SpaceAvatarsV2Custom"&&ev.createElement(e1.SpaceAvatar,{size:"xs",src:o.preferences?.avatars_v2.small?.hdpi?.url}),ev.createElement(eZq,null,o.name),ev.createElement(eZ8,null)),null!=r&&ev.createElement(sC.rU,{to:{pathname:`/d/${n}`}},r.shared_preferences?.avatar?.value??ev.createElement(tn.Icon,{icon:"dd_project"}),ev.createElement(eZq,null,r.info.title||"Untitled")))))))},eZ9=function(e){let{fromParam:t,sortBy:a,taskConnection:n,isFolded:l,onFoldToggle:r}=e,o=eZO[a],i=n?.edges;if(null==i)return null;let s=i.filter(e=>null!=e.node.document);return 0===s.length?null:ev.createElement(eZU,null,ev.createElement(eZZ,{onClick:r},ev.createElement("div",{className:"heading-row"},ev.createElement(eZV,{isFolded:l}),ev.createElement(eY.Z,o),ev.createElement(eZL,null,s.length?.toString())),ev.createElement(eZz,null)),!l&&s.map(e=>{let{node:a}=e;return ev.createElement(eZ7,{key:a.id,task:a,fromParam:t})}))},eLe=(0,la.ZP)` + query SpaceTasksQuery( + $limit: Int! + $end: DateTimeDesc! + $start: DateTimeDesc! + $assignees: [String!] + $completed: Boolean! + $spaceIds: [String!] + $type: TaskFilteringType + ) { + pastDue: tasks( + last: $limit + filterby: { + dateRange: { end: $start } + assignees: $assignees + completed: $completed + spaceIds: $spaceIds + type: $type + } + ) { + totalCount + edges { + cursor + node { + id + document_id + document { + id + info + shared_preferences + } + assignees { + ...BasicUserFields + } + node_id + completed + text_string + end + start + is_recurring + line_number + delta + } + } + pageInfo { + hasNextPage + hasPreviousPage + endCursor + startCursor + } + } + today: tasks( + first: $limit + filterby: { + dateRange: { start: $start, end: $end } + assignees: $assignees + completed: $completed + spaceIds: $spaceIds + type: $type + } + ) { + totalCount + edges { + cursor + node { + id + document_id + document { + id + info + shared_preferences + } + assignees { + ...BasicUserFields + } + node_id + completed + is_recurring + line_number + text_string + end + start + delta + } + } + pageInfo { + hasNextPage + hasPreviousPage + endCursor + startCursor + } + } + upcoming: tasks( + first: $limit + filterby: { + dateRange: { start: $end } + assignees: $assignees + completed: $completed + spaceIds: $spaceIds + type: $type + } + ) { + totalCount + edges { + cursor + node { + id + document_id + document { + id + info + shared_preferences + } + assignees { + ...BasicUserFields + } + node_id + completed + text_string + end + start + is_recurring + line_number + delta + } + } + pageInfo { + hasNextPage + hasPreviousPage + endCursor + startCursor + } + } + noDate: tasks( + first: $limit + filterby: { + dateRange: null + assignees: $assignees + completed: $completed + spaceIds: $spaceIds + type: $type + } + ) { + totalCount + edges { + cursor + node { + id + document_id + document { + id + info + shared_preferences + } + assignees { + ...BasicUserFields + } + node_id + completed + text_string + is_recurring + line_number + delta + } + } + pageInfo { + hasNextPage + hasPreviousPage + endCursor + startCursor + } + } + } + ${up} +`,eLt=(0,la.ZP)` + fragment MembershipPreferencesFragment on Membership { + id + preferences { + tasks + } + } +`,eLa=(0,la.ZP)` + mutation SpaceTasksPreferencesUpdate($input: SpaceTasksPreferencesUpdateInput!) { + spaceTasksPreferencesUpdate(input: $input) { + clientMutationId + membership { + id + preferences { + tasks + } + } + } + } +`,eLn=eL.default.div.withConfig({displayName:"styled__BodyWrapper",componentId:"sc-c81f3a7a-0"})` + display: flex; + flex-direction: column; + flex: 1; +`,eLl=eL.default.div.withConfig({displayName:"styled__LoadingWrapper",componentId:"sc-c81f3a7a-1"})` + margin: 30px 0; +`,eLr=eL.default.div.withConfig({displayName:"styled__Text",componentId:"sc-c81f3a7a-2"})` + margin-left: 32px; + font-size: 12px; + color: ${e=>e.theme.textColors.hex(30)}; + text-transform: uppercase; +`,eLo=function(e){let{spaceId:t,spaceTasksPreferences:a}=e,n=(0,eK.Z)(),l=(0,eF.TH)(),r=(0,eF.k6)(),[o,i]=(0,ev.useState)(()=>{let e=new URLSearchParams(l.search);return a.filterAssignees??e.getAll("assignee")});(0,ev.useEffect)(()=>{let e=new URLSearchParams;for(let t of o)e.append("assignee",t);r.replace({pathname:l.pathname,search:e.toString()})},[r,o,l.pathname]);let{start:s,end:d}=(0,ev.useMemo)(()=>{let e=eG()().startOf("day"),t=e.clone().add(1,"day");return{start:{date:e.clone().locale("en").format("YYYY-MM-DD"),timezone:e.tz()},end:{date:t.clone().locale("en").format("YYYY-MM-DD"),timezone:t.tz()}}},[]),{data:c,error:m,loading:u}=(0,eB.a)(eLe,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",variables:{limit:9999,start:s,end:d,spaceIds:t?[t]:null,completed:!1,assignees:o}}),[p]=(0,cs.D)(eLa),g=a.fold?.["Past Due"]??!1,f=a.fold?.Today??!1,h=a.fold?.Upcoming??!1,y=a.fold?.["No Date"]??!1;(0,ev.useEffect)(()=>{i(new URLSearchParams(l.search).getAll("assignee"))},[l.search]),(0,ev.useEffect)(()=>{i(a.filterAssignees)},[a]);let b=(0,ev.useCallback)(e=>{tN()(function(){let a={filterAssignees:o,fold:{"Past Due":e.pastDue??g,Today:e.today??f,Upcoming:e.upcoming??h,"No Date":e.noDate??y}};p({variables:{input:{clientMutationId:(0,ld.Z)(),spaceId:t,preferences:a}},update:(e,t)=>{let a=t.data?.spaceTaskPreferencesUpdate?.membership;if(null==a)return;let n=e.readFragment({id:`Membership:${a.id}`,fragment:eLt});null!=n&&e.writeFragment({id:`Membership:${a.id}`,fragment:eLt,data:{...n,preferences:{...n.preferences,tasks:a.preferences.tasks}}})}})},20)()},[o,t,g,f,h,y,p]),v=(0,ev.useCallback)(()=>{b({pastDue:!g})},[b,g]),k=(0,ev.useCallback)(()=>{b({today:!f})},[b,f]),E=(0,ev.useCallback)(()=>{b({upcoming:!h})},[b,h]),x=(0,ev.useCallback)(()=>{b({noDate:!y})},[b,y]);if(u)return ev.createElement(eLl,null,ev.createElement(eI.Spinner,null));if(null!=m)return console.warn(m),er.Tb(m),ev.createElement(eLl,null,ev.createElement(eLr,null,"Something went wrong."));if(null==c){let e=Error("Space Task query should not return data that is null.");return console.warn(e),er.Tb(e),ev.createElement(eLl,null,ev.createElement(eLr,null,"Something went wrong."))}let{pastDue:_,today:w,upcoming:N,noDate:C}=c,M=_?.totalCount??0,S=M+(w?.totalCount??0)+(N?.totalCount??0)+(C?.totalCount??0),I="tasks";return ev.createElement(eLn,null,0===S&&ev.createElement(ePJ,{message:n.formatMessage({id:"general.there_are_no_tasks_to_display",defaultMessage:"There are no tasks to display."})}),null!=_&&_.totalCount>0&&ev.createElement(eZ9,{fromParam:I,sortBy:"Past Due",taskConnection:_,isFolded:g,onFoldToggle:v}),null!=w&&w.totalCount>0&&ev.createElement(eZ9,{fromParam:I,sortBy:"Today",taskConnection:w,isFolded:f,onFoldToggle:k}),null!=N&&N.totalCount>0&&ev.createElement(eZ9,{fromParam:I,sortBy:"Upcoming",taskConnection:N,isFolded:h,onFoldToggle:E}),null!=C&&C.totalCount>0&&ev.createElement(eZ9,{fromParam:I,sortBy:"No Date",taskConnection:C,isFolded:y,onFoldToggle:x}),S<=3&&ev.createElement(eUN,null,ev.createElement(eY.Z,{id:"general.space_tasks_description",defaultMessage:"\uD83D\uDCA1 Tasks with due dates or assignments will show up here. Manage your tasks across all your projects."})))},eLi=(0,la.ZP)` + query SpaceTasksPreferencesQuery($spaceId: ID!) { + membership(space_id: $spaceId) { + id + preferences { + tasks + } + } + } +`,eLs=function(e){let{spaceId:t}=e,{data:a,loading:n,error:l}=(0,eB.a)(eLi,{variables:{spaceId:t},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),r=(0,ev.useMemo)(()=>a?.membership?.preferences?.tasks??{filterAssignees:[],fold:{}},[a]);return ev.createElement(ev.Fragment,null,ev.createElement(eOl,{spaceID:t,isTasks:!0}),!n&&null==l&&ev.createElement(eLo,{spaceId:t,spaceTasksPreferences:r}))},eLd=(0,eL.default)(lT.NU).withConfig({displayName:"NewTemplateItem__StyledTemplateIcon",componentId:"sc-901d3afd-0"})` + > path { + stroke: #999; + } +`,eLc=eL.default.div.withConfig({displayName:"NewTemplateItem__Container",componentId:"sc-901d3afd-1"})` + display: flex; + flex-direction: row; + align-items: center; + padding: 14px 22px; + :hover { + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f8f8f8"}; + } + position: relative; + + @media (min-width: 768px) { + padding: 14px 32px; + } +`,eLm=eL.default.div.withConfig({displayName:"NewTemplateItem__ProjectIcon",componentId:"sc-901d3afd-2"})` + display: flex; + width: 50px; + height: 50px; + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1); + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + margin-right: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; +`,eLu=eL.default.div.withConfig({displayName:"NewTemplateItem__ContentWrapper",componentId:"sc-901d3afd-3"})` + display: flex; + flex: 1; + flex-direction: column; + align-items: flex-start; + justify-content: center; +`,eLp=eL.default.div.withConfig({displayName:"NewTemplateItem__Top",componentId:"sc-901d3afd-4"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; +`,eLg=eL.default.span.withConfig({displayName:"NewTemplateItem__Title",componentId:"sc-901d3afd-5"})` + display: flex; + font-size: 17px; + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eLf=function(e){let{membership:t}=e,a=Eu({role:t.role,action:"create_template"}),n=`/spaces/${t.space.id}/new/template`;return a?ev.createElement(sC.rU,{to:n},ev.createElement(eLc,null,ev.createElement(eLm,null,ev.createElement(eLd,null)),ev.createElement(eLu,null,ev.createElement(eLp,null,ev.createElement(eLg,null,ev.createElement(eY.Z,{id:"general.create_template",defaultMessage:"Create a template"})))))):null},eLh=eL.default.div.withConfig({displayName:"TemplateGrid__Grid",componentId:"sc-15b1db98-0"})` + display: inline-flex; + flex-wrap: wrap; + margin-bottom: 25px; + gap: 1rem; +`,eLy=function(e){let{basePath:t,tab:a}=e,n=(0,e$.useDispatch)();return ev.createElement(eLh,null,"project"===a&&ev.createElement(ev.Fragment,null,ev.createElement(eUw,null,ev.createElement(sC.rU,{to:`${t}`},ev.createElement(eU_,null,ev.createElement(tn.Icon,{icon:"dd_project"}))),ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.start_blank",defaultMessage:"Start Blank"}))),ev.createElement(eUw,null,ev.createElement(eU_,{onClick:()=>{n(NU())}},ev.createElement(tn.Icon,{icon:"dd_import"})),ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.import",defaultMessage:"Import"})))),"template"===a&&ev.createElement(eUw,null,ev.createElement(sC.rU,{to:`${t}`},ev.createElement(eU_,null,ev.createElement(tn.Icon,{icon:"dd_new"}))),ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.create_a_template",defaultMessage:"Create a template"}))),ev.createElement(eUw,null,ev.createElement(sC.rU,{to:"/templates",target:"_blank",rel:"noopener noreferrer"},ev.createElement(eU_,null,ev.createElement(tn.Icon,{icon:"dd_browsetemplates"}))),ev.createElement("div",null,ev.createElement(eY.Z,{id:"general.browse_templates",defaultMessage:"Browse templates"}))))},eLb=eL.default.div.withConfig({displayName:"TemplateEmptyState__Wrapper",componentId:"sc-e54ba5a8-0"})` + display: flex; + flex-direction: column; + align-items: flex-start; + flex: 1; + text-align: left; + padding: 0 32px; + ${e1.UiTypography.sm}; +`,eLv=function(e){let{spaceId:t,role:a}=e,n=`/spaces/${t}/new/template`,l=Eu({role:a,action:"create_template"});return ev.createElement(eLb,null,l&&ev.createElement(ev.Fragment,null,ev.createElement(eUx,null,ev.createElement(eY.Z,{id:"general.create_a_template",defaultMessage:"Create a template"})),ev.createElement(eLy,{basePath:n,tab:"template"})))},eLk=function(e){let{documentStatus:t,location:a,space:n,history:l,match:r}=e,o=(0,eK.Z)(),{search:i}=a,{id:s}=n,d=T_((0,eI.useTheme)()),c=(0,ev.useMemo)(()=>pU(s,t,i,null,null),[t,i,s]),m=(0,ev.useMemo)(()=>({query:pP,variables:c}),[c]),{data:u,loading:p,error:g}=(0,eB.a)(pP,{variables:c,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"});if(p)return ev.createElement(eI.Spinner,{height:319});if(null!=g||t!==iM)return ev.createElement(efB,{message:"There was a problem loading your projects."});let f=u?.membership,h=u?.membership?.role??null,y=u?.membership?.space?.documents_v2?.edges??[],b=u?.membership?.space?.documents_v2?.totalCount??0;return ev.createElement(ev.Fragment,null,b>0&&null!=f&&ev.createElement(eLf,{membership:f}),0===b&&eUZ(c)&&ev.createElement(ePJ,{message:o.formatMessage({id:"general.no_filtered_templates",defaultMessage:"There are no projects to be shown for the chosen filter."})}),0===b&&ev.createElement(eLv,{role:h,spaceId:s}),y.length>0&&ev.createElement(eUg,{history:l,location:a,match:r,membership:f}),ev.createElement("div",{className:"mb-5",style:d},y.map(e=>{let{node:t}=e;return null==t?null:ev.createElement(eUU,{spaceQuery:m,key:t.id,spaceID:s,document:t})})),ev.createElement(eNH,{pathname:a.pathname,search:a.search,hash:a.hash,totalCount:b,itemPerPage:20}))},eLE=eL.default.div.withConfig({displayName:"Space__AccessContainer",componentId:"sc-3c967ed3-0"})` + display: flex; + flex-direction: column; + padding: 16px 0; + overflow-y: scroll; + ${tS} +`,eLx=eL.default.h1.withConfig({displayName:"Space__AccessTitle",componentId:"sc-3c967ed3-1"})` + ${e1.UiTypography.sm}; + color: ${e=>e.theme.appColors.hex(10)}; + margin-bottom: 2px; +`,eL_=eL.default.p.withConfig({displayName:"Space__AccessDescription",componentId:"sc-3c967ed3-2"})` + color: ${e=>e.theme.appColors.hex(50)}; + ${e1.UiTypography.sm}; + padding: 0; + margin: 0; +`,eLw=function(e){let{location:t,match:a}=e,n=(0,eF.k6)(),{pathname:l}=(0,eF.TH)(),r=a.params.subspaceID||a.params.spaceID,{data:o,loading:i}=(0,eB.a)(ep6,{variables:{spaceID:r}}),s=o?.membership,d=s?.space,c=d?.memberships,m=d?.parent_membership,u=ev.useMemo(()=>c?.map(e=>e.user)??[],[c]),p=ev.useMemo(()=>({primaryColor:d?.color}),[d]);return(ev.useEffect(()=>{if(!i&&null!=d){if(null==m&&d.is_subspace){let e=`/subspaces/${d.id}`;if(!l.includes(e)){let t=l.split(d.id),a=t.length>1?t.pop():"";n.replace(`${e}${a}`)}return}if(null!=m&&d.is_subspace){let e=`/spaces/${m.space.id}/subspaces/${d.id}`;if(!l.includes(e)){let t=l.split(d.id),a=t.length>1?t.pop():"";n.replace(`${e}${a}`)}}}},[i,d,m,n,l]),i)?ev.createElement(eI.Spinner,{height:319}):null==s?ev.createElement(eLE,null,ev.createElement(eLx,null,ev.createElement(eY.Z,{id:"general.no_workspace_access",defaultMessage:"You do not have access to this workspace"})),ev.createElement(eL_,null,ev.createElement(eY.Z,{id:"general.no_workspace_access_description",defaultMessage:"To get access, you must be invited by a workspace member."}))):ev.createElement(eI.ThemeProvider,{theme:p},ev.createElement(ejz,{location:t,spaceID:r}),ev.createElement(eT.ql,{title:`${d.name} - Taskade`}),ev.createElement(ejb,{space:d,users:u,role:s.role}),ev.createElement(eOx,{space:d,role:s.role}),ev.createElement(eRP,{spaceID:d.id}),ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:"/spaces/:spaceID/subspaces/:subspaceID?",render:e=>ev.createElement(ev.Fragment,null,ev.createElement(eOl,{...e,documentStatus:de,spaceID:d.id}),ev.createElement(eZw,{...e,documentStatus:de,space:d,membership:s}))}),ev.createElement(eF.AW,{exact:!0,path:"/:type(spaces|subspaces)/:spaceID",render:e=>ev.createElement(ev.Fragment,null,ev.createElement(eOl,{...e,documentStatus:de,spaceID:d.id}),ev.createElement(eZw,{...e,documentStatus:de,space:d,membership:s}))}),ev.createElement(eF.AW,{path:"/spaces/:spaceID/subspaces/:subspaceID/:documentType(templates)",render:e=>ev.createElement(ev.Fragment,null,ev.createElement(eOl,{...e,documentStatus:da,spaceID:d.id}),ev.createElement(eLk,{...e,documentStatus:da,space:d,membership:s}))}),ev.createElement(eF.AW,{path:"/:type(spaces|subspaces)/:spaceID/:documentType(templates)",render:e=>ev.createElement(ev.Fragment,null,ev.createElement(eOl,{...e,documentStatus:da,spaceID:d.id}),ev.createElement(eLk,{...e,documentStatus:da,space:d,membership:s}))}),ev.createElement(eF.AW,{path:"/spaces/:spaceID/subspaces/:subspaceID/:documentType(archive)",render:e=>ev.createElement(ev.Fragment,null,ev.createElement(eOl,{...e,spaceID:d.id,documentStatus:dt}),ev.createElement(eZw,{...e,documentStatus:dt,space:d,membership:s}))}),ev.createElement(eF.AW,{path:"/:type(spaces|subspaces)/:spaceID/:documentType(archive)",render:e=>ev.createElement(ev.Fragment,null,ev.createElement(eOl,{...e,spaceID:d.id,documentStatus:dt}),ev.createElement(eZw,{...e,documentStatus:dt,space:d,membership:s}))}),ev.createElement(eF.AW,{path:"/spaces/:spaceID/subspaces/:subspaceID/tasks",render:e=>ev.createElement(eLs,{...e,spaceId:r})}),ev.createElement(eF.AW,{path:"/:type(spaces|subspaces)/:spaceID/tasks",render:e=>ev.createElement(eLs,{...e,spaceId:r})}),ev.createElement(eF.AW,{path:"/spaces/:spaceID/subspaces/:subspaceID/roadmap",render:e=>ev.createElement(eZj,{...e,documentStatus:de,space:d})}),ev.createElement(eF.AW,{path:"/:type(spaces|subspaces)/:spaceID/roadmap",render:e=>ev.createElement(eZj,{...e,documentStatus:de,space:d})}),ev.createElement(eF.AW,{path:"/:type(spaces|subspaces)/:spaceID/media",render:e=>ev.createElement(eO3,{...e,space:d,membership:s})}),ev.createElement(eF.AW,{path:"/spaces/:spaceID/subspaces/:subspaceID/media",render:e=>ev.createElement(eO3,{...e,space:d,membership:s})}),ev.createElement(eF.AW,{path:"/:type(spaces|subspaces)/:spaceID/agents",render:e=>ev.createElement(eOO,{...e,space:d,membership:s})}),ev.createElement(eF.AW,{path:"/spaces/:spaceID/subspaces/:subspaceID/agents",render:e=>ev.createElement(eOO,{...e,space:d,membership:s})}),ev.createElement(eF.AW,{path:["/:type(spaces|subspaces)/:spaceID/flows","/spaces/:spaceID/subspaces/:subspaceID/flows"],render:e=>ev.createElement(eOK,{...e,space:d,membership:s})})),s&&ev.createElement(eR$,{membership:s}))},eLN={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SubspaceJoinMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SubspaceJoinInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"subspaceJoin"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientMutationId"}},{kind:"Field",name:{kind:"Name",value:"membership"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"space"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"is_subspace"}},{kind:"Field",name:{kind:"Name",value:"is_trial"}},{kind:"Field",name:{kind:"Name",value:"is_unread"}},{kind:"Field",name:{kind:"Name",value:"preferences"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"trialEndedAt"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Emoji"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emoji"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SpaceAvatarsV2Custom"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"size"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},eLC=function(){let[e]=(0,cs.D)(eLN),t=(0,eF.k6)(),a=(0,eF.TH)(),[n,l]=ev.useState(!1),r=(0,eF.LX)(a.pathname,{path:eZ.subspaceJoin,exact:!0}),o=r?.params.spaceID,i=r?.params.subspaceID;return(ev.useEffect(()=>{let a=(0,ld.Z)();(async()=>{if(null==o||null==i){l("There was an error joining the folder. Please try again.");return}try{let n=await e({variables:{input:{clientMutationId:a,subspaceId:i}},update:(e,t)=>{let{data:a}=t;if(null==a)return;let n=a?.subspaceJoin,l=lg(!1,o),r=e.readQuery({query:lu,variables:l}),s=r?.memberships?.edges.find(e=>e.node.space.id===i);null!=r&&null==s&&n?.membership!=null&&e.writeQuery({query:lu,variables:l,data:(0,es.ZP)(r,e=>{if(null!=e.memberships){e.memberships.totalCount+=1;let t=e.memberships?.edges??[];e.memberships.edges=[...t,{node:n.membership,__typename:"MembershipEdge",cursor:`${e.memberships.edges.length+1}`}]}return e})});let d={spaceID:o,first:100,filterby:{archived:!1,hasMembership:!1,visibility:"public"}},c=e.readQuery({query:kg,variables:d});null!=c&&e.writeQuery({query:kg,variables:d,data:(0,es.ZP)(c,e=>{if(e.membership?.space.folders.edges!=null){let t=c?.membership?.space.folders.edges??[];e.membership.space.folders.edges=t.filter(e=>e.node.id!==i)}return e.membership?.space.folders.totalCount!=null&&(e.membership.space.folders.totalCount-=1),e})})}});n.data?.subspaceJoin.membership.id!=null?t.push(`/spaces/${o}/subspaces/${i}`):l("There was an error joining the folder. Please try again.")}catch(e){l((0,ei.getMessageFromError)(bH(e,["subspaceJoin"])??e)??"There was an error joining the folder. Please try again.")}})()},[]),n)?ev.createElement(efB,{message:n}):ev.createElement(eI.Spinner,{height:319})},eLM=function(e){let t=ev.useRef(null),{props:a}=(0,eI.useMenuItem)({stopRef:t,name:e.name});return ev.createElement("button",{...a,type:"button",className:e.className},e.children)},eLS=function(e){let{documentID:t,isStarred:a,handleMouseHover:n}=e,l=(0,ll.x)(),r=ev.useRef(null),o=ev.useRef(null),[i,s]=ev.useReducer(eI.popupReducer,{expanded:!1,initialFocus:"first"}),d=(0,eI.usePopup)({referenceElementRef:r,popupElementRef:o,state:i,placement:"bottom-start"}),c=ev.useCallback(()=>{n(!1)},[n]);(0,eI.usePopupEvents)({state:i,onCollapse:c});let m=(0,eI.useMenuButton)({ref:r,state:i,dispatch:s}),u=ev.useCallback(e=>{if("Activate"===e.type){let{name:a}=e.payload;switch(a){case"star":l.mutate({mutation:Mx,optimisticResponse:{__typename:"Mutation",starDocument:{__typename:"Document",id:t,starred_at:new Date().toString()}},variables:{id:t,starred:!0}});break;case"unstar":l.mutate({mutation:Mx,optimisticResponse:{__typename:"Mutation",starDocument:{__typename:"Document",id:t,starred_at:null}},variables:{id:t,starred:!1}})}s({type:"Collapse"})}},[l,t]);return ev.createElement(ev.Fragment,null,ev.createElement("button",{...m.props,className:"ml-1.5 h-10 w-10 cursor-pointer rounded-lg border-none bg-none text-appcolor-500 shadow-none outline-none hover:bg-appcolor-300 focus:outline-none",onClick:e=>{m.props.onClick(e),e.preventDefault(),e.stopPropagation()}},ev.createElement(tn.Icon,{icon:"header_more"})),i.expanded&&ev.createElement(eI.Popup,{...d.props,dispatch:s,modal:!0},ev.createElement(eI.MenuGroupContext.Provider,{value:u},ev.createElement(eI.Menu,{className:"flex min-w-55 flex-col rounded-lg border border-appcolor-300 bg-appcolor-0 py-3 shadow"},a?ev.createElement(eLM,{className:"flex w-full max-w-[15rem] items-center p-[var(--menu-item-padding)] text-sm text-textcolor-900 hover:bg-appcolor-300",name:"unstar"},ev.createElement(tn.Icon,{icon:"dd_star",className:"transform-[var(--menu-item-icon-scale)] mr-[var(--menu-item-gap)]"}),ev.createElement(eY.Z,{id:"general.unstar",defaultMessage:"Unstar"})):ev.createElement(eLM,{className:"flex w-full max-w-[15rem] items-center p-[var(--menu-item-padding)] text-sm text-textcolor-900 hover:bg-appcolor-300",name:"star"},ev.createElement(tn.Icon,{icon:"dd_star",className:"transform-[var(--menu-item-icon-scale)] mr-[var(--menu-item-gap)]"}),ev.createElement(eY.Z,{id:"general.star",defaultMessage:"Star"}))))))},eLI=(0,eL.default)(lT.hA).withConfig({displayName:"ProjectItem__StyledStarIcon",componentId:"sc-2f081f2-0"})` + height: 20px; + width: 20px; + + > path { + fill: #f2d750; + } +`,eLD=(0,eL.default)(lT.mq).withConfig({displayName:"ProjectItem__StyledProjectIcon",componentId:"sc-2f081f2-1"})` + color: ${e=>e.theme.appColors.hex(50)}; +`,eLT=eL.default.div.withConfig({displayName:"ProjectItem__Container",componentId:"sc-2f081f2-2"})` + display: flex; + flex-direction: row; + align-items: center; + padding: 14px 22px; + :hover { + background: ${e=>e.theme.isNightMode?"#1C1F21":"#f8f8f8"}; + } + position: relative; + + @media (min-width: 768px) { + padding: 14px 32px; + } +`,eL$=eL.default.div.withConfig({displayName:"ProjectItem__ProjectIcon",componentId:"sc-2f081f2-3"})` + display: flex; + flex-shrink: 0; + width: 50px; + height: 50px; + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1); + border-radius: 10px; + background: ${e=>e.theme.appColors.hex(100)}; + margin-right: 20px; + align-items: center; + justify-content: center; + align-self: flex-start; + + & > span { + font-size: 26px; + } +`,eLP=eL.default.div.withConfig({displayName:"ProjectItem__ContentWrapper",componentId:"sc-2f081f2-4"})` + display: flex; + flex: 1; + flex-direction: column; + align-items: flex-start; + justify-content: center; +`,eLF=eL.default.div.withConfig({displayName:"ProjectItem__Top",componentId:"sc-2f081f2-5"})` + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; + padding-top: 2px; +`,eLA=eL.default.span.withConfig({displayName:"ProjectItem__Title",componentId:"sc-2f081f2-6"})` + font-size: 17px; + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; + color: ${e=>e.theme.isNightMode?"#e5e5e5":"#333333"}; +`,eLR=eL.default.div.withConfig({displayName:"ProjectItem__StarIconWrapper",componentId:"sc-2f081f2-7"})` + display: flex; + margin-left: 5px; +`,eLj=eL.default.div.withConfig({displayName:"ProjectItem__ActionWrapper",componentId:"sc-2f081f2-8"})` + display: flex; + flex-basis: 150px; + justify-content: flex-end; +`,eLO=eL.default.div.withConfig({displayName:"ProjectItem__BottomWrapper",componentId:"sc-2f081f2-9"})` + display: inherit; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + margin: 6px 0 0; + + span { + margin: 0; + } +`,eLU=function(e){let{document:t}=e,{space:a,info:n}=t,{stats:l}=n,r=l?.completedCount??0,o=l?.totalCount??0,i=nQ(t),[s,d]=(0,ev.useState)(!1),c=a?.color,m=(0,ev.useMemo)(()=>null==c?void 0:{primaryColor:c},[c]),u=null==n.title||ts()(n.title)?"Untitled":n.title,p=cc()(t.updated_at).fromNow(),g=e=>{d(e)};return ev.createElement(eI.ThemeProvider,{theme:m},ev.createElement(sC.rU,{to:{pathname:`/d/${t.id}`,search:"?from=starred"},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1)},ev.createElement(eLT,null,t.is_unread&&ev.createElement(eP6,{style:{position:"absolute",left:"12px",top:"36px"}}),ev.createElement(eL$,null,null!=i?ev.createElement("span",null,i):ev.createElement(eLD,null)),ev.createElement(eLP,null,ev.createElement(eLF,null,ev.createElement(eLA,null,u),null!=t.starred_at&&ev.createElement(eLR,null,ev.createElement(eLI,null))),ev.createElement(eLO,null,ev.createElement(eP4,{spaceName:a?.name,updatedBy:n.updatedBy,updatedFromNow:p}))),ev.createElement(eLj,null,s?ev.createElement(eLS,{documentID:t.id,isStarred:null!=t.starred_at,handleMouseHover:g}):ev.createElement(pl,{percentCompleted:o>0?r/o*100:0})))))},eLZ=eL.default.div.withConfig({displayName:"StarredListEmptyState__Wrapper",componentId:"sc-bdca85b5-0"})` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; + max-width: 664px; + margin: 0 auto; + font-size: 14px; + text-align: center; + height: 100%; + padding: 32px 32px 160px 32px; + + @media (max-width: 768px) { + max-width: 540px; + padding-bottom: 100px; + } + + @media (max-width: 480px) { + max-width: 100%; + padding-bottom: 100px; + } +`,eLL=eL.default.h4.withConfig({displayName:"StarredListEmptyState__Heading",componentId:"sc-bdca85b5-1"})` + ${e1.ArticleTypography.heading4} + font-weight: 500; + color: ${e=>e.theme.textColors.hex(0)}; + margin-bottom: 8px; +`,eLB=eL.default.p.withConfig({displayName:"StarredListEmptyState__Description",componentId:"sc-bdca85b5-2"})` + ${e1.UiTypography.md} + line-height: 22px; + color: ${e=>e.theme.textColors.hex(50)}; + margin: 0 0 16px; +`,eLz=eL.default.div.withConfig({displayName:"StarredListEmptyState__EmptyImageWrapper",componentId:"sc-bdca85b5-3"})` + margin-bottom: 24px; + opacity: 40%; + opacity: ${e=>e.theme.isNightMode?"40%":"50%"}; +`,eLV=function(e){let{heading:t,description:a,hideIcon:n}=e;return ev.createElement(eLZ,null,ev.createElement(eLz,null,!n&&ev.createElement(lT.L8,null)),ev.createElement(eLL,null,t),ev.createElement(eLB,null,a))},eLq=function(e){let{location:t}=e,{search:a}=t,n=egi(a,20),{data:l,loading:r,error:o}=(0,eB.a)(egr,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",variables:n}),i=(0,eK.Z)(),s=ev.createElement(ePJ,{message:i.formatMessage({id:"general.starred_projects_error_loading",defaultMessage:"There is an error loading starred projects. Please try again later"}),hideIcon:!0});if(r)return ev.createElement(eI.Spinner,{height:319});if(null!=o)return s;let d=l?.starredProjects;if(null==d)return s;let{edges:c,totalCount:m}=d;return null==c?s:0===m?ev.createElement(ev.Fragment,null,ev.createElement(eLV,{heading:i.formatMessage({id:"general.empty_state_starred_projects",defaultMessage:"There are no starred projects"}),description:i.formatMessage({id:"general.empty_state_starred_projects_description",defaultMessage:"Any projects you star will show up here."})})):ev.createElement(ev.Fragment,null,(0,eo.compactMap)(c,e=>{let t=e.node;if(null!=t)return ev.createElement(eLU,{key:t.id,document:t})}),ev.createElement(eNH,{pathname:t.pathname,search:t.search,hash:t.hash,totalCount:m,itemPerPage:20}))},eLW=function(e){let{location:t}=e;return ev.createElement(ev.Fragment,null,ev.createElement(ex5,null),ev.createElement(eT.ql,{title:"Starred - Taskade"}),ev.createElement(eD6,null),ev.createElement(eLq,{location:t}))},eLH=(0,e$.connect)(function(e){return{user:t7(e),rightSidebarIsOpen:e.session.rightSidebarIsOpen}}),eLG=function(e){return ev.createElement("div",{className:"flex h-screen"},ev.createElement(ex5,null),ev.createElement(efN,null),ev.createElement(eD_,null,ev.createElement(eF.rs,null,ev.createElement(eF.AW,{path:eZ.spaceSettings,component:ejE}),ev.createElement(eF.AW,{exact:!0,path:eZ.subspaceJoin,component:eLC}),ev.createElement(eF.AW,{path:eZ.spaceIndex,component:eLw}),ev.createElement(eF.AW,{path:eZ.activityIndex,component:eDz}),ev.createElement(eF.AW,{path:eZ.recentIndex,component:eFd}),ev.createElement(eF.AW,{path:"/shared",component:ejB}),ev.createElement(eF.AW,{exact:!0,path:eZ.starredIndex,component:eLW}),ev.createElement(eF.AW,{exact:!0,path:eZ.myTasks,component:ePW}),ev.createElement(eF.AW,{exact:!0,path:"/search",component:eAb}),ev.createElement(eF.AW,{exact:!0,path:"/calendar",component:e$b}))),e.rightSidebarIsOpen&&ev.createElement(eDK,null))},eLK=eLH(function(e){return null==e.user?ev.createElement(eF.l_,{to:"/login"}):ev.createElement(eLG,e)}),eLY=()=>ev.createElement(_Q,null,ev.createElement(eF.rs,null,ev.createElement(eF.AW,{exact:!0,path:"/",component:evK}),ev.createElement(eF.AW,{exact:!0,path:eZ.editor,component:efz}),ev.createElement(eF.AW,{exact:!0,path:eZ.inboxNewList,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.inboxNewListFromDocumentID,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.inboxNewListWithDocumentType,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewTemplate,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewList,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewTemplateFromDocumentID,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewListFromDocumentID,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewTemplateWithDocumentType,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.spaceNewListWithDocumentType,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.newTemplate,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.newList,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.newTemplateFromDocumentID,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.newListFromDocumentID,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.newTemplateWithDocumentType,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.newListWithDocumentType,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.signIn,component:wR}),ev.createElement(eF.AW,{exact:!0,path:eZ.mfaAuthenticate,component:wf}),ev.createElement(eF.AW,{exact:!0,path:eZ.signUp,component:wO}),ev.createElement(eF.AW,{exact:!0,path:eZ.verifyEmail,component:wR}),ev.createElement(eF.AW,{exact:!0,path:"/forgot",component:wQ}),ev.createElement(eF.AW,{exact:!0,path:eZ.resetPassword,component:wv}),ev.createElement(eF.AW,{path:eZ.recentIndex,component:eLK}),ev.createElement(eF.AW,{path:eZ.activityIndex,component:eLK}),ev.createElement(eF.AW,{path:eZ.myTasks,component:eLK}),ev.createElement(eF.AW,{path:"/(spaces|subspaces|shared|lists)",component:eLK}),ev.createElement(eF.AW,{exact:!0,path:"/search",component:eLK}),ev.createElement(eF.AW,{exact:!0,path:eZ.document,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.embed,component:efL}),ev.createElement(eF.AW,{exact:!0,path:eZ.ssoDesktop,component:w5}),ev.createElement(eF.AW,{exact:!0,path:eZ.ssoMobile,component:w3}),ev.createElement(eF.AW,{exact:!0,path:eZ.print,component:eho}),ev.createElement(eF.AW,{path:"/onboarding",component:exM}),ev.createElement(eF.AW,{path:"/getting-started",component:evH}),ev.createElement(eF.AW,{path:"/calendar",component:eLK}),ev.createElement(eF.AW,{path:"/settings",component:eDx}),ev.createElement(eF.AW,{path:eZ.appSumoWelcome,component:wK}),ev.createElement(eF.AW,{path:"/oauth2/authorize",component:eki}),ev.createElement(eF.AW,{path:"/saml/sso",component:ex2}),ev.createElement(eF.AW,{path:"/invitations/:token",component:Np}),ev.createElement(eF.AW,{exact:!0,path:"/p/:publicDocumentId",component:ehY}),ev.createElement(eF.AW,{exact:!0,path:"/a/:publicSpaceAgentIdWithSlug",component:exq}),ev.createElement(eP.lt,{path:"/f/:flowId",component:evq}))),eLQ=(0,la.ZP)` + subscription MeUpdatedSubscription { + meUpdated { + id + locale + preferences { + isNightMode + } + } + } +`,eLJ=function(){return(0,eDp.m)(eLQ),null},eLX=function(e){let{children:t}=e,a=(0,eF.TH)(),n=a?.search,l=ev.useMemo(()=>new URLSearchParams(n),[n]).get("theme"),r=ev.useMemo(()=>"light"===l?"light":"dark"===l?"dark":void 0,[l]),{data:o}=(0,eB.a)(sN),i=o?.me?.preferences.isNightMode,s=ev.useMemo(()=>"boolean"==typeof i?i?"dark":"light":null===i?"no-preference":void 0,[i]),d=r||s||"dark",[c,m]=ev.useState(()=>"dark"===d);ev.useEffect(()=>{if("dark"===d)m(!0);else if("light"===d)m(!1);else{let e=window.matchMedia("(prefers-color-scheme: dark)");m(e.matches);let t=e=>{m(e.matches)};return"function"==typeof e.addEventListener&&e.addEventListener("change",t),()=>{"function"==typeof e.removeEventListener&&e.removeEventListener("change",t)}}},[d]),ev.useEffect(()=>{c?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[c]);let u=ev.useMemo(()=>({isNightMode:c,primaryColor:eI.Colors.BRAND,breakpoints:{xs:0,sm:576,md:768,lg:992,xl:1200}}),[c]);return ev.createElement(eI.ThemeProvider,{theme:u},t)};var eL0=a(29558);let eL1=function(e){let{getAgentLocale:t,children:n}=e,l=function(e){let[t,a]=(0,ev.useState)(e);return(0,ev.useEffect)(()=>{let t=()=>{a(e())};return window.addEventListener("languagechange",t),()=>{window.removeEventListener("languagechange",t)}},[e]),t}(t),r=(0,eB.a)(sW),[o,i]=(0,cs.D)(e_l),s=r.data?.me??null,d=s?.id??null,c=s?.locale??l??"en-US",m=s?.timezone??null,u=s?.preferences.dayOfWeek??null,p=s?.preferences.timeFormat??null,g=(0,e$.useDispatch)(),[f,h]=ev.useState({}),y=ev.useMemo(()=>(0,sX.getSupportedLanguage)(c)??"en-US",[c]);return ev.useEffect(()=>{(async function(){h(Object.fromEntries(Object.entries(await a(2352)(`./${y}/strings.json`)).map(e=>{let[t,a]=e;return[t,a.message]})))})()},[y]),(0,ev.useEffect)(()=>{let e=ewn(c);ewl(e),ewr(e,u,p)},[u,g,c,p]),(0,ev.useEffect)(()=>{ewo(m)},[m]),(0,ev.useEffect)(()=>{i.called||null==d||null!=m||o({variables:{input:{timezone:eG().tz.guess()}}})},[d,o,i.called,m]),ev.createElement(eL0.Z,{locale:c,messages:f,onError:()=>{}},n)};function eL2(e,t,a){let n=(0,eF.LX)(e,{path:t,exact:!0,strict:!1});if(null==n)return!1;let l=n.params;return null!=l&&(null==a||null!=l[a])}let eL5=ev.memo(function(){let e=(0,eF.TH)(),t=ev.useMemo(()=>{var t;return eL2(t=e.pathname,eZ.document,"documentID")?"Project":eL2(t,eZ.spaceNewList)?"Space Project Creation":eL2(t,eZ.spaceNewListFromDocumentID)?"Space Template Gallery":eL2(t,eZ.newList)?"Project Creation":eL2(t,eZ.newListFromDocumentID)?"Template Gallery":eL2(t,eZ.spaceIndex,"subspaceID")?"Folder":eL2(t,eZ.spaceIndex,"spaceID")?"Space":eL2(t,eZ.appSumoWelcome)?"AppSumo Welcome":eL2(t,eZ.settings)?"Settings":eL2(t,eZ.search)?"Search":eL2(t,eZ.signUp)?"Sign Up":eL2(t,eZ.signIn)?"Sign In":eL2(t,eZ.mfaAuthenticate)?"Multi-Factor Authentication":eL2(t,eZ.myTasks)?"My Tasks":eL2(t,eZ.calendarIndex)?"Calendar":eL2(t,"/onboarding")?"Onboarding":void 0},[e.pathname]);ev.useEffect(()=>{!function(){if(null==u$)try{let e=a(23067);e.load("1htnaSVfXkfbbK4fpLEsh4RcA8R","https://rudderstack.taskade.cloud"),u$=e}catch(n){uP+=1;let e=uA();if(((0,ei.getStatusCodeFromError)(n)??500)>=500)try{a(23067).reset(),uF+=1,er.n_({category:"analytics",message:"Reset Rudder Analytics"})}catch(e){uT(new ei.TaskadeError({message:"Failed to reset Rudder Analytics"},{cause:e}),uI)}let t=uA();uT(n,uI,{extras:{loadFailedCount:uP,resetCount:uF,prevCookie:e,currCookie:t}})}}()},[]);let{data:n,loading:l}=(0,eB.a)(sW),r=n?.me?.email,o=n?.me?.id,i=n?.me?.handle;ev.useEffect(()=>{l||(null!=o?(u$?.identify(o,{email:r,username:i}),"undefined"!=typeof profitwell&&profitwell("start",{user_email:r})):u$?.reset())},[r,l,o,i]);let s=ev.useRef("undefined"!=typeof document?document.referrer:""),d=ev.useMemo(()=>new URL(e.pathname+e.search,"https://www.taskade.com"),[e.pathname,e.search]);return ev.useEffect(()=>{let e=s.current,a={path:d.pathname,referrer:e,search:d.search,title:document.title,url:d.href,name:t},n=function(e){let t=tL.parse(e),a={};for(let[e,n]of Object.entries(t)){let t=e.toLowerCase();t.startsWith("utm_")&&("campaign"===(t=t.substr(4))&&(t="name"),null!=n&&(a[t]=n))}if(!ts()(a))return a}(a.search);u$?.page(void 0,void 0,{...a},{app:{name:"web"},campaign:n,page:a})},[d,t]),ev.useEffect(()=>{s.current=d.href},[d]),null}),eL3=(0,eC.zH)(function(e){let{store:t,apolloClient:a,queryClient:n,getAgentLocale:l,helmetContext:r,history:o}=e;return ev.createElement(eT.B6,{context:r},ev.createElement(eM.aH,{client:n},ev.createElement(eN.e,{client:a},ev.createElement(e$.Provider,{store:t},ev.createElement(eD.xI,{history:o,store:t},ev.createElement(eP.tn,null,ev.createElement(eL1,{getAgentLocale:l},ev.createElement(eLX,null,ev.createElement(eI.LayersProvider,null,ev.createElement(eL5,null),ev.createElement(eLY,null),ev.createElement(eLJ,null),ev.createElement(eS.t,{initialIsOpen:!1}))))))))))});var eL4=a(35367),eL6=a(31892),eL8=a(93331),eL7=a(38066),eL9=a(36765),eBe=a(54098),eBt=a.n(eBe),eBa=a(58042);function eBn(){return(0,ei.assert)(!0,"`RELEASE` global constant must be defined"),"5.21.0"}function eBl(){return(0,ei.assert)(!0,"`TIER` global constant must be defined"),"production"}var eBr=a(93581),eBo=a(48216),eBi=a(73486);class eBs extends eBr.i{client;constructor(e){super(),this.client=e}request(e){return new eBo.y(t=>this.client.subscribe({...e,query:(0,eBi.S)(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:e=>e instanceof Error?t.error(e):null!==e&&"object"==typeof e&&"code"in e&&"reason"in e?t.error(Error(`Socket closed with event ${e.code} ${e.reason||""}`)):t.error(new ea.cA({graphQLErrors:Array.isArray(e)?e:[e]}))}))}}let eBd={ChatMessageFileBody:{file:e=>e.file??null,lambdaResponse:e=>e.lambdaResponse??null}},eBc=(0,la.ZP)` + scalar File + + extend type ChatMessageFileBody { + file: File + } + + extend type WorkspaceMemberRemovePayload { + isOptimistic: Boolean + } + + extend type SpaceMediaEdge { + created: Boolean + } +`;var eBm=a(97091);let eBu={CurrentUser:{keyFields:[],merge:!0,fields:{mfas:(0,eBm.ZB)(),pats:(0,eBm.ZB)()}},CurrentUserPreferences:{keyFields:!1,merge:!0},Image:{keyFields:!1,merge:!0},MyAccounts:{keyFields:[],merge:!0},ProjectAddons:{keyFields:!1,merge:!0,fields:{countdowns:{merge:function(e){return(t,a,n)=>{let{readField:l,mergeObjects:r}=n,o=t?t.slice(0):[],i=Object.create(null);return t&&t.forEach((t,a)=>{let n=l(e,t);null!=n&&(i[n]=a)}),a.forEach(t=>{let a=l(e,t);if(null!=a){let e=i[a];"number"==typeof e?o[e]=r(o[e],t):(i[a]=o.length,o.push(t))}}),o}}("id")}}},Size:{keyFields:!1,merge:!0},SpacePreferences:{keyFields:!1,merge:!0},UserAvatar:{keyFields:!1,merge:!0},UserAvatarV2:{keyFields:!1,merge:!0},Document:{fields:{preferences:{merge:!0},backlinks:(0,eBm.ZB)()}},Space:{fields:{media:(0,eBm.ZB)(["filterby","orderby"])}},SpaceAgent:{fields:{medias:(0,eBm.ZB)()}},SpaceMediaEdge:{fields:{created:{read:e=>null==e?null:e.created}}},Query:{fields:{search:(0,eBm.ZB)(["filterby","orderby"]),googlePeople:(0,eBm.ZB)(["filterby"]),document:{keyArgs:["id"],read(e,t){let{args:a,toReference:n}=t;return e??n({__typename:"Document",id:a?.id})}},membership:{keyArgs:["space_id"],read(e,t){let{cache:a,args:n,toReference:l}=t;if(null!=e)return e;let r=n?.space_id;if(null==r)return e;let o=a.readQuery({query:sW}),i=o?.me?.id;return null==i?e:l({__typename:"Membership",id:`${i}@${r}`})}},space:{keyArgs:["id"],read(e,t){let{args:a,toReference:n}=t;if(null!=e)return e;let l=a?.id;return null==l?e:n({__typename:"Space",id:l})}},conversationMessages:(0,eBm.ZB)(["filterby"]),spaceAgents:(0,eBm.ZB)(["filterby"]),flows:(0,eBm.ZB)(["filterby"]),flowRuns:(0,eBm.ZB)(["filterby"]),conversations:(0,eBm.ZB)(["filterby"])}}};var eBp=a(51584),eBg=a.n(eBp);let eBf="SETTINGS/SET_ITEM",eBh={isNightMode:"true","visited-downloads":"false","seen-tour-001-step2":"false","seen-tour-001-step3":"false","seen-tour-001-step4":"false","seen-tour-001-step5":"false"},eBy=new Set(Object.keys(eBh));function eBb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){let e=ga();if(eu()(e))return eBh;try{return{isNightMode:e.getItem("isNightMode")||"true","visited-downloads":e.getItem("visited-downloads")||"false","seen-tour-001-step2":e.getItem("seen-tour-001-step2")||"false","seen-tour-001-step3":e.getItem("seen-tour-001-step3")||"false","seen-tour-001-step4":e.getItem("seen-tour-001-step4")||"false","seen-tour-001-step5":e.getItem("seen-tour-001-step5")||"false"}}catch(e){return console.warn(e),eBh}}(),t=arguments.length>1?arguments[1]:void 0;if(t.type===eBf){let{key:a,value:n}=t.payload;return eBy.has(a)?{...e,[a]:n}:e}return e}let eBv=e=>e=>t=>{let a=e(t);if(t.type===eBf){let e=ga();if(!eu()(e)){let{key:a}=t.payload;if(eBy.has(a)){let{value:n}=t.payload;try{!0===eBg()(n)&&(n=JSON.parse(n)),e.setItem(a,n)}catch(e){console.warn(e)}}}}return a};var eBk=a(34728),eBE=a.n(eBk);let eBx={text:void 0};class eB_ extends(0,tz.Record)(eBx){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new eB_(e)}static createWithNode(e){return eB_.create({text:(0,Df.MS)(e.text)})}setTextWithValue(e){return this.set("text",e)}setTextWithDelta(e){let t=(0,Df.MS)(e);return this.setTextWithValue(t)}setWithNode(e){return this.setTextWithDelta(e.text)}toggleLink(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.update("text",t=>t.change().call(RS,e).value)}insertAutocompleteHyperlink(e,t,a){return this.update("text",n=>n.change().call(RI,e,t,a).value)}insertAutocompleteMention(e,t){return this.update("text",a=>a.change().call(RT,e,t).value)}insertAutocompleteTag(e,t){return this.update("text",a=>a.change().call(R$,e,t).value)}insertAutocompleteText(e,t){return this.update("text",a=>a.change().call(RP,e,t).value)}toggleMark(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.update("text",a=>a.change().call(RA,e,t).value)}focusNode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.update("text",t=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.change();return null!=t&&(a=t>=0?(a=a.collapseToStartOf(e.document)).move(t):a.collapseToEndOf(e.document)),(a=a.focus()).value})(t,e))}unfocusNode(){return this.update("text",e=>e.change().blur().value)}}let eBw={activeRoomID:null,fetchStatus:uv,fetchResult:null,focusNodeID:null,formatMenuState:null,spaceIsNew:!1,syncState:Ng,outOfSync:!1,userIsNew:!1,siteID:void 0,backendError:null,sideDrawerIsOpen:!1,firebaseNotificationPermission:void 0,rightSidebarIsOpen:!1,noteOpenNodeId:null};class eBN extends(0,tz.Record)(eBw){static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{siteID:t=(0,O3.SK)(),...a}=e;return new eBN({...a,siteID:t})}updateWithNodeID(e,t,a){if(eu()(e))return this;if(this.focusNodeID===e){let t=a.getIn([e,"text"],null);return eu()(t)||!t.isFocused?this.set("focusNodeID",null).set("formatMenuState",null):this}{let n=a.getIn([e,"text"],null);if(eu()(n))return this;if(n.isFocused){let a=t.findAncestorsForNode(e);return this.set("focusNodeID",e).set("formatMenuState",{nodeID:e,ancestors:a})}return this}}setFetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.set("fetchStatus",e).set("fetchResult",eu()(t)?null:new tz.Map(t))}setNoteOpenNodeId(e){return this.set("noteOpenNodeId",e)}}function eBC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return arguments.length>1&&arguments[1],e}var eBM=a(7739),eBS=a.n(eBM);let eBI={total:0,attachments:[],uploadingAttachments:[]},eBD={completedNodeIDs:new Set,recurNodeIDs:new Set};function eBT(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"end",n=t.findIndex(t=>t.id===e.id);return n>-1?[...t.slice(0,n),e,...t.slice(n+1)]:"start"===a?[e,...t]:[...t,e]}function eB$(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBD,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case mn:return(0,es.ZP)(e,e=>{for(let[a,n]of(e.completedNodeIDs=new Set,e.recurNodeIDs=new Set,Object.entries(t.payload.attachments))){let t=e[a]??{};for(let[e,a]of Object.entries(n)){switch(e){case"assignees":case"dates":continue}t[e]=a}e[a]=t}});case mi:return function(e,t){let{attachment:a,info:n}=t.payload,{data:l}=a;switch(l.type){case T.Date:return e;case m2:{let t=ec()(e,[a.nodeID],{}),l=ec()(t,["comments"],{}),r=ec()(l,["isActive"],!1),o=ec()(l,["attachments"],[]),i=r?eBT(a,o):o,{total:s}=n;return{...e,[a.nodeID]:{...t,comments:{...l,total:s,attachments:i}}}}case m1:case T.Embed:{let t=ec()(e,[a.nodeID],{}),l=ec()(t,["media"],{}),r=eBT(a,ec()(l,["attachments"],[]),"start"),{mediaTotal:o}=n;return{...e,[a.nodeID]:{...t,media:{...l,total:o,attachments:r}}}}case T.Assignee:default:return e}}(e,t);case my:return function(e,t){let{nodeID:a}=t.payload,n=e?.[a]??{},l=n?.media??eBI,r=n?.media?.uploadingAttachments??[];return{...e,[a]:{...n,media:{...l,uploadingAttachments:[t.payload,...r]}}}}(e,t);case mE:return{...e,completedNodeIDs:new Set};case mk:return{...e,recurNodeIDs:new Set};case ms:return function(e,t){let{which:a}=t.payload;switch(a.type){case T.Date:return e;case m2:case T.Embed:case m1:{let t=ec()(e,[a.nodeID],{}),n="";a.type===m1||a.type===T.Embed?n="media":a.type===m2&&(n="comments");let l=ec()(t,[n],{}),r=ec()(l,["attachments"],[]).filter(e=>e.id!==a.id),o=Math.max(ec()(l,["total"],1)-1,0);return{...e,[a.nodeID]:{...t,[n]:{...l,total:o,attachments:r}}}}case T.Assignee:default:return e}}(e,t);case mb:return function(e,t){let{nodeID:a,uploadID:n}=t.payload,l=e?.[a]??{},r=l?.media??eBI,o=(l?.media?.uploadingAttachments??[]).filter(e=>e.uploadID!==n);return{...e,[a]:{...l,media:{...r,uploadingAttachments:o}}}}(e,t);case mx:return eBD;case mh:return function(e,t){let{nodeID:a,comments:n}=t.payload,l=ec()(e,[a],{}),r=ec()(l,["comments"],{});return{...e,[a]:{...l,comments:{...r,attachments:n}}}}(e,t);case mg:return function(e,t){let{nodeID:a,fetchStatus:n}=t.payload,l=ec()(e,[a],{}),r=ec()(l,["comments"],{});return{...e,[a]:{...l,comments:{...r,fetchStatus:n}}}}(e,t);case mf:return function(e,t){let{nodeID:a,uploadStatus:n}=t.payload,l=ec()(e,[a],{}),r=ec()(l,["comments"],{});return{...e,[a]:{...l,comments:{...r,uploadStatus:n}}}}(e,t);case mu:return function(e,t){let{nodeID:a,isActive:n}=t.payload,l=ec()(e,[a],{}),r=ec()(l,["comments"],{});return{...e,[a]:{...l,comments:{...r,isActive:n}}}}(e,t);case md:return function(e,t){let{attachments:a}=t.payload;return a.reduce((t,a)=>{let{data:n}=a,l=null;switch(n.type){case m2:l="comments";case T.Date:}if(null!=l){let n=ec()(e,[a.nodeID],{}),r=ec()(n,[l],{}),o=ec()(r,["attachments"],[]),i=p6()(o,e=>e.id===a.id);if(i>-1)return Ml()(t,{[a.nodeID]:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ml()(e,{[l]:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attachments:[],total:0};return Ml()(e,{attachments:{$splice:[[i,1,a]]}})}})}})}return t},e)}(e,t);case xg:return function(e,t){let a=t.payload,n=eW().groupBy(a,"nodeId");return(0,es.ZP)(e,e=>{let t=new Set(Object.keys(n));for(let a in e)t.has(a)||delete e[a].assignees;for(let[t,a]of Object.entries(n)){let n=e[t];if(null==n)e[t]={assignees:{total:a.length,attachments:a}};else if(null==n.assignees)n.assignees={total:a.length,attachments:a};else{let e=new Set;for(let t of a){let a=n.assignees.attachments.findIndex(e=>e.id===t.id);-1===a?(n.assignees.attachments.push(t),n.assignees.total+=1):n.assignees.attachments[a]=t,e.add(t.id)}for(let t=n.assignees.total-1;t>=0;t--){let a=n.assignees.attachments[t];e.has(a.id)||(n.assignees.attachments.splice(t,1),n.assignees.total-=1)}}}})}(e,t);case xf:return function(e,t){let a=t.payload,n=eW().groupBy(a,"nodeId");return(0,es.ZP)(e,e=>{let t=new Set(Object.keys(n));for(let a in e)t.has(a)||delete e[a].dates;for(let[t,a]of Object.entries(n)){let n=e[t];if(null==n)e[t]={dates:{total:a.length,attachments:a}};else if(null==n.dates)n.dates={total:a.length,attachments:a};else for(let e of a){let t=n.dates.attachments.findIndex(t=>t.id===e.id);-1===t?(n.dates.attachments.push(e),n.dates.total+=1):n.dates.attachments[t]=e}}})}(e,t);case xh:return function(e,t){let a=t.payload;return(0,es.Uy)(e,e=>{for(let t of a){let a=t.node_id,n=e[a];if(null==n)e[a]={countdowns:{total:t.removed?0:1,attachments:[t]}};else if(null==n.countdowns)n.countdowns={total:t.removed?0:1,attachments:[t]};else{let e=n.countdowns.attachments.findIndex(e=>e.id===t.id);if(-1===e)n.countdowns.attachments.push(t),t.removed||(n.countdowns.total+=1);else{let a=n.countdowns.attachments[e];n.countdowns.attachments[e]=t,!a.removed&&t.removed?n.countdowns.total-=1:a.removed&&!t.removed&&(n.countdowns.total+=1)}}}})}(e,t);case xy:return function(e,t){let a=t.payload,n=eBS()(a,"node_id");return(0,es.ZP)(e,e=>{let t=new Set(Object.keys(n));for(let a in e)t.has(a)||delete e[a].reactionCollections;for(let[t,a]of Object.entries(n)){let n=e[t];if(null==n)e[t]={reactionCollections:{total:a.length,attachments:a}};else if(null==n.reactionCollections)n.reactionCollections={total:a.length,attachments:a};else for(let e of a){let t=n.reactionCollections.attachments.findIndex(t=>t.id===e.id);-1===t?(n.reactionCollections.attachments.push(e),n.reactionCollections.total+=1):n.reactionCollections.attachments[t]=e}}})}(e,t);default:return e}}var eBP=a(82569),eBF=a.n(eBP);function eBA(e,t){return function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0,l=t[n.type];return l?l(a,n):a}}let eBR={user:null,accounts:{list:[],fetchStatus:uv,errors:[]}},eBj=eBA(eBR,{"@@taskade/user/ADD_ACCOUNT_TO_LIST":function(e,t){return(0,es.ZP)(e,a=>{let{id:n}=t.payload,l=[...ec()(e,["accounts","list"],[]),n];return a.accounts.errors=l,a})},[cm]:function(e,t){return(0,es.ZP)(e,e=>(e.accounts.errors=[],e))},"@@taskade/user/REMOVE_ACCOUNT_FROM_LIST":function(e,t){return(0,es.ZP)(e,a=>{let{id:n}=t.payload,l=ec()(e,["accounts","list"],[]),r=eBF()(l,n);return a.accounts.list=r,a})},[cu]:function(e,t){return(0,es.ZP)(e,e=>(e.accounts.fetchStatus=t.payload.fetchStatus,e))},[cp]:function(e,t){return(0,es.ZP)(e,e=>{let{accounts:a}=t.payload;return e.accounts.list=a,e})},[cf]:function(e,t){return(0,es.ZP)(e,e=>{let{user:a}=e,{user:n}=t.payload;return eu()(a)?e.user=n:eu()(n)?e.user=n:Object.keys(n).forEach(e=>{a[e]!==n[e]&&(a[e]=n[e])}),e})}}),eBO=eBA({latestMessageAt:void 0},{[Zj]:function(e,t){let{latestMessageAt:a}=t.payload;return(0,es.ZP)(e,e=>{e.latestMessageAt=a})},[ZO]:function(e){return(0,es.ZP)(e,e=>{e.latestMessageAt=void 0})}});function eBU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:li.Contents.create();return arguments.length>1&&arguments[1],e}function eBZ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return arguments.length>1&&arguments[1],e}let eBL="@@taskade/history/APPLY_LOCAL_CHANGESET",eBB=new tz.Map;function eBz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{focusID:a,caretPosition:n,unfocusID:l}=t.payload,r=e;return eu()(l)||(r=r.update(l,e=>e.unfocusNode())),r.update(a,e=>e.focusNode(n))}function eBV(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0;return t.type,e}function eBq(e,t){let a=t;for(let t of e)a=a.delete(t);return a}function eBW(e,t,a,n){let l=n;for(let n of e)l=l.updateWithNodeID(n,t,a);return l}function eBH(e,t){return t.updateContents(e,t.hideCompleted)}class eBG{contents;documentPreferences;history;search;session;slate;ops;constructor(e){this.contents=e.contents,this.documentPreferences=e.documentPreferences,this.history=e.history,this.search=e.search,this.session=e.session,this.slate=e.slate,this.ops=[]}static perform(e,t){try{let a=new eBG(e);return[t(a),null]}catch(e){return[null,e]}}commit(e){let{contents:t,documentPreferences:a,history:n,search:l,session:r,slate:o,ops:i}=this;return(0,es.ZP)(e,e=>(e.contents=t,e.documentPreferences=a,e.history=n,e.search=l,e.session=r,e.slate=o,i.length>0&&(e.history=e.history.saveChange({ops:i})),e))}}function eBK(e,t,a){let n=t.findNodeByID(e);if(null==n||n.collapsed||!n.hasChild)return null;for(let e=n.children.size-1;e>=0;e--){let t=n.children.get(e);if(a.isNodeIDVisible(t))return t}return null}function eBY(e,t,a,n,l){let{contents:r,slate:o,documentPreferences:i}=e,s=r.getIn(["nodes",t]);if(null==s)return e;let d=!1,c=s.children.first();if(null!=c){let t=r.getIn(["nodes",c]);if(null==t)return e;let a=i.hideCompleted;d=0===t.textString.length&&(!a||!t.completed)}if(a=a.select(n.selection).delete().blur(),d){if(null==c)return e;let l=o.getIn([c,"text"]).change().insertFragment(n.fragment);l=l.collapseToStartOf(l.value.document).focus();let[r,i]=eBG.perform(e,e=>e.changeNodeText(t,a).changeNodeText(c,l));return null==r?(console.warn(i),e):r.commit(e)}{let r=(0,ld.Z)(),o={type:"fragment",children:[function(e,t,a,n,l){let r=function(e,t,a){let n;let{contents:l,documentPreferences:r}=e,o=t.children.find(e=>r.isNodeIDVisible(e));if(null!=o){let e=l.findNodeByID(o);if(e?.format?.node!=null)return li.NodeFormat.create({node:e.format.node})}if(null==a)return null;let i=l.findNodeByID(a);if(null==i)return null;let s=i.indexOfChildNodeID(t.id);if(s<=0)return null;for(let e=s-1;e>0;e--){let t=i.children.get(e);if(null!=t&&r.isNodeIDVisible(t)){n=t;break}}if(null==n)return null;let d=l.findNodeByID(n);if(null==d)return null;let c=d.children.find(e=>r.isNodeIDVisible(e));if(null==c)return null;let m=l.findNodeByID(c);if(null==m)return null;let u=m.format;return null==u?null:li.NodeFormat.create({node:u.node})}(l,a,n),o={id:e,type:"text",text:(0,Df.xc)(t.fragment),children:[]};return(0,es.ZP)(o,e=>{e.format=r})}(r,n,s,l,e)]},[i,d]=eBG.perform(e,e=>e.changeNodeText(t,a).insertFragmentAdjacentToTarget({id:t,position:"afterbegin"},o).focusNode(r,0));return null==i?(console.warn(d),e):i.commit(e)}}function eBQ(e,t,a,n,l){if(l.right.isEmpty){let r=(0,ld.Z)(),o={id:r,type:"text",text:(0,Df.xc)(l.right.fragment),children:[]};o.format=t.format?.toJS()??null;let i={type:"fragment",children:[o]},[s,d]=eBG.perform(e,e=>e.changeNodeText(t.id,n).insertFragmentAdjacentToTarget({id:t.id,parentId:CP()(a),position:"afterend"},i).focusNode(r,-1));return null==s?(console.warn(d),e):s.commit(e)}{n=n.select(l.left.selection).delete();let r=(0,ld.Z)(),o={id:r,type:"text",text:(0,Df.xc)(l.left.fragment),children:[]};o.format=t.format?.toJS()??null;let i={type:"fragment",children:[o]},s=l.left.isEmpty?[r,-1]:[t.id,0],[d,c]=eBG.perform(e,e=>e.changeNodeText(t.id,n).insertFragmentAdjacentToTarget({id:t.id,parentId:CP()(a),position:"beforebegin"},i).focusNode(...s));return null==d?(console.warn(c),e):d.commit(e)}}function eBJ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Etc/UTC",a=ez.DateTimeDescSchema.required().validate(e);if(null!=a.error)throw a.error;let{date:n,time:l,timezone:r}=a.value;if(null==r&&null==eG().tz.zone(t))throw new ei.HttpError({message:"Invalid default timezone",code:"BAD_REQUEST",scope:{extras:{defaultTimezone:t}}});return null==l?eG().tz(n,r??t):eG().tz(`${n}T${l}`,r??t)}function eBX(e,t){if(null==t)return null;let a=e.contents;if(null==a)return null;let n=a.findNodeByID(t);return null==n?null:n.completed}function eB0(e,t){if(null==t)return null;let a=e.contents;if(null==a)return null;let n=a.findNodeByID(t);return null==n?null:n.textString}function eB1(e,t){if(null==t)return null;let a=e.attachments?.[t]?.dates?.attachments?.[0];if(null==a)return null;let n=a.addonDate.start,l=a.addonDate.end;return null!=n&&null!=l?{start:eBJ(n),end:eBJ(l)}:null!=n?{start:null,end:eBJ(n)}:null!=l?{start:null,end:eBJ(l)}:null}function eB2(e,t){if(null==t)return null;let a=e.contents;if(null==a)return null;let n=a.findNodeByID(t);if(null==n)return null;let l=(0,sX.extractHashtagsWithIndices)(n.textString);return 0===l.length?null:l[0].hashtag}function eB5(e,t){if(null==t)return null;let a=e.contents;if(null==a)return null;let n=a.findNodeByID(t);if(null==n)return null;let l=(0,sX.extractMentions)(n.textString);return 0===l.length?null:l[0]}function eB3(e,t){if(null==t)return null;let a=e.contents.findNodeByID(t),n=a?.attributes?.created;if(null==n)return null;let l=new Date(n.at);return cc()(l)}function eB4(e){return(t,a)=>null!=t&&null!=a?e(t,a):null!=t?-1:null!=a?1:0}function eB6(e,t){return e>t?1:ee.setTextWithValue(t.value))).getIn([e,"text"]);if(null==r||r.document!==o.document){let t=(0,Df.xc)(o.document),[n,l]=a.setTextInNodeWithDeltaSnapshot(e,t);null!=l&&(this.ops.push(l),a=n)}return n=n.focusNodeID===e?n.updateWithNodeID(e,a,l):n.updateWithNodeID(n.focusNodeID,a,l).updateWithNodeID(e,a,l),this.contents=a,this.slate=l,this.session=n,this},eBG.prototype.deleteNode=function(e,t){let{contents:a,session:n,slate:l,documentPreferences:r}=this,o=[];{let[n,l]=a.removeNode(e,t);if(null==l)throw Error(`Unable to remove node ${e}`);o.push(...l),a=n}let i=o.filter(e=>2===e.p.length&&"nodes"===e.p[0]&&"od"in e).map(e=>e.p[1]);return l=eBq(i,l),n=eBW(i,a,l,n),r=eBH(a,r),this.contents=a,this.session=n,this.slate=l,this.documentPreferences=r,this.ops.push(...o),this},eBG.prototype.deleteNodes=function(e){let{contents:t,session:a,slate:n}=this,l=[];{let[a,n]=t.removeNodes(e);if(null==n)throw Error(`Unable to remove node ${e}`);l.push(...n),t=a}let r=l.filter(e=>2===e.p.length&&"nodes"===e.p[0]&&"od"in e).map(e=>e.p[1]);return n=eBq(r,n),a=eBW(r,t,n,a),this.contents=t,this.session=a,this.slate=n,this.ops.push(...l),this},eBG.prototype.focusNode=function(e,t){let{contents:a}=this,{session:n,slate:l}=this;if(e===n.focusNodeID)return this;let r=n.focusNodeID;if(null!=r){let e=l,t=n;e=e.update(r,e=>e.unfocusNode()),t=t.updateWithNodeID(r,a,e),l=e,n=t}if(null!=e){let r=l,o=n;r=r.update(e,e=>e.focusNode(t)),o=o.updateWithNodeID(e,a,r),l=r,n=o}return this.slate=l,this.session=n,this},eBG.prototype.insertFragmentAdjacentToTarget=function(e,t){let{contents:a,documentPreferences:n,search:l,slate:r}=this,o=[];{let[n,l]=a.insertFragmentAdjacentToTarget(e,t);if(null==l)throw Error("Unable to insert fragment adjacent to target");o.push(...l),a=n}{let e=n,t=l,i=r;for(let n of o.filter(e=>2===e.p.length&&"nodes"===e.p[0]&&!("od"in e)&&"oi"in e).map(e=>e.p[1])){let l=a.getIn(["nodes",n]);if(null==l)throw Error("Change describe an invalid node insertion operation");i=i.set(n,eB_.createWithNode(l)),t=t.addVisibleNodes([n]),l.completed||(e=e.addVisibleNodes([n]))}n=e,l=t,r=i}return this.contents=a,this.documentPreferences=n,this.slate=r,this.ops.push(...o),this},eBG.prototype.outdentNode=function(e,t){let{contents:a,session:n}=this,l=[];{let[n,r]=a.outdentAtNode(e,t);if(null==r)throw Error("Unable to outdent node");a=n,l.push(...r)}if(n.focusNodeID===e){let t=n,l=a.findAncestorsForNode(e);n=t=t.set("formatMenuState",{nodeID:e,ancestors:l})}return this.contents=a,this.session=n,this.ops.push(...l),this},eBG.prototype.indentNode=function(e,t){let{contents:a,session:n,documentPreferences:l}=this,r=[];{let[n,o]=a.indentAtNode(e,t);if(null==o)throw Error("Unable to indent node");a=n,r.push(...o);let i=a.findParentNodeByID(e);if(null!=i){let e=i.id;l=l.addVisibleNodes([e])}}if(n.focusNodeID===e){let t=n,l=a.findAncestorsForNode(e);n=t=t.set("formatMenuState",{nodeID:e,ancestors:l})}return this.contents=a,this.session=n,this.documentPreferences=l,this.ops.push(...r),this},eBG.prototype.setComplete=function(e,t){let{contents:a,documentPreferences:n}=this,l=[];{let[n,r]=a.setCompleteInNodes(e,t);if(null==r)return this;l.push(...r),a=n}let r=n.hideCompleted;return n=n.updateContents(a,r),this.contents=a,this.documentPreferences=n,this.ops.push(...l),this},eBG.prototype.setCollapse=function(e,t){let{contents:a}=this,[n,l]=a.setCollapseInNodes(e,t);if(null==l)throw Error("Unable to set collapse in nodes");return this.contents=n,this.ops.push(...l),this},eBG.prototype.insertNode=function(e,t){let{contents:a,session:n,slate:l,documentPreferences:r}=this,o=[];{let[n,l]=a.insertNode(e,t);if(null==l)throw Error(`Unable to add child node to ${t}`);o.push(...l),a=n}return l=l.update(e.id,()=>eB_.createWithNode(e)),n=eBW([e.id],a,l,n),r=eBH(a,r),this.contents=a,this.session=n,this.slate=l,this.documentPreferences=r,this.ops.push(...o),this},eBG.prototype.setFormatInNode=function(e,t,a){let{contents:n}=this,l=[];{let[r,o]=n.setFormatInNode(e,t,a);if(null==o)throw Error(`Unable to set format for ${e}`);l.push(o),n=r}return this.contents=n,this.ops.push(...l),this},eBG.prototype.putNote=function(e,t){let{contents:a}=this,n=["nodes",e,"attributes","note"],l=a.updateIn(n,e=>bW()(e,t)?e:t),r=a.getIn(["nodes",e]),o=l.getIn(["nodes",e]),i=r.diff(o).map(t=>({...t,p:["nodes",e,...t.p]}));return 0===i.length||(this.contents=l,this.ops.push(...i)),this},eBG.prototype.applyLocalChangeset=function(e){let{type:t,changeset:a,history:n}=e,{contents:l,documentPreferences:r,session:o,slate:i}=this,s=l.apply(a),d=r,c=o,m=i;for(let e of a.ops)if("nodes"===e.p[0]){if(2===e.p.length){let t=e.p[1];if((0,ei.assert)("string"==typeof t),(0,li.isObjectReplaceOp)(e)&&2===e.p.length&&"nodes"===e.p[0]&&"string"==typeof e.p[1]){if(null==e.oi){null!=e.od&&(m=m.remove(t));continue}let a=s.findNodeByID(t);if(null==a)throw new ei.HttpError({code:"CONFLICT",message:"Replaced node cannot be found"});m=m.update(t,e=>null==e?eB_.createWithNode(a):e.setTextWithDelta(a.text))}else if((0,li.isObjectDeleteOp)(e)&&2===e.p.length&&"nodes"===e.p[0]&&"string"==typeof e.p[1])m=m.remove(t);else if((0,li.isObjectInsertOp)(e)&&2===e.p.length&&"nodes"===e.p[0]&&"string"==typeof e.p[1]){let e=s.findNodeByID(t);if(null==e)throw new ei.HttpError({code:"CONFLICT",message:"Inserted node cannot be found"});m=m.update(t,t=>null==t?eB_.createWithNode(e):t.setTextWithDelta(e.text))}}else if(3===e.p.length){let t=e.p[1];if((0,ei.assert)("string"==typeof t),(0,li.isDeltaOp)(e)&&3===e.p.length&&"nodes"===e.p[0]&&"string"==typeof e.p[1]&&"text"===e.p[2]){let e=s.findNodeByID(t);if(null==e)throw new ei.HttpError({code:"CONFLICT",message:"Edited node cannot be found"});m=m.update(t,t=>null==t?eB_.createWithNode(e):t.setTextWithDelta(e.text))}else if((0,li.isNodeCompletionOp)(e)){if(!1===e.oi){let e=s.findAncestorsForNode(t);d=d.addVisibleNodes([...e,t])}null!=c.focusNodeID&&(m=m.update(t,e=>e.focusNode(-1)),c=c.updateWithNodeID(t,s,m))}}else 4===e.p.length&&(0,li.isListInsertOp)(e)&&4===e.p.length&&"nodes"===e.p[0]&&"string"==typeof e.p[1]&&"children"===e.p[2]&&"number"==typeof e.p[3]&&(d=d.updateContents(s,r.hideCompleted))}let u=c.focusNodeID;if(null==u||m.has(u)||(u=(c=c.updateWithNodeID(u,s,m)).focusNodeID),"undo"===t){let e=n.undos.last();if(null!=e){let t=function(e){for(let t of(0,li.invertChangeset)(e).ops)if("nodes"===t.p[0]){if(2===t.p.length){let e=t.p[1];if("od"in t){let a=function(e){let t=0;for(let a of e.ops){if(null==a.insert)return -1;if(null!=a.attributes&&a.attributes.paragraph)break;t+=CI().Op.length(a)}return t}(t.od.text);if(a<0)return null;return{anchorNodeId:e,anchorOffset:a,focusNodeId:e,focusOffset:a}}break}if(3===t.p.length){if("text"===t.p[2]){let e=t.p[1],a=function(e){let t=0,a=0;for(let n of e.ops)if(null!=n.retain){if(null!=n.attributes){a+=n.retain;break}t+=n.retain,a+=n.retain}else if(null!=n.insert)break;else if(null!=n.delete){t+=n.delete,a+=n.delete;break}return{anchor:t,focus:a}}(t.o);return{anchorNodeId:e,anchorOffset:a.anchor,focusNodeId:e,focusOffset:a.focus}}break}}return null}(e);null!=t&&(t.anchorNodeId!==u&&null!=u&&(m.has(u)?m=m.update(u,e=>e.unfocusNode()):console.warn(`Invalid focus node ID in session: ${u}`)),m.has(t.anchorNodeId)&&(m=m.update(t.anchorNodeId,e=>e.focusNode(t.anchorOffset))),c=c.updateWithNodeID(t.anchorNodeId,s,m))}}return this.contents=s,this.history=n,this.documentPreferences=d,this.session=c,this.slate=m,this},eBG.prototype.adoptNoteIfNeeded=function(e,t){let{contents:a}=this;if(null==t)return this;let n=a.findNodeByID(t),l=n?.attributes?.note?.value;if(null!=l&&l.length>0)return this;let r=a.findNodeByID(e),o=r?.attributes?.note;return null==o?this:this.putNote(t,o)};let eB8=eB4(function(e,t){return e>t?-1:et?1:enull!=e&&e.type===t&&(null==a||e.data.isSuperset(a)))}let ezi=eBA(void 0,{[cQ]:function(e,t){let{contents:a,history:n,session:l,slate:r}=e,{nodeID:o}=t.payload;if(a.hasIn(["nodes",o])){let i=r.getIn([o,"text"]),s=(r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,change:n}=t.payload;return e.update(a,e=>e.setTextWithValue(n.value))}(r,t)).getIn([o,"text"]);if(eu()(i)||i.document!==s.document){let e=(0,Df.xc)(s.document),[t,l]=a.setTextInNodeWithDeltaSnapshot(o,e);null!=l&&(n=n.saveChange({ops:[l]}),a=t)}return l=l.focusNodeID===o?l.updateWithNodeID(o,a,r):l.updateWithNodeID(l.focusNodeID,a,r).updateWithNodeID(o,a,r),{...e,contents:a,session:l,slate:r,history:n}}return(console.warn({message:`Node (${o}) not found, discarding action…`,action:t}),l.focusNodeID===o)?(l=l.updateWithNodeID(o,a,r),{...e,session:l}):e},[cH]:function(e,t){let{contents:a}=e,{session:n,slate:l}=e,{focusID:r,caretPosition:o}=t.payload,i=a.findNodeByID(r);if(null==i)return e;let s=i.textString.length;return l=null!=o&&o>s?eBz(l,{...t,payload:{...t.payload,caretPosition:-1}}):eBz(l,t),n=n.updateWithNodeID(r,a,l),{...e,session:n,slate:l}},[mv]:function(e,t){let{contents:a}=e,{session:n,slate:l}=e,r=t.payload.unfocusID||n.focusNodeID;return eu()(r)?e:(l=l.update(r,e=>e?.unfocusNode()),n=n.updateWithNodeID(r,a,l),{...e,session:n,slate:l})},[cV]:function(e,t){let{contents:a,history:n,search:l,documentPreferences:r,session:o,slate:i}=e,{node:s,parentID:d,insertAtIndex:c}=t.payload,[m,u]=a.insertNode(s,d,c);return n=n.saveChange({ops:u}),a=m,i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{node:a}=t.payload;return e.update(a.id,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eB_.create();return e.setWithNode(a)})}(i,t),l=l.addVisibleNodes([s.id]),r=r.addVisibleNodes([s.id]),o=o.updateWithNodeID(s.id,a,i),{...e,contents:a,history:n,documentPreferences:r,search:l,session:o,slate:i}},[cG]:function(e,t){let{contents:a}=e,{ancestors:n,currentID:l}=t.payload,r=a.extractFragment([l]);r=(0,lr.replaceIDs)(r);let o=CP()(n),[i,s]=eBG.perform(e,e=>{e=e.insertFragmentAdjacentToTarget({id:l,parentId:o,position:"afterend"},r);let t=r.children[0]?.id;return null!=t&&(e=e.focusNode(t,-1)),e});return null==i?(console.warn(s),e):i.commit(e)},[cK]:function(e,t){let{ancestors:a,currentID:n}=t.payload,[l,r]=eBG.perform(e,e=>{let t=e,l=(t=t.indentNode(n,a)).contents.findParentNodeByID(n);return null!=l&&l.collapsed?t.setCollapse([l.id],!1):t});return null==l?(console.warn(r),e):l.commit(e)},[IV]:function(e,t){let{contents:a,history:n,session:l}=e,{nodeIds:r,parentId:o}=t.payload,[i,s]=a.indentNodes(r,o);if(null==s)return e;n=n.saveChange({ops:s}),a=i;{let e=l;for(let t of r)if(e.focusNodeID===t){let n=a.findAncestorsForNode(t);e=e.set("formatMenuState",{nodeID:t,ancestors:n});break}l=e}return{...e,contents:a,history:n,session:l}},[cY]:function(e,t){let{contents:a,history:n,session:l,documentPreferences:r}=e,{ancestors:o,currentID:i}=t.payload,[s,d]=a.outdentAtNode(i,o);if(null!=d){n=n.saveChange({ops:d});let e=a.findParentNodeByID(i)?.id;null!=e&&r.hideCompleted&&function(e,t){if(null==t||null==t.children)return!1;let a=t.children.every(t=>!e.isNodeIDVisible(t));return t.completed&&a}(r,s.findNodeByID(e))&&(r=r.removeVisibleNodes([e])),a=s}if(l.focusNodeID===i){let e=a.findAncestorsForNode(i);l=l.set("formatMenuState",{nodeID:i,ancestors:e})}return{...e,contents:a,history:n,session:l,documentPreferences:r}},[IW]:function(e,t){let{contents:a,history:n,session:l}=e,{nodeIds:r}=t.payload,[o,i]=a.outdentNodes(r);if(null==i)return e;n=n.saveChange({ops:i}),a=o;{let e=l;for(let t of r)if(e.focusNodeID===t){let n=a.findAncestorsForNode(t);e=e.set("formatMenuState",{nodeID:t,ancestors:n});break}l=e}return{...e,contents:a,history:n,session:l}},[eBL]:function(e,t){let[a,n]=eBG.perform(e,e=>e.applyLocalChangeset(t.payload));return null!=n?(console.warn("Unable to apply local changeset"),e):a.commit(e)},[Fo]:function(e,t){let{contents:a,documentPreferences:n,meta:l,slate:r}=e,{changeset:o}=t.payload,{id:i,from:s,ops:d,to:c}=o;if(l.id!==i)return console.warn("Changeset id does not match."),e;if(l.revision!==s.revision)return console.warn("Changeset from revision does not match."),e;for(let e of(a=a.apply(o),d))switch(!0){case(0,li.isSubtypeOp)(e,"delta"):{let{p:t,o:a}=e;if(3!==t.length)continue;let n=t[1];if(!bW()(t,["nodes",n,"text"]))continue;r=r.updateIn([n,"text"],e=>{let t=(0,Df.Rx)(e,a),n=e.change();return n.applyOperations(t,{save:!1}),n.value});break}case(0,li.isObjectDeleteOp)(e):{let{p:t}=e;if(2!==t.length)continue;let a=t[1];r=r.delete(a),n=n.removeVisibleNodes([a]);break}case(0,li.isObjectInsertOp)(e):{let{p:t}=e;if(2!==t.length)continue;let l=t[1],o=a.findNodeByID(l);r=r.set(l,eB_.createWithNode(o)),n=n.checkNodes(a,[o]);break}case(0,li.isObjectReplaceOp)(e):{let{p:t}=e;if(2!==t.length){let e=t[1],l=a.findNodeByID(e);n=n.checkNodes(a,[l]);continue}let l=t[1];throw Error(`We do not support replacing node at ${l}…`)}}return l={...l,...c},{...e,contents:a,documentPreferences:n,meta:l,slate:r}},[cq]:function(e,t){let{ancestors:a,currentID:n,adopterID:l}=t.payload,[r,o]=eBG.perform(e,e=>{let t=e,r=function(e,t,a){let n=e.findNextNodeId(a,{skipDescendants:!0});for(;null!=n;){if(t.isNodeIDVisible(n))return n;n=e.findNextNodeId(n)}let l=e.findPreviousNodeID(a);for(;null!=l;){if(l===e.rootID)return e.rootID;if(t.isNodeIDVisible(l))break;l=e.findPreviousNodeID(l)}return l}((t=t.adoptChildrenIfNeeded(n,l)).contents,t.documentPreferences,n);return t=t.deleteNode(n,CP()(a)),null!=r&&(t=t.focusNode(r,-1)),t});return null!=o?(console.warn(o),e):r.commit(e)},[cW]:function(e,t){if(e.meta.id!==t.payload.documentID)return e;let{nodeIDs:a}=t.payload,[n,l]=eBG.perform(e,t=>{let{contents:n,documentPreferences:l}=e,r=t.deleteNodes(a),o=CT()(a);if(null==o)return r;let i=Jk(n,l,o);return null==i?r:r.focusNode(i,-1)});return null==n?(console.warn(l),e):n.commit(e)},[c1]:function(e,t){let{contents:a,history:n}=e,{source:l}=t.payload,r=(0,li.targetFromOldTarget)(t.payload.target),[o,i]=a.moveNodesAdjacentTo(l,r);return null==i?e:(n=n.saveChange({ops:i}),a=o,(0,es.ZP)(e,e=>(e.contents=a,e.history=n,e)))},[IB]:function(e,t){let{contents:a,history:n}=e,{source:l,target:r}=t.payload,[o,i]=a.moveNodesAdjacentTo(l,r);return null==i?e:(n=n.saveChange({ops:i}),a=o,(0,es.ZP)(e,e=>(e.contents=a,e.history=n,e)))},[c5]:function(e,t){let{contents:a,history:n,documentPreferences:l,attachments:r}=e,o=[],i=[];a.traverse((e,t)=>0===t.length||(e.completed?o.push(e.id):i.push(e.id),!0));let s=[],d=[],c=[],m=i.length>0;if(m)for(let t of i)s.push(t),ezr((e?.attachments?.[t]?.dates?.attachments??[]).filter(e=>"recurrence"in e.addonDate).find(e=>e.nodeId===t))?c.push(t):d.push(t);else for(let e of o)d.push(e);let[u,p]=a.setCompleteInNodes(d,m);return null!=p&&(a=u,n=n.saveChange({ops:p}),l.hideCompleted&&(l=l.updateContents(a,l.hideCompleted))),r=(0,es.ZP)(r,e=>{for(let t of s)e.completedNodeIDs.add(t);for(let t of c)e.recurNodeIDs.add(t);return e}),{...e,contents:a,history:n,attachments:r,documentPreferences:l}},[c2]:function(e,t){let{contents:a,history:n}=e,l=[],r=[];a.traverse((e,t)=>0===t.length||0===e.children.size||(e.collapsed?l.push(e.id):r.push(e.id),!0));let o=r.length>0,[i,s]=a.setCollapseInNodes(o?r:l,o);return null!=s&&(a=i,n=n.saveChange({ops:s})),(0,es.ZP)(e,e=>(e.contents=a,e.history=n,e))},[c0]:function(e,t){var a;let{currentID:n}=t.payload,{contents:l,history:r,session:o,slate:i}=e,s=t.payload.collapse;null==s&&(s=!(s=l.getIn(["nodes",n,"collapsed"])??!1));let[d,c]=l.setCollapseInNodes([n],s);return null==c?e:(null!=(a=o.focusNodeID)&&d.findDescendantsForNode(n).includes(a)&&(i=i.update(n,e=>e.focusNode(-1)),o=o.updateWithNodeID(n,d,i)),r=r.saveChange({ops:c}),l=d,(0,es.ZP)(e,e=>(e.contents=l,e.history=r,e.session=o,e.slate=i,e)))},[cJ]:function(e,t){let a=t.payload.nodeIDs,{contents:n}=e,l=!ezl()(a,e=>n.getIn(["nodes",e,"completed"])),r=[],o=[],i=[];for(let t of a){let a=ec()(e,["attachments",t,"dates","attachments"],[]),s=vH()(a,e=>"recurrence"in e.addonDate);0===s.length?l!==n.getIn(["nodes",t,"completed"])&&(o.push(t),l&&r.push(t)):l&&!n.getIn(["nodes",t,"completed"])?(r.push(t),ezr(s.find(e=>e.nodeId===t))?i.push(t):o.push(t)):!l&&n.getIn(["nodes",t,"completed"])&&o.push(t)}let s=e;if(o.length>0){let[e,t]=eBG.perform(s,e=>{let t=e;if(t=t.setComplete(o,l),l&&null!=t.session.focusNodeID&&o.includes(t.session.focusNodeID)){let e=function(e,t,a){let n=e.findNextNodeId(a);if(!t.hideCompleted)return n;for(;null!=n&&!t.isNodeIDVisible(n);)n=e.findNextNodeId(n);return n}(t.contents,t.documentPreferences,t.session.focusNodeID);null==e&&t.documentPreferences.hideCompleted&&(e=function(e,t,a){let n=e.findPreviousNodeID(a);if(!t.hideCompleted)return n;for(;null!=n&&!(n===e.rootID||t.isNodeIDVisible(n));)n=e.findPreviousNodeID(n);return n}(t.contents,t.documentPreferences,t.session.focusNodeID)),null!=e&&(t=t.focusNode(e,-1))}return t});null!=e?s=e.commit(s):console.warn(t)}return r.length>0&&(s=(0,es.ZP)(s,e=>{for(let t of r)e.attachments.completedNodeIDs.add(t);return e})),i.length>0&&(s=(0,es.ZP)(s,e=>{for(let t of i)e.attachments.recurNodeIDs.add(t);return e})),s},[cX]:function(e,t){let{contents:a}=e,n=a.findDescendantsForNode(t.payload.nodeId),l=[t.payload.nodeId,...n],r=[],o=[];for(let e of l)a.getIn(["nodes",e,"completed"])?r.push(e):o.push(e);let i=[],s=[],d=[],c=o.length>0;if(c)for(let t of o)i.push(t),ezr((e?.attachments?.[t]?.dates?.attachments??[]).filter(e=>"recurrence"in e.addonDate).find(e=>e.nodeId===t))?d.push(t):s.push(t);else for(let e of r)s.push(e);let m=e;if(s.length>0){let[e,a]=eBG.perform(m,e=>{let a=e;a=a.setComplete(s,c);let n=t.payload.nodeId;if(!a.documentPreferences.hideCompleted)return a.focusNode(n,-1);let l=Jv(a.contents,a.documentPreferences,n);return null==l&&(l=Jk(a.contents,a.documentPreferences,n)),null!=l&&(a=a.focusNode(l,-1)),a});null!=e?m=e.commit(m):console.warn(a)}return i.length>0&&(m=(0,es.ZP)(m,e=>{for(let t of i)e.attachments.completedNodeIDs.add(t);return e})),d.length>0&&(m=(0,es.ZP)(m,e=>{for(let t of d)e.attachments.recurNodeIDs.add(t);return e})),m},[c4]:function(e,t){let{contents:a,history:n,slate:l}=e,{nodeID:r}=t.payload;if(!a.nodes.has(r))return e;let o=(l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,data:n}=t.payload;return e.update(a,e=>e.toggleLink(n))}(l,t)).getIn([r,"text"]),i=(0,Df.xc)(o.document),[s,d]=a.setTextInNodeWithDeltaSnapshot(r,i);return null!=d&&(n=n.saveChange({ops:[d]}),a=s),{...e,contents:a,history:n,slate:l}},[c6]:function(e,t){let{contents:a,history:n,slate:l}=e,{nodeID:r}=t.payload;if(!a.nodes.has(r))return e;let o=(l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,projectTitle:n,data:l,range:r}=t.payload;return e.update(a,e=>e.insertAutocompleteHyperlink(n,l,r))}(l,t)).getIn([r,"text"]),i=(0,Df.xc)(o.document),[s,d]=a.setTextInNodeWithDeltaSnapshot(r,i);return null!=d&&(n=n.saveChange({ops:[d]}),a=s),{...e,contents:a,history:n,slate:l}},[c8]:function(e,t){let{contents:a,history:n,slate:l}=e,{nodeID:r}=t.payload;if(!a.nodes.has(r))return e;let o=(l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,handle:n,range:l}=t.payload;return e.update(a,e=>e.insertAutocompleteMention(n,l))}(l,t)).getIn([r,"text"]),i=(0,Df.xc)(o.document),[s,d]=a.setTextInNodeWithDeltaSnapshot(r,i);return null!=d&&(n=n.saveChange({ops:[d]}),a=s),{...e,contents:a,history:n,slate:l}},[c7]:function(e,t){let{contents:a,history:n,slate:l}=e,{nodeID:r}=t.payload;if(!a.nodes.has(r))return e;let o=(l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,tag:n,range:l}=t.payload;return e.update(a,e=>e.insertAutocompleteTag(n,l))}(l,t)).getIn([r,"text"]),i=(0,Df.xc)(o.document),[s,d]=a.setTextInNodeWithDeltaSnapshot(r,i);return null!=d&&(n=n.saveChange({ops:[d]}),a=s),{...e,contents:a,history:n,slate:l}},[c9]:function(e,t){let{contents:a,history:n,slate:l}=e,{nodeID:r}=t.payload;if(!a.nodes.has(r))return e;let o=(l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,text:n,range:l}=t.payload;return e.update(a,e=>e.insertAutocompleteText(n,l))}(l,t)).getIn([r,"text"]),i=(0,Df.xc)(o.document),[s,d]=a.setTextInNodeWithDeltaSnapshot(r,i);return null!=d&&(n=n.saveChange({ops:[d]}),a=s),{...e,contents:a,history:n,slate:l}},[c3]:function(e,t){let{contents:a,history:n}=e,{slate:l}=e,{nodeID:r}=t.payload;if(!a.nodes.has(r))return e;let o=(l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eBB,t=arguments.length>1?arguments[1]:void 0,{nodeID:a,type:n,data:l}=t.payload;return e.update(a,e=>e.toggleMark(n,l))}(l,t)).getIn([r,"text"]),i=(0,Df.xc)(o.document),[s,d]=a.setTextInNodeWithDeltaSnapshot(r,i);return null!=d&&(n=n.saveChange({ops:[d]}),a=s),{...e,contents:a,history:n,slate:l}},[IH]:function(e,t){let{contents:a,slate:n}=e,{selectedIds:l,type:r,data:o}=t.payload,i=function(e,t){let a=[];for(let n of e){t.rootID!==n&&a.push(n);let e=t.findDescendantsForNode(n);a.push(...e)}return a}(l,a),s=function(e,t,a,n){for(let l of e){let e=n.getIn([l,"text"]);if(null==e||!ezo(e,t,a))return!1}return!0}(i,r,o,n),[d,c]=eBG.perform(e,e=>{for(let t of i){let a=e.slate.getIn([t,"text"]);if(null==a)throw Error("Unknown Node ID");if(s){let n=a.change().call(RA,r,o);e=e.changeNodeText(t,n)}else if(!ezo(a,r,o)){let n=a.change().call(RA,r,o);e=e.changeNodeText(t,n)}}return e});return null==d?(console.warn(c),e):d.commit(e)},[Iz]:function(e,t){let a=li.Contents.create(),n=new li.History,l=emk.create(),r=eBN.create({urlComponents:e.session.urlComponents,firebaseNotificationPermission:e.session.firebaseNotificationPermission}),o=a.nodes.map(eB_.createWithNode),i=emu.create();return{...e,attachments:eBD,contents:a,history:n,documentPreferences:i,meta:{},search:l,session:r,slate:o}},[me]:function(e,t){let{contents:a}=t.payload,n=li.Contents.deserialize(a),l=new li.History,r=emk.create(),o=n.nodes.map(eB_.createWithNode);return{...e,contents:n,history:l,search:r,slate:o}},[mt]:function(e,t){var a;let{contents:n,history:l}=e,{nodeID:r,type:o,value:i}=t.payload,s=(a=n,Array.isArray(r)?1===r.length&&r[0]===a.rootID?a.rootNode.children.toArray():r:r===a.rootID?a.rootNode.children.toArray():[r]),d=n,c=[];for(let t of s){let[a,n]=d.setFormatInNode(t,o,i);if(null==n)return e;d=a,c.push(n)}return l=l.saveChange({ops:c}),n=d,(0,es.ZP)(e,e=>(e.contents=n,e.history=l,e))},[ma]:function(e,t){let{nodeId:a,note:n}=t.payload,l=e,[r,o]=eBG.perform(l,e=>e.putNote(a,n));return null!=r?l=r.commit(l):console.warn(o),l},[m_]:function(e,t){let{session:a}=e;return a=a.setNoteOpenNodeId(t.payload.nodeId),{...e,session:a}},[N0]:function(e,t){let{contents:a,search:n,attachments:l}=e,{query:r}=t.payload;return{...e,search:n.updateContentsAndQuery(a,l,r)}},[N1]:function(e,t){let{contents:a,search:n,attachments:l}=e,{queryItem:r}=t.payload,o=n.getQueryItems(n),i=o.findIndex(e=>r===e);if(-1===i){let t=[...o,r].join(" ");return{...e,search:n.updateContentsAndQuery(a,l,t)}}{let t=[...o];t.splice(i,1);let r=t.join(" ");return{...e,search:n.updateContentsAndQuery(a,l,r)}}},[N2]:function(e,t){let{contents:a,search:n}=e,{nodeID:l,collapse:r}=t.payload;if(!n.isActive)return console.warn("Attempts to toggle collapse of search node when search is not active…"),e;let o=a.findNodeByID(l);return eu()(o)?(console.warn(`Node (${l}) could not be found…`),e):o.hasChild?(n.isNodeIDVisible(l)||console.warn(`Node (${l}) is not visible…`),{...e,search:n.withMutations(e=>{e.addVisibleNodes(o.children.toArray()),e.toggleCollapseOfNodeID(o.id,r)})}):(console.warn(`Node (${l}) has no children…`),e)},[ehs]:function(e,t){let{contents:a,documentPreferences:n}=e;return{...e,documentPreferences:n.updateContents(a,t.payload.hideCompleted)}},[Iq]:function(e,t){let a=(0,lr.replaceIDs)(t.payload.fragment),n=t.payload.target,[l,r]=eBG.perform(e,e=>{e=e.insertFragmentAdjacentToTarget(n,a);let t=a.children[0]?.id;return null!=t&&(e=e.focusNode(t,-1)),e});return null==l?(console.warn(r),e):l.commit(e)},[IG]:function(e,t){var a;let{contents:n,attachments:l}=e,{nodeId:r,ancestors:o}=t.payload,i=CP()(o);if(null==i)return e;let s=n.findPreviousNodeID(r,o);if(null==s||null!=(a=l[r])&&((a?.media?.uploadingAttachments??[]).length>0||(a?.media?.attachments??[]).length>0||(a?.assignees?.total??0)>0||(a?.dates?.total??0)>0||(a?.countdowns?.total??0)>0||(a?.reactionCollections?.total??0)>0))return e;if(n.getIn(["nodes",i,"children"]).includes(s)){let t=e.slate.getIn([r,"text"]);if(null==t)return e;let a=e.slate.getIn([s,"text"]);if(null==a||function(e,t,a){let n=e.findNodeByID(t);if(n?.attributes?.note==null||0===n.attributes.note.value.length)return!1;let l=e.findNodeByID(a);return l?.attributes?.note!=null&&0!==l.attributes.note.value.length}(n,r,s))return e;let l=a.change();{let e=t.document,a=l.value.document,n=(a=(l=l.collapseToEndOf(a)).value.document).text.length;l=l.insertFragment(e).moveOffsetsTo(n,n).focus()}let[o,d]=eBG.perform(e,e=>e.adoptChildrenIfNeeded(r,s).adoptNoteIfNeeded(r,s).deleteNode(r,i).changeNodeText(s,l));return null==o?(console.warn(d),e):o.commit(e)}{let t=n.getIn(["nodes",r]);if(null==t||t.children.size>0)return e;let a=e.slate.getIn([r,"text"]);if(null==a)return e;let l=e.slate.getIn([s,"text"]);if(null==l)return e;let o=a.document;if(!ts()(o.text))return e;let d=l.change();{let e=d.value.document,t=(e=(d=d.collapseToEndOf(e)).value.document).text.length;d=d.insertFragment(o).moveOffsetsTo(t,t).focus()}let[c,m]=eBG.perform(e,e=>e.adoptChildrenIfNeeded(r,s).deleteNode(r,i).changeNodeText(s,d));return null==c?(console.warn(m),e):c.commit(e)}},[IK]:function(e,t){let{slate:a,contents:n}=e,{nodeId:l,ancestors:r}=t.payload;if(l===n.rootID)return e;let o=CP()(r);if(null==o)return e;let i=n.findNextNodeID(l,r);if(null==i||i===l)return e;let s=n.getIn(["nodes",o,"children"]);if(null==s||!s.contains(i))return e;let d=a.getIn([i,"text","document"]);if(null==d)return e;let c=a.getIn([l,"text"]);if(null==c)return e;let m=c.document.text.length,u=c.change().insertFragment(d).moveOffsetsTo(m,m),[p,g]=eBG.perform(e,e=>e.adoptChildrenIfNeeded(i,l).deleteNode(i,o).changeNodeText(l,u));return null==p?(console.warn(g),e):p.commit(e)},[IY]:function(e,t){let{contents:a,slate:n}=e,{nodeId:l,ancestors:r}=t.payload,o=CP()(r),i=n.getIn([l,"text"]);if(null==i)return e;let s=function(e){let t=e.change();t.value.isExpanded&&(t=t.delete());let{document:a,selection:n}=t.value,l=a.getTexts(),r=l.first(),o=l.last(),i=eg.e6.create({anchorKey:r.key,anchorOffset:0,focusKey:n.anchorKey,focusOffset:n.anchorOffset}),s=eg.e6.create({anchorKey:n.anchorKey,anchorOffset:n.anchorOffset,focusKey:o.key,focusOffset:o.text.length}),d=a.getFragmentAtRange(i),c=a.getFragmentAtRange(s);return[t,{left:{fragment:d,isEmpty:0===d.text.length,selection:i},right:{fragment:c,isEmpty:0===c.text.length,selection:s}}]}(i),d=s[0],c=s[1],{left:m,right:u}=c,p=dA(e);if(null==o)return eBY(e,l,d,u,o);{let t=a.getIn(["nodes",o]);if(null==t)return e;if(t.isLastChild(l)&&m.isEmpty&&u.isEmpty&&o!==a.rootID){let[t,a]=eBG.perform(e,e=>e.outdentNode(l,r));return null==t?(console.warn(a),e):t.commit(e)}{let t=a.getIn(["nodes",l]);if(null==t)return e;let n="action"===p&&o===a.rootID,i="board"===p&&o===a.rootID,s=(0,li.isHeading)(t.getIn(["format","node"]));return!t.collapsed&&(t.hasChild||s)||n||i?u.isEmpty?eBY(e,l,d,u,o):eBQ(e,t,r,d,c):(u.isEmpty,eBQ(e,t,r,d,c))}}},[IX]:function(e,t){let{slate:a,contents:n}=e,{nodeId:l,ancestors:r}=t.payload,o=n.findNodeByID(l);if(null==o||o.textString.length>0)return e;let i=a.getIn([l,"text"]);if(null==i)return e;let s=t.payload.fragment;if(0===s.children.length)return e;let d=s.children[0];if(s=(0,es.ZP)(s,e=>(e.children.shift(),e)),null==d)return e;let c=(0,Df.MS)(new(CI())(d.text)),m=i.change().insertFragment(c.document),u={type:"fragment",children:d.children},[p,g]=eBG.perform(e,e=>(e=e.changeNodeText(l,m),null!=d.format&&(null!=d.format.node&&(e=e.setFormatInNode(l,"node",d.format.node)),null!=d.format.children&&(e=e.setFormatInNode(l,"children",d.format.children))),null!=d.completed&&(e=e.setComplete([l],d.completed)),u.children.length>0&&(e=e.insertFragmentAdjacentToTarget({id:l,position:"afterbegin"},u)),s.children.length>0&&(e=e.insertFragmentAdjacentToTarget({id:l,parentId:CP()(r),position:"afterend"},s)),null!=l&&(e=e.focusNode(l,-1)),e));return null==p?(console.warn(g),e):p.commit(e)},[I0]:function(e,t){let{selectedIds:a}=t.payload,{contents:n}=e;if(0===a.length)return e;let l=n.findParentNodeByID(a[0]);if(null==l)return e;let r=function(e,t){let a=e.indexOfChildNodeID(t[0]);for(let n of t){let t=e.indexOfChildNodeID(n);te.deleteNodes(a).insertFragmentAdjacentToTarget(r,i).focusNode(o,0));return null==s?(console.warn(d),e):s.commit(e)},[I1]:function(e,t){let{selectedIds:a}=t.payload;if(a.isEmpty())return e;let{contents:n,documentPreferences:l}=e,[r]=eBG.perform(e,e=>{let t=function(e,t,a){if(e.isEmpty())return t.rootID;let n=t.findParentNodeByID(e.first());if(null==n)return t.rootID;let l=n.children.findLast(t=>null!=t&&e.has(t));if(null==l)return t.rootID;let r=Jv(t,a,l,!0);return null==r?function(e,t,a){if(!a.isActive)return t.findFurthestNodeID(e);let n=e,l=eBK(n,t,a);for(;null!=l;)l=eBK(n=l,t,a);return n}(l,t,a):r}(a,n,l);return e.focusNode(t)});return null!=r?r.commit(e):e},[I2]:function(e,t){let{selectedIds:a}=t.payload;if(a.isEmpty())return e;let{contents:n,documentPreferences:l}=e,[r]=eBG.perform(e,e=>{let t=function(e,t,a){if(e.isEmpty())return t.rootID;let n=t.findParentNodeByID(e.first());if(null==n)return t.rootID;let l=n.children.find(t=>null!=t&&e.has(t));if(null==l)return t.rootID;let r=Jk(t,a,l);return null==r?t.rootID:r}(a,n,l);return e.focusNode(t)});return null!=r?r.commit(e):e},[I5]:function(e,t){let{nodeId:a}=t.payload,{contents:n,history:l}=e,r=n.findAncestorsForNode(a);if(0===r.length)return e;let[o,i]=n.setCollapseInNodes(r,!1);return null==i?e:(n=o,l=l.saveChange({ops:i}),(0,es.ZP)(e,e=>(e.contents=n,e.history=l,e)))},[I3]:function(e,t){let{contents:a,history:n}=e,{nodeId:l,sortBy:r}=t.payload;if(null==a.findNodeByID(l))return e;let o=a;switch(r){case O.CompleteAsc:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eBX.bind(void 0,e),eB8));break;case O.CompleteDesc:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eBX.bind(void 0,e),eB7));break;case O.DueDate:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eB1.bind(void 0,e),eB9));break;case O.AlphabeticalAsc:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eB0.bind(void 0,e),eze));break;case O.AlphabeticalDesc:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eB0.bind(void 0,e),ezt));break;case O.Tag:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eB2.bind(void 0,e),eze));break;case O.Mention:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eB5.bind(void 0,e),eze));break;case O.DateCreated:o=a.updateIn(["nodes",l,"children"],t=>t.sortBy(eB3.bind(void 0,e),eza))}let i=a.diff(o);if(0===i.ops.length)return e;let s=n.saveChange({ops:i.ops});return(0,es.ZP)(e,e=>(e.contents=o,e.history=s,e))},[I4]:function(e,t){let{contents:a,history:n,slate:l,documentPreferences:r}=e,{contents:o}=t.payload,i=a.diff(o);if(0===i.ops.length)return e;for(let e of(n=n.saveChange({ops:i.ops}),i.ops))switch(!0){case(0,li.isSubtypeOp)(e,"delta"):{let{p:t,o:a}=e;if(3!==t.length)continue;let n=t[1];if(!(0,eq.isEqual)(t,["nodes",n,"text"]))continue;l=l.updateIn([n,"text"],e=>{let t=(0,Df.Rx)(e,a),n=e.change();return n.applyOperations(t,{save:!1}),n.value});break}case(0,li.isObjectDeleteOp)(e):{let{p:t}=e;if(2!==t.length)continue;let a=t[1];l=l.delete(a),r=r.removeVisibleNodes([a]);break}case(0,li.isObjectInsertOp)(e):{let{p:t}=e;if(2!==t.length)continue;let a=t[1],n=o.findNodeByID(a);l=l.set(a,eB_.createWithNode(n)),r=r.checkNodes(o,[n]);break}case(0,li.isObjectReplaceOp)(e):{let{p:t}=e;if(2!==t.length){let e=t[1],a=o.findNodeByID(e);r=r.checkNodes(o,[a]);continue}let a=t[1];throw Error(`We do not support replacing node at ${a}…`)}}return{...e,contents:o,history:n,slate:l,documentPreferences:r}},[I6]:function(e,t){let[a,n]=eBG.perform(e,a=>{let{nodeId:n,range:l,nodeFormat:r}=t.payload,{contents:o,slate:i}=e,s=o.rootID;if(null==o.findNodeByID(s)||null==o.findNodeByID(n))return a;let d=i.getIn([n,"text"]);if(null==d)return a;let c=function(e){if(e.end<=e.start)return null;let t=new(CI());return e.start>0&&(t=t.retain(e.start)),t=t.delete(e.end-e.start)}(l);if(null==c)return a;let m=(0,Df.Rx)(d,c),u=d.change();return u=u.applyOperations(m,{save:!1}),a.changeNodeText(n,u).setFormatInNode(n,"node",r)});return null==a?(console.warn(n),e):a.commit(e)},[I8]:function(e,t){let{slate:a,contents:n}=e,{nodeId:l,parentId:r}=t.payload,o=t.payload.fragment;if(null==n.findNodeByID(l))return e;let i=a.getIn([l,"text"]);if(null==i)return e;let s=o.children[0];if(o=(0,es.ZP)(o,e=>{e.children.shift()}),null==s)return e;let d=(0,Df.MS)(new(CI())(s.text)),c=i.change().collapseToStartOf(i.document).selectAll().insertFragment(d.document),m={type:"fragment",children:s.children},[u,p]=eBG.perform(e,e=>(e=e.changeNodeText(l,c),m.children.length>0&&(e=e.insertFragmentAdjacentToTarget({id:l,position:"afterbegin"},m)),o.children.length>0&&(e=e.insertFragmentAdjacentToTarget({id:l,parentId:r,position:"afterend"},o)),e));return null==u?(console.warn(p),e):u.commit(e)}}),ezs=(0,ek.UY)({cloudUpload:uN.reducer,embed:Zl.reducer,media:Z$.reducer,moveFolder:_l.reducer,changeTimezone:cL.reducer,historyRevert:C_.reducer,invitePicker:Ez.reducer,deleteAccount:hT.reducer,print:Mk.reducer,projectSettings:M1.reducer,node:jr.reducer,calendarAddNode:est.reducer,quickAdd:uO.reducer,aiAssistant:DT.reducer,managePeopleGroup:e_a.reducer,aiCreateProject:Nj.reducer,projectAiAddBlock:Gx.reducer,editSpace:En.reducer,copyDocuments:gO.reducer,moveDocuments:xX.reducer,mfaSetup:eII.reducer,aiPromptTemplates:co.reducer,mediaAi:Pw.reducer,spaceMediaPreview:eAN.reducer,aiCreditLimit:ce.reducer,createSpaceAgent:TN.reducer,editSpaceAgent:TS.reducer,oauthCreate:eIj.reducer,oauthUpdate:eIF.reducer,spaceAgentChat:Uy.reducer,createFlow:eRe.reducer,upgradeDialog:_M.reducer}),ezd={collaborators:{fetchStatus:{}},starred:{list:[],fetchStatus:uv},shared:{list:[],fetchStatus:uv}};function ezc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ezd,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case xs:{let{documentID:a}=t.payload,n=ec()(e,["shared","list"],[]);return{...e,shared:{...e.shared,list:eBF()(n,a)}}}case xd:{let{documentID:a,fetchStatus:n}=t.payload;return{...e,collaborators:{...e.collaborators,fetchStatus:{...e.collaborators.fetchStatus,[a]:n}}}}case xc:return{...e,shared:{...e.shared,fetchStatus:t.payload.fetchStatus}};case xm:return{...e,shared:{...e.shared,list:t.payload.documents}};default:return e}}function ezm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:emu.create(),t=arguments.length>1?arguments[1]:void 0;return t.type,e}let ezu=eBA({comments:{}},{[KL]:(0,es.ZP)((e,t)=>{let{documentID:a,nodeID:n,draft:l}=t.payload;pA()(e,["comments",a,n],l)})});var ezp=a(66604),ezg=a.n(ezp);let ezf={accounts:{entities:{}},assignments:{entities:{}},spaces:{entities:{}},collaborators:{entities:{}},documents:{entities:{}},memberships:{entities:{}},tags:{entities:{}},users:{entities:{}}};function ezh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ezf,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case xr:return ezg()(e,(e,a)=>({...e,entities:Object.entries(t.payload[a]||{}).reduce((e,t)=>{let[a,n]=t;return{...e,[a]:{...e[a]||{},...n}}},e.entities)}));case"Entities/REMOVE_ENTITIES":return ezg()(e,(e,a)=>({...e,entities:Vd()(e.entities,t.payload[a])}));default:return e}}function ezy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return arguments.length>1&&arguments[1],e}function ezb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===l6?null:e}function ezv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new li.History;return arguments.length>1&&arguments[1],e}let ezk={};function ezE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ezk,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Fn:return{...e,...t.payload.meta,newborn:!0};case Fr:return function(e,t){let{meta:a}=t.payload;return{...e,...a}}(e,t);case xT:return function(e,t){let{space:a}=t.payload,n=eu()(a)?null:{id:a.id,color:a.color};return{...e,space:n}}(e,t);case x$:return{...e,preferences:{...e.preferences,...t.payload.preferences}};case xP:return function(e,t){let{conference:a}=t.payload;return{...e,conference:a}}(e,t);default:return e}}let ezx={isOpen:!1},ez_=eBA(ezx,{[uR]:function(e){return(0,es.ZP)(e,e=>{e.isOpen=!e.isOpen})}}),ezw={isOpen:!1,resource:null},ezN=eBA(ezw,{[f$]:function(e,t){let{resource:a}=t.payload;return(0,es.ZP)(e,e=>(e.isOpen?(e.isOpen=!1,e.resource=null):(e.isOpen=!0,e.resource=a),e))}}),ezC={isOpen:!1},ezM=eBA(ezC,{[E5]:function(e){return(0,es.ZP)(e,e=>(e.isOpen=!0,e))},[E2]:function(e){return(0,es.ZP)(e,e=>(e.isOpen?e.isOpen=!1:e.isOpen=!0,e))}}),ezS={isOpen:!1,documentID:null,nodeID:null},ezI=eBA(ezS,{[$Z]:function(e,t){return(0,es.ZP)(e,e=>{if(!e.isOpen&&null!=t.payload){let{documentID:a,nodeID:n}=t.payload;if(null!=a&&null!=n)return e.isOpen=!0,e.documentID=a,e.nodeID=n,e}return e.isOpen=!1,e.documentID=null,e.nodeID=null,e})}}),ezD={isOpen:!1,resource:null},ezT=eBA(ezD,{[_d]:function(e){return(0,es.ZP)(e,e=>(e.isOpen?e.isOpen=!1:e.isOpen=!0,e))}}),ez$={isOpen:!1,platform:void 0},ezP=eBA(ez$,{[NO]:function(e,t){let{platform:a}=t.payload;return(0,es.ZP)(e,e=>(null!=a?(e.isOpen=!0,e.platform=a):(e.isOpen=!e.isOpen,e.platform=void 0),e))}}),ezF={isOpen:!1,parentID:null,parentName:"",parentType:null,parentTaskadePlanType:null},ezA=eBA(ezF,{[gZ]:function(e,t){let{parentID:a,parentName:n,parentType:l,parentTaskadePlanType:r}=t.payload;return(0,es.ZP)(e,e=>(e.isOpen?(e.isOpen=!1,e.parentID=null,e.parentname="",e.parentType=null,e.parentTaskadePlanType=null):(e.isOpen=!0,e.parentID=a,e.parentName=n,e.parentType=l,e.parentTaskadePlanType=r),e))}}),ezR={documentID:null,isOpen:!1,spaceID:null},ezj=eBA(ezR,{[xn]:function(e,t){return(0,es.ZP)(e,e=>(e.documentID=null,e.isOpen=!1,e.spaceID=null,e))},[xa]:function(e,t){let{documentID:a,options:n}=t.payload,{spaceID:l}=n;return(0,es.ZP)(e,e=>(e.isOpen||ts()(a)?(e.documentID=null,e.isOpen=!1,e.spaceID=null):(e.isOpen=!0,e.documentID=a,e.spaceID=l),e))}}),ezO={documentID:null,spaceID:null,isOpen:!1,isTemplate:!1,duplicate:!1,redirect:!1},ezU=eBA(ezO,{[px]:function(e,t){return(0,es.ZP)(e,e=>(e.documentID=null,e.spaceID=null,e.isOpen=!1,e.isTemplate=!1,e.duplicate=!1,e.redirect=!1,e))},[pE]:function(e,t){let{payload:a}=t,n=a.documentID??null,l=a.options?.duplicate??!1,r=a.options?.isTemplate??!1,o=a.options?.spaceID??null,i=a.options?.redirect??!1;return(0,es.ZP)(e,e=>(e.isOpen||ts()(n)?(e.documentID=null,e.spaceID=null,e.isOpen=!1,e.isTemplate=!1,e.duplicate=!1,e.redirect=!1):(e.isOpen=!0,e.documentID=n,e.spaceID=o,e.isTemplate=!!eBg()(r)&&r,e.duplicate=l,e.redirect=i),e))}}),ezZ={createSpace:ezF,documentCopyV2:ezO,documentMove:{isOpen:!1,documentID:null,updateMetaSpace:!1,callback:null},documentMoveV2:ezR,documentInvite:{isOpen:!1,documentID:null},spaceLeave:{isOpen:!1},spaceDelete:{isOpen:!1},spaceJoin:{isOpen:!1},spaceNotification:{isOpen:!1},documentNotification:{isOpen:!1},signUpConversion:{isOpen:!1},signUpCreatorConversion:{isOpen:!1},loginSignup:{isOpen:!1,activeView:"signup",copyAsTemplate:!1,enableCopyList:!1},invite:ezw,shortcuts:ezD,command:ezx,import:ez$,largeFile:ezC,nodeComments:ezS};function ezL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ezZ,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"@@taskade/modal/SET_DOCUMENT_INVITE_DOCUMENT":return function(e,t){let{documentID:a}=t.payload;return{...e,documentInvite:{...e.documentInvite,documentID:a}}}(e,t);case"@@taskade/modal/SET_DOCUMENT_MOVE_MODAL_DOCUMENT":return{...e,documentMove:{...e.documentMove,documentID:t.payload.documentID}};case rc:return function(e,t){let{isOpen:a,activeView:n,copyAsTemplate:l,enableCopyList:r}=t.payload;return{...e,loginSignup:{...e.loginSignup,isOpen:p7()(a)?e.loginSignup.isOpen:a,activeView:p7()(n)?e.loginSignup.activeView:n,copyAsTemplate:p7()(l)?e.loginSignup.copyAsTemplate:l,enableCopyList:p7()(r)?e.loginSignup.enableCopyList:r}}}(e,t);case"@@taskade/modal/TOGGLE_DOCUMENT_INVITE_MODAL":return function(e,t){let a={...e.documentInvite,isOpen:!e.documentInvite.isOpen};return p7()(t.payload.documentID)||(a.documentID=t.payload.documentID),{...e,documentInvite:a}}(e,t);case rm:return{...e,spaceLeave:{isOpen:!e.spaceLeave.isOpen}};case ru:return{...e,spaceDelete:{isOpen:!e.spaceDelete.isOpen}};case"@@taskade/modal/TOGGLE_SPACE_JOIN_MODAL":return{...e,spaceJoin:{isOpen:!e.spaceJoin.isOpen}};case rp:return{...e,spaceNotification:{isOpen:!e.spaceNotification.isOpen}};case rg:return{...e,documentNotification:{isOpen:!e.documentNotification.isOpen}};case rf:return function(e){let t=!e.loginSignup.isOpen;return{...e,loginSignup:{...e.loginSignup,isOpen:t,copyAsTemplate:!!t&&e.loginSignup.copyAsTemplate,enableCopyList:!!t&&e.loginSignup.enableCopyList}}}(e,t);case px:case pE:return(0,es.ZP)(e,e=>(e.documentCopyV2=ezU(e.documentCopyV2,t),e));case xn:case xa:return(0,es.ZP)(e,e=>(e.documentMoveV2=ezj(e.documentMoveV2,t),e));case gZ:return(0,es.ZP)(e,e=>(e.createSpace=ezA(e.createSpace,t),e));case f$:return(0,es.ZP)(e,e=>(e.invite=ezN(e.invite,t),e));case _d:return(0,es.ZP)(e,e=>(e.shortcuts=ezT(e.shortcuts,t),e));case uR:return(0,es.ZP)(e,e=>(e.command=ez_(e.command,t),e));case NO:return(0,es.ZP)(e,e=>(e.import=ezP(e.import,t),e));case E5:case E2:return(0,es.ZP)(e,e=>(e.largeFile=ezM(e.largeFile,t),e));case $Z:return(0,es.ZP)(e,e=>(e.nodeComments=ezI(e.nodeComments,t),e));default:return e}}function ezB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return arguments.length>1&&arguments[1],e}let ezz=lw().object({id:lw().string().required(),userId:lw().number().integer().required(),updatedAt:lw().number().integer().required(),type:lw().number().integer().required(),focusState:lw().object({nodeId:lw().string().allow(null).allow("").optional()}).allow(null).optional()}).required();function ezV(e,t,a){let n=e.nodes[a];return null==n?e.nodes[a]=[t]:-1===n.findIndex(e=>e===t)&&n.push(t),e}function ezq(e,t,a){let n=e.nodes[a];if(null==n)return e;let l=n.findIndex(e=>e===t);return l>-1&&n.splice(l,1),0===n.length&&delete e.nodes[a],e}let ezW=eBA({selfPresenceID:"",presences:{},nodes:{},users:new Map},{[zV]:function(e,t){let{selfPresenceID:a}=t.payload;return(0,es.ZP)(e,e=>(e.selfPresenceID=a,e))},[zq]:function(e,t){let{presenceEvent:a}=t.payload,{presences:n}=a;return null==n?e:(0,es.ZP)(e,e=>{for(let t of n){let a=ezz.validate(t);if(null!=a.error)continue;let{id:n,userId:l,type:r,updatedAt:o,focusState:i}=a.value;if(n===e.selfPresenceID)continue;let s=ts()(i?.nodeId)?void 0:i?.nodeId;switch(r){case BO.PresenceType.AVAILABLE:{let t=e.presences[n];if(null==t)e.presences[n]={presenceID:n,userID:l,updatedAt:o,focusedNodeID:s},null!=s&&ezV(e,n,s);else{let a=t.focusedNodeID;t.updatedAt=o,t.focusedNodeID=s,a!==s&&(null!=a&&ezq(e,n,a),null!=s&&ezV(e,n,s))}let a=e.users.get(l);null==a?e.users.set(l,new Set([n])):a.add(n);break}case BO.PresenceType.UNAVAILABLE:{let t=e.presences[n];null!=t&&(null!=t.focusedNodeID&&ezq(e,n,t.focusedNodeID),delete e.presences[n]);let a=e.users.get(l);null!=a&&(a.delete(n),0===a.size&&e.users.delete(l))}}}return e})},[zW]:function(e){return(0,es.ZP)(e,e=>(e.presences={},e.nodes={},e))}});function ezH(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:emk.create(),t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_VISIBLE_NODES":{let{nodes:a}=t.payload;return e.addVisibleNodes(a)}case N5:return e.set("isOpen",!e.isOpen);default:return e}}let ezG=eBA(eBN.create(),{[sg]:function(e,t){return e.set("backendError",null)},[Fl]:function(e,t){let{syncState:a}=t.payload;return e.set("syncState",a)},[sc]:function(e,t){return e.set("outOfSync",!0)},[sm]:function(e,t){let{status:a,result:n}=t.payload;return e.setFetch(a,n)},[sb]:function(e,t){return e.set("firebaseNotificationPermission",t.payload.permission)},[su]:function(e,t){return e.set("spaceIsNew",t.payload.spaceIsNew)},[sp]:function(e,t){return e.set("userIsNew",t.payload.userIsNew)},[sf]:function(e,t){return e.set("sideDrawerIsOpen",t.payload.open??!e.sideDrawerIsOpen)},[sy]:function(e){return e.set("sideDrawerIsOpen",!1)},[sh]:function(e,t){return null==t.payload.open?e.update("rightSidebarIsOpen",e=>!e):e.set("rightSidebarIsOpen",t.payload.open)}});var ezK=a(44908),ezY=a.n(ezK);let ezQ={avatar:{uploadStatus:uv}},ezJ={spaces:{list:[],archivedList:[],fetchStatus:uv},documents:{active:{spaces:{},fetchStatus:{}},archived:{spaces:{},fetchStatus:{}},templated:{spaces:{},fetchStatus:{}}},memberships:{spaces:{},fetchStatus:{}},files:{}};function ezX(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ezJ,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case eRz:return(0,es.ZP)(e,e=>{let{documentStatus:a,spaceID:n,fetchStatus:l}=t.payload;return e.documents[a].fetchStatus[n]=l,e});case eRV:{let{documentStatus:a}=t.payload;return{...e,documents:{...e.documents,[a]:{...e.documents[a],spaces:{...e.documents[a].spaces,[t.payload.spaceID]:t.payload.documents}}}}}case eRq:{let{spaceID:a,documentID:n,documentStatus:l,position:r}=t.payload,o=ec()(e,["documents",l,"spaces",a],[]),i=[...o.slice(0,r),n,...o.slice(r)];return{...e,documents:{...e.documents,[l]:{...e.documents[l],spaces:{...e.documents[l].spaces,[t.payload.spaceID]:i}}}}}case eRH:{let{spaceID:a,documentID:n,documentStatus:l}=t.payload,r=ec()(e,["documents",l,"spaces",a],[]),o=eBF()(r,n);return{...e,documents:{...e.documents,[l]:{...e.documents[l],spaces:{...e.documents[l].spaces,[t.payload.spaceID]:o}}}}}case eRK:return function(e,t){let{spaceID:a,uploadStatus:n}=t.payload;return{...e,files:{[a]:{...ezQ,avatar:{uploadStatus:n}}}}}(e,t);case eRY:return{...e,memberships:{...e.memberships,fetchStatus:{...e.memberships.fetchStatus,[t.payload.spaceID]:t.payload.fetchStatus}}};case eRQ:return{...e,memberships:{...e.memberships,spaces:{...e.memberships.spaces,[t.payload.spaceID]:t.payload.memberships},fetchStatus:{...e.memberships.fetchStatus,[t.payload.spaceID]:t.payload.fetchStatus}}};case eRL:return function(e,t){let{payload:{archived:a,spaceID:n}}=t,{list:l,archivedList:r}=e.spaces,o=a?eBF()(l,n):[...l,n],i=a?[...r,n]:eBF()(r,n);return{...e,spaces:{...e.spaces,list:ezY()(o),archivedList:ezY()(i)}}}(e,t);default:return e}}let ez0=function(e){let t=(0,ek.UY)({attachments:eB$,auth:eBj,chatroom:eBO,context:eBZ,dialogs:ezs,documents:ezc,documentPreferences:ezm,drafts:ezu,entities:ezh,history:ezv,meta:ezE,modal:ezL,contents:eBU,search:ezH,session:ezG,router:(0,eD.iz)(e),spaces:ezX,slate:eBV,growl:ezb,notifications:(0,l3.createReducer)(5),settings:eBb,presence:ezW,appsumo:eBC,oauth2:ezB,flowOAuth2:ezy});return eBE()(t,ezi)},ez1=function(e){let{apolloClient:t,getAgentLocale:a,store:n,history:l}=e;return ev.createElement(eN.e,{client:t},ev.createElement(e$.Provider,{store:n},ev.createElement(eD.xI,{history:l,store:n},ev.createElement(eL1,{getAgentLocale:a},ev.createElement(eLX,null,ev.createElement(sK,{header:"Uh oh!",subheader:"A critical error occurred. Please click the link below to refresh the page.",imageUrl:"/images/generic_error.svg",showReturnLink:!0}))))))};function ez2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,eb.lX)(),l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){let e=new eL8.h({possibleTypes:{IUser:["CurrentUser","User"],IPaymentMethod:["StripeCard"],SearchHit:["SearchHitNode","SearchHitComment"]},typePolicies:eBu});"undefined"!=typeof window&&null!=window.__APOLLO_STATE__&&e.restore(window.__APOLLO_STATE__);let t=new eL7.A({uri:"/graphql",batchMax:10,batchInterval:40,fetch:eBt()}),a=new URL("/graphql/subscription","https://www.taskade.com");if("http:"===a.protocol)a.protocol="ws:";else if("https:"===a.protocol)a.protocol="wss:";else throw new ei.TaskadeError({message:`Unknown protocol ${a.protocol} in root URL`});let n=new eBs((0,eBa.eI)({url:a.href})),l=(0,eL4.V)(e=>{let{query:t}=e,a=(0,eL9.p$)(t);return"OperationDefinition"===a.kind&&"subscription"===a.operation},n,t);return new eL6.f({name:"taskade-web-frontend",version:eBn(),link:l,credentials:"same-origin",headers:{"X-Anonymous-ID":u$?.getAnonymousId()??void 0},cache:e,assumeImmutableResults:!0,resolvers:eBd,typeDefs:eBc})}(),r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],i=arguments.length>7&&void 0!==arguments[7]?arguments[7]:ewt,s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:new eh.S,d={apolloClient:l,history:n,queryClient:s},c=(0,ex.ZP)({context:d}),m=[e_.Z.withExtraArgument(d),c,eBv];if(!o){var u;m=[...m,(u=(0,ew.ZP)({transports:["websocket"]}),e=>((function(e,t){let{dispatch:a}=t;e.on("connect",()=>{a(rC())}),e.on("connect_error",e=>{a({type:"@@socket.io/ERROR",payload:{error:e}})}),e.on("disconnect",e=>{a(rM(e))}),e.io.on("error",e=>{a({type:"@@socket.io/CONNECT_ERROR",payload:{error:e}})}),e.io.on("reconnect",e=>{a({type:"@@socket.io/RECONNECT",payload:{attemptNumber:e}})}),e.io.on("reconnect_attempt",e=>{a({type:"@@socket.io/RECONNECT_ATTEMPT",payload:{attemptNumber:e}})}),e.io.on("reconnect_error",e=>{a({type:"@@socket.io/RECONNECT_ERROR",payload:{error:e}})}),e.io.on("reconnect_failed",()=>{a({type:"@@socket.io/RECONNECT_FAILED",payload:{}})})})(u,e),e=>t=>{switch(t.type){case rw:ec()(t,["executor","resolve"])(u);break;case r_:{let{executor:e,payload:a}=t,{eventName:n,args:l}=a;if(eu()(e))u.emit(n,...l);else{let{resolve:t}=e;u.emit(n,...l,t)}break}case rN:u.close().open()}return e(t)}))]}m=[...m,(0,ey.Z)(n)];let p=(0,ek.md)(...m);t&&(p=(0,eE.Uo)({})(p));let g=e?{...e,attachments:{...eBD,...ec()(e,["attachments"],{})},auth:{...eBR,...ec()(e,["auth"],{})},documents:{...ezd,...ec()(e,["documents"],{})},entities:{...ezf,...ec()(e,["entities"],{})},spaces:{...ezJ,...ec()(e,["spaces"],{})}}:e,f=(0,ek.MT)(ez0(n),g,p);a&&c.run(a);let h=gt();return eu()(h)||(h.store=f),ev.createElement(ef.SV,{fallback:e=>ev.createElement(ez1,{apolloClient:l,errorData:e,getAgentLocale:i,store:f,history:n})},ev.createElement(eL3,{apolloClient:l,queryClient:s,getAgentLocale:i,store:f,helmetContext:r,history:n}))}var ez5=a(34857),ez3=a(95142);let ez4=tN()(gr,1500),ez6={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BasicUserParts"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"default_name"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"timezone"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ldpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}},{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]},ez8=(0,la.ZP)` + query ProjectAddonsReactionQuery($id: ID!, $shareToken: ShareTokenInput) { + document(id: $id, shareToken: $shareToken) { + id + addons { + reactionCollections { + id + node_id + emojis { + name + users { + skin + user { + ...BasicUserFields + } + } + created_at + } + } + } + } + } + ${up} +`,ez7={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectAssignmentQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"assignments"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"NullValue"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"initials"}},{kind:"Field",name:{kind:"Name",value:"avatars_v2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"small"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mdpi"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},ez9={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProjectSharedPreferencesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"documentId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"documentId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shared_preferences"}}]}}]}}]};function eVe(e,t,a){let n=a.readQuery({query:ez9,variables:{documentId:e}});if(null==n||null==n.document)return;let l={...n.document.shared_preferences};null==t?(delete l.start,delete l.end):(l.start=t.start,l.end=t.end),a.writeQuery({query:ez9,variables:{documentId:e},data:{...n,document:{...n.document,shared_preferences:l}}})}function eVt(e,t){let a=iP()(t,["type"])&&iP()(t,["id"])?`${t.type}:${t.id}:chatroom`:null;if(null==a)throw Error("chatroomID cannot be null");return(0,ex.GG)(n=>{let l=e=>{n(ex.uR)};return e.on(a,e=>{n({type:euv,payload:{to:t,data:e}})}),e.on("disconnect",l),()=>{e.off(a,l),e.off("disconnect",l)}},ex.Ef.expanding(8))}function*eVa(e){for(;;){let t=yield(0,ez5.qn)(e);if(t.type===euv){let{data:e}=t.payload;switch(e.type){case"attachment/create":yield(0,ez5.gz)(mz(e.attachment,e.info));break;case"attachment/delete":yield(0,ez5.gz)(mV(e.which));break;case"attachment/edit":yield(0,ez5.gz)(mq([e.attachment]));break;case"attachment/due-date/recur":yield(0,ez5.gz)(mq(e.attachments));break;case"attachment/assignee-updated":{let t=hR.Wc.safeParse(e);if(!t.success){uT(new ei.HttpError({code:"BAD_REQUEST",message:"Received bad data from `attachment/assignee-updated`"},{cause:t.error}),uI);break}let a=t.data,{operation:n,projectId:l,nodeId:r,attachmentId:o}=a,i=yield(0,ez5.fw)("apolloClient"),s=i.readQuery({query:Fm,variables:{id:l,shareToken:null}}),d=(0,es.ZP)(s,e=>{if(e?.document!=null)switch(n){case"created":{let t=i.readFragment({fragment:ez6,id:`User:${a.assignee.id}`}),n={__typename:"ProjectAddonAssignee",id:o,nodeId:r,assigner:i.readFragment({fragment:ez6,id:`User:${a.assignee.id}`})??{__typename:"User",id:a.assigner.id.toString(),default_name:`unknown${a.assigner.id}`,display_name:null,handle:`unknown${a.assigner.id}`,initials:"UN",timezone:"Etc/UTC",avatars_v2:{small:{ldpi:{url:"/images/no-avatar.png"},mdpi:{url:"/images/no-avatar.png"}}}},assignee:t??{__typename:"User",id:a.assigner.id.toString(),default_name:`unknown${a.assigner.id}`,display_name:null,handle:`unknown${a.assigner.id}`,initials:"UN",timezone:"Etc/UTC",avatars_v2:{small:{ldpi:{url:"/images/no-avatar.png"},mdpi:{url:"/images/no-avatar.png"}}}}};if(null==e.document.addons)e.document.addons={assignees:[n]};else if(null==e.document.addons.assignees)e.document.addons.assignees=[n];else{let t=e.document.addons.assignees.findIndex(e=>e.id===o);-1===t?e.document.addons.assignees.push(n):e.document.addons.assignees[t]=n}break}case"removed":{if(null==e.document.addons||null==e.document.addons.assignees)return;let t=e.document.addons.assignees.findIndex(e=>e.id===o);if(-1===t)return;e.document.addons.assignees.splice(t,1)}}});i.writeQuery({query:Fm,data:d,variables:{id:l,shareToken:null}});break}case"attachment/date-updated":{let t=hR.Um.safeParse(e);if(!t.success){uT(new ei.HttpError({code:"BAD_REQUEST",message:"Received bad data from `attachment/date-updated`"},{cause:t.error}),uI);break}let a=t.data,{projectId:n,nodeId:l,attachmentId:r,operation:o}=a,i=yield(0,ez5.fw)("apolloClient"),s=i.readQuery({query:Fm,variables:{id:n,shareToken:null}});if(null==s)break;let d=(0,es.ZP)(s,e=>{if(null!=e.document)switch(o){case"created":case"updated":{let t=i.readFragment({fragment:ez6,id:`User:${a.creator.id}`})??{__typename:"User",id:a.creator.id.toString(),default_name:`unknown${a.creator.id}`,display_name:null,handle:`unknown${a.creator.id}`,initials:"UN",timezone:"Etc/UTC",avatars_v2:{small:{ldpi:{url:"/images/no-avatar.png"},mdpi:{url:"/images/no-avatar.png"}}}},n={__typename:"ProjectAddonDate",id:r,nodeId:l,addonDate:a.addonDate,author:t};if(null==e.document.addons)e.document.addons={dates:[n]};else if(null==e.document.addons.dates)e.document.addons.dates=[n];else{let t=e.document.addons.dates.findIndex(e=>e.id===r);-1===t?e.document.addons.dates.push(n):e.document.addons.dates[t]=n}break}case"removed":{if(null==e.document.addons||null==e.document.addons.dates)return;let t=e.document.addons.dates.findIndex(e=>e.id===r);if(-1===t)return;e.document.addons.dates.splice(t,1)}}});i.writeQuery({query:Fm,data:d,variables:{id:n,shareToken:null}});break}case"attachment/countdown-updated":{let{projectId:t}=e,a=yield(0,ez5.fw)("apolloClient");yield(0,ez5.RE)([a,"query"],{query:eaq,variables:{id:t,shareToken:null},fetchPolicy:"network-only"});break}case"attachment/reaction-updated":{let{projectId:t}=e,a=yield(0,ez5.fw)("apolloClient");yield(0,ez5.RE)([a,"query"],{query:ez8,variables:{id:t,shareToken:null},fetchPolicy:"network-only"});break}case"document/set-date":if(e.ok&&"document"===e.to.type){let{start:t,end:a}=e,n=yield(0,ez5.fw)("apolloClient");eVe(e.to.id,null!=t?{start:t,end:a}:null,n)}break;case"document/delete-date":if(e.ok&&"document"===e.to.type){let t=yield(0,ez5.fw)("apolloClient");eVe(e.to.id,null,t)}break;case"tag/tag-template":case"tag/tag-document":if(e.ok&&"document"===e.to.type){let{tag:t,tagged:a}=e,n=yield(0,ez5.fw)("apolloClient");erv(e.to.id,{__typename:"Tag",id:t.id.toString(),key:t.key,preferences:{__typename:"TagPreferences",color:t.preferences.color},raw_key:t.rawKey},a,n.cache)}break;case"assignment/assign-to-document":if(e.ok&&"document"===e.to.type){let{assignment:t,assigned:a}=e,n=yield(0,ez5.fw)("apolloClient");!function(e,t,a,n){let l=n.readQuery({query:ez7,variables:{documentId:e}});if(null==l||null==l.document||null==l.document.assignments.edges)return;let r=l.document.assignments.edges,o=r.findIndex(e=>null!=e&&null!=e.node&&e.node.id===t.id);if(a){if(-1!==o)return;r=[...r,{node:{__typename:"Assignment",id:t.id,user:{__typename:"User",id:`${t.user.id}`,handle:t.user.handle,initials:t.user.initials,avatars_v2:{__typename:"UserAvatarV2",small:{__typename:"UserAvatar",mdpi:{__typename:"Image",url:ec()(t.user.avatars,["small","mdpi","url"],"/images/no-avatar.png")}}}}}}]}else{if(-1===o)return;(r=[...r]).splice(o,1)}n.writeQuery({query:ez7,variables:{documentId:e},data:{...l,document:{...l.document,assignments:{...l.document.assignments,edges:r}}}})}(e.to.id,t,a,n)}}}}}function*eVn(e){let t=t=>"@@taskade/Chatroom/SEND_MESSAGE"===t.type&&bW()(ec()(t,["payload","to"]),e);for(;;){let{payload:a,executor:n}=yield(0,ez5.qn)(t),{body:l}=a,r=yield(0,ez5.xN)(BU("CHATROOM_MESSAGE",{id:(0,ld.Z)(),type:"message",to:e,body:l}));r.ok?n.resolve():n.reject({[ez3.Ck]:r.details})}}function*eVl(e){yield(0,ez5.gz)(euk(e,uE));let t=yield(0,ez5.xN)(BU("CHATROOM_JOIN",{id:(0,ld.Z)(),type:"join",to:e}));if(!t.ok){let e=new ei.FetchError(t);throw Object.assign((yield(0,ez5.RE)([e,e.toTaskadeError]))??e,{shouldRetry:!0})}yield(0,ez5.gz)(euk(e,uk))}function*eVr(e){let{to:t}=e.payload,a=yield(0,ez5.xN)(BZ()),n=0;for(;;){if(n>0){let e=2**Math.min(n,8);yield(0,ez5.gw)(1e3*e)}a.connected||(yield(0,ez5.qn)(rx));let e=null,l=null;try{e=yield(0,ez5.RE)(eVt,a,t),yield(0,ez5.RE)(eVl,t),n=0,l=yield(0,ez5.rM)(eVn,t),yield(0,ez5.RE)(eVa,e)}catch(t){let{shouldRetry:e}=t;if(!e)throw t;n+=1}finally{eu()(e)&&(e.close(),e=null),l&&(yield(0,ez5.al)(l),l=null),yield(0,ez5.gz)(euE(t))}}}function*eVo(e){let{to:t}=e.payload;yield(0,ez5.gz)(euE(t)),yield(0,ez5.gz)(rS("CHATROOM_LEAVE",{id:(0,ld.Z)(),type:"leave",to:t}))}function*eVi(e){let t=!1,a=null;try{let n=yield(0,ez5.rM)(eVr,e);a=yield(0,ez5.qn)(eub),yield(0,ez5.al)(n),t=!0}finally{(t||(yield(0,ez5.By)()))&&(yield(0,ez5.RE)(eVo,a))}}function*eVs(e){let t=yield(0,ez5.RE)(fL,`/web-api/d/${e}/info`);t.ok&&(yield(0,ez5.gz)(e=>{t.json().then(t=>{e(xo(iS(ec()(t,["payload","documents"],[])).entities))})}))}function*eVd(e){let{callback:t,documentID:a}=e.payload,n=yield(0,ez5.Ys)(),l=se(n,null,a),r=l.getStatus(),o=l.space.id,i=dP(n);if(l){var s,d;let e=l.set("isArchived",!l.isArchived);yield(0,ez5.gz)(xo({documents:{[a]:e.toEntity()}})),yield(0,ez5.gz)({type:eRH,payload:{spaceID:o,documentID:a,documentStatus:r}}),yield(0,ez5.gz)((0,l3.success)({uid:(s=e.isArchived)?"document-archived":"document-unarchived",message:s?"Moved to archive!":"Unarchived!",position:"br",autoDismiss:1,dismissible:!1}));try{let s=l.isArchived?fV:fz,c=yield(0,ez5.RE)(s,`/d/${a}/archive`);if(c.ok)yield(0,ez5.gz)((d=e.getStatus(),{type:eRB,payload:{spaceID:o,documentStatus:d}})),t&&t();else if(yield(0,ez5.gz)(xo({documents:{[a]:l.toEntity()}})),yield(0,ez5.gz)({type:eRq,payload:{spaceID:o,documentID:a,documentStatus:r,position:0}}),i===a&&401===c.status){let e=gt();eu()(e)||(e.location.href=dQ(n))}}catch(e){er.$e(t=>{t.setExtra("documentID",a),er.Tb(e)})}}}function*eVc(e){let t=yield(0,ez5.Ys)(),a=dD(t),n=t9(t);yield(0,ez5.gz)(xA({hideChat:!a}));try{n&&!(yield(0,ez5.RE)(a?fV:fz,`/d/${e}/hide-chat`)).ok&&(yield(0,ez5.gz)(xA({hideChat:a})))}catch(t){er.$e(a=>{a.setExtra("documentID",e),er.Tb(t)})}}function*eVm(e){let t=dT((yield(0,ez5.Ys)()));yield(0,ez5.gz)(ehd(!t)),yield(0,ez5.gz)(xA({hideCompleted:!t}));try{let a=t?fV:fz;(yield(0,ez5.RE)(a,`/d/${e}/hide-completed`)).ok||(yield(0,ez5.gz)(ehd(t)),yield(0,ez5.gz)(xA({hideCompleted:t})))}catch(t){er.$e(a=>{a.setExtra("documentID",e),er.Tb(t)})}}function*eVu(e){let t=yield(0,ez5.Ys)();if(!t9(t)){yield(0,ez5.gz)(xb(e,uk));return}yield(0,ez5.gz)(xb(e,uE));let a=yield(0,ez5.RE)(fL,`/web-api/d/${e}/collaborators`);if(a.ok){yield(0,ez5.gz)(xb(e,uk));let n=yield(0,ez5.RE)([a,a.json]),l=ec()(n,["payload","collaborators"],[]),r=(0,tV.Fv)(l,ic),o=se(t,null,e).set("collaborators",l);yield(0,ez5.gz)(xo({...r.entities,documents:{...r.entities.documents,[e]:o.toEntity()}}))}else yield(0,ez5.gz)(xb(e,ux))}function*eVp(e,t){let a=(0,tV.Fv)(t,ic),n=se((yield(0,ez5.Ys)()),null,e),l=n.collaborators||[],r=n.set("collaborators",[...t,...l]);yield(0,ez5.gz)(xo({...a.entities,documents:{...a.entities.documents,[e]:r.toEntity()}}))}function eVg(e){let t=dV(e);if(eu()(t))return;let{id:a}=t;return a}function*eVf(){let e=yield(0,ez5.Ys)(eVg);if(eu()(e)){let t=Error("Unable emit presence for unknown document");er.$e(a=>{a.setExtra("documentId",e),er.Tb(t)});return}let t=yield(0,ez5.xN)(BZ()),a=function(t){if(t.type===Fo){let{changeset:a}=t.payload;return a.id===e}return!1};for(;;){t.connected||(yield(0,ez5.qn)(rx));let e=function(e){let t=t7(e);if(eu()(t))return;let a=dV(e);if(eu()(a))return;let{id:n,space:l}=a;if(eu()(l))return;let{id:r}=l,o={type:"presence",to:{type:"document",id:n,space:r}},i=function(e,t){let a={},n=dO(e);eu()(n)||(a.document=n);let l=e.chatroom.latestMessageAt;return null!=l&&(a.chatroom=l),ts()(a)?void 0:a}(e,0);return eu()(i)||(o.snapshot=i),o}((yield(0,ez5.Ys)()));eu()(e)||(yield(0,ez5.gz)(rS("PRESENCE",e)));let{timeout:n,action:l}=yield(0,ez5.S3)({timeout:(0,ez5.gw)(3e4),action:(0,ez5.qn)(a)});eu()(l)||(yield(0,ez5.gw)(500))}}var eVh=a(11227),eVy=a.n(eVh);let eVb=eVy()("taskcade:frontend:sagas:sync"),eVv=new Set([cV,Fi,c1,IB,cq,cW,cK,IV,cY,IW,IG,IK,IY,I3,cJ,c5,c0,c2,c4,c3,IH,cH,cQ,Fn,mt,c6,c8,c7,c9,Iq,"@@taskade/editor/INSERT_TEXT",IQ,IJ,I4,cX,ma]),eVk=new Set([Fr,Fl,sc]);function eVE(e){return!!eVv.has(e.type)||!eVk.has(e.type)&&(eVb(`Uncategorized sync action: ${e.type}`),!1)}var eVx=a(75982);async function eV_(e,t){let a=JSON.stringify(e.serialize()),n=await fetch(t,{credentials:"same-origin",method:"POST",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json","X-Anonymous-ID":u$?.getAnonymousId()??void 0},body:a});if(!n.ok)throw new ei.FetchError(n);let l=await n.json(),r={contents:e,revision:l.meta.revision};return{...l,serverState:r}}function*eVw(e,t){let a=yield(0,ez5.Ys)(),n=iL(a),l=dP(a),r=eu()(l);for(;r;){(0,ei.assert)(null==t,"New document shouldn't have server state yet");let a=yield(0,ez5.qn)(e),o=yield(0,ez5.Ys)(iL);if(a.type===c0){n=o;continue}if(a.type===cQ){let e=a.payload.nodeID;if(null!=e){let t=n.findNodeByID(e),a=o.findNodeByID(e);if(null!=t&&null!=a&&0===t.text.diff(a.text).length()){n=o;continue}}}if(a.type===Fi)yield(0,ez5.gz)(Fs(Ny));else{if(n===o)continue;if(yield(0,ez5.gz)(Fs(Nh)),yield(0,ez5.gw)(500),yield(0,ez5.gz)(Fs(Ny)),yield(0,ez5.yl)(e),n===(o=yield(0,ez5.Ys)(iL))){yield(0,ez5.gz)(Fs(Nf));continue}}try{let e=yield(0,ez5.Ys)(tK);if(eu()(e))throw Error("Something went wrong. Please try again.");let a=`${e.pathname}${e.search}${e.hash}`,i=yield(0,ez5.RE)(eV_,o,a);t=i.serverState;let{meta:s,documents:d,memberships:c,spaces:m}=i,u=ec()(d,[0,"creator"]),p=ec()(d,[0,"editPath"]),g=ec()(d,[0,"id"]),f=ec()(s,["space","id"],null),{entities:h}=iS(d),{entities:y}=(0,tV.Fv)(m,ig),{entities:b,result:v}=(0,tV.Fv)(c,eRZ),k={users:{...h.users,...b.users}};yield(0,ez5.gz)(xo({...h,...b,...y,...k})),eu()(f)||(yield(0,ez5.gz)(eR1(f,v,uk))),yield(0,ez5.gz)({type:mx,payload:{}}),yield(0,ez5.gz)({type:Fn,payload:{meta:s}});let E=s.preferences?.hideCompleted;if(null!=E&&(yield(0,ez5.gz)(ehd(E))),u)yield(0,ez5.gz)((0,eVx.gx)(`/d/${g}`));else{let e=new URL(`/d/${g}`,"https://www.taskade.com"),t=yield(0,ez5.Ys)(d$);t&&e.searchParams.set("as",t),p&&(e.searchParams.set("share","edit"),e.searchParams.set("edit",p.replace("/e/",""))),yield(0,ez5.gz)((0,eVx.gx)({pathname:e.pathname,search:e.search}))}yield(0,ez5.gz)(Fs(Nf)),n=o,l=yield(0,ez5.Ys)(dP),r=eu()(l)}catch(t){let{res:e}=t;throw t}}return(0,ei.assert)(null!=t,"Server state should be available"),{contents:n,id:l,serverState:t}}let eVN="@@taskade/rtce/RECV_SERVER_CHANGESET",eVC="@@taskade/rtce/SYNC_CLIENT_CHANGESET";function eVM(e){return{type:eVN,payload:{changeset:e}}}async function eVS(e){let t=dP(e),a=dO(e),n=new URL(`/d/${t}/changes`,"https://www.taskade.com"),l=JSON.stringify({revision:a}),r=await fetch(n,{credentials:"same-origin",method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:l});if(!r.ok)throw new ei.FetchError(r);return r.json()}function*eVI(e,t,a){let n=yield(0,ez5.Ys)(dO),l=yield(0,ez5.xN)(BU("DOCUMENT_SYNC",e,n));if(!l.ok)throw l.error||Error("unknown error occurred preventing us from syncing the document");let{changes:r}=l.payload;for(let e of r)yield(0,ez5.gz)(a,eVM(e));for(;;){let e=yield(0,ez5.qn)(t);yield(0,ez5.gz)(a,eVM(e))}}function*eVD(e,t){let a=yield(0,ez5.xN)(BZ());for(;;){a.connected||(yield(0,ez5.qn)(rx));let n=null;try{n=function(e,t){let a=`document:${t}:changes`;return(0,ex.GG)(t=>{let n=e=>{t(e)},l=e=>{t(ex.uR)};return e.on(a,n),e.on("disconnect",l),()=>{e.off(a,n),e.off("disconnect",l)}},ex.Ef.expanding(8))}(a,e),yield(0,ez5.RE)(eVI,e,n,t)}finally{eu()(n)||(n.close(),n=null)}}}async function eVT(e,t,a){(0,ei.assert)(null!=t,"Expect document ID to be available"),e.source.release="5.21.0";let n=JSON.stringify(e),l=function(e,t){let a=new URL(`/d/${e}/collaborate`,"https://www.taskade.com");if("string"==typeof t&&t.length>0){let e=tL.parse(t),n=e.share;if("edit"===n){let t=e[n];"string"==typeof t&&t.length>0&&(a.searchParams.set("share",n),a.searchParams.set("edit",t))}else if("check"===n){let t=e[n];"string"==typeof t&&t.length>0&&(a.searchParams.set("share",n),a.searchParams.set("check",t))}}return a}(t,a),r=await fetch(l,{credentials:"same-origin",method:"POST",headers:{"X-Anonymous-ID":u$?.getAnonymousId()??void 0,Accept:"application/json","Content-Type":"application/json"},body:n});if(!r.ok)throw new ei.FetchError(r);return r.json()}let eV$=eVy()("taskade:rtce");function*eVP(e,t){for(yield(0,ez5.gw)(500),yield(0,ez5.yl)(e);;)if(function(e,t){switch(e.type){case c0:if(t)return!1;return!0;case cQ:{if(t)return!1;let{change:a}=e.payload;return a.operations.some(e=>e?.type!=="set_selection")}default:return!0}}((yield(0,ez5.qn)(e)),(yield(0,ez5.Ys)(dq))))switch(yield(0,ez5.Ys)(dR)){case Ng:case Nf:case Nb:yield(0,ez5.gz)(Fs(Nh)),yield(0,ez5.yl)(e),yield(0,ez5.gz)(t,{type:eVC,payload:{}})}}function*eVF(e,t,a,n){eV$(`Running RTCE for document ${e}…`),er.n_({category:"rtce",message:"Run RTCE",data:{documentID:e}});let l=t,r=null,o=[];function*i(t){let a=yield(0,ez5.Ys)(),n=dO(a);if((0,ei.assert)(null!=n,"Expect editor revision to be available"),(0,ei.assert)(n===l.revision,"Editor revision should match server revision"),null==t.from)return console.warn(`Server changeset without from, assume to be an origin changeset, skipping…`),!0;if(t.from.revisionn)return console.warn(`Editor at revision ${n}, unable to apply changeset for revision ${t.from.revision}, queuing it up…`),!1;(0,ei.assert)(t.from.revision===n,"Expect editor revision to match server changeset");let o=_$(a);(0,ei.assert)(null!=o,"Expect editor site ID to be available");let i=iL(a),s=(0,li.applyServerChangeset)({siteId:o,id:e,serverState:l,contents:i,submittedClientChangeset:r},t);return yield(0,ez5.xN)({type:Fo,payload:{changeset:s.serverChangesetPrime,documentClient:s}}),l=s.serverState,r=s.submittedClientChangeset,!0}function*s(){try{let e=yield(0,ez5.Ys)();for(let t of(yield(0,ez5.RE)(eVS,e)).payload.changesets)if(!(yield(0,ez5.RE)(i,t)))throw Error("Failed to pull latest changes from server");let t=yield(0,ez5.Ys)(dO),a=p6()(o,e=>null!=e.from&&e.from.revision>=t);-1===a&&(a=o.length),o.splice(0,a)}catch(a){let t=yield(0,ez5.Ys)(dO);throw new ei.TaskadeError({message:"Missing revision, unable to follow up",scope:{extras:{documentID:e,revision:t,pendingRevisions:o.map(e=>null!=e.from?e.from.revision:-1),details:(0,ei.getMessageFromError)(a)}}},{cause:a})}}for(yield(0,ez5.rM)(eVD,e,a),yield(0,ez5.rM)(eVP,n,a);;){let t=yield(0,ez5.qn)(a);switch(t.type){case eVN:{eV$("Receive server changeset…"),er.n_({category:"rtce",message:"Receive server changeset",data:{serverChangesetRevision:t.payload.changeset.from?.revision,pendingChangesetsLength:o.length,submittedChangesetUuid:r?.uuid}});let e=CM()(o,t.payload.changeset,e=>null!=e.from?e.from.revision:-1);for(o.splice(e,0,t.payload.changeset);o.length>0;){let e=o[0];if(!(yield(0,ez5.RE)(i,e)))break;o.shift()}o.length>5&&(yield(0,ez5.RE)(s));break}case eVC:{eV$("Sync client changeset…"),er.n_({category:"rtce",message:"Sync client changeset",data:{pendingChangesetsLength:o.length,submittedChangesetUuid:r?.uuid}});let t=!0;try{for(null!=r&&(yield(0,ez5.RE)(s),null!=r&&(r=null));;){yield(0,ez5.gw)(500);let a=yield(0,ez5.Ys)(),n=_$(a);(0,ei.assert)(null!=n,"Expect client site ID to be available");let o=iL(a),s=(0,li.generateClientChangeset)({siteId:n,id:e,serverState:l,contents:o,submittedClientChangeset:r},{generateUuid:()=>(0,O3.SK)()});if(null==s){yield(0,ez5.gz)(Fs(Nf));break}yield(0,ez5.gz)(Fs(Ny)),eV$("Syncing client changeset:\n%j",{clientRev:dO(a),changeset:s}),r=s;let d=a.router.location.search,{meta:c,changesets:m}=yield(0,ez5.RE)(eVT,r,e,d);for(let e of(t=!1,m))yield(0,ez5.RE)(i,e);let u=yield(0,ez5.Ys)(dO);if(c.revision!==u)throw Error("Fail to stay in sync");yield(0,ez5.xN)(Fc(c)),t=!0}}catch(a){let e=(0,ei.getStatusCodeFromError)(a);if(409===e)throw a;{if(!t)throw a;let n=(0,ei.mergeSentryScopes)((0,ei.getSentryScopeFromError)(a),{extras:{recoverable:t,statusCode:e}});er.$e(e=>{let{extras:t}=n;null!=t&&e.setExtras(t),er.Tb(a)});let l=(0,ei.getMessageFromError)(a);console.warn(`Recovering from ${l}`),yield(0,ez5.gz)(Fs(Nb))}}}}}}function*eVA(e,t,a){let n=null;try{console.log(`Starting RTCE for Document ${e}…`),n=yield(0,ez5.RE)(ex.CE,ex.Ef.expanding(8)),yield(0,ez5.RE)(eVF,e,t,n,a)}finally{eu()(n)||(n.close(),n=null)}}function*eVR(e){let t=null;try{let a=J6.Gd().getScope()?.getTransaction()?.startChild({op:"editor.lifecycle.setup-rtce"});t=yield(0,ez5.ZO)(eVE,ex.Ef.sliding(1));let{serverState:n,id:l}=yield(0,ez5.RE)(eVw,t,e);yield(0,ez5.rM)(eVf),a?.finish(),yield(0,ez5.RE)(eVA,l,n,t)}catch(e){if(409===ec()(e,["res","status"]))yield(0,ez5.gz)({type:sc,payload:{}}),yield(0,ez5.gz)(Fs(Nb)),er.Tb(e);else throw yield(0,ez5.gz)(Fs(Nb)),e}finally{eu()(t)||(t.close(),t=null)}}class eVj{noteValue;constructor(){this.noteValue=new Set}}class eVO{nodeListeners;static isNoteValueText0Operation(e){return(0,li.isText0Op)(e)&&5===e.p.length&&"nodes"===e.p[0]&&"string"==typeof e.p[1]&&"attributes"===e.p[2]&&"note"===e.p[3]&&"value"===e.p[4]}constructor(){this.nodeListeners=new Map}addNoteValueListener(e,t){let a=this.nodeListeners.get(e);null==a&&(a=new eVj,this.nodeListeners.set(e,a)),a.noteValue.add(t)}removeNoteValueListener(e,t){let a=this.nodeListeners.get(e);return null!=a&&a.noteValue.delete(t)}applyChangeset(e,t){let a=new Map;for(let t of e.ops)if(eVO.isNoteValueText0Operation(t)){let e=t.p[1];(0,ei.assert)("string"==typeof e,"Node ID must be string");let n=a.get(e);null!=n?a.set(e,li.Text0Subtype.compose(n,t.o)):a.set(e,t.o)}for(let[e,n]of a.entries()){let a=["nodes",e,"attributes","note","value"],l=t.getIn(a);if(null!=l){let t={p:["nodes",e,"attributes","note","value"],t:"text0",o:n};this.emitNoteValueText0Operation(l,t)}else{let t=new ei.HttpError({code:"CONFLICT",message:"Missing note value, unable to emit change events…",scope:{extras:{nodeId:e,o:JSON.stringify(n)}}});er.Tb(t)}}}emitNoteValueText0Operation(e,t){(0,ei.assert)(eVO.isNoteValueText0Operation(t),"Expect Text0 operation targeting note's value");let a=t.p[1];(0,ei.assert)("string"==typeof a,"Expect nodeId to be string");let n=this.nodeListeners.get(a);if(null!=n)for(let a of n.noteValue)a(e,t)}}function eVU(e){switch(e.type){case XK:case XY:case Fo:case eBL:return!0;default:return!1}}function*eVZ(){let e=new eVO;for(;;){let t=yield(0,ez5.qn)(eVU);switch(t.type){case XK:{let{nodeId:a,listener:n}=t.payload;e.addNoteValueListener(a,n);break}case XY:{let{nodeId:a,listener:n}=t.payload;e.removeNoteValueListener(a,n);break}case Fo:{let{changeset:a,documentClient:n}=t.payload;e.applyChangeset(a,n.contents);break}case eBL:{let{changeset:a}=t.payload,n=yield(0,ez5.Ys)(iL);e.applyChangeset(a,n)}}}}function eVL(e){switch(e.type){case IQ:case IJ:return!0;default:return!1}}function*eVB(){let e=yield(0,ez5.Ys)(),[t,a]=e.history.undoChange();if(null==a){yield(0,ez5.xN)((0,l3.warning)({uid:"undo",message:"Nothing to undo",position:"br",autoDismiss:1,dismissible:!1}));return}let n={type:eBL,payload:{type:"undo",changeset:{ops:(0,li.invertChangeset)(a).ops,created:a.created},history:t}},[,l]=eBG.perform(e,e=>e.applyLocalChangeset(n.payload));if(null!=l){let e=new ei.TaskadeError({code:"CONFLICT",statusCode:409,message:"Unable to Undo"},{cause:l});er.Tb(e),yield(0,ez5.xN)((0,l3.warning)({uid:"undo",message:"Unable to undo",position:"br",autoDismiss:1,dismissible:!1}));return}yield(0,ez5.xN)(n)}function*eVz(){let e=yield(0,ez5.Ys)(),[t,a]=e.history.redoChange();if(null==a){yield(0,ez5.xN)((0,l3.warning)({uid:"redo",message:"Nothing to redo",position:"br",autoDismiss:1,dismissible:!1}));return}let n={type:eBL,payload:{type:"redo",changeset:a,history:t}},[,l]=eBG.perform(e,e=>e.applyLocalChangeset(n.payload));if(null!=l){let e=new ei.TaskadeError({code:"CONFLICT",statusCode:409,message:"Unable to Redo"},{cause:l});er.Tb(e),yield(0,ez5.xN)((0,l3.warning)({uid:"redo",message:"Unable to redo",position:"br",autoDismiss:1,dismissible:!1}));return}yield(0,ez5.xN)(n)}function*eVV(){for(;;)switch((yield(0,ez5.qn)(eVL)).type){case IJ:yield(0,ez5.RE)(eVB);break;case IQ:yield(0,ez5.RE)(eVz)}}function*eVq(e){(0,ei.assert)(!e.ok,"response must not be ok");try{let t=yield(0,ez5.RE)([e,e.json]);if("PROJECT_UNAVAILABLE"===t.code)return{code:t.code};let{status:a,message:n}=t,l=eu()(a)?e.status:a.code,r=eu()(a)?e.statusText:a.reason,o=`${l}: ${r}`;return{code:l,text:r,header:o,subheader:n}}catch(t){return{code:e.status,text:e.statusText,header:`${e.status}: ${e.statusText}`}}}function*eVW(e,t,a){let n;(0,ei.assert)(Nk(e),"`match` must be a valid document match");let l=a?.startChild({op:"editor.lifecycle.load.fetch"}),{params:r}=e;if(null!=r.documentID){let e=t?.router,a=efC(e.location.pathname),l=new URL(`/${a?"embed":"d"}/${r.documentID}.json`,"https://www.taskade.com");l.search=e.location.search,l.searchParams.set("skip",""),n=`${l.pathname}${l.search}`}else if(null!=r.documentPathType&&null!=r.documentViewOrEditID){let e=new URL(`/${r.documentPathType}/${r.documentViewOrEditID}.json`,"https://www.taskade.com");e.searchParams.set("skip",""),n=`${e.pathname}${e.search}`}else throw Error("Invalid project path");let o=yield(0,ez5.RE)(fL,n);if(!o.ok){let e=Error(o.statusText);throw e.fetchResult=yield eVq(o),e}let{attachments:i,contents:s,entities:d,meta:c}=yield(0,ez5.RE)([o,o.json]);l?.finish();let m=a?.startChild({op:"editor.lifecycle.load.hydrate"});yield(0,ez5.gz)({type:mn,payload:{attachments:i}}),yield(0,ez5.gz)(mw(s)),yield(0,ez5.gz)(xo(ezg()(d,e=>ec()(e,["entities"],{})))),yield(0,ez5.gz)(Fc(c));let u={contents:li.Contents.deserialize(s),revision:c.revision};return m?.finish(),u}function*eVH(e,t){let a=ec()(t,["params","documentType"],null);if(!eu()(a))switch(a){case"blank":break;case"from":{yield(0,ez5.gz)(sv(uE));let{params:a}=t,n=e?.router?.location?.search??"";new URLSearchParams(n).get("from");let l=`/d/${a.documentID}.json${n}`,r=yield(0,ez5.RE)(fL,l);if(!r.ok){let e=Error(r.statusText);throw e.fetchResult=yield eVq(r),e}let{contents:o}=yield(0,ez5.RE)([r,r.json]);yield(0,ez5.gz)(mw(o));break}case"note":case"outline":{let t=iL(e).setDocumentTypeFormat(a);yield(0,ez5.gz)(mw(t.serialize()));break}case"get-started":case"weekly":case"bullet-journal":case"personal-task-tracker":case"distributed-teamwork-list":case"project-board":case"feature-prioritization-board":case"content-strategy-checklist":case"mindmap":case"product-development-tree":case"organizational-chart":case"action-items":case"brainstorming":case"marketing-plan":case"scrum":case"today":case"meeting":{yield(0,ez5.gz)(sv(uE));let e=`/templates/${a}.json`,t=yield(0,ez5.RE)(fL,e);if(!t.ok){let e=Error(t.statusText);throw e.fetchResult=yield eVq(t),e}let n=yield(0,ez5.RE)([t,t.json]);yield(0,ez5.gz)(mw(n));break}default:throw Error(`Unsupported Document Type: ${a}`)}}function*eVG(e){let t,a=null,n=!1,l=!1,{match:r}=e.payload;try{var o;switch(yield(0,ez5.rM)(eVV),yield(0,ez5.rM)(eVZ),!0){case Nv(r):{let e=J6.Gd().getScope()?.getTransaction()?.startChild({op:"editor.lifecycle.new"}),t=yield(0,ez5.Ys)(),a=t.router,n=II(a.location.pathname);yield(0,ez5.RE)(eVH,t,r),n&&(ec()(t,["spaces","memberships","fetchStatus",n],{})===uv?yield(0,ez5.gz)(eR0(n,uk)):yield(0,ez5.gz)(eRX(n))),e?.finish();break}case Nk(r):{let e=J6.Gd().getScope()?.getTransaction()?.startChild({op:"editor.lifecycle.load"}),o=yield(0,ez5.Ys)();a=dV(o),(eu()(a)||a.viewPath!==r.url&&a.editPath!==r.url)&&(yield(0,ez5.gz)(sv(uE)),t=yield(0,ez5.RE)(eVW,r,o,e),n=!0,l=!0),e?.finish();break}default:throw Error("Invalid `match` received.")}yield(0,ez5.gz)(sv(uk));let e=J6.Gd().getScope()?.getTransaction()?.startChild({op:"editor.lifecycle.init"}),i=yield(0,ez5.Ys)(),s=dT(i);if(yield(0,ez5.gz)(ehd(s)),a=dV(i),null==a||ts()(a)||(null!=a.space&&!ts()(a.space)&&n&&(yield(0,ez5.gz)(eRX(a.space.id))),ts()(a.id)||!l)||(yield(0,ez5.gz)((o=a.id,{type:xi,payload:{documentID:o}}))),!dq(i)){let e=iL(i),{rootNode:t}=e;if(!eu()(t)){if(eu()(a)||eu()(a.id)||!t.hasChild)yield(0,ez5.gz)(mI(t.id));else if(s){let a=e.findNodeByPredicateFromRoot(e=>e.id!==t.id&&!e.completed);null!=a&&(yield(0,ez5.gz)(mI(a.id)))}else{let e=t.children.first();null!=e&&(yield(0,ez5.gz)(mI(e)))}}}e?.finish(),yield(0,ez5.RE)(eVR,t)}catch(t){console.warn(t);let{fetchResult:e={code:500,text:t.message}}=t;e.status>=500&&er.$e(e=>{let a=t?.context;null!=a&&e.setExtra("context",a),er.Tb(t)}),yield(0,ez5.gz)(sv(ux,e))}}function*eVK(e){let t=!1;try{let a=yield(0,ez5.rM)(eVG,e);yield(0,ez5.qn)(ri),yield(0,ez5.al)(a),t=!0}finally{(t||(yield(0,ez5.By)()))&&(yield(0,ez5.gz)({type:Iz,payload:{}}))}}function*eVY(e){let{documentID:t,attachment:a,callback:n,callbackIsGenerator:l}=e.payload,r=yield(0,ez5.xN)(BU("ATTACHMENT_CREATE",{id:(0,ld.Z)(),type:"attachment/create",to:{type:"document",id:t},attachment:a}));r.ok?(yield(0,ez5.gz)(mz(r.attachment,r.info)),n&&(l?yield(0,ez5.RE)(n):n())):n&&null!=r.details&&n({[ez3.Ck]:r.details})}function*eVQ(e){let{documentID:t,which:a}=e.payload;yield(0,ez5.gz)(mV(a)),yield(0,ez5.xN)(BU("ATTACHMENT_DELETE",{id:(0,ld.Z)(),type:"attachment/delete",to:{type:"document",id:t},attachment:a}))}function*eVJ(e){let{documentID:t,attachment:a,callback:n}=e.payload,l=yield(0,ez5.xN)(BU("ATTACHMENT_EDIT",{id:(0,ld.Z)(),type:"attachment/edit",to:{type:"document",id:t},attachment:a}));l.ok&&(yield(0,ez5.gz)(mq([l.attachment])),n&&n())}function*eVX(e){let{documentID:t,nodeID:a}=e.payload;yield(0,ez5.gz)(mY(a,uE));let n=yield(0,ez5.RE)(fL,`/web-api/d/${t}/comments/${a}`);if(n.ok){yield(0,ez5.gz)(mY(a,uk));let e=yield(0,ez5.RE)([n,n.json]);yield(0,ez5.gz)({type:mh,payload:{nodeID:a,comments:ec()(e,["payload",a,"comments","attachments"],[])}})}else yield(0,ez5.gz)(mY(a,ux))}let eV0=(0,la.ZP)` + mutation ProcessCompletedNodes($input: ProcessCompletedNodesInput!) { + processCompletedNodes(input: $input) { + clientMutationId + ok + } + } +`;async function eV1(e,t){return e.mutate(t)}function*eV2(e,t){let a=yield(0,ez5.Ys)(),n=[],l=ec()(a,["attachments","completedNodeIDs"],[]);if(yield(0,ez5.gz)({type:mE,payload:{}}),ts()(l)||l.forEach(e=>{t.has(e)||(n.push(e),t.add(e))}),!ts()(n)){let e=dP(a);if(null!=e){let t=yield(0,ez5.fw)("apolloClient"),a={mutation:eV0,variables:{input:{clientMutationId:(0,ld.Z)(),documentID:e,nodeIDs:n}}};try{yield(0,ez5.RE)(eV1,t,a)}catch(e){}}n.forEach(e=>{t.delete(e)})}}function*eV5(e,t){let a=yield(0,ez5.Ys)(),n=[],l=ec()(a,["attachments","recurNodeIDs"],[]);yield(0,ez5.gz)({type:mk,payload:{}}),ts()(l)||l.forEach(e=>{if(null==e){let e=Error("recurNodeIDs has null element.");er.Tb(e);return}t.has(e)||(n.push(e),t.add(e))});let r=dV(a);if(!ts()(n)){let e=yield(0,ez5.xN)(BU("ATTACHMENT_DUE_DATE_RECUR",{id:(0,ld.Z)(),type:"attachment/due-date/recur",to:{type:"document",id:r.id},documentPath:r.editPath,nodeIDs:n}));if(e.ok){let t=e.attachments,a=yield(0,ez5.fw)("apolloClient"),n=a.readQuery({query:Fm,variables:{id:r.id,shareToken:null}});if(null!=n){let e=(0,es.ZP)(n,e=>{for(let a of t){let t=e.document.addons.dates.findIndex(e=>e.id===a.id);if(-1!==t){let n={__typename:"ProjectAddonDate",id:a.id,nodeId:a.nodeID,addonDate:a.data};e.document.addons.dates[t]=n}}});a.writeQuery({query:Fm,data:e,variables:{id:r.id,shareToken:null}})}}n.forEach(e=>{t.delete(e)})}}function*eV3(e,t,a){yield(0,ez5.gz)(mH(e,t));try{let e=yield(0,ez5.RE)([a,"json"]);switch(e.code){case"ATTACHMENT_LIMIT_ERROR":yield(0,ez5.gz)((0,l3.error)({uid:"attachment-upload-error",message:e.message,position:"tc",autoDismiss:8,dismissible:!1}));break;case"TASKADE_UNLIMITED_REQUIRED_ERROR":{let e=yield(0,ez5.Ys)(),t=dV(e);Ic()?yield(0,ez5.gz)(E3()):null!=t&&null!=t.space?yield(0,ez5.gz)(d4(t.space.id)):yield(0,ez5.gz)(d4());break}default:throw new ei.TaskadeError({message:e?.message??"There was an error uploading the file.",scope:{extras:{body:e}}})}}catch(e){if(e instanceof ei.TaskadeError&&null!=e.scope){let{extras:t}=e.scope;er.$e(a=>{null!=t&&a.setExtras(t),er.Tb(e)})}else er.Tb(e);yield(0,ez5.gz)((0,l3.error)({uid:"attachment-upload-error",message:e.message,position:"tc",autoDismiss:3,dismissible:!1}))}}function*eV4(e,t,a,n){let l=JSON.stringify({type:"attachment",documentID:e,nodeID:t,includeS3Policy:"true",filename:n.name,filesize:n.size}),r=yield(0,ez5.RE)(fB,"/web-api/uploads/request-data",{"Content-Type":"application/json"},l);if(!r.ok){yield(0,ez5.RE)(eV3,t,a,r);return}let{token:o,s3Policy:i,s3URL:s,awsUploadAPIBaseURL:d}=(yield(0,ez5.RE)([r,r.json])).payload,{formData:c,s3ObjectKey:m}=uo(n,i);if(!(yield(0,ez5.RE)(fB,s,{},c)).ok){yield(0,ez5.gz)(mH(t,a));return}let u=JSON.stringify({body:{s3ObjectKey:m}}),p=yield(0,ez5.RE)(fB,`${d}/uploads`,{"uploads-authorization-jwt":o,"Content-Type":"application/json"},u),g=yield(0,ez5.RE)([p,p.json]);if(!p.ok){yield(0,ez5.gz)(mH(t,a));return}let f=g.data,h={documentID:g.documentID,nodeID:g.nodeID,spaceID:g.spaceID},y=function*(){yield(0,ez5.gz)(mH(t,a))};yield(0,ez5.gz)(mL(e,{nodeID:t,data:{type:m1,file:f,info:h}},y,!0))}function*eV6(e){let{documentID:t,nodeID:a,files:n}=e.payload;yield(0,ez5.gz)(DE(a,!1));let l=[];for(let e of n){let t=(0,ld.Z)();yield(0,ez5.gz)(mW(a,t)),l.push({file:e,uploadID:t})}for(let e of l){let{file:n,uploadID:l}=e;yield(0,ez5.RE)(eV4,t,a,l,n)}}function*eV8(e,t){yield(0,ez5.gz)(mQ(e,uv));try{let e=yield(0,ez5.RE)([t,"json"]);if("TASKADE_UNLIMITED_REQUIRED_ERROR"===e.code){let e=yield(0,ez5.Ys)(),t=dV(e);Ic()?yield(0,ez5.gz)(E3()):null!=t&&null!=t.space?yield(0,ez5.gz)(d4(t.space.id)):yield(0,ez5.gz)(d4())}else throw Error(e?.message??"There was an error uploading the file.")}catch(e){yield(0,ez5.gz)((0,l3.error)({uid:"file-comment-upload-error",message:e.message,position:"tc",autoDismiss:3,dismissible:!1}))}}function*eV7(e){yield(0,ez5.gz)(mQ(e,uv)),yield(0,ez5.gz)((0,l3.error)({uid:"file-comment-upload-error",message:"There was an error uploading the file.",position:"tc",autoDismiss:3,dismissible:!1}))}function*eV9(e,t,a){yield(0,ez5.gz)(mQ(t,uE));let n=JSON.stringify({type:"comment",documentID:e,nodeID:t,includeS3Policy:"true",filename:a.name,filesize:a.size}),l=yield(0,ez5.RE)(fB,"/web-api/uploads/request-data",{"Content-Type":"application/json"},n);if(!l.ok){yield(0,ez5.RE)(eV8,t,l);return}let{token:r,s3Policy:o,s3URL:i,awsUploadAPIBaseURL:s}=(yield(0,ez5.RE)([l,l.json])).payload,{formData:d,s3ObjectKey:c}=uo(a,o);if(!(yield(0,ez5.RE)(fB,i,{},d)).ok){yield(0,ez5.RE)(eV7,t);return}let m=JSON.stringify({body:{s3ObjectKey:c}}),u=yield(0,ez5.RE)(fB,`${s}/uploads`,{"uploads-authorization-jwt":r,"Content-Type":"application/json"},m),p=yield(0,ez5.RE)([u,u.json]);if(!u.ok){yield(0,ez5.RE)(eV7,t);return}let g=p.data,f={documentID:p.documentID,nodeID:p.nodeID,spaceID:p.spaceID},h=function*(){yield(0,ez5.gz)(mQ(t,uv))};yield(0,ez5.gz)(mL(e,{nodeID:t,data:{type:m2,body:{type:m3,data:{file:g}},info:f}},h,!0))}function*eqe(e){let{documentID:t,nodeID:a,files:n}=e.payload;for(let e of n)yield(0,ez5.RE)(eV9,t,a,e)}function*eqt(e,t){yield(0,ez5.gz)(eRJ(e,uE,t));try{let a=`/web-api/spaces/${e}/documents`;switch(t){case iC:a=`/web-api/spaces/${e}/documents/archive`;break;case iM:a=`/web-api/spaces/${e}/documents/templates`}let n=yield(0,ez5.Ys)(),l=tQ(n),r=yield(0,ez5.RE)(fL,`${a}${l}`);r.ok?yield(0,ez5.gz)(a=>{r.json().then(n=>{var l;let r=iS(ec()(n,["payload","documents"],[]));a(xo(r.entities)),a((l=r.result,{type:eRV,payload:{spaceID:e,documents:l,documentStatus:t}})),a(eRJ(e,uk,t))})}):yield(0,ez5.gz)(eRJ(e,ux,t))}catch(a){er.$e(n=>{n.setExtra("spaceID",e),n.setExtra("documentStatus",t),er.Tb(a)}),yield(0,ez5.gz)(eRJ(e,ux,t))}}function*eqa(e){let{archived:t,spaceID:a}=e.payload;yield(0,ez5.gz)(eR3(a,t));let n=yield(0,ez5.Ys)(),l=function(e,t,a){let n=ec()(iX(e,null),[a],null);return n?new iy(n):null}(n,0,a);if(l){let e=l.set("isArchived",t);yield(0,ez5.gz)(xo({spaces:{[a]:e.toEntity()}}));let r=function(e,t,a){let n=iX(e,null),l=[];return Object.keys(n).forEach(e=>{let t=n[e];t.parent===a&&l.push(new iy(t))}),l}(n,0,e.id);yield(0,ez5.$6)(r.map(e=>{let a=e.set("isArchived",t);return(0,ez5.gz)(xo({spaces:{[a.id]:a.toEntity()}}))})),yield(0,ez5.$6)(r.map(e=>(0,ez5.gz)(eR3(e.id,t))))}}function*eqn(e,t){if(!e)return{ok:!1,details:"Space id is empty"};let a=yield(0,ez5.RE)(fB,`/web-api/spaces/${e}/avatar`,{"Content-Type":"application/json"},JSON.stringify(t)),n=yield(0,ez5.RE)([a,a.json]);return a.ok?{ok:!0,responseObject:n}:{ok:!1,details:n.details}}function*eql(e,t,a){let{callback:n,isCreateSpace:l,isEditSpace:r}=a;yield(0,ez5.gz)(eR2(t,uv));try{let t=yield(0,ez5.RE)([e,"json"]);switch(t.code){case"NOT_FOUND":case"PAYLOAD_TOO_LARGE":n({avatar:[t.message]});break;default:throw Error("There was an error uploading the file.")}}catch(e){n({avatar:[e.message]})}}function eqr(e){e({avatar:["There was an error uploading the file."]})}function*eqo(e){let{spaceID:t,content:a,options:n}=e.payload,{callback:l}=n,r=yield(0,ez5.RE)(eqn,t,{defaultAvatar:{type:"default",data:{value:a}}});r.ok?l():l({avatar:[r.details]})}function*eqi(e){let{spaceID:t,content:a,options:n}=e.payload,{callback:l,filename:r,filesize:o}=n;yield(0,ez5.gz)(eR2(t,uE));let i=JSON.stringify({type:"space_avatar",spaceID:t,includeS3Policy:"true",filename:r,filesize:o}),s=yield(0,ez5.RE)(fB,"/web-api/uploads/request-data",{"Content-Type":"application/json"},i);if(!s.ok){yield(0,ez5.RE)(eql,s,t,n);return}let{token:d,s3Policy:c,s3URL:m,awsUploadAPIBaseURL:u}=(yield(0,ez5.RE)([s,s.json])).payload,{formData:p,s3ObjectKey:g}=uo(fq(a),c,r);if(!(yield(0,ez5.RE)(fB,m,{},p)).ok){yield(0,ez5.RE)(eqr,l);return}let f=JSON.stringify({body:{s3ObjectKey:g}}),h=yield(0,ez5.RE)(fB,`${u}/uploads`,{"uploads-authorization-jwt":d,"Content-Type":"application/json"},f),y=yield(0,ez5.RE)([h,h.json]);if(!h.ok){yield(0,ez5.RE)(eqr,l);return}let b=yield(0,ez5.RE)(eqn,t,{awsResponse:y});b.ok?l():l({avatar:[b.details]}),yield(0,ez5.gz)(eR2(t,uv))}let eqs=new tV.fK.Entity("accounts"),eqd=new tV.fK.Array(eqs);function*eqc(){yield(0,ez5.$6)([function*(){yield(0,ez5.$6)([function*(){for(;;){let{values:e,callback:t}=(yield(0,ez5.qn)(l9)).payload,a={Accept:"application/json","Content-Type":"application/json"},n=JSON.stringify(e),l=yield(0,ez5.RE)(fB,"/forgot",a,n),r=yield(0,ez5.RE)([l,l.json]);t({...r.payload.errors,[ez3.Ck]:ec()(r.payload,["message"],void 0)})}}(),function*(){for(;;){let{values:e,callback:t}=(yield(0,ez5.qn)(re)).payload,a={Accept:"application/json","Content-Type":"application/json"},{path:n,...l}=e,r=JSON.stringify(l),o=yield(0,ez5.RE)(fB,n,a,r);if(o.ok)gr("/login");else{let e=yield(0,ez5.RE)([o,o.json]);t({...e.payload.errors,[ez3.Ck]:ec()(e.payload,["message"],void 0)})}}}(),function*(){for(;;){let{values:e,callback:t}=(yield(0,ez5.qn)(rt)).payload,a={"Content-Type":"application/json","X-Anonymous-ID":u$?.getAnonymousId()??void 0},n=JSON.stringify(e),l=yield(0,ez5.RE)(fB,"/signup",a,n),r=yield(0,ez5.RE)([l,l.json]);ec()(e,["refresh"],"false"),l.ok&&r.payload.user?ez4(r.payload.redirect):t({...r.errors,[ez3.Ck]:ec()(r.errors,["_error"],void 0)})}}(),function*(){for(;;){let{values:e,callback:t}=(yield(0,ez5.qn)(ra)).payload,a={Accept:"application/json","Content-Type":"application/json","X-Anonymous-ID":u$?.getAnonymousId()??void 0},n=JSON.stringify(e),l=yield(0,ez5.RE)(fB,"/login",a,n),r=yield(0,ez5.RE)([l,l.json]);ec()(e,["refresh"],"false"),l.ok&&r.payload.user?gr(r.payload.redirect):l.ok&&!0===r.mfa?gr(r.payload.redirect):t({...r.payload.errors,[ez3.Ck]:ec()(r.payload.error,["message"],void 0)})}}()])}(),function*(){yield(0,ez5.$6)([function*(){for(;;){let e=yield(0,ez5.qn)(d3),t=e.payload.workspaceId,a=e.payload.reason;yield(0,ez5.gz)(_M.actions.toggleUpgradeDialog(t?{spaceId:t,reason:a}:null))}}()])}(),function*(){yield(0,ez5.$6)([function*(){yield(0,ez5.Fm)(euy,eVi)}()])}(),function*(){yield(0,ez5.$6)([function*(){let e={};for(;;){let{documentID:t,collaborators:a}=(yield(0,ez5.qn)("@@taskade/document/ADD_DOCUMENT_COLLABORATORS")).payload,n=e[t];n&&n.isRunning()||(e[t]=yield(0,ez5.rM)(eVp,t,a))}}(),function*(){let e={};for(;;){let{documentID:t}=(yield(0,ez5.qn)(xi)).payload,a=e[t];a&&a.isRunning()||(e[t]=yield(0,ez5.rM)(eVu,t))}}(),function*(){let e={};for(;;){let{documentID:t}=(yield(0,ez5.qn)("@@taskade/document/FETCH_DOCUMENT_ENTITY")).payload,a=e[t];a&&a.isRunning()||(e[t]=yield(0,ez5.rM)(eVs,t))}}(),function*(){for(;;){yield(0,ez5.qn)("@@taskade/document/FETCH_SHARED_DOCUMENTS"),yield(0,ez5.gz)(xv(uE));let e=tQ((yield(0,ez5.Ys)())),t=yield(0,ez5.RE)(fL,`/web-api/documents/shared${e}`);t.ok?(yield(0,ez5.gz)(function(e){return t=>{e.json().then(e=>{let a=iS(ec()(e,["payload","documents"],[]));t(xo(a.entities)),t({type:xm,payload:{documents:a.result}})})}}(t)),yield(0,ez5.gz)(xv(uk))):yield(0,ez5.gz)(xv(ux))}}(),function*(){let e={};for(;;){let t=yield(0,ez5.qn)(xD),{documentID:a}=t.payload,n=e[a];n&&n.isRunning()||(e[a]=yield(0,ez5.rM)(eVd,t))}}(),function*(){let e={};for(;;){let{documentID:t}=(yield(0,ez5.qn)(xu)).payload,a=e[t];a&&a.isRunning()||(e[t]=yield(0,ez5.rM)(eVc,t))}}(),function*(){let e={};for(;;){let{documentID:t}=(yield(0,ez5.qn)(xp)).payload,a=e[t];a&&a.isRunning()||(e[t]=yield(0,ez5.rM)(eVm,t))}}()])}(),function*(){yield(0,ez5.Fm)(ro,eVK)}(),function*(){yield(0,ez5.$6)([function*(){let e=yield(0,ez5.ZO)(ml,ex.Ef.sliding(15));for(;;){let t=yield(0,ez5.qn)(e);yield(0,ez5.RE)(eVY,t)}}(),function*(){let e={};for(;;){let t=yield(0,ez5.qn)(mr),{documentID:a,which:n}=t.payload,l=`${a}-${n.nodeID}-${n.type}-${n.id}`,r=e[l];r&&r.isRunning()||(e[l]=yield(0,ez5.rM)(eVQ,t))}}(),function*(){let e={};for(;;){let t=yield(0,ez5.qn)(mo),{documentID:a,attachment:n}=t.payload,l=`${a}-${n.id}`,r=e[l];r&&r.isRunning()||(e[l]=yield(0,ez5.rM)(eVJ,t))}}(),function*(){let e={};for(;;){let t=yield(0,ez5.qn)(mp),{documentID:a,nodeID:n}=t.payload,l=`${a}-${n}`,r=e[l];r&&r.isRunning()||(e[l]=yield(0,ez5.rM)(eVX,t))}}(),function*(){let e=new Set;for(;;){let t=yield(0,ez5.qn)([cJ,cX,c5]);yield(0,ez5.rM)(eV2,t,e)}}(),function*(){let e=new Set;for(;;){let t=yield(0,ez5.qn)([cJ,cX,c5]);yield(0,ez5.rM)(eV5,t,e)}}(),function*(){for(;;){let e=yield(0,ez5.qn)(mc),t=yield(0,ez5.fw)("apolloClient"),a=dU((yield(0,ez5.Ys)())),{data:n}=yield(0,ez5.RE)([t,"query"],{query:Cw,variables:{spaceID:a},fetchPolicy:"cache-first"}),l=n?.membership?.space?.taskadePlan?.type??"free";if(!fR.Vl.getFeature("media.upload.non_image_types").plans[l]&&e.payload.files.some(e=>!cx.ImageMimeTypes.has(e.type))){yield(0,ez5.gz)(d4(a,_w.enum.uploadFileType));continue}yield(0,ez5.rM)(eV6,e)}}(),function*(){for(;;){let e=yield(0,ez5.qn)(mm),t=yield(0,ez5.fw)("apolloClient"),a=dU((yield(0,ez5.Ys)())),{data:n}=yield(0,ez5.RE)([t,"query"],{query:Cw,variables:{spaceID:a},fetchPolicy:"cache-first"}),l=n?.membership?.space?.taskadePlan?.type??"free";if(!fR.Vl.getFeature("media.upload.non_image_types").plans[l]&&e.payload.files.some(e=>!cx.ImageMimeTypes.has(e.type))){yield(0,ez5.gz)(d4(a,_w.enum.uploadFileType));continue}yield(0,ez5.rM)(eqe,e)}}()])}(),function*(){yield(0,ez5.$6)([function*(){let e={};for(;;){let t=yield(0,ez5.qn)(eRW),{spaceID:a}=t.payload,n=`archive-${a}`,l=e[n];l&&l.isRunning()||(e[n]=yield(0,ez5.rM)(eqa,t))}}(),function*(){let e={};for(;;){let{documentStatus:t,spaceID:a}=(yield(0,ez5.qn)(eRB)).payload,n=e[`${a}-${t}`];n&&n.isRunning()||(e[a]=yield(0,ez5.rM)(eqt,a,t))}}(),function*(){for(;;){let{spaceID:e}=(yield(0,ez5.qn)(eRG)).payload;yield(0,ez5.gz)(eR0(e,uE));try{let t=`/web-api/spaces/${e}/memberships`,a=yield(0,ez5.RE)(fL,t);a.ok?yield(0,ez5.gz)(function(e,t,a){return n=>{t.json().then(t=>{var l;let r=(l=ec()(t,["payload","memberships"],[]),(0,tV.Fv)(l,eRZ));n(xo(r.entities)),n(eR1(e,r.result,a))})}}(e,a,uk)):yield(0,ez5.gz)(eR0(e,ux))}catch(t){er.Tb(t),yield(0,ez5.gz)(eR0(e,ux))}}}(),function*(){let e={};for(;;){let t=yield(0,ez5.qn)("@@taskade/space/SAVE_AVATAR"),{spaceID:a,options:n}=t.payload,l=`upload-space-avatar-${a}`,r=e[l];r&&r.isRunning()||("custom"===n.type?e[l]=yield(0,ez5.rM)(eqi,t):e[l]=yield(0,ez5.rM)(eqo,t))}}()])}(),function*(){yield(0,ez5.$6)([function*(){for(;;){let e=yield(0,ez5.qn)(cg),t={"Content-Type":"application/json"},{values:a,callback:n}=e.payload,{path:l,...r}=a,o=JSON.stringify(r),i=yield(0,ez5.RE)(fB,"/web-api/user/change-password",t,o);try{if(i.ok)n(),yield(0,ez5.gz)((0,l3.success)({uid:"change-password-success",message:"Password changed!",position:"br",autoDismiss:1,dismissible:!1}));else{let e=yield(0,ez5.RE)([i,i.json]);n({[ez3.Ck]:e.details})}}catch(e){er.Tb(e)}}}(),function*(){for(;;){yield(0,ez5.qn)("@@taskade/user/FETCH_ACCOUNTS");try{yield(0,ez5.gz)(cb(uE));let e=yield(0,ez5.RE)(fL,"/web-api/user/accounts");e.ok?yield(0,ez5.gz)(function(e,t){return a=>{e.json().then(e=>{var n;let l=(n=ec()(e,["payload","accounts"],[]),(0,tV.Fv)(n,eqd));a(xo(l.entities)),a({type:cp,payload:{accounts:l.result}}),a(cb(t))})}}(e,uk)):yield(0,ez5.gz)(cb(ux))}catch(e){er.Tb(e),yield(0,ez5.gz)(cb(ux))}}}(),function*(){for(;;){let{values:e,form:t,callback:a}=(yield(0,ez5.qn)("@@taskade/user/SUBMIT_SETTINGS_FORM")).payload;try{let n={"Content-Type":"application/json"},l=JSON.stringify(e),r=yield(0,ez5.RE)(fB,"/web-api/user",n,l);if(r.ok){let{payload:{user:e}}=yield(0,ez5.RE)([r,r.json]),{defaultName:n,displayName:l,handle:o,timezone:i,locale:s,pendingEmail:d,pendingEmailType:c}=e;yield(0,ez5.gz)(ck({defaultName:n,displayName:l,handle:o,pendingEmail:d,pendingEmailType:c,timezone:i,locale:s})),a(),t.reset(),yield(0,ez5.gz)((0,l3.success)({uid:"update-user-success",message:"Account updated!",position:"br",autoDismiss:1,dismissible:!1})),yield(0,ez5.gz)({type:rN,payload:{}})}else{let e=yield(0,ez5.RE)([r,r.json]);a({...e.exception.errors,[ez3.Ck]:ec()(e.errors,["_error"],void 0)})}}catch(e){er.Tb(e)}}}(),function*(){for(;;){let t=yield(0,ez5.qn)(ch),a=t7((yield(0,ez5.Ys)())),n={"Content-Type":"application/json"},{key:l,value:r,localStorageKey:o}=t.payload,i=JSON.stringify({key:l,value:r});try{if(l){if(a)yield(0,ez5.gz)(ck({preferences:{...a.preferences,[l]:r}})),(yield(0,ez5.RE)(fB,"/web-api/user/preferences",n,i)).ok||(yield(0,ez5.gz)(ck({preferences:a.preferences})));else{var e;yield(0,ez5.gz)((e=o||l,{type:eBf,payload:{key:e,value:r}}))}}}catch(e){er.Tb(e)}}}()])}()])}(0,es.MD)(),en.S({dsn:"https://e0a36c3727c443f69b3739259d379227@o4505191584890880.ingest.sentry.io/4505192783806464",environment:eBl(),release:eBn(),beforeSend(e,t){if("development"===eBl())return console.warn({event:e,hint:t}),null;let a=t.originalException;if(null!=a){if(a instanceof ea.cA){if((0,eo.isNonEmptyArray)(a.graphQLErrors)){let n=a.graphQLErrors[0],l=n.extension?.statusCode??n.extensions?.exception?.status?.code;if(null!=l&&("string"==typeof l&&Number.isNaN(l=parseInt(l,10))&&(l=520),l<500))return console.warn({event:e,hint:t}),null}}else if(a instanceof Error&&"Extension context invalidated."===a.message)return console.warn({event:e,hint:t}),null}return(0,ei.enrichErrorEvent)(e,t)},ignoreErrors:["Non-Error promise rejection captured with value: Object Not Found Matching Id:","GraphQL error: Unable to show activity for Guest."],integrations:[new el.gE],tracesSampleRate:.1}),(0,eg.Gh)();let eqm=function(e){if(eu()(e))return;let{contents:t,slate:a,session:n}=e;return eu()(t)?t=li.Contents.create(t):li.Contents.isContents(t)||(t=li.Contents.deserialize(t)),a=t.nodes.map(eB_.createWithNode),n=eu()(n)?eBN.create():eBN.create(n),{...e,contents:t,slate:a,session:n}}(window.__PRELOADED_STATE__),equ=ec()(eqm,["auth","user"]);if(!eu()(equ)){er.e(e=>{e.setUser({id:equ.id,ip_address:"{{auto}}",email:equ.email,username:equ.handle})});let e=ewn(equ.locale);ewl(e),ewr(e,equ.preferences?.dayOfWeek??null,equ.timeFormat??null),ewo(equ.timezone??null)}let eqp=document.getElementById("app");eqp.hasChildNodes()?ep.hydrate(ez2(eqm,!0,eqc),eqp):ep.render(ez2(eqm,!0,eqc),eqp)},21762:(e,t,a)=>{"use strict";a.d(t,{R:()=>r});var n=a(29730),l=a(67294);let r=function(e){let t=l.useRef(null),a=l.useRef(null),r=l.useRef(null),[o,i]=l.useState(!1),{arrowProps:s,popperProps:d,referenceProps:c}=(0,n.useControlledTooltip)({referenceElementRef:t,arrowElementRef:a,popperElementRef:r,placement:"top",visible:o});return l.createElement(l.Fragment,null,l.createElement("div",{...c,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},className:e.className},e.children),o&&l.createElement(n.Tooltip,{arrowProps:s,popperProps:d},e.tooltipContent))}}},e=>{var t=t=>e(e.s=t);e.O(0,[895,126,107,459,836,65],()=>t(1413)),e.O()}]); \ No newline at end of file