(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[42780],{31783:function(){},60449:function(){},6543:function(n,e,t){"use strict";t.d(e,{B:function(){return r}});var o=t(78513);const i={"\n   query SpacesWithUnreadNotes {\n      newUnreadNotesPerSpace {\n         spaceId\n         count\n      }\n   }\n":o.$p,"\n   fragment AppBarAvatar on Profile {\n      ...ProfileAvatar\n      factsCount\n      isAdmin\n      state {\n         available\n         note {\n            id\n            text\n            html\n         }\n         inCallId\n      }\n      dateCreated\n      statistics(lastNDays: 7) {\n         start\n         end\n         totalCardsClosed\n         totalCardsCreated\n         cardsCreatedPerDay\n         cardsClosedPerDay\n      }\n   }\n":o.qZ,"\n   mutation SetState($available: Boolean, $availableForCommunityId: ID, $note: ID) {\n      setState(\n         available: $available\n         availableForCommunityId: $availableForCommunityId\n         noteId: $note\n      ) {\n         __typename\n         id # id is required for the cache to update automatically\n         prevNoteId\n         ...StateFragment\n      }\n   }\n":o.Hs,"\n   query SidebarNotesState($ids: [ID!]) {\n      notes(ids: $ids) {\n         notes {\n            id\n            readAt\n            dateEdited\n            unreadCommentsCount\n            commentsCount\n         }\n      }\n   }\n":o.w3,"\n   fragment StateFragment on ProfileState {\n      id\n      available\n      availableForCommunityId\n      wavingAtMe\n      inCallId\n      inCallWith {\n         id\n         name\n         image\n      }\n      wavingAtId\n      wavedAtById\n      wavingStartedAt\n      changedAt\n      note {\n         __typename\n         id\n      }\n      place {\n         __typename\n         id\n         name\n         image\n      }\n   }\n":o.nA,"\n   mutation AcceptWaving($pageId: ID!, $callId: ID) {\n      acceptWaving(profile: $pageId, callId: $callId)\n   }\n":o.oW,"\n   mutation DeclineWaving {\n      declineWaving {\n         ...StateFragment\n      }\n   }\n":o.Yv,"\n   fragment SectionNote on Note {\n      ...NoteFragment\n      ...NoteCard\n      events {\n         ...NoteEvent\n      }\n   }\n":o.vw,"\n   query StartPageNotesQuery($me: ID!, $visitTime: TimePb, $twoDaysAgo: TimePb) {\n      discover: relevantNotes(limit: 3, filter: { not: { author: [$me] } }) {\n         notes {\n            ...SectionNote\n         }\n      }\n      toClose: notes(\n         limit: 3\n         filter: {\n            or: [{ closed: false }, { dateClosed: { gt: $visitTime } }]\n            dateCreated: { lt: $twoDaysAgo }\n            author: [$me]\n         }\n         orderBy: { dateModified: desc }\n      ) {\n         notes {\n            ...SectionNote\n         }\n      }\n   }\n":o.Oc,"\n   query CalendarInfo($filter: NoteFilterInput, $year: Int!, $month: Int!) {\n      notes(limit: 0, filter: $filter) {\n         aggregations {\n            daysOfMonth(year: $year, month: $month) {\n               name\n               values {\n                  value\n                  count\n               }\n            }\n         }\n      }\n   }\n":o.$7,"\n   fragment CanvasNodeFrag on CanvasNode {\n      id\n      height\n      x\n      y\n      width\n      height\n      uri\n      version\n      deleted\n      data\n   }\n":o.B8,"\n   fragment CanvasUserFrag on CanvasUser {\n      id\n      mouse {\n         x\n         y\n      }\n      profile {\n         id\n         image\n         name\n      }\n      view {\n         x\n         y\n         width\n         height\n      }\n      version\n   }\n":o.Y7,"\n   subscription CanvasChanged($id: ID!) {\n      canvasChanged(id: $id) {\n         __typename\n         ...CanvasNodeFrag\n         ...CanvasEdgeFrag\n         ...CanvasUserFrag\n      }\n   }\n":o.sV,"\n   mutation PutCanvasNode($canvas: ID!, $id: ID!, $node: CanvasNodeInput!) {\n      putCanvasNode(canvasId: $canvas, id: $id, node: $node) {\n         ...CanvasNodeFrag\n      }\n   }\n":o.kx,"\n   mutation PutCanvasUser($canvas: ID!, $user: CanvasUserInput!) {\n      putCanvasUser(canvasId: $canvas, user: $user) {\n         ...CanvasUserFrag\n      }\n   }\n":o.pe,"\n   mutation DeleteCanvasNode($canvas: ID!, $id: ID!) {\n      deleteCanvasNode(canvasId: $canvas, id: $id)\n   }\n":o.j2,"\n   mutation DeleteCanvasEdge($canvas: ID!, $id: ID!) {\n      deleteCanvasEdge(canvasId: $canvas, id: $id)\n   }\n":o.qt,"\n   fragment CanvasEdgeFrag on CanvasEdge {\n      id\n      points {\n         x\n         y\n      }\n      predicateUri\n      source\n      target\n      version\n      deleted\n   }\n":o.nn,"\n   mutation PutCanvasEdge($canvas: ID!, $id: ID!, $edge: CanvasEdgeInput!) {\n      putCanvasEdge(canvasId: $canvas, id: $id, edge: $edge) {\n         ...CanvasEdgeFrag\n      }\n   }\n":o.gg,"\n   query KanbanColumns($ids: [ID!]) {\n      notes(ids: $ids) {\n         notes {\n            ...ColumnCard\n         }\n      }\n   }\n":o.pK,"\n   fragment ColumnCard on Note {\n      ...NotePermissions\n      id\n      title\n      html\n      mentions {\n         note {\n            ...NoteCard\n         }\n      }\n   }\n":o.X7,"\n   fragment CommentAreaNote on Note {\n      id\n      readAt\n      closed\n      ...NotePermissions\n      events {\n         ...NoteEvent\n      }\n   }\n":o.kE,"\n   query IsAdminOfCommunity($id: ID!) {\n      community(id: $id) {\n         canEdit\n      }\n   }\n":o.yt,"\n   query NoteListComments($id: ID!) {\n      note(id: $id) {\n         id\n         __typename\n         events {\n            ...NoteEvent\n         }\n      }\n   }\n":o.$u,"\n   mutation RemoveReaction($id: ID!, $reaction: Reaction!) {\n      removeReactionToNote(id: $id, reaction: $reaction)\n   }\n":o.vK,"\n   mutation AddReaction($id: ID!, $reaction: Reaction!) {\n      reactToNote(id: $id, reaction: $reaction)\n   }\n":o.kV,"\n   mutation PublishNote(\n      $id: ID!\n      $to: [ID!]!\n      $permissionType: DigitalDocumentPermissionType\n      $token: String\n      $announce: Boolean\n      $pin: Boolean\n   ) {\n      publishNote(\n         id: $id\n         to: $to\n         permissionType: $permissionType\n         token: $token\n         announce: $announce\n         pin: $pin\n      ) {\n         ...NoteFragment\n      }\n   }\n":o.nh,"\n   mutation MarkNoteAsRelated($id: ID!, $relatedTo: ID!) {\n      markNoteAsRelated(id: $id, relatedTo: $relatedTo)\n   }\n":o.pL,"\n   mutation MarkNoteAsUnrelated($id: ID!, $relatedTo: ID!) {\n      markNoteAsUnrelated(id: $id, relatedTo: $relatedTo)\n   }\n":o.DI,"\n   query NotePageNote(\n      $uri: String!\n      $prop: String\n      $token: String\n      $filter: NoteFilterInput\n      $minScore: Float\n   ) {\n      about(uri: $uri, property: $prop, token: $token) {\n         ...NotePageAbout\n      }\n   }\n":o.tE,"\n   fragment NotePageAbout on About {\n      __typename\n      subject\n      property\n      note {\n         title\n         mentions {\n            isDefinition\n         }\n         ...NoteListNote\n         ...NoteCard\n         ...NoteFragment\n         ...CommentAreaNote\n         events {\n            ...NoteEvent\n         }\n      }\n      properties {\n         ...NotePageUsedProps\n      }\n      suggestedProperties {\n         id\n         label\n         description\n      }\n      notes {\n         hits {\n            ...NoteListHit\n            note {\n               kindsText\n               kinds {\n                  id\n                  uri\n                  label\n               }\n            }\n         }\n      }\n      suggestedNotes(minScore: $minScore, limit: 5, filter: $filter) {\n         hits {\n            ...NoteListHit\n         }\n      }\n   }\n":o.uC,"\n   fragment NotePageUsedProps on UsedProperty {\n      count\n      entity {\n         id\n         label\n         description\n      }\n   }\n":o.cY,"\n   query GetNoteSidebarNote($id: ID!) {\n      note(id: $id) {\n         ...NoteSidebarNote\n      }\n   }\n":o.iN,"\n   fragment NoteListHit on NoteHit {\n      locs: fieldTermLocations {\n         term\n         fullTerm\n         inDefinition\n         inComment\n         field\n      }\n      score\n      note {\n         ...NoteListNote\n         events {\n            ...NoteEvent\n         }\n      }\n   }\n":o.Hp,"\n   fragment NoteListNote on Note {\n      ...NoteFragment\n      ...NoteCard\n   }\n":o.BK,"\n   subscription NoteUpdate($grantee: ID!) {\n      noteUpdate(grantee: $grantee) {\n         __typename\n         id\n         kind\n         shouldNotify\n         note {\n            __typename\n            ...NoteSidebarNote\n         }\n      }\n   }\n":o.Px,"\n   fragment NoteSidebarNote on Note {\n      title\n      mentions {\n         isDefinition\n      }\n      ...NoteListNote\n      ...NoteCard\n      ...NoteFragment\n      ...CommentAreaNote\n      events {\n         ...NoteEvent\n      }\n   }\n":o.KD,"\n   subscription Sub($subject: String!) {\n      sub(subject: $subject) {\n         subject\n         data\n      }\n   }\n":o.jP,"\n   mutation DeleteNote($id: ID!) {\n      deleteNote(id: $id)\n   }\n":o._f,"\n   subscription ProfileStatusChanged($pageId: ID!) {\n      profileStatusChanged(profileId: $pageId) {\n         ...StateFragment\n      }\n   }\n":o.eK,"\n   fragment ProfileAvatar on Profile {\n      __typename\n      id\n      name\n      image\n      dateCreated\n   }\n":o.is,"\n   fragment CommunityAvatar on Community {\n      __typename\n      id\n      name\n      image\n      fullName\n   }\n":o.aI,"\n   fragment NoteFragment on Note {\n      __typename\n      id\n      text\n      html\n      deleted\n      version\n      isWatching\n      closed\n      doneCount\n      todoCount\n      closeSuggested\n      kindsText\n      createdFromTemplateId\n      ignoredSuggestions\n      currentParticipants {\n         __typename\n         id\n         image\n         name\n         dateCreated\n         state {\n            id\n            __typename\n            inCallId\n            available\n            note {\n               __typename\n               id\n            }\n         }\n      }\n      author {\n         __typename\n         id\n         image\n         name\n         dateCreated\n         state {\n            id\n            available\n         }\n      }\n      mentions {\n         uri\n         text\n         subject\n         property\n         type\n         kind\n      }\n      hasDigitalDocumentPermission {\n         grantee {\n            ...ProfileAvatar\n            ...CommunityAvatar\n            ... on Place {\n               id\n               name\n               image\n            }\n         }\n         permissionType\n         announce\n         pin\n      }\n      inheritedPermission {\n         grantee {\n            ...ProfileAvatar\n            ...CommunityAvatar\n            ... on Place {\n               id\n               name\n               image\n            }\n         }\n         permissionType\n      }\n      commentsCount\n      unreadCommentsCount\n      dateCreated\n      dateModified\n      dateEdited\n      readAt\n      archivedAt\n      linkSuggestions {\n         name\n         url\n      }\n      myAnswers\n      questionResult {\n         count\n         results {\n            answer\n            count\n         }\n      }\n      definitionCount\n      uploads {\n         id\n         url(seconds: 86400)\n         previewUrl(seconds: 86400)\n      }\n      reactions {\n         agreement {\n            count\n            me\n         }\n         applause {\n            count\n            me\n         }\n      }\n   }\n":o.MX,"\n   query SearchPage($text: String!, $partOf: ID, $partOfArray: [ID!]) {\n      entities: semanticEntities(search: $text, limit: 4) {\n         hits {\n            entity {\n               __typename\n               id\n               label\n               aliases\n               description\n               image\n            }\n         }\n      }\n      profiles(search: $text, partOf: $partOfArray, take: 3) {\n         results: hits {\n            score\n            fieldTermLocations {\n               field\n               term\n               start\n               end\n               inDefinition\n            }\n            matchingNotes(take: 3) {\n               termsInNonAccessibleNotes {\n                  fullTerm\n               }\n               hits {\n                  note {\n                     id\n                     text\n                     kinds {\n                        id\n                     }\n                  }\n                  fieldTermLocations {\n                     term\n                     fullTerm\n                  }\n               }\n            }\n            page: profile {\n               __typename\n               ... on Profile {\n                  __typename\n                  ...ProfileAvatar\n                  facts(take: 3) {\n                     id\n                     category\n                     text\n                  }\n               }\n            }\n         }\n      }\n      communities(search: $text, take: 3, partOf: $partOf) {\n         results: hits {\n            score\n            page: community {\n               ...CommunityAvatar\n               titleImage\n               description\n            }\n         }\n      }\n      notes(\n         filter: { search: $text, authorPartOf: $partOf }\n         orderBy: { relevancy: desc }\n         limit: 10\n         offset: 0\n      ) {\n         notes {\n            ...NoteFragment\n            ...NoteCard\n         }\n      }\n   }\n":o.Sc,"\n   fragment NoteCard on Note {\n      ...NotePermissions\n      __typename\n      id\n      html\n      text\n      dateCreated\n      dateModified\n      dateEdited\n      todoCount\n      doneCount\n      archivedAt\n      readAt\n      closed\n      closeSuggested\n      closedForMe\n      unreadCommentsCount\n      commentsCount\n      definitionCount\n      version\n      deleted\n      isWatching\n      kindsText\n      ignoredSuggestions\n      createdFromTemplateId\n      hasDigitalDocumentPermission {\n         ...hasDigitalDocumentPermission\n      }\n      inheritedPermission {\n         grantee {\n            ...ProfileAvatar\n            ...CommunityAvatar\n            ... on Place {\n               id\n               name\n               image\n            }\n         }\n         permissionType\n      }\n      currentParticipants {\n         ...ProfileAvatar\n      }\n      author {\n         ...ProfileAvatar\n      }\n      linkSuggestions {\n         name\n         url\n      }\n      definitions {\n         term\n         negated\n         definition\n         approved\n      }\n      questionResult {\n         count\n         results {\n            answer\n            count\n         }\n      }\n      myAnswers\n      mentions {\n         property\n         propname\n         subject\n         uri\n         kind\n         linkPreview {\n            url\n            title\n            description\n            icon\n            images\n         }\n      }\n      uploads {\n         id\n         url(seconds: 86400)\n         previewUrl(seconds: 86400)\n      }\n      reactions {\n         agreement {\n            count\n            me\n         }\n         applause {\n            count\n            me\n         }\n      }\n      events {\n         ...NoteEvent\n      }\n   }\n":o.Go,"\n   fragment NoteEvent on NoteEvent {\n      __typename\n      ... on NoteCommentedEvent {\n         actor {\n            ...Actor\n         }\n         at\n         html\n      }\n      ... on NoteChangedEvent {\n         actor {\n            ...Actor\n         }\n         at\n         from\n         to\n      }\n      ... on NoteReferencedEvent {\n         actor {\n            ...Actor\n         }\n         at\n         byNote {\n            id\n            text\n         }\n      }\n      ... on NoteClosedEvent {\n         actor {\n            ...Actor\n         }\n         at\n         reasonTime\n         reasonIsNthComment\n         suggested\n      }\n      ... on NoteReopenedEvent {\n         actor {\n            ...Actor\n         }\n         at\n         suggested\n      }\n      ... on NoteCreatedEvent {\n         actor {\n            ...Actor\n         }\n         at\n      }\n   }\n":o.X5,"\n   fragment Actor on Profile {\n      ...ProfileAvatar\n      state {\n         id\n         available\n      }\n   }\n":o.HH,"\n   fragment hasDigitalDocumentPermission on DigitalDocumentPermission {\n      permissionType\n      grantee {\n         __typename\n         ...ProfileAvatar\n         ...CommunityAvatar\n         ... on Place {\n            id\n            name\n            image\n         }\n      }\n      announce\n      pin\n   }\n":o.Kn,"\n   fragment NotePermissions on Note {\n      author {\n         id\n      }\n      hasDigitalDocumentPermission {\n         grantee {\n            ...IdOfPage\n         }\n         permissionType\n      }\n      inheritedPermission {\n         grantee {\n            ...IdOfPage\n         }\n         permissionType\n      }\n   }\n":o.s4,"\n   fragment IdOfPage on Page {\n      __typename\n      ... on Profile {\n         id\n      }\n      ... on Place {\n         id\n      }\n      ... on Community {\n         id\n      }\n   }\n":o._l,"\n   query SearchPageSpace($id: ID!) {\n      community(id: $id) {\n         id\n         name\n         image\n      }\n   }\n":o.Ff,"\n   query BoardColumns($ids: [ID!]) {\n      notes(ids: $ids) {\n         notes {\n            ...NoteCard\n         }\n      }\n   }\n":o.xy,"\n   query MyNotes($filter: NoteFilterInput) {\n      notes(filter: $filter) {\n         hits {\n            note {\n               id\n               html\n            }\n         }\n      }\n   }\n":o.w4};function r(n){var e;return null!==(e=i[n])&&void 0!==e?e:{}}},84798:function(n,e,t){"use strict";function o(n,e){const t=new Map;for(const o of n){const n=e(o);for(const e of n){const n=t.get(e);n?n.includes(o)||n.push(o):t.set(e,[o])}}return t}function i(n,e){const t=new Map;for(const o of n){const n=e(o);t.set(n,o)}return t}t.d(e,{Z:function(){return o},r:function(){return i}})},41035:function(n,e,t){"use strict";t.d(e,{L:function(){return r}});var o=t(8449),i=t(19845);const r=(0,o.O4)("mainDrawerOpen",!1,i.G,{getOnInit:!0})},66864:function(n,e,t){"use strict";t.d(e,{U:function(){return r},j:function(){return i}});var o=t(8449);const i="whitelabelHost",r=(0,o.O4)(i,void 0,void 0,{getOnInit:!0})},38321:function(n,e,t){"use strict";var o=t(27573),i=t(20099),r=t(26481),a=t(22845),s=t(34766),l=t(9937),d=t(22543),c=t(41160),u=t(81086),m=t(8449),h=t(50525),v=t(19845),f=t(62377),p=t(61814),g=t(99142),y=t(67754),x=t(94786),w=t(24853),C=t(7653),j=t(14283),N=t(87659),b=t(14832),k=t(9943),Z=t(48754),P=t(85177);const I=(0,m.O4)("navigationDrawer.expansions",{},v.z,{getOnInit:!0});function D(n){let{href:e,title:t,icon:m,expansionKey:v=e,editable:D=!1,onClick:S,nested:$,className:A,canAddPart:O=!1,inSidebar:E,defaultExpanded:T=!1,ignoreNestedClick:F,withoutEditButton:W=!1,showNested:_=0}=n;const M=(0,y.useRouter)(),L=(0,f.W)(),[z,R]=(0,u.KO)(I),B=v in z?z[v]:T,U=!!e.match(/^https?:\/\//g),q=(0,h.Z)(),K=(0,u.Dv)(p.Tf),H="none"!==K,G="note"===K&&((0,i.pj)(e)||(0,i.uZ)(e))&&O,[V,Y]=(0,C.useState)("none"),X=(0,o.jsx)(c.Z,{className:(0,Z.Z)("absolute m-auto shrink-0 transition-opacity",q?"opacity-1 -translate-y-1/2":"opacity-0 group-hover:opacity-100"),style:{left:q?6:2+(E?0:10)},onMouseDown:n=>{n.stopPropagation()},onClick:n=>{n.preventDefault(),n.stopPropagation(),R((n=>({...n,[v]:!B})))},children:(0,o.jsx)(x.U,{className:(0,Z.Z)("arrow transition-transform",B?"expanded rotate-0":"rotate-180")})}),J=(0,j.Z)(),Q=!!$,nn=J===e,en=(0,b.Z)(),tn=(0,P.__)(),on=(0,P.Rc)(),rn=(0,o.jsxs)(l.Z,{className:(0,Z.Z)("group relative transition-all","saved"===V&&"bg-info/20","error"===V&&"bg-error/50","saving"===V&&"bg-success/50",nn&&"text-primary",H&&"opacity-50",H&&G&&"bg-primary/10 opacity-100",A),onClick:S,component:U?"a":e?N.default:"button",href:e,target:U?"_blank":void 0,onMouseDown:n=>{if(n.shiftKey&&e.startsWith("/notes/"))return L(e.slice(7)),n.preventDefault(),n.stopPropagation(),!1;U||J===e||M.push(e)},onDragStart:n=>{if(!(0,i.pj)(e))return;const t=new URL(e,window.location.origin).href;n.dataTransfer.effectAllowed="copyLink",n.dataTransfer.setData("text/plain",t),n.dataTransfer.setData("text/uri-list",t),n.dataTransfer.setData(p.Pj,JSON.stringify({id:(0,k.Do)(e)}))},onDrop:n=>{const t=n.dataTransfer.getData("text/uri-list");let o=(0,i.uZ)(e)?null:void 0;const r=e.match(/#(.*)$/);r&&(o=r[1]),console.log("dropped",t,o);const a=(0,g.ZP)(e)||(0,g.M_)(e);a&&(Y("saving"),tn("card.linkAdded",a,{href:t,kind:"chip"}),(0,i.sU)(on,a,t,void 0,o).then((()=>{Y("saved"),setTimeout((()=>Y("none")),1e3)}),(n=>{Y("error"),setTimeout((()=>Y("none")),1e3)})))},children:[(0,o.jsx)(d.Z,{className:(0,Z.Z)(!q&&"transition-opacity",Q?"group-hover:opacity-0":"group-hover:opacity-100"),children:m}),!q&&Q?X:null,(0,o.jsx)(r.Z,{primary:t}),D&&!W&&(0,o.jsx)(a.Z,{className:"-mr-1",children:(0,o.jsx)(c.Z,{className:"remove backdrop-blur-md",onMouseDown:n=>{n.stopPropagation(),n.preventDefault(),en("editFavorite",e)},edge:"end","aria-label":"comments",children:(0,o.jsx)(w.z,{size:18})})})]});return!$||Array.isArray($)&&0===$.length?rn:(F&&($=(0,o.jsx)("div",{onClick:n=>{n.stopPropagation(),n.preventDefault()},children:$})),(0,o.jsxs)(o.Fragment,{children:[rn,$&&(0,o.jsx)(s.Z,{in:B,mountOnEnter:!0,unmountOnExit:!0,children:$})]}))}e.Z=C.memo(D)},68777:function(n,e,t){"use strict";t.r(e),t.d(e,{Dot:function(){return de},NavigationDrawer:function(){return Un},columnsFromCardHtml:function(){return se},default:function(){return ue}});var o=t(27573),i=t(69016),r=t(66680),a=t(38321),s=t(88216),l=t(72073),d=t(28759),c=t(38199),u=t(99213),m=t(34766),h=t(41160),v=t(50209),f=t(9937),p=t(23200),g=t(22326),y=t(17119),x=t(46161),w=t.n(x),C=t(22543),j=t(3627),N=t(26481),b=t(97951),k=t(88347),Z=t(11939),P=t(21887),I=t(43590),D=t(80029),S=t(44568),$=t(76876),A=t(45496),O=t(19467),E=t(23090),T=t(81086),F=t(41035),W=t(81132),_=t(50525),M=t(98446),L=t(22385),z=t(86096),R=t(25626),B=t(53749),U=t(3145),q=t(16385),K=t(53582),H=t(20582),G=t(67754),V=t(93565),Y=t(5614),X=t(53475),J=t(94799),Q=t(36867),nn=t(39958),en=t(1286),tn=t(71233),on=t(48958),rn=t(60493),an=t(6364),sn=t(47787),ln=t(94786),dn=t(7653),cn=t(82882),un=t(6543),mn=t(74946),hn=t(46957),vn=t(26573),fn=t(92733),pn=t(64343),gn=t(46425),yn=t(84364),xn=t(36351),wn=t(9177),Cn=t(52338),jn=t(3982),Nn=t(14832),bn=t(35117),kn=t(10448),Zn=t(68128),Pn=t(48754);function In(n){let{value:e="list",onChange:t}=n;const i=(0,s.ZP)("CalendarToggle");return(0,o.jsxs)("div",{className:"bg-rounded ml-auto flex items-center justify-center gap-1 rounded-xl",onClick:n=>{n.preventDefault()},children:[(0,o.jsx)(bn.Z,{title:i("calendar"),children:(0,o.jsx)("button",{className:(0,Pn.Z)("text-secondary flex cursor-pointer items-center justify-center rounded-xl border-none bg-transparent p-0.5 opacity-80 outline-none","calendar"==e&&"bg-text/10 text-inherit opacity-100"),onClick:()=>null===t||void 0===t?void 0:t("calendar"),children:(0,o.jsx)(kn.f,{className:"size-5 text-inherit"})})}),(0,o.jsx)(bn.Z,{title:i("list"),children:(0,o.jsx)("button",{className:(0,Pn.Z)("text-secondary flex cursor-pointer items-center justify-center rounded-xl border-none bg-transparent p-0.5 opacity-80 outline-none","list"==e&&"bg-text/10 text-inherit opacity-100"),onClick:()=>null===t||void 0===t?void 0:t("list"),children:(0,o.jsx)(Zn.a,{className:"size-5 text-inherit"})})})]})}var Dn=t(8449),Sn=t(19845),$n=t(98653),An=t(97870),On=t(82601),En=t(71609),Tn=t(85177),Fn=t(85978),Wn=t(74890);function _n(n){return function(n){var e,t;const o=new Uint8Array((null===(e=n.match(/.{1,2}/g))||void 0===e?void 0:e.map((n=>parseInt(n,16))))||[]);let i="";for(const a of o)i+=a.toString(2).padStart(8,"0");const r=(null===(t=i.match(/.{1,6}/g))||void 0===t?void 0:t.map((n=>parseInt(n.padEnd(6,"0"),2))))||[];return r.map((n=>Mn[n])).join("")}((0,Wn.sha256)("favorites:".concat(n))).slice(0,21)}const Mn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ln=t(99142),zn=t(34240);const Rn=(0,H.default)((()=>Promise.all([t.e(32209),t.e(97390),t.e(95696),t.e(78943),t.e(66763)]).then(t.bind(t,10474)).then((n=>({default:n.StaticDatePicker})))),{loadableGenerated:{webpack:()=>[10474]},ssr:!1}),Bn=(0,un.B)("\n   query CalendarInfo($filter: NoteFilterInput, $year: Int!, $month: Int!) {\n      notes(limit: 0, filter: $filter) {\n         aggregations {\n            daysOfMonth(year: $year, month: $month) {\n               name\n               values {\n                  value\n                  count\n               }\n            }\n         }\n      }\n   }\n");function Un(n){let{onClose:e}=n;var t,i;const r=(0,s.ZP)("NavigationDrawer"),d=(0,_.Z)(),u=((0,W.Z)(),(0,l.Z)({updateInterval:36e5})),m=(0,T.Dv)(z.Z),h=(0,dn.useMemo)((()=>({gte:(0,S.b)(u),lte:(0,$.i)(u)})),[u]),[v]=(0,mn.FPW)({variables:{today:h}}),f=(0,T.Dv)(M.ZP),p=(0,q.ZP)("myStack"),g="time:".concat((new Date).toISOString().slice(0,10)),y=null===(i=v.data)||void 0===i||null===(t=i.notesForToday)||void 0===t?void 0:t.notes.filter((n=>{var e,t;return(null===(e=n.mentions)||void 0===e?void 0:e.some((n=>(0,yn.Z)(n.uri).startsWith(g))))||(null===(t=n.linkSuggestions)||void 0===t?void 0:t.some((n=>(0,yn.Z)(n.url).startsWith(g))))})),x=(0,q.ZP)("hideOverviewInNav"),w=(0,q.ZP)("mobileStories"),C=(0,q.ZP)("favoritesAsIndexCard");var j;return(0,o.jsxs)("div",{className:"pt-safe pointer-events-auto relative flex min-h-[calc(100dvh-56px)] flex-col",children:[(0,o.jsxs)(ce,{onClick:()=>{d&&e&&e()},children:[d&&(0,o.jsx)(a.Z,{href:d?"/start":"/any",title:r("startMobile"),icon:(0,o.jsx)(V.C,{})}),f&&!x&&(0,o.jsx)(a.Z,{href:"/overview",title:r("overview"),icon:(0,o.jsx)(Y.T,{})}),(0,o.jsx)(Gn,{notesToday:null!==(j=null===y||void 0===y?void 0:y.length)&&void 0!==j?j:0}),!d&&(p?(0,o.jsx)(qn,{}):(0,o.jsx)(a.Z,{href:d?"/notes?filter=author%3Ame&orderBy=dateCreated%3Adesc":"/any?stack=cards:author:me&orderBy=dateCreated%3Adesc",title:r("notes"),icon:(0,o.jsx)(On.MY,{className:"size-4"})})),(0,o.jsx)(a.Z,{href:d?"/profiles":"/any?stack=profiles",title:r("profiles"),icon:(0,o.jsx)(X.Q,{})}),(0,o.jsx)(a.Z,{href:d?"/communities":"/any?stack=spaces",title:r("spaces"),icon:(0,o.jsx)(J.W,{})}),w&&d&&(0,o.jsx)(Kn,{})]}),C?(0,o.jsx)(ne,{}):(0,o.jsx)(Qn,{partOf:m}),(0,o.jsx)("div",{className:"flex-1"}),(0,o.jsxs)("div",{className:"text-text-secondary pb-safe bg-default mt-auto p-2 text-xs",children:[(0,o.jsx)(c.default,{color:"inherit",href:"https://clye.app/agb",target:"_blank",className:"no-underline",children:r("agb")}),", ",(0,o.jsx)(c.default,{className:"no-underline",color:"inherit",href:"https://clye.app/datenschutz",target:"_blank",children:r("privacy")}),", ",(0,o.jsx)(c.default,{className:"no-underline",color:"inherit",href:"https://clye.app",target:"_blank",children:r("whatsClye")})]})]})}const qn=dn.memo((function(n){let{}=n;var e;const t=(0,s.ZP)("NavigationDrawer"),i="/notes?filter=author%3Ame+closed:false&orderBy=urgency%3Adesc&backButton=false",r=(0,G.usePathname)(),l=(0,G.useSearchParams)();return(0,o.jsx)(a.Z,{href:i,title:t("notes"),expansionKey:"myStack",icon:(0,o.jsx)(On.MY,{className:"size-4"}),defaultExpanded:"/notes"===r&&(null===l||void 0===l||null===(e=l.get("filter"))||void 0===e?void 0:e.includes("author%3Ame")),nested:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.Z,{icon:(0,o.jsx)(Q.x,{}),href:i,title:t("card.urgency")}),(0,o.jsx)(a.Z,{icon:(0,o.jsx)(nn.O,{}),href:"/notes?filter=author%3Ame&orderBy=urgency%3Adesc&backButton=false",title:t("card.other")}),(0,o.jsx)(a.Z,{icon:(0,o.jsx)(en.w,{}),href:"/notes?filter=author%3Ame&orderBy=relevancy%3Adesc&backButton=false",title:t("card.grouped")}),(0,o.jsx)(a.Z,{icon:(0,o.jsx)(tn.f,{style:{opacity:.5}}),href:"/notes?filter=author%3Ame&orderBy=relevancy%3Adesc&backButton=false",title:t("card.closeSuggested")})]})})}));function Kn(){var n;const e=(0,s.ZP)("NavigationDrawer");var t;const i=null!==(t=null===(n=An.S.card.recommend.useQuery({mine:!1,limit:5}).data)||void 0===n?void 0:n.items.map((n=>n.card.id)).filter((n=>{if(n)return n})))&&void 0!==t?t:[];if(0===i.length)return null;let r="/notes/"+i[0];return i.forEach(((n,e)=>{r+=0===e?"?ids="+n:"&ids="+n})),(0,o.jsx)(a.Z,{href:r,title:e("clyeRelevantCards"),icon:(0,o.jsx)(on.n,{})})}const Hn=(0,Dn.O4)("calMode","list",Sn.G,{getOnInit:!0}),Gn=dn.memo((function(n){let{notesToday:e=0}=n;const t=(0,T.Dv)(pn.Z),r=(new Date).toISOString().slice(0,10),l=(0,G.useRouter)(),[c,m]=(0,T.KO)(i.Rd),h=(0,s.ZP)("NavigationDrawer"),v=(0,d.Z)(),f=(0,dn.useMemo)((()=>null!==c&&void 0!==c?c:{setAt:(new Date).toISOString(),date:(new Date).toISOString()}),[c]),p=(0,dn.useMemo)((()=>new Date(f.date)),[f]);let g=(0,dn.useMemo)((()=>(0,A.z)(p)?h("day.today"):(0,O.g)(p)?h("day.yesterday"):(0,E.P)(p)?h("day.tomorrow"):v.formatDateTime(p,{weekday:"short",day:"numeric",month:"numeric",year:"2-digit"}).replace(".,","")),[p,h,v]);const y=(0,q.ZP)("calendarToggle"),[x,w]=(0,T.KO)(Hn);y&&(g=(0,o.jsxs)("div",{className:"flex items-center justify-center",children:[(0,o.jsx)("div",{className:"flex-1",children:g}),(0,o.jsx)(In,{value:x,onChange:n=>{w(n),l.replace(Vn(n,f.date))}})]}));const C=(0,G.usePathname)();let j=Vn(x,f.date);var N,b,k;return t!==r&&(b="newDot",k="daily",j=(N=j).includes("?")?"".concat(N,"&").concat(b,"=").concat(k):"".concat(N,"?").concat(b,"=").concat(k)),(0,o.jsx)(a.Z,{href:j,title:g,icon:(0,o.jsx)(u.Z,{badgeContent:e,variant:"dot",color:"primary",overlap:"circular",invisible:t===r,children:(0,o.jsx)(rn.R,{})}),expansionKey:"daily",defaultExpanded:null===C||void 0===C?void 0:C.startsWith("/daily"),ignoreNestedClick:!0,nested:(0,o.jsx)(Yn,{time:p,onChange:n=>{const e=n.toISOString().slice(0,10);m((n=>({...n,date:e}))),l.replace(Vn(x,e))}})})}));function Vn(n,e){return"list"===n?"/daily/".concat(e.slice(0,10),"?orderBy=dateCreated%3Adesc"):"/calendar?day=".concat(e.slice(0,10))}const Yn=dn.memo((function(n){const{time:e,onChange:t}=n,i=(0,dn.useMemo)((()=>w()(e)),[e]),r=(0,T.Dv)(L.ZP),a=(0,dn.useMemo)((()=>{var n,e;if(!r)return{};const t=null!==(e=null===r||void 0===r||null===(n=r.partOf)||void 0===n?void 0:n.map((n=>{let{page:e}=n;return e.id})).filter((n=>"deleted"!==n)))&&void 0!==e?e:[],o=null===r||void 0===r?void 0:r.id;return{or:[{author:o?[o]:null},{sharedWith:o?[o]:null},{announcedTo:t}]}}),[r]),[s,l]=(0,dn.useState)(i.month()),[d]=(0,fn.aM)({query:Bn,variables:{year:i.year(),month:s+1,filter:a}}),c=(0,dn.useMemo)((()=>{var n,e,t,o,i,r,a,s,l,c,u;if(d.fetching)return{perDay:{},max:0};var m;return{perDay:Object.fromEntries(null!==(u=null===(i=d.data)||void 0===i||null===(o=i.notes)||void 0===o||null===(t=o.aggregations)||void 0===t||null===(e=t.daysOfMonth)||void 0===e||null===(n=e.values)||void 0===n?void 0:n.map((n=>[n.value,n.count])))&&void 0!==u?u:[]),max:null!==(m=null===(c=d.data)||void 0===c||null===(l=c.notes)||void 0===l||null===(s=l.aggregations)||void 0===s||null===(a=s.daysOfMonth)||void 0===a||null===(r=a.values)||void 0===r?void 0:r.reduce(((n,e)=>n>e.count?n:e.count),0))&&void 0!==m?m:0}}),[d]);return(0,o.jsx)(Xn.Provider,{value:c,children:(0,o.jsx)(Rn,{sx:n=>({"& .MuiDateCalendar-root":{width:240,height:240},"& .MuiDayCalendar-slideTransition":{minHeight:240,overflow:"hidden"},["&.".concat(I.j.root)]:{backgroundColor:"transparent",minWidth:200,color:n.vars.palette.text.secondary},"& .MuiButtonBase-root":{color:n.vars.palette.text.secondary},"& .MuiYearCalendar-root":{width:240},"& .MuiPickersDay-root":{width:25,height:25,background:"transparent",position:"relative"},"& .MuiDayCalendar-weekDayLabel":{width:25,height:32},"& .MuiPickersArrowSwitcher-spacer":{width:0},"& .MuiPickersCalendarHeader-root":{mt:0},"& .MuiPickersCalendarHeader-label":n.typography.caption,"& .dot":{background:"rgb(".concat(n.vars.palette.text.secondaryChannel," / 0.2)"),zIndex:-1}}),className:"mb-2 w-60",displayStaticWrapperAs:"desktop",slotProps:{nextIconButton:{size:"small"},previousIconButton:{size:"small"},toolbar:{toolbarFormat:""}},slots:{day:Jn},onMonthChange:n=>{try{l(n.month())}catch(e){console.error(e)}},value:i,onChange:n=>{n&&t(n)}})})})),Xn=dn.createContext({perDay:{},max:0});function Jn(n){const e=dn.useContext(Xn),t=w()(n.day).date().toString(),i=t.padStart(2,"0");var r;const a=null!==(r=e.perDay[i])&&void 0!==r?r:0,s=a/(e.max||1)*.6+(a>0?.4:0);return(0,o.jsxs)(D.H,{...n,children:[(0,o.jsx)("div",{className:"dot absolute bottom-0 left-0 right-0 top-0 rounded-[50%]",style:{transform:"scale(".concat(100*s,"%)")}}),(0,o.jsx)("span",{children:t})]})}const Qn=dn.memo((function(n){let{partOf:e}=n;const t=(0,l.Z)({updateInterval:36e5}),d=(0,dn.useMemo)((()=>({gte:(0,S.b)(t),lte:(0,$.i)(t)})),[t]),[c]=(0,mn.FPW)({variables:{today:d}}),[u,f]=(0,T.KO)(i.v3),p=(0,dn.useMemo)((()=>{var n,e,t;return null!==(t=null===(e=c.data)||void 0===e||null===(n=e.favorites)||void 0===n?void 0:n.filter(hn.Dw))&&void 0!==t?t:vn.r}),[c.data,u]),g=(0,K.Z)(),y=(0,s.ZP)("NavigationDrawer"),x=(0,_.Z)(),w=(0,Nn.Z)(),C=(0,T.b9)(F.L);return(0,o.jsxs)(ce,{className:"mt-4",dense:!0,subheader:(0,o.jsx)(le,{onChange:x?void 0:f,show:x||u,text:y("favorites"),icon:(0,o.jsx)(an.U,{})}),children:[(0,o.jsx)(m.Z,{in:x||u&&p.length>0,unmountOnExit:!0,mountOnEnter:!0,children:(0,o.jsx)(cn.Z,{children:p.filter(hn.Dw).map((n=>{var t,i,s,l,d,c,u,v,f,p,y,j,N,b,k,Z,P,I,D,S,$,A,O;return(0,o.jsx)(m.Z,{children:(0,o.jsx)(a.Z,{href:n.path,withoutEditButton:x,onClick:n=>{x&&C(!1)},title:x?(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)("div",{className:"flex-1 truncate",children:null!==(Z=null!==(k=null!==(b=null!==(N=n.title)&&void 0!==N?N:null===(t=n.community)||void 0===t?void 0:t.name)&&void 0!==b?b:null===(s=n.note)||void 0===s||null===(i=s.text)||void 0===i?void 0:i.split(/\n/).at(0))&&void 0!==k?k:null===(l=n.profile)||void 0===l?void 0:l.image)&&void 0!==Z?Z:"Seite"}),(0,o.jsx)(h.Z,{className:"pr-0",onClick:e=>{e.stopPropagation(),e.preventDefault(),w("editFavorite",n.path)},children:(0,o.jsx)($n.z,{size:18,className:""})})]}):(0,o.jsx)("div",{children:null!==(S=null!==(D=null!==(I=null!==(P=n.title)&&void 0!==P?P:null===(d=n.community)||void 0===d?void 0:d.name)&&void 0!==I?I:null===(u=n.note)||void 0===u||null===(c=u.text)||void 0===c?void 0:c.split(/\n/).at(0))&&void 0!==D?D:null===(v=n.profile)||void 0===v?void 0:v.image)&&void 0!==S?S:"Seite"}),canAddPart:!!n.note&&(0,r.U)((0,En.m)(n.note),null!==g&&void 0!==g?g:null,e),editable:!0,icon:(0,o.jsx)(U.Z,{path:n.path,note:null!==($=n.note)&&void 0!==$?$:void 0,src:null!==(O=null!==(A=null===(f=n.community)||void 0===f?void 0:f.image)&&void 0!==A?A:null===(p=n.profile)||void 0===p?void 0:p.image)&&void 0!==O?O:void 0,size:16}),nested:n.note&&(null===(y=n.note)||void 0===y?void 0:y.mentions)&&(null===(j=n.note)||void 0===j?void 0:j.mentions.length)>0?(0,o.jsx)(ie,{path:n.path}):void 0})},n.path)}))})}),(0,o.jsx)(m.Z,{in:u&&p.length<1,unmountOnExit:!0,mountOnEnter:!0,children:(0,o.jsx)(v.Z,{component:"div",className:"ml-14",variant:"caption",color:"text.secondary",children:y("noFavorites")})}),(0,o.jsx)(ee,{hide:!u})]})})),ne=dn.memo((function(n){let{}=n;var e;const t=(0,K.Z)(),r=(0,s.ZP)("NavigationDrawer"),a=(0,_.Z)(),[l,d]=(0,T.KO)(i.v3),c=((0,Nn.Z)(),(0,T.b9)(F.L),(0,Tn.Zy)(Fn.Wb,_n(null!==t&&void 0!==t?t:""),{enabled:!!t}));var u;const h=(0,zn.F)(null!==(u=null===(e=c.data)||void 0===e?void 0:e.html)&&void 0!==u?u:"").links;return(0,o.jsxs)(ce,{className:"mt-4",dense:!0,subheader:(0,o.jsx)(le,{onChange:a?void 0:d,show:a||l,text:r("favorites"),icon:(0,o.jsx)(an.U,{})}),children:[(0,o.jsx)(m.Z,{in:a||l&&h.length>0,unmountOnExit:!0,mountOnEnter:!0,children:(0,o.jsx)(cn.Z,{children:h.filter(hn.Dw).map((n=>(0,o.jsx)(m.Z,{children:(0,o.jsx)(re,{link:n.link,text:n.text||void 0,showNested:3})},n.link)))})}),(0,o.jsx)(m.Z,{in:l&&h.length<1,unmountOnExit:!0,mountOnEnter:!0,children:(0,o.jsx)(v.Z,{component:"div",className:"ml-14",variant:"caption",color:"text.secondary",children:r("noFavorites")})}),(0,o.jsx)(te,{hide:!l})]})})),ee=dn.memo((function(n){let{hide:e}=n;var t;const r=(0,s.ZP)("ClyeAppBar"),[a]=(0,mn.FPW)(),[,l]=(0,mn.ulW)();var d;const c=null!==(d=null===(t=a.data)||void 0===t?void 0:t.favorites)&&void 0!==d?d:[],u=(0,T.b9)(i.v3),[h,v]=(0,T.KO)(F.L),p=(0,_.Z)(),g=(0,G.usePathname)(),y=(0,G.useSearchParams)(),x=(0,jn.O_)(),w=()=>x?oe():"",j=w(),b=(0,Nn.Z)();if(null===g||void 0===g?void 0:g.startsWith("/calls"))return null;if("/start"===g)return null;const k=!!c.some((n=>(null===n||void 0===n?void 0:n.path)===j));return(0,o.jsx)(m.Z,{in:!k&&!e,children:(0,o.jsx)(R.ZP,{introId:B.rS.appBarFavorite,normalTitle:r(k?"editFavorite":"favoriteTooltip"),title:r("favoriteIntro"),backdrop:!1,disabled:!h||g.startsWith("/notes/")&&(null===y||void 0===y?void 0:y.has("shareWith"))||!(null===y||void 0===y?void 0:y.has("filter")),children:(0,o.jsxs)(f.Z,{onClick:n=>{n.preventDefault(),n.stopPropagation(),k?b("editFavorite",w()):(l({path:w(),title:document.title}),u(!0),p||v(!0))},children:[(0,o.jsx)(C.Z,{children:(0,o.jsx)(sn.v,{})}),(0,o.jsx)(N.Z,{primary:r("favorite")})]})})})})),te=dn.memo((function(n){let{hide:e}=n;var t;const r=(0,s.ZP)("ClyeAppBar"),[a]=(0,mn.FPW)(),[,l]=(0,mn.ulW)();var d;const c=null!==(d=null===(t=a.data)||void 0===t?void 0:t.favorites)&&void 0!==d?d:[],u=(0,T.b9)(i.v3),[h,v]=(0,T.KO)(F.L),p=(0,_.Z)(),g=(0,G.usePathname)(),y=(0,G.useSearchParams)(),x=(0,jn.O_)(),w=()=>x?oe():"",j=w(),b=(0,Nn.Z)();if(null===g||void 0===g?void 0:g.startsWith("/calls"))return null;if("/start"===g)return null;const k=!!c.some((n=>(null===n||void 0===n?void 0:n.path)===j));return(0,o.jsx)(m.Z,{in:!k&&!e,children:(0,o.jsx)(R.ZP,{introId:B.rS.appBarFavorite,normalTitle:r(k?"editFavorite":"favoriteTooltip"),title:r("favoriteIntro"),backdrop:!1,disabled:!h||g.startsWith("/notes/")&&(null===y||void 0===y?void 0:y.has("shareWith"))||!(null===y||void 0===y?void 0:y.has("filter")),children:(0,o.jsxs)(f.Z,{onClick:n=>{n.preventDefault(),n.stopPropagation(),k?b("editFavorite",w()):(l({path:w(),title:document.title}),u(!0),p||v(!0))},children:[(0,o.jsx)(C.Z,{children:(0,o.jsx)(sn.v,{})}),(0,o.jsx)(N.Z,{primary:r("favorite")})]})})})}));function oe(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href;const e=new URL(n);return e.searchParams.delete("i"),e.searchParams.delete("dialog"),e.searchParams.delete("placeholder"),e.searchParams.delete("shareWith"),e.searchParams.delete("shouldMention"),e.searchParams.delete("filter"),e.searchParams.delete("clean"),e.searchParams.delete("backButton"),e.searchParams.delete("linkedFrom"),e.searchParams.sort(),e.pathname+e.search}function ie(n){let{path:e,title:t,showNested:i=0}=n;var s,l;const d=(0,T.Dv)(z.Z),c=(0,K.Z)(),u=(0,Ln.aA)(e),m=(0,Tn.Zy)(Fn.Wb,u);if(e.startsWith("/kanban")&&(null===(s=m.data)||void 0===s?void 0:s.html)&&u){var h;const n=se(null!==(h=m.data.html)&&void 0!==h?h:"",u),e=(0,r.U)((0,En.m)(m),null!==c&&void 0!==c?c:null,d);return n.map(((n,r)=>(0,o.jsx)(a.Z,{className:"ml-8",icon:(0,o.jsx)(Cn.Q,{}),href:n.href,title:null!==t&&void 0!==t?t:n.title,canAddPart:e,showNested:i-1},n.href)))}var v;const f=(0,zn.F)(null!==(v=null===(l=m.data)||void 0===l?void 0:l.html)&&void 0!==v?v:"").links;var p;return null!==(p=null===f||void 0===f?void 0:f.filter((n=>n.link.startsWith("/"))).map(((n,e)=>(0,o.jsx)(re,{showNested:i-1,link:n.link,text:n.text},"".concat(e," ").concat(n.link)))))&&void 0!==p?p:void 0}function re(n){let{link:e,text:t,showNested:i=0}=n;const s=(0,K.Z)(),l=(0,Ln.ZP)(e),d=(0,Tn.Zy)(Fn.Wb,l||null).data,c=(0,T.Dv)(z.Z),u=!!d&&(0,r.U)(d,null!==s&&void 0!==s?s:null,c),m=d&&d.html?(0,zn.F)(d.html):void 0,h=(!t||t.startsWith("/")?(null===m||void 0===m?void 0:m.title)||t:t||(null===m||void 0===m?void 0:m.title))||"Link";return l?(0,o.jsx)(ae,{canAddPart:u,id:l,title:h,showNested:i-1}):(0,o.jsx)(a.Z,{className:"ml-10 mr-2 rounded-2xl py-0.5 pl-2",icon:(0,o.jsx)(U.Z,{path:e,note:d||void 0,size:16}),href:e,title:h,canAddPart:u,showNested:i-1})}function ae(n){let{id:e,title:t,canAddPart:i,showNested:r=0}=n;var s;const l=(0,Tn.Zy)(Fn.Wb,e||null);return!t&&(null===(s=l.data)||void 0===s?void 0:s.html)&&(t=(0,zn.F)(l.data.html).title),(0,o.jsx)(a.Z,{className:"ml-10 mr-2 rounded-2xl py-0.5 pl-2",icon:(0,o.jsx)(U.Z,{path:"/notes/".concat(e),note:l.data||void 0,size:16}),href:"/any?stack=card:".concat(e),title:t,canAddPart:i,showNested:r,nested:r>0?(0,o.jsx)(ie,{path:"/notes/".concat(e)}):void 0})}function se(n,e){const t=(0,xn.l7)(n),o=[];for(const i of t)"h2"===i.type?o.push({href:"/notes/".concat(e,"#").concat(i.id),title:wn.NB.string(i)}):"link"===i.type&&i.href.startsWith("/notes/")&&o.push({href:i.href,title:wn.NB.string(i)});return o}function le(n){const{onChange:e,show:t,action:i,icon:r,text:a}=n,s=(0,o.jsxs)(p.Z,{className:"group relative flex w-full pr-0",sx:n=>({"& .header":{flex:1,textAlign:"left"},"& .arrow":i?{opacity:0,transition:n=>n.transitions.create(["transform","opacity"]),transform:t?"rotate(0deg)":"rotate(180deg)",position:"absolute",left:20,height:"24px !important",width:"24px !important",top:8,borderRadius:12,background:n=>n.vars.palette.background.default}:{opacity:0,float:"right",transition:n=>n.transitions.create(["transform","opacity"]),transform:t?"rotate(0deg)":"rotate(180deg)"},"&:hover .arrow":{opacity:1},"& .notFavorite":{opacity:0,transition:n.transitions.create(["opacity"])},"&:hover .notFavorite":{opacity:1},"& .MuiButtonBase-root svg":{mr:0}}),children:[r," ",(0,o.jsx)("span",{className:"header",children:a}),i,e&&(0,o.jsx)(ln.U,{className:"arrow"})]});return e?(0,o.jsx)(g.Z,{component:"div",sx:{width:1},onClick:()=>e((n=>!n)),children:s}):s}function de(n){let{size:e}=n;return e?(0,o.jsx)("div",{className:"flex items-center justify-center",style:{width:e,height:e},children:(0,o.jsx)("div",{className:"bg-text-secondary h-1 w-1 rounded-full",style:{width:e/5*2,height:e/5*2}})}):(0,o.jsx)("div",{className:"bg-text-secondary ml-1 h-1 w-1 rounded-full"})}const ce=(0,P.ZP)(y.Z)((n=>{let{theme:e}=n;return{["& .".concat(j.Z.root)]:{minWidth:e.spacing(4)},["& .".concat(gn.Z.root)]:{padding:e.spacing(0,1),borderRadius:e.spacing(1)},["& .".concat(Z.Z.root)]:{background:"transparent",display:"flex",alignItems:"center",lineHeight:e.spacing(5),paddingLeft:e.spacing(3),svg:{height:16,width:16,marginRight:e.spacing(2)}},["& .".concat(k.Z.root)]:{marginLeft:e.spacing(0),marginRight:e.spacing(1),paddingLeft:e.spacing(3),borderRadius:e.spacing(4),borderTopLeftRadius:0,borderBottomLeftRadius:0,"& .remove":{opacity:0,transition:e.transitions.create("opacity")},"&:hover .remove":{opacity:1}},["& .".concat(b.Z.primary)]:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}}}));var ue=dn.memo(Un)},69016:function(n,e,t){"use strict";t.d(e,{Rd:function(){return g},j6:function(){return y},v3:function(){return p}});var o=t(7653),i=t(8449),r=t(67754),a=t(19845),s=t(85056),l=t(81086),d=t(5565),c=t(41035);const u=(0,i.O4)("recent",[],void 0,{getOnInit:!0});u.debugLabel="recentAtom";const m="https://clye.app";function h(n){const e=new URL(n,m);if(e.searchParams.delete("dialog"),e.searchParams.has("q")){var t,o;const n=null===(o=e.searchParams)||void 0===o||null===(t=o.get("q"))||void 0===t?void 0:t.trim();n?e.searchParams.set("q",n):e.searchParams.delete("q")}return e.searchParams.sort(),e.toString().slice(m.length)}const v=(0,i.O4)("show-favorites",!1,a.G,{getOnInit:!0});v.debugLabel="_showFavoritesAtom";const f=(0,i.O4)("has-favorites-been-shown",!1,a.G,{getOnInit:!0});f.debugLabel="hasFavoritesBeenShownAtom";const p=(0,d.cn)((n=>n(v)),((n,e,t)=>{const o="function"===typeof t?t(n(v)):t;e(v,o),o&&(n(f)||(e(c.L,!0),e(f,!0)))}));(0,i.O4)("show-space-links",!1,a.G,{getOnInit:!0}).debugLabel="showSpaceLinksAtom";(0,i.O4)("show-recent",!1,a.G,{getOnInit:!0}).debugLabel="showRecentAtom";const g=(0,i.O4)("selected-day",{setAt:(new Date).toISOString(),date:(new Date).toISOString()},a.z,{getOnInit:!0});function y(){return function(){const n=(0,l.b9)(u),e=(0,r.usePathname)(),t=(0,r.useSearchParams)(),i="".concat(e).concat(t?"?".concat(t):"");(0,o.useEffect)((()=>{const e={at:(new Date).toISOString(),title:document.title,path:h(i)};n((n=>function(n,e){return[e,...n.filter((n=>n.path!==e.path&&!e.path.startsWith(n.path)))].slice(0,10)}(n,e)))}),[i,n])}(),null}g.onMount=n=>{n((n=>(0,s.K)(new Date(n.setAt),new Date)?n:{setAt:(new Date).toISOString(),date:(new Date).toISOString()}))}},66680:function(n,e,t){"use strict";function o(n,e,t){return n.author===e||Object.entries(null!==(o=n.permissions)&&void 0!==o?o:{}).some((n=>{let[o,i]=n;return(o===e||t.has(o))&&"write"===i}));var o}t.d(e,{U:function(){return o}})},20099:function(n,e,t){"use strict";t.d(e,{ib:function(){return m},pj:function(){return c},sU:function(){return d},uZ:function(){return u}});var o=t(99142),i=t(84364),r=t(36351),a=t(9177),s=t(45853),l=t(85978);async function d(n,e,t,o,a){for(let d=0;d<3;d++){const c=await n.get(l.Wb,e,"server");if(!c.data)throw console.error("note not found",e),new Error("note not found");t=(0,i.Z)(t);const u=(0,r.l7)(c.data.html),m=h(t,o,a)(u),v=(0,r.qC)(m);if(v===c.data.html)return v;try{await n.addAndWait("card.edited",e,{html:v,prevEditTime:c.data.dateEdited})}catch(s){if(console.error("failed to update note",s),d>=2)throw console.error("failed to update note on ".concat(d," retry"),s),s;continue}return v}}function c(n){return!!(0,o.ZP)(n)}function u(n){return n.startsWith("/kanban/")}function m(n,e){return n.filter((n=>{if(!a.W_.isElement(n))return!0;if(n.children=m(n.children,e),0===n.children.length){if("paragraph"===n.type)return!1;if("bulleted-list"===n.type||"numbered-list"===n.type||"check-list-item"===n.type)return!0}return"link"!==n.type||n.href!==e}))}function h(n,e,t,o){if(null===t)return console.log("inserting into kanban first section",n,e),t=>{let o=t.findIndex((n=>a.W_.isElement(n)&&("h2"===n.type||"h3"===n.type)));-1===o&&(o=t.length-1);let i=t.findIndex(((n,e)=>e>o&&a.W_.isElement(n)&&("h2"===n.type||"h3"===n.type)));-1===i&&(i=t.length);const r=h(n,e)(t.slice(o,i));return m(t.slice(0,o),n).concat(r).concat(m(t.slice(i),n))};if(t)return o=>{const i=o.findIndex((n=>a.W_.isElement(n)&&("h2"===n.type||"h3"===n.type)&&n.id===t));let r=o.findIndex(((n,e)=>e>i&&a.W_.isElement(n)&&("h2"===n.type||"h3"===n.type)));-1===r&&(r=o.length);const s=h(n,e)(o.slice(i,r));return m(o.slice(0,i),n).concat(s).concat(m(o.slice(r),n))};if(n===e)return n=>n;const i={type:"link",kind:c(n)?s.OA.chip:void 0,href:n,pos:o,children:[{text:""}]};return e?t=>{t=m(t,n);const o=n=>{for(let t=0;t<n.length;t++){const r=n[t];if(!a.W_.isElement(r))continue;if("link"===r.type&&r.href===e)return n.splice(t,0,i),n;let s=!1,l=!1;for(const n of r.children)a.W_.isElement(n)&&("link"===n.type&&n.href===e?s=!0:l=!0);const d=s&&!l;if("check-list-item"===r.type&&r.children.length<=3&&d)return n.splice(t,0,{type:"check-list-item",checked:!1,children:[i]}),n;if("list-item"===r.type&&r.children.length<=3&&d)return n.splice(t,0,{type:"list-item",children:[i]}),n;r.children=o(r.children)}return n};return o(t)}:e=>{let t=(e=m(e,n))[e.length-1];return a.W_.isElement(t)&&"check-list-item"===t.type?e.push({type:"check-list-item",checked:!1,children:[i]}):!a.W_.isElement(t)||"bulleted-list"!==t.type&&"numbered-list"!==t.type?a.W_.isElement(t)&&"paragraph"===t.type&&(1===t.children.length&&a.xv.isText(t.children[0])&&""===t.children[0].text||t.children.every((n=>a.W_.isElement(n)&&"link"===n.type||a.xv.isText(n)&&""===n.text)))?t.children.push(i):e.push({type:"paragraph",children:[i]}):t.children.push({type:"list-item",children:[i]}),e}}},64343:function(n,e,t){"use strict";const o=(0,t(8449).O4)("todaySeen",null,void 0,{getOnInit:!0});e.Z=o},14283:function(n,e,t){"use strict";t.d(e,{Z:function(){return i}});var o=t(67754);function i(){const n=(0,o.usePathname)(),e=(0,o.useSearchParams)(),t=e&&Array.from(e.entries()).length>0?"?".concat(e.toString()):"";return"".concat(n).concat(t)}},98446:function(n,e,t){"use strict";t.d(e,{b1:function(){return d},hb:function(){return a}});var o=t(5565),i=t(66864),r=t(57669);const a=(0,o.cn)(void 0);a.onMount=n=>{n(l())},a.debugLabel="domainAtom";const s=(0,o.cn)(void 0);function l(){const n=window.localStorage[i.j];return n&&r.z[n]||r.z[window.location.host]}s.onMount=n=>{window.localStorage.baseCommunity&&n(window.localStorage.baseCommunity);const e=l();e&&n(e.space)},s.debugLabel="baseCommunityAtom",e.ZP=s;const d=(0,o.cn)(null,((n,e,t)=>{const o=l();o&&(e(a,o),e(s,o.space))}))},86096:function(n,e,t){"use strict";var o=t(5565),i=t(22385);const r=(0,o.cn)((n=>{var e,t;return new Set((null===(t=n(i.ZP))||void 0===t||null===(e=t.partOf)||void 0===e?void 0:e.map((n=>null===n||void 0===n?void 0:n.page.id)))||[])}));e.Z=r},25626:function(n,e,t){"use strict";t.d(e,{ZP:function(){return w}});var o=t(27573),i=t(54026),r=t(53749),a=t(88216),s=t(27112),l=t(50209),d=t(4295),c=t(61852),u=t(26313),m=t(21887),h=t(80844),v=t(35117),f=t(39340),p=t(81086),g=t(7653);const y=new Set;const x=(0,m.ZP)((n=>{let{className:e,...t}=n;return(0,o.jsx)(v.Z,{...t,classes:{popper:e}})}))((n=>{let{theme:e}=n;return{["& .".concat(f.Z.tooltip)]:{paddingTop:e.spacing(1.5),paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),borderRadius:12,[e.getColorSchemeSelector("dark")]:{backgroundColor:"rgb(".concat(e.vars.palette.secondary.lightChannel," / 0.4)")},[e.getColorSchemeSelector("light")]:{backgroundColor:"rgb(".concat(e.vars.palette.secondary.darkChannel," / 0.4)")},backdropFilter:"blur(12px)"},["& .".concat(f.Z.arrow)]:{[e.getColorSchemeSelector("dark")]:{color:"rgb(".concat(e.vars.palette.secondary.lightChannel," / 0.4)")},[e.getColorSchemeSelector("light")]:{color:"rgb(".concat(e.vars.palette.secondary.darkChannel," / 0.4)")}}}}));function w(n){let{introId:e,showEventIfIntroduced:t,disabled:m=!1,backdrop:f=!0,title:w,children:C,ref:j,normalTitle:N,...b}=n;const k=(0,a.ZP)("IntroTooltip"),[Z,P]=function(n,e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=(0,i.Z)(),[a,s]=(0,g.useState)(!1);e||(e=!o);const l=(0,g.useRef)(!1);e&&a&&s(l.current=!1);const[d,c]=(0,p.KO)((0,r.SI)(n)),u=(0,g.useRef)((()=>{}));return(0,g.useEffect)((()=>{if(e)return;if(d&&!t)return;const o=new URLSearchParams(window.location.search);if(o.has("dialog")||o.has("invite"))return;if(y.has(n))return;y.add(n);let i=!0;return r.gg.lock().then((n=>{if(u.current=n,!i)return u.current();s(l.current=!0)})),()=>{l.current&&(s(!1),u.current()),i=!1}}),[n,e,d,t]),[a,function(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&c(),l.current&&(u.current(),s(l.current=!1))}]}(e,m,t),I="function"===typeof C?C(Z):C;return Z?(0,o.jsxs)(o.Fragment,{children:[f&&(0,o.jsx)(h.Z,{disablePortal:!Z,children:(0,o.jsx)(s.Z,{sx:{zIndex:1499},open:Z,onExit:()=>P(!1)})}),(0,o.jsx)(x,{arrow:!0,open:Z,style:{zIndex:Z?void 0:9999},title:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.Z,{variant:"body2",sx:{color:"white",textShadow:"0 0 4px black"},children:w}),(0,o.jsx)(d.Z,{children:(0,o.jsx)(c.default,{variant:"contained",size:"small",onClick:n=>{n.preventDefault(),n.stopPropagation(),P()},"data-testid":"intro-tooltip-ok",sx:n=>({boxShadow:n.shadows[1]}),children:k("okButton")})})]}),...b,children:f?(0,o.jsx)(u.Z,{component:"div",sx:{zIndex:1501},children:I}):I})]}):N?(0,o.jsx)(v.Z,{title:N,children:I}):I}},3145:function(n,e,t){"use strict";t.d(e,{Z:function(){return Z}});var o=t(27573),i=t(16385),r=t(67697),a=t(5697),s=t(68777),l=t(20582),d=t(3578),c=t(15934),u=t(26101),m=t(73184),h=t(71233),v=t(6880),f=t(89516),p=t(60493),g=t(10448),y=t(93240),x=t(5614),w=t(94799),C=t(81375),j=t(82601),N=t(41979),b=t(34240);const k=(0,l.default)((()=>Promise.all([t.e(99426),t.e(58364),t.e(25604),t.e(43814),t.e(57254),t.e(83429),t.e(72069),t.e(66606),t.e(1580),t.e(99161),t.e(90291),t.e(14664)]).then(t.bind(t,80718)).then((n=>n.AnyIcon))),{loadableGenerated:{webpack:()=>[80718]},ssr:!1});function Z(n){let{src:e,path:t,size:l,note:Z,...P}=n;const I=(0,i.ZP)("showNoteStateOnLink");if(e)return"megaphone"===e?(0,o.jsx)(d.J,{size:l,...P}):"globe-hemisphere-west"===e?(0,o.jsx)(c.D,{size:l,...P}):"spinner"===e?(0,o.jsx)(u.$,{size:l,...P}):e.match(/^[a-zA-Z_]+$/g)?(0,o.jsx)(k,{name:e,size:l,...P}):(0,o.jsx)(a.Z,{sx:{height:null!==l&&void 0!==l?l:16,width:null!==l&&void 0!==l?l:16},src:e,...P});if(null===t||void 0===t?void 0:t.startsWith("/notes/")){if(null===Z||void 0===Z?void 0:Z.deleted)return(0,o.jsx)(m.S,{size:l,...P});if(Z&&Z.html){const n=(0,N.u)(Z.html);if(n)return n}if(Z&&I){if(Z.closed)return(0,o.jsx)(h.f,{size:l,...P});var D;let n=null!==(D=Z.todoCount)&&void 0!==D?D:0;var S;let e=null!==(S=Z.doneCount)&&void 0!==S?S:0;if(Z.html&&!Z.todoCount&&!Z.doneCount){const t=(0,b.F)(Z.html);for(const o of t.tasks)o.checked?e++:n++}if(n>0||e>0)return(0,o.jsx)(r.n,{todoCount:n,doneCount:e})}return(0,o.jsx)(j.MY,{className:40===l?"size-10":32==l?"size-8":16===l?"size-4":"size-6",...P})}return(null===t||void 0===t?void 0:t.startsWith("/notes"))?(0,o.jsx)(v.o,{size:l,...P}):(null===t||void 0===t?void 0:t.startsWith("/kanban"))?(0,o.jsx)(f.p,{size:l,...P}):(null===t||void 0===t?void 0:t.startsWith("/calendar"))?(0,o.jsx)(p.R,{size:l,...P}):(null===t||void 0===t?void 0:t.startsWith("/daily/"))?(0,o.jsx)(g.f,{size:l,...P}):(null===t||void 0===t?void 0:t.startsWith("/search"))?(0,o.jsx)(y.Y,{size:l,...P}):"/start"===t?(0,o.jsx)(x.T,{size:l,...P}):(null===t||void 0===t?void 0:t.startsWith("/profiles/"))||"/me"===t?(0,o.jsx)(a.Z,{sx:{height:null!==l&&void 0!==l?l:16,width:null!==l&&void 0!==l?l:16}}):(null===t||void 0===t?void 0:t.startsWith("/communities/"))?(0,o.jsx)(w.W,{size:l,...P}):(null===t||void 0===t?void 0:t.match(/https:\/\/[a-z]+.wikipedia.org/))?(0,o.jsx)(C.Z,{size:l,...P}):(0,o.jsx)(s.Dot,{size:l})}},67697:function(n,e,t){"use strict";t.d(e,{n:function(){return r}});var o=t(27573),i=t(53582);function r(n){let{todoCount:e,doneCount:t,className:r,noInnerCircle:a,classes:s,strokeWidth:l=16}=n;const d=256,c=t/(e+t),u=(d-l)/2-24,m=2*u*Math.PI,h=m-c*m;(0,i.Z)();return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 ".concat(d," ").concat(d),className:r,children:[(0,o.jsx)("circle",{cx:128,cy:128,r:u,fill:"none",stroke:"currentColor",strokeWidth:l,strokeDasharray:"".concat(m," ").concat(m),strokeDashoffset:h,strokeLinecap:"round",transform:"rotate(-90 128 128)",className:null===s||void 0===s?void 0:s.circle}),!a&&(0,o.jsx)("circle",{cx:128,cy:128,r:u/2,fill:"currentColor",strokeLinecap:"round"})]})}},81375:function(n,e,t){"use strict";t.d(e,{Z:function(){return i}});var o=t(27573);function i(n){return(0,o.jsx)("svg",{style:n.size?{width:n.size,height:n.size}:{},...n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:"1em",width:"1em",fill:"currentColor",children:(0,o.jsx)("path",{d:"M14.97,18.95L12.41,12.92C11.39,14.91 10.27,17 9.31,18.95C9.3,18.96 8.84,18.95 8.84,18.95C7.37,15.5 5.85,12.1 4.37,8.68C4.03,7.84 2.83,6.5 2,6.5C2,6.4 2,6.18 2,6.05H7.06V6.5C6.46,6.5 5.44,6.9 5.7,7.55C6.42,9.09 8.94,15.06 9.63,16.58C10.1,15.64 11.43,13.16 12,12.11C11.55,11.23 10.13,7.93 9.71,7.11C9.39,6.57 8.58,6.5 7.96,6.5C7.96,6.35 7.97,6.25 7.96,6.06L12.42,6.07V6.47C11.81,6.5 11.24,6.71 11.5,7.29C12.1,8.53 12.45,9.42 13,10.57C13.17,10.23 14.07,8.38 14.5,7.41C14.76,6.76 14.37,6.5 13.29,6.5C13.3,6.38 13.3,6.17 13.3,6.07C14.69,6.06 16.78,6.06 17.15,6.05V6.47C16.44,6.5 15.71,6.88 15.33,7.46L13.5,11.3C13.68,11.81 15.46,15.76 15.65,16.2L19.5,7.37C19.2,6.65 18.34,6.5 18,6.5C18,6.37 18,6.2 18,6.05L22,6.08V6.1L22,6.5C21.12,6.5 20.57,7 20.25,7.75C19.45,9.54 17,15.24 15.4,18.95C15.4,18.95 14.97,18.95 14.97,18.95Z"})})}},70582:function(n,e,t){"use strict";t.d(e,{C9:function(){return d},PathnameSniffer:function(){return m},XO:function(){return c},_$:function(){return u},vd:function(){return l}});var o=t(5565),i=t(81086),r=t(8449),a=t(67754),s=t(7653);const l=(0,r.O4)("workspace","me",void 0,{getOnInit:!0}),d=(0,o.cn)(""),c=(0,o.cn)(new URLSearchParams),u=(0,o.cn)(null);function m(){const n=(0,i.b9)(d),e=(0,a.usePathname)();(0,s.useEffect)((()=>{n(null!==e&&void 0!==e?e:"")}),[e,n]);const t=(0,a.useSearchParams)(),o=(0,i.b9)(c);(0,s.useEffect)((()=>{t&&o(t)}),[t,o]);const r=(0,a.useRouter)(),l=(0,i.b9)(u);return(0,s.useEffect)((()=>{l(r)}),[r,l]),null}},47276:function(n,e,t){"use strict";t.d(e,{Z:function(){return m},o:function(){return c}});var o=t(98446),i=t(5565),r=t(81086),a=t(8805),s=t(46957),l=t(70582),d=t(53582);const c=(0,i.cn)((n=>{const e=n(l.C9),t=n(o.ZP);if("/overview"===e&&t)return t;const i=e.split("/");switch(i[1]){case"overview":return t;case"communities":return i[2]||"me";case"profiles":if(i[2]===n(d.G))return"me";case"search":case"notes":{const e=n(l.XO),t=null===e||void 0===e?void 0:e.get("space");if(t)return t;const o=null===e||void 0===e?void 0:e.get("community");if(o)return o;var r;const i=(a.iz.parse(null!==(r=null===e||void 0===e?void 0:e.get("filter"))&&void 0!==r?r:"")||[]).map((n=>"field"!==n.type?null:u.has(n.field.name)&&"uri"===n.value.type?n.value.uri:null)).find(s.Dw);if(i){const n=i.replace(/^\/communities\//,"");if(n.length<22)return n}const d=null===e||void 0===e?void 0:e.get("shareWith");return d&&d.length<=22?d:"me"}default:return n(l.vd)}}),((n,e,t)=>e(l.vd,t)));c.debugLabel="currentWorkspaceAtom";const u=new Set(["sharedWith","geteiltMit","announcedTo","partOf"]);function m(){return(0,r.Dv)(c)}},14428:function(n,e,t){"use strict";t.d(e,{Z:function(){return l}});var o=t(27573),i=t(16938),r=t.n(i),a=t(40643),s=t.n(a);function l(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?(0,o.jsx)("span",{style:{whiteSpace:"pre-wrap"},children:s()(n,r()(n,e)).map(((n,e)=>{let{text:t,highlight:i}=n;return i?(0,o.jsx)("b",{children:t},e):(0,o.jsx)("span",{children:t},e)}))}):n}},32272:function(n,e,t){"use strict";t.d(e,{A:function(){return y}});var o=t(27573),i=t(88216),r=t(9937),a=t(22845),s=t(5697),l=t(17119),d=t(56178),c=t(26481),u=t(14428),m=t(18081),h=t(42474),v=t(7653),f=t(3145),p=t(84309);const g=v.createContext("");function y(n){const{options:e,index:t,insertOption:i,selectCategory:r,search:a=""}=n,s=[];let d=0;for(const l of e)"category"in l?(s.push((0,o.jsx)(x,{offset:d,options:l.options,category:l.category,insertOption:i,selected:t-d,categorySelected:l.category===n.category,alone:1===e.length,onSelect:()=>r(l.category===n.category?void 0:l.category)},d)),d+=l.options.length):(s.push((0,o.jsx)(w,{i:d,option:l,insertOption:i,selected:d===t},d)),d++);return(0,o.jsx)(g.Provider,{value:a,children:(0,o.jsx)(l.Z,{className:"h-96 max-h-96 overflow-y-auto pt-0",children:s})})}function x(n){const{category:e,options:t,offset:s,insertOption:l,selected:d,alone:u,onSelect:v}=n,f=(0,i.ZP)("MentionOptionCategoryListItem");return(0,o.jsxs)(o.Fragment,{children:[!u&&(0,o.jsxs)(r.Z,{onClick:v,className:"top-0",sx:n=>({top:0,zIndex:n.zIndex.modal+1}),children:[(0,o.jsx)(c.Z,{primary:f("category.".concat(e))}),(0,o.jsx)(a.Z,{className:"flex items-center justify-center",children:n.categorySelected?(0,o.jsx)(m.X,{size:20}):(0,o.jsx)(h.T,{size:20})})]}),t.map(((n,e)=>(0,o.jsx)(w,{i:s+e,option:n,insertOption:l,selected:e===d},e)))]})}const w=v.memo((function(n){const{option:e,insertOption:t,selected:i,i:a}=n,l=v.useContext(g),m=(0,v.useRef)(null);(0,v.useEffect)((()=>{m.current&&i&&m.current.scrollIntoView({behavior:"smooth",block:"nearest"})}),[i]);const h=e.image&&p.a[e.image];return(0,o.jsxs)(r.Z,{ref:m,selected:i,onMouseDown:()=>t(a),dense:!0,children:[(0,o.jsx)(d.Z,{children:"emoticon"===e.image?(0,o.jsx)("span",{className:"text-[24px]",children:e.uri}):h?(0,o.jsx)(h,{className:"size-10"}):e.image?(0,o.jsx)(s.Z,{src:e.image||(e.uri&&e.uri.startsWith("/")?"":"https://www.wikidata.org/static/images/project-logos/wikidatawiki.png"),alt:e.name,style:{marginRight:8},className:"mr-2"}):(0,o.jsx)(f.Z,{path:e.uri,size:40})}),(0,o.jsx)(c.Z,{classes:{secondary:"truncate max-h-[1.4em]",primary:"truncate max-h-[1.4em]"},primary:(0,u.Z)(e.name,l),secondary:e.description&&(0,u.Z)(e.description,l)})]},e.uri)}))},71609:function(n,e,t){"use strict";t.d(e,{m:function(){return a}});var o=t(85978),i=t(74946);const r=new WeakMap;function a(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";var t,a,s;const l=r.get(n);if(l)return l;var d,c,u,m,h;const v={...o.Wb.initialState(n.id),readAt:{[e]:n.readAt},html:null!==(d=n.html)&&void 0!==d?d:"",author:null!==(c=null===(t=n.author)||void 0===t?void 0:t.id)&&void 0!==c?c:"",dateCreated:n.dateCreated,dateEdited:n.dateEdited,dateModified:n.dateModified,closed:!!n.closed,linkSuggestions:null!==(u=null===(a=n.linkSuggestions)||void 0===a?void 0:a.map((n=>({text:n.name,uri:n.url}))))&&void 0!==u?u:[],deleted:null!==(m=n.deleted)&&void 0!==m&&m,permissions:Object.fromEntries(null!==(h=null===(s=n.hasDigitalDocumentPermission)||void 0===s?void 0:s.map((n=>{var e;return[n.grantee.id,null!==(e={[i.N3T.CommentPermission]:"comment",[i.N3T.ReadPermission]:"read",[i.N3T.WritePermission]:"write"}[n.permissionType])&&void 0!==e?e:n.permissionType]})))&&void 0!==h?h:[])};return r.set(n,v),v}},41979:function(n,e,t){"use strict";t.d(e,{u:function(){return s}});var o=t(27573),i=t(67697),r=t(84021),a=t(34240);function s(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";var t,s,l;const d=(0,a.F)(n);let c=0,u=0;for(const o of d.tasks)o.checked?u++:c++;if(c>0||u>0)return(0,o.jsx)("span",{className:"flex text-lg",children:(0,o.jsx)(i.n,{className:e,todoCount:c,doneCount:u})});return((null===(t=d.links)||void 0===t?void 0:t.filter((n=>n.link.startsWith("/notes/")&&"chip"===n.kind)))||[]).length>2&&((null===(s=d.links)||void 0===s?void 0:s.filter((n=>!(n.link.startsWith("/notes/")&&"chip"===n.kind))))||[]).length<2||(null===(l=d.links)||void 0===l?void 0:l.filter((n=>"file"===n.kind)).length)>0||d.kinds.includes("wbfRgnJuv82El6LnN8Uvd")?(0,o.jsx)(r.g,{className:e}):null}},84309:function(n,e,t){"use strict";t.d(e,{a:function(){return I}});var o=t(35747),i=t(18081),r=t(94933),a=t(78829),s=t(47787),l=t(48489),d=t(53532),c=t(64238),u=t(95276),m=t(760),h=t(776),v=t(24984),f=t(58e3),p=t(74345),g=t(14997),y=t(31336),x=t(6207),w=t(92486),C=t(71586),j=t(18777),N=t(66952),b=t(39547),k=t(10448),Z=t(22049),P=t(82601);const I={true:o.J,false:i.X,link:r.r,time:a.S,add:s.v,newNote:l.i,code:d.E,template:c.w,answer:u.H,solution:m.d,h1:h.c,h2:v.s,text:f.I,person:p.n,boolean:g.$,duration:y.B,user:p.n,property:x.f,prop:w.V,type:w.V,unknown:C.n,place:j.$,male:N.m,female:b.d,event:k.f,card:P.MY,excalidraw:Z.a}},9943:function(n,e,t){"use strict";t.d(e,{Bo:function(){return v},Do:function(){return s},EK:function(){return m},N:function(){return u},Z9:function(){return c},zw:function(){return h}});var o=t(34129),i=t(34240),r=t(84798);function a(n,e){const t=[];t.push("/notes/".concat(n.card.id));const o=(0,i.F)(n.card.html);if(!n.card.closed&&o.kinds.includes("question")&&t.push("open kind:question"),n.card.html)for(const i of o.kinds)t.push("kind:".concat(i));for(const{link:i}of o.links)t.push(i);if(n.card.linkSuggestions)for(const{uri:i}of n.card.linkSuggestions)t.push(i);const r=e.get(n.card.id);return r&&t.push(...r.map((n=>"/notes/".concat(n)))),t}function s(n){const e=n.match(/^\/notes\/([A-Za-z0-9-_]+)/);return e?e[1]:null}function l(n,e,t){const o=n.get(e);o?o.push(t):n.set(e,[t])}function d(n){const e=new Map;for(const t of n){if(!(null===t||void 0===t?void 0:t.card.html))continue;const n=(0,i.F)(t.card.html);for(const o of n.links){const n=s(o.link);n&&l(e,n,t.card.id)}}return e}function c(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;const t=d(n),o=(0,r.Z)(n,(n=>a(n,t).filter(e))),i=Math.max(Math.min(n.length-2,.6*n.length),1);for(const[r,a]of o){const n=s(r);if(n&&a.length>1){const e=a.findIndex((e=>e.card.id===n));e>-1&&a.splice(e,1)}a.length>i&&o.delete(r)}const l=new Set,c=[];for(const r of n){if(l.has(r.card.id))continue;l.add(r.card.id);const n=a(r,t);if(n.length>0){let e=o.get(n[0]),t=n[0];for(let i=1;i<n.length;i++){const r=n[i],a=o.get(r);a&&((!e||a.length>e.length)&&(e=a,t=r))}if(e&&e.length>1){for(const n of e)l.add(n.card.id);l.has(t)||c.push({type:"topic",hits:e,key:t,uri:t}),s(t)&&l.add(t);continue}}c.push({type:"hit",key:r.card.id,hit:r})}return c}function u(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;const t=d(n),o=(0,r.Z)(n,(n=>a(n,t).filter(e))),i=Math.max(Math.min(n.length-2,.6*n.length),1);for(const[r,a]of o){const n=s(r);if(n&&a.length>1){const e=a.findIndex((e=>e.card.id===n));e>-1&&a.splice(e,1)}a.length>i&&o.delete(r)}const l=new Set,c=[];for(const r of n){if(l.has(r.card.id))continue;l.add(r.card.id);const n=a(r,t);if(n.length>0){let e=o.get(n[0]),t=n[0];for(let i=1;i<n.length;i++){const r=n[i],a=o.get(r);a&&((!e||a.length>e.length)&&(e=a,t=r))}if(e&&e.length>1){for(const n of e)l.add(n.card.id);l.has(t)||c.push({type:"topic",hits:e,key:t,uri:t}),s(t)&&l.add(t);continue}}}return c}function m(n){return h(n)?null:n.startsWith("/")||n.startsWith("http")?n:"/entities/".concat(n)}function h(n){return n.startsWith("kind:")?n.slice(5):null}function v(n){return"open"===n?o.EP(o.yR("closed"),o.Bd("false")):n.startsWith("kind:")?o.EP(o.yR("kind"),o.Bd(n.slice(5))):o.EP(o.yR("mentions"),o.VF(n))}},61814:function(n,e,t){"use strict";t.d(e,{Pj:function(){return i},Tf:function(){return r}});var o=t(5565);const i="application/vnd.clye.note+json",r=(0,o.cn)("none");function a(n){var e,t,o,r;const a=null===(e=n.dataTransfer)||void 0===e?void 0:e.types;return(null===a||void 0===a?void 0:a.includes(i))?"note":(console.log("dragKindFromEvent",a,null===(t=n.dataTransfer)||void 0===t?void 0:t.items),(null!==(s=null===(r=n.dataTransfer)||void 0===r||null===(o=r.files)||void 0===o?void 0:o.length)&&void 0!==s?s:0)>0||(null===a||void 0===a?void 0:a.includes("Files"))?"file":"unknown");var s}r.onMount=n=>{let e;const t=t=>{n(a(t)),clearTimeout(e),e=window.setTimeout(o,200)},o=()=>n("none"),i=n=>{n.preventDefault(),clearTimeout(e),e=window.setTimeout(o,200)},r=t=>{n(a(t)),t.preventDefault(),clearTimeout(e),e=window.setTimeout(o,200)},s=e=>{e.preventDefault(),n("none")},l=n=>{clearTimeout(e),e=window.setTimeout(o,200)};return window.addEventListener("dragenter",t),window.addEventListener("dragleave",i),window.addEventListener("dragover",r),window.addEventListener("drop",s),window.addEventListener("dragend",l),()=>{window.removeEventListener("dragenter",t),window.removeEventListener("dragleave",i),window.removeEventListener("dragover",r),window.removeEventListener("drop",s),window.removeEventListener("dragend",l)}}},28759:function(n,e,t){"use strict";t.d(e,{Z:function(){return u}});var o=t(81167),i=t(74712);const r=60,a=60*r,s=24*a,l=7*s,d=s*(365/12),c=365*s;function u(){const{formats:n,locale:e,now:t,onError:u,timeZone:m}=(0,i.Z)();function h(n,e,t,i,r){let a;try{a=function(n,e,t){let i;if("string"!==typeof e)return e;const r=e;if(i=null===n||void 0===n?void 0:n[r],!i){const n=new o.Z(o.b.MISSING_FORMAT,"Format `".concat(r,"` is not available. You can configure it on the provider or provide custom options."),t);throw u(n),n}return i}(t,e)}catch(s){return String(n)}try{return i(a)}catch(s){return u(new o.Z(o.b.FORMATTING_ERROR,s.message,r)),String(n)}}return{formatDateTime:function(t,o,i){return h(t,o,null===n||void 0===n?void 0:n.dateTime,(n=>(m&&!(null===n||void 0===n?void 0:n.timeZone)&&(n={...n,timeZone:m}),new Intl.DateTimeFormat(e,n).format(t))),i)},formatNumber:function(t,o,i){return h(t,o,null===n||void 0===n?void 0:n.number,(n=>new Intl.NumberFormat(e,n).format(t)),i)},formatRelativeTime:function(n,i,m){try{if(!i){if(!t)throw new Error("The `now` parameter wasn't provided to `formatRelativeTime` and there was no global fallback configured on the provider.");i=t}const o=n instanceof Date?n:new Date(n),u=i instanceof Date?i:new Date(i),m=(o.getTime()-u.getTime())/1e3,{unit:h,value:v}=function(n){const e=Math.abs(n);let t,o;return e<r?(o="second",t=Math.round(n)):e<a?(o="minute",t=Math.round(n/r)):e<s?(o="hour",t=Math.round(n/a)):e<l?(o="day",t=Math.round(n/s)):e<d?(o="week",t=Math.round(n/l)):e<c?(o="month",t=Math.round(n/d)):(o="year",t=Math.round(n/c)),{value:t,unit:o}}(m);return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(v,h)}catch(h){return u(new o.Z(o.b.FORMATTING_ERROR,h.message,m)),String(n)}}}}},72073:function(n,e,t){"use strict";t.d(e,{Z:function(){return a}});var o=t(7653),i=t(74712);function r(){return new Date}function a(n){const e=null===n||void 0===n?void 0:n.updateInterval,{now:t}=(0,i.Z)(),[a,s]=(0,o.useState)(t||r());return(0,o.useEffect)((()=>{if(!e)return;const n=setInterval((()=>{s(r())}),e);return()=>{clearInterval(n)}}),[t,e]),a}}}]);