PageSourceSearch

https://excited-edge-f5d.notion.site/_assets/comments-6b0e11f2fe17c8bd.js

js excited-edge-f5d.notion.site collected 2026-10-09 22:52:26 UTC 155,586 bytes, 1 lines download raw bytes

1"use strict";(globalThis.rspackChunknotion_next=globalThis.rspackChunknotion_next||[]).push([[13926],{823756(e,t,n){var i=()=>n(546605);class o extends i().Store{getInitialState(){return{forceDiscussionOpen:!1,isPageDescriptionExpanded:!0}}}n.d(t,{n:()=>o})},81422(e,t,n){function i(e){return e.scrollHeight-(e.scrollTop+e.clientHeight)}n.d(t,{W:()=>i})},723652(e,t,n){var i=n(635790),o=n(440302);let s={position:"absolute",bottom:0,insetInlineStart:8,width:12,height:12,borderRadius:12,background:"transparent",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},r=i.memo(function(e){let{badge:t,className:i,dragHandleStyle:r,hideName:l,iconSize:d,iconStyle:c,labelSizeVariant:u,propertySchema:m,showDragIcon:p,showIcon:g,style:h,textRef:f}=e,v=(0,n(960253).I)(()=>({container:{display:"flex",alignItems:"center",lineHeight:"120%",minWidth:0,fontSize:n(139424).A.isMobile?16:14,gap:"small"===u?2:6,...h},iconWrapper:{display:"grid",justifyContent:"center",alignItems:"center",position:e.showIntegrationIconOverlay?"relative":void 0,...c},dragHandle:{gridColumn:1,gridRow:1,opacity:+!!p,transition:`opacity ${n(153262).bM}`},itemIcon:{gridColumn:1,gridRow:1,opacity:+!p,transition:`opacity ${n(153262).bM}`}}),[c,u,p,h,e.showIntegrationIconOverlay]);return(0,o.jsxs)("div",{className:i,style:v.container,children:[g?(0,o.jsxs)("div",{style:v.iconWrapper,children:[(0,o.jsx)("div",{style:v.itemIcon,children:(0,o.jsx)(a,{propertySchema:m,iconSize:d,iconStyle:c})}),e.showIntegrationIconOverlay?(0,o.jsx)("div",{style:s,children:e.showIntegrationIconOverlay}):void 0,(0,o.jsx)("div",{style:v.dragHandle,children:(0,o.jsx)(n(544954).t,{wrapperStyle:r})})]}):void 0,l?void 0:(0,o.jsx)("div",{ref:f,style:n(699422).RC,children:m.name}),t]})});function a(e){let{propertySchema:t,iconSize:i,iconStyle:s}=e,r=(0,n(960253).e)(),a=n(139424).A.isMobile?18:16;return(0,o.jsx)(n(44026).zB,{type:t.type,icon:t.icon,size:i||a,theme:n(632079).Tj,themeMode:r,style:s})}n.d(t,{R:()=>a},{m:r})},614095(e,t,n){function i(e){let{thread:t,transaction:i}=e;if("rootWithReplies"===t.type){(0,n(787932).z)({store:t.rootCommentStore,data:{resolved:!0},transaction:i}
1),(0,n(977458).Q)({discussionStore:t.discussionStore,transaction:i}),s({...e,thread:t,resolved:!0});return}(0,n(29855).j)({...e,discussionStore:t.discussionStore,commentStore:t.discussionStore.getFirstComment()})}function o(e){let{thread:t,transaction:i}=e;if("rootWithReplies"===t.type){(0,n(737146).U)({thread:t,transaction:i}),(0,n(977458).w)({discussionStore:t.discussionStore,transaction:i}),(0,n(787932).z)({store:t.rootCommentStore,data:{resolved:!1},transaction:i}),s({...e,thread:t,resolved:!1});return}let o=t.discussionStore.getFirstComment();o&&(0,n(187819).E3)({...e,discussionStore:t.discussionStore,commentStore:o})}function s(e){var t;let{environment:i,thread:o,discussionLocation:s,resolved:r}=e,{discussionStore:a,rootCommentStore:l}=o,d=(0,n(48697).Xk)(n(313432).eR,s),c={comment_id:l.id,root_comment_id:l.id,discussion_id:a.id,from:s,parent_block_id:a.getParentId(),...d&&{inbox_session_id:n(825109).Lt.state.sessionId,notification_page_id:null==(t=a.getParentStore())||null==(t=t.getNavigableBlockStore())?void 0:t.id}};r?n(65255).MR(i,{...c,discussion_type:a.getType()}):n(65255).Jg(i,c)}n.d(t,{b:()=>o,i:()=>i})},409581(e,t,n){function i(e){let{environment:t,openInNew:i,spaceId:r,threadId:a}=e;i||n(139424).A.isMobile?s({environment:t,openInNew:i,spaceId:r,threadId:a}):o({environment:t,threadId:a})}function o(e){let{environment:t,threadId:i}=e,o=t.RouterStore.state.route;if("chat"===o.name){let e=(0,n(366367).X_)({...o,threadId:i});n(800198).Router.navigate({environment:t,url:e});return}let s=n(192314).AppStoreMainEditorCurrentBlockStore.state;(s||(0,n(548124).shouldAllowOpeningAgentOnSpecifiedRoute)(o))&&((0,n(183163).openChatPanel)({environment:t,store:s,chatPanelState:{isOpen:!0,threadId:i}}),function(e){let{environment:t}=e;n(475097).default.isCenterPeekOpen()&&n(270912).VN({environment:t,from:"agent_sidebar_open"})}({environment:t}))}function s(e){let{environment:t,openInNew:i,spaceId:o,threadId:s}=e;n(800198).Router.navigate({environment:t,openInNew:i,url:(0,n(366367).zD)({isElectron:t.device.isElectron,spaceId:o,threadId:s})})}n.r(t),n.d(t,{openCommentThread:()=>i,openCommentThreadInChatPanel:()=>o,openCommentThreadInFullPageChat:()=>s})},63728(e,t,n){function i(e,t){let i=n(966980).dd(t),o=n(401558).xh(i);e.setState({...e.state,files:o})}async function o(e){let{blockStore:t,pageViewBlockStore:i,environment:o,tabId:s}=e;!function(e){let{blockStore:t,pageViewBlockStore:i}=e;i?i.setState({...i.state,forceDiscussionOpen:!0}):n(400890).q.openNewPageDiscussionInput(t)}({blockStore:t,pageViewBlockStore:i}),n(65255).o2(o,{from:"page_comments"}),await n(374176).default.afterNextFlush();let r=n(24296).j.findInteractive(s,e=>e.getBlockStore().id===t.id),a=null==r?void 0:r.getInputStore();a&&(0,n(739204).z)({store:a.state.textStore})}n.d(t,{O2:()=>o,eD:()=>i})},640441(e,t,n){let i,o;n.r(t),n.d(t,{BlockDiscussionList:()=>eq,Comment:()=>eb,CommentFileBlock:()=>tc().f,Discussion:()=>eJ,DiscussionIndicator:()=>eQ().Ay,DiscussionInput:()=>ea().V,DiscussionReactionBar:()=>T().tx,MOBILE_REACTION_PILL_STYLE_OVERRIDES:()=>T().ZR,MarginCommentsSection:()=>tn,NewDiscussionMenu:()=>ts,NewPageDiscussion:()=>eG,PropertyDiscussionIndicator:()=>e1,REACTION_PILL_STYLE:()=>T().Of,ReactionBar:()=>T().Ay,ReplyDiscussionMenu:()=>ta,SuggestionContext:()=>eL,UnreadDiscussionsPopup:()=>tu().$,discussionHelpers:()=>a(),handleDismissNewDiscussion:()=>ti().HR,reactionActions:()=>tm()}),n(730330),n(976614),n(139583),n(159952);var s,r=n(635790),a=()=>n(139203);let l={display:"flex",flexDirection:"column",gap:0,marginBlockStart:4,marginBlockEnd:8};n(953925),n(499468),n(586042),n(169187),n(726090),n(132457),n(219390),n(73168),n(540679),n(765324);var d=()=>n(74292);n(974864);var c=()=>n(849697);function u(e){var t;return e.getAlive()?((null==(t=e.getAgentActivityData())?void 0:t.triggered_agent_activity)??[]).filter(t=>{let n=c().t.createChildStore(e,t.runPointer);return n.isDefined()&&n.canRead()}):[]}function m(e,t){let i=(0,n(533992).v3)(),o=(null==t?void 0:t.animate)??!0;return(0,r.useCallback)(()=>{let t=n(240414).T.findSelectableFromStore(e);t&&(0,n(840529).p)({environment:i,handle:t,vertical:{reveal:"bottom"},horizontal:{reveal:"closest"},animate:o})},[o,e,i])}function p(e){let{blockStore:t}=e;return(0,n(579993).K8)(()=>
1{if(!(0,n(335818).fc)(t))return!1;if(!(0,n(335818).f1)(t))return!0;let e=t.getAssociatedCollectionStore();return!e||!(0,n(607689).vW)(e)},[t])}var g=()=>n(646440);let h="calc(100% + -20px)";function f(e,t,n){return t?20:"margin_comments"===e?12:"comment_unfurl"===e&&"start"===n?14:16}var v=n(440302);let S={threadLine:{position:"absolute",backgroundColor:n(632079).Tj.border.secondary,borderRadius:2,width:1.5,height:h,insetInlineStart:11.25,top:30}};function b(){return(0,v.jsx)("div",{"aria-hidden":!0,style:S.threadLine})}let x=(0,n(327219).YK)({working:{id:"agentActivityComment.working",defaultMessage:"Working"},worked:{id:"agentActivityComment.worked",defaultMessage:"Worked"},paused:{id:"agentActivityComment.paused",defaultMessage:"Paused"},failed:{id:"agentActivityComment.failed",defaultMessage:"Failed"},viewChat:{id:"agentActivityComment.viewChat",defaultMessage:"{status, select, worked {Worked. View chat} working {Working. View chat} failed {Failed. View chat} paused {Paused. View chat} other {View chat}}"}}),y={position:"relative"},C={paddingInlineStart:32,paddingTop:4};function k(e){let{runParentCommentStore:t,activity:i,discussionLocation:o,shouldShowThreadLine:s}=e,a=(0,n(533992).Y0)(),l=(0,n(533992).v3)(),d=(0,n(327219).tz)(),u=(0,n(174720).H)(),m=(0,n(233633).C)({type:"discussionLocation",location:o}),p=(0,n(579993).K8)(()=>t.getSpaceStore(),[t]),{threadId:h,activityStatus:S,botStore:k,createdAt:I}=(0,n(579993).K8)(()=>{let e=c().t.createChildStore(t,i.runPointer),o=e.getStatus(),s=e.getDataStore().getKeyValue("current_turn_id"),r=e.getParentStore(),a=s===i.workflowTurnId?o??"running":"success";return{botStore:r&&p?(0,g()._A)({workflowStore:r,spaceStore:p}):void 0,createdAt:t.getCreatedTime(),threadId:e.getDataStore().getKeyValue("thread_id"),activityStatus:(0,n(761292).NF)(i.turnStatus??a)}},[i.runPointer,i.turnStatus,i.workflowTurnId,t,p]),w=(0,r.useCallback)(e=>{!h||((0,n(158131).T)({threadId:h,from:"agent_comment"}),(0,n(7029).V)(e)||(e.preventDefault(),(0,n(37269).K)({environment:l,spaceId:i.runPointer.spaceId,threadId:h})))},[i.runPointer.spaceId,l,h]),j=(0,n(960253).I)(()=>({container:{paddingTop:8,paddingBottom:8,paddingInlineStart:f(o,m,"start"),paddingInlineEnd:f(o,m,"end")}}),[o,m]),L=h?(0,n(366367).zD)({threadId:h,spaceId:i.runPointer.spaceId,isElectron:a.isElectron}):void 0,M="pending"===S||"working"===S,A=(0,n(682792).p)({status:S,intl:d}),T=A.label,_="other";M?(T=d.formatMessage(x.working),_="working"):"finished_success"===S?(T=d.formatMessage(x.worked),_="worked"):"paused"===S?(T=d.formatMessage(x.paused),_="paused"):(0,n(761292).XP)(S)&&(T=d.formatMessage(x.failed),_="failed");let D=(0,v.jsxs)(n(4458).fI,{gap:4,alignItems:"center",children:["finished_success"!==S&&A.icon?(0,v.jsx)(n(16275).I,{icon:A.icon,size:16,colorPalette:A.colorPalette,colorVariant:A.colorVariant}):void 0,(0,v.jsx)(n(861510).N,{text:T,styleKey:"bodyRegular",colorVariant:"secondary",animate:M,colorStop:"narrow"})]}),B="discussion_sidepeek"===o||u&&"updates_sidebar"===o;return(0,v.jsx)("div",{style:j.container,children:(0,v.jsxs)("div",{style:y,children:[k?(0,v.jsx)(n(443468).Y,{authorStore:k,spaceStore:p,createdTime:I,lastEditedTime:I,location:o}):void 0,s&&!B?(0,v.jsx)(b,{}):void 0,(0,v.jsx)("div",{style:C,children:L?(0,v.jsx)(n(68774).N,{href:L,external:!1,onClick:w,"aria-label":d.formatMessage(x.viewChat,{status:_}),children:D}):D})]})})}n(632079).Tj.text.inversePrimary;let I={helpIcon:{color:n(632079).Tj.text.tertiary,flexDirection:"row-reverse",gap:6,width:14,alignItems:"center",cursor:"pointer",textDecoration:"none",pointerEvents:"auto"},text:{maxWidth:200}};function w(e){let{discussionLocation:t,commentStore:i}=e,o=(0,n(579993).K8)(()=>{if(!i)return!1;let e=i.getCreatedByPointer();return!!e&&e.id===n(268033).px.id},[i]),s=(0,n(233633).C)({type:"discussionLocation",location:t}),r=(0,n(960253).I)(()=>({container:{display:"flex",flexDirection:"row",gap:6,width:"100%",color:n(632079).Tj.text.tertiary,fontSize:n(139424).A.isMobile?n(699422).J.UISmall.mobile:n(699422).J.UISmall.desktop,paddingTop:8,paddingInlineStart:f(t,s,"start")+24-8}}),[t,s]);return o?(0,v.jsxs)("div",{style:r.container,children:[(0,v.jsx)(n(16275).I,{icon:n(14389
16).exclamationMarkTriangleFillSmallIcon,size:"xs"}),(0,v.jsx)(n(493772).j,{style:I.text,children:(0,v.jsx)(n(327219).sA,{id:"aiCommentHeader.conflictingContent.label",defaultMessage:"Notion AI found potential conflicts"})}),(0,v.jsx)(n(68774).N,{href:"https://notion.notion.site/AI-Conflict-Detection-158efdeead058037b57efc2b77ad9c21",external:!0,style:I.helpIcon,children:(0,v.jsx)(n(16275).I,{icon:n(211052).questionMarkCircleSmallIcon,size:"sm"})})]}):null}let j=new Set([n(955630).xd.toggle,n(955630).xd.bulletedList,n(955630).xd.numberedList,n(955630).xd.quote,n(955630).xd.toDo,n(955630).xd.code,n(955630).xd.callout,n(955630).xd.header,n(955630).xd.subHeader,n(955630).xd.subSubHeader,n(955630).xd.tableRow]),L=(0,n(327219).YK)({orphanedContentDeleted:{id:"comments.discussionContext.orphanedContentDeleted",defaultMessage:"Original content deleted"}}),M={style0:{marginTop:0,marginBottom:0},style1:{fontFamily:(0,n(699422).vc)(n(849917).locale).mono,fontSize:12,tabSize:2},style3:{cursor:"text"}};function A(e){let t=(0,n(327219).tz)(),i=(0,n(579993).K8)(()=>{var t;return e.store.isDefined()?null==(t=e.store.getParentStore())?void 0:t.getValue():null},[e.store]),o=(0,n(579993).K8)(()=>e.blockStore.getSpaceId(),[e.blockStore]),s=(0,n(579993).K8)(()=>{let t=e.store.getParentStore();if(!(null!=t&&t.isType("alias")))return;let n=t.getAliasTargetStore();if((null==n?void 0:n.table)==="block"&&n.isFormBlock())return{store:n,value:n.getValue()}},[e.store]),r=(0,n(579993).K8)(()=>{if(e.isOrphaned)return[[t.formatMessage(L.orphanedContentDeleted)]];if(!e.store.isDefined())return;let i=e.store.getContext(),o=i?(0,n(353711).l8)({discussionContextData:i,discussionType:e.store.getType(),discussionId:e.store.id,intl:t}):void 0;if(!o)return;let s=n(247438).JJ$(o,t=>!n(247438).iQL(t)||n(247438).Orm(t)===e.store.id);return n(247438).AhH(s)>50&&(s=n(247438).JG8(s,50,[(0,n(247438).Ey_)("…")])),s},[e.isOrphaned,e.store,t]),a=(0,n(579993).K8)(()=>{let t=e.blockStore.getAssociatedCollectionStore();if(!t||"collection"!==t.table)return;let i=t.getSchema(),o=e.store.getPropertyId();if(void 0!==o)return(0,n(853300)._g)({schema:i,property:o})},[e.blockStore,e.store]),l={display:"flex",width:"100%",marginTop:6,marginBottom:6,fontSize:13,color:e.isOrphaned?n(632079).Tj.text.disabled:n(632079).Tj.text.secondary};function d(i){r||(r=[[""]]);let s=(0,n(511791).RX)(t).title;return s?(0,v.jsx)("div",{style:l,children:(0,v.jsxs)(n(4458).fI,{width:"100%",children:[(0,v.jsx)(n(740148).l,{isOrphaned:e.isOrphaned}),a?(0,v.jsx)(n(384943).G,{propertySchema:a,dontShowColon:""===r[0][0]}):void 0,(({textValue:t,propertySchema:i,discussionParentValue:s})=>{let r=(0,v.jsx)("div",{style:{overflow:"hidden",lineHeight:"18px",maxHeight:72},children:(0,v.jsx)(n(877634).vY,{value:{value:t,spaceId:o},propertySchema:i,labeled:!1,rootStore:e.blockStore,disableStyleAnnotations:!0,disableInsertedDeletedAnnotations:!0,disableDateStyleAnnotations:!0})});if(!s)return r;let a=s.type;return a===n(955630).xd.code?(0,v.jsx)(n(806106).A,{title:(0,n(877634).Ab)(s),theme:n(632079).Tj,style:M.style0,children:(0,v.jsx)("span",{style:M.style1,children:r})}):(0,n(877634).ux)(a)?(0,v.jsx)(n(806106).A,{title:(0,n(877634).ux)(a),theme:n(632079).Tj,style:M.style0,children:r}):r})({textValue:r,discussionParentValue:i,propertySchema:s})]})}):null}if("updates_sidebar"===e.discussionLocation||"discussion_sidepeek"===e.discussionLocation||e.forceRichContextPreview){if(e.isOrphaned)return d();if(!i)return null;if("text"!==i.type&&void 0===a){let t=null!=s&&s.value?s.value:i,o=null!=s&&s.store?s.store:e.blockStore;return(0,v.jsx)("div",{onClick:e.onClick,style:{display:"flex",cursor:n(993189).Bj6.fromBlock(i).isType(n(955630).Si)?"text":void 0},children:r&&j.has(i.type)?d(i):(0,v.jsxs)("div",{style:l,children:[(0,v.jsx)(n(740148).l,{isOrphaned:e.isOrphaned}),(0,v.jsx)(n(877634).su,{blockValue:t,rootStore:o,blockPreviewLocation:"comments_sidebar"})]})})}}return(0,v.jsx)("div",{onClick:e.onClick,style:M.style3,children:d()})}var T=()=>n(88308);let _={style0:{fontWeight:n(699422).Wy.regular},content:{position:"relative",fontSize:14,width:"100%"},avatarsAndNames:{display:"flex",flexDirection:"row",alignItems:"center",fontWeight:n(699422).Wy.medium,gap:8},reactorNames:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},reactionElementsBelowUserRow:{paddingInlineStart:32},reactionBarWrapper:{marginTop:8},statusDot:{width:8,height:8,borderRadius:"50%",backgroundColor:n(632079).Tj.blue.icon.accentPrimary}};function D(e){let{discussionStore:t,discussionContext:i,discussionLocation:o,blockStore:s,hoveringDiscussion:l,showUnreadStatusDot:d=!1}=e,c=(0,n(327219).tz)(),[u,m]=(0,r.useState)(!1),p=(0,r.useCallback)(()=>{m(!0)},[]),g=(0,r.useCallback)(()=>{m(!1)},[]),h=(0,n(579993).uB)(void 0,n(510969).A),f=(0,n(579993).K8)(()=>h.state.open,[h]),S=(0,n(579993).K8)(()=>(0,n(974410).f)(s),[s]),b=(0,n(579993).K8)(()=>{let e=n(868249).L.getUserVisibleReactions(t),i=e.flatMap(e=>{let t=e.getCreatedTime();return e.getActorStores().map(e=>({actor:e,createdTime:t}))}),o=(0,n(960408).hS)(i.sort((e,t)=>
1t.createdTime-e.createdTime),e=>e.actor.id);return{reactorNames:o.map(e=>e.actor.getDisplayName(c)),reactors:o.map(e=>e.actor),reactions:e}},[t,c]),x=u||l||f||((null==b?void 0:b.reactions)??[]).length>0,y=function({discussionLocation:e}){return(0,n(960253).I)(()=>({container:{flexGrow:"comment_unfurl"===e?1:void 0,paddingTop:"comment_unfurl"===e?10:8,paddingBottom:8}}),[e])}({discussionLocation:o}),C=(0,r.useRef)(null),k=(0,n(533992).v3)().currentUser.id,I=(0,n(579993).K8)(()=>{var e;let t=null==b||null==(e=b.reactors)?void 0:e.map(e=>(0,n(935786).d5)(e).asActor).filter(n(48697).O9);return(0,n(847871).b)({intl:c,currentUserId:k,authors:t,fontWeightForAuthorNames:"medium",isCondensedFormat:!0})},[k,null==b?void 0:b.reactors,c]);if(!b)return null;let w=i||"updates_sidebar"===o||"discussion_sidepeek"===o,j=b.reactors[0],L=b.reactors[1];return(0,v.jsx)("div",{ref:C,style:y.container,onMouseMove:p,onMouseLeave:g,children:(0,v.jsxs)("div",{style:_.content,children:[(0,v.jsxs)(n(4458).fI,{alignItems:"center",justifyContent:"space-between",children:[(0,v.jsxs)("div",{style:_.avatarsAndNames,children:[b.reactors.length>0?(0,v.jsxs)("div",{children:[j&&L&&S?(0,v.jsx)(n(126177).v,{frontActorStore:j,backActorStore:L,spaceStore:S}):void 0,j&&!L?(0,v.jsx)(n(10097).E,{authorStore:j,avatarSize:24,hasTooltip:!0,avatarStyle:{}},j.id):void 0]}):void 0,(0,v.jsx)("span",{style:_.reactorNames,children:(0,v.jsx)(n(327219).sA,{id:"reactions.blockReaction",defaultMessage:"{reactors} <regular>reacted</regular>",values:{reactors:I,regular:e=>(0,v.jsx)("span",{style:_.style0,children:e})}})})]}),d?(0,v.jsx)(n(4458).fI,{alignItems:"center",marginInlineEnd:4,children:(0,v.jsx)("div",{style:_.statusDot})}):void 0]}),(0,v.jsxs)("div",{style:_.reactionElementsBelowUserRow,children:[w?(0,v.jsx)(A,{format:(0,a().discussionLocationToDiscussionFormat)(o),discussionLocation:o,store:t,blockStore:s,onClick:e=>e.stopPropagation(),isOrphaned:!1}):void 0,x?(0,v.jsx)("div",{style:_.reactionBarWrapper,children:(0,v.jsx)(T().Ay,{parentStore:t,discussionLocation:o})}):void 0]})]})})}function B(e){return e.isFirstComment&&"comment_unfurl"!==e.discussionLocation&&"feed_item_top_level_discussion"!==e.discussionLocation}let R=(i=(s={avatarSize:24,rootLineBlockStart:30,rootLineHeight:h,rootLineInlineStart:11.5}).avatarSize+8,o=16+s.rootLineInlineStart,{commentBranchOffset:8+s.avatarSize/2,composerBranchOffset:s.composerBranchOffset??8+s.avatarSize/2,contentIndent:i,elbowWidth:i+16-8-o,rootLineBlockStart:s.rootLineBlockStart,rootLineHeight:s.rootLineHeight,rootLineInlineStart:s.rootLineInlineStart,spineOffset:o});n(435368);let P=(0,n(327219).YK)({unsubscribed:{id:"discussionActions.unsubscribeFromDiscussion.toast",defaultMessage:"Muted replies to this discussion"}}),E=(0,n(327219).YK)({actionBar:{id:"comment.actions.bar.label",defaultMessage:"Comment actions"}
1,reply:{id:"comment.actions.reply.label",defaultMessage:"Reply"},openSidePeek:{id:"comment.actions.openSidePeek.label",defaultMessage:"Open"},closeSidePeek:{id:"comment.actions.closeSidePeek.label",defaultMessage:"Close"},closeSidePeekTooltip:{id:"comment.actions.closeSidePeek.tooltip",defaultMessage:"Close side peek"},openSidePeekTooltip:{id:"comment.actions.openSidePeek.tooltip",defaultMessage:"Open in side peek"}});function F(e){let{children:t,visible:i,location:o,timelineActions:s}=e,r=(0,n(327219).tz)(),a=i||n(139424).A.isMobile,l=n(139424).A.isMobile||"updates_sidebar"===o||"discussion_sidepeek"===o||null==s?void 0:s.sidePeek,d=l?r.formatMessage(l.isOpen?E.closeSidePeek:E.openSidePeek):void 0,c=(0,n(960253).I)(()=>({wrapper:{position:n(139424).A.isMobile?"relative":"absolute",insetInlineEnd:n(139424).A.isMobile?void 0:0,zIndex:1,...n(139424).A.isMobile?{top:-3,alignSelf:"flex-start",flexShrink:0,paddingInlineStart:8,marginInlineStart:"auto"}:{marginTop:6*("updates_sidebar"===o||"discussion_sidepeek"===o),top:-4},opacity:+!!a},titlePropertyPeekLabel:{fontFamily:n(699422).Tf.sans,textTransform:"uppercase",letterSpacing:.5}}),[o,a]);return(0,v.jsx)("div",{style:c.wrapper,children:(0,v.jsxs)(n(330116).E,{"aria-label":r.formatMessage(E.actionBar),size:"sm",children:[l?(0,v.jsx)(n(517352).e,{iconLeading:n(357055).A,onClick:l.onToggle,tooltip:l.isOpen?r.formatMessage(E.closeSidePeekTooltip):r.formatMessage(E.openSidePeekTooltip),children:(0,v.jsx)(n(111010).D,{as:"span",colorVariant:"secondary",style:c.titlePropertyPeekLabel,styleKey:"captionMedium",children:d})}):void 0,l?(0,v.jsx)(n(457655).b,{}):void 0,null!=s&&s.onReply?(0,v.jsx)(n(517352).e,{"aria-label":r.formatMessage(E.reply),iconLeading:n(302530).arrowUTurnUpLeftFillIcon,onClick:s.onReply,tooltip:r.formatMessage(E.reply)}):void 0,t]})})}let O=(0,n(327219).YK)({addReaction:{id:"comment.actions.addReaction.label",defaultMessage:"Add reaction"},acceptButton:{id:"comment.actions.acceptButton.label",defaultMessage:"Accept"},rejectButton:{id:"comment.actions.rejectButton.label",defaultMessage:"Reject"},moreActions:{id:"comment.actions.moreActions.label",defaultMessage:"More actions"},reopenButton:{id:"comment.actions.reopenButton.label",defaultMessage:"Reopen"},resolveButton:{id:"comment.actions.resolveButton.label",defaultMessage:"Resolve"},markUnreadButton:{id:"comment.actions.markAsUnread.label",defaultMessage:"Mark as unread"},markReadButton:{id:"comment.actions.markAsRead.label",defaultMessage:"Mark as read"},mobileCommentMenuTitle:{id:"comment.mobileCommentMenu.title",defaultMessage:"Comment"},resolveDiscussionButton:{id:"comment.resolveDiscussion.button",defaultMessage:"Resolve comments"},editComment:{id:"comment.editCommentNoDescriptor.button",defaultMessage:"Edit"},viewAgentChat:{id:"comment.viewAgentChat.button",defaultMessage:"View chat"},deleteComment:{id:"comment.deleteCommentNoDescriptor.button",defaultMessage:"Delete"},copyLinkToDiscussion:{id:"comment.copyLinkToDiscussionNoDescriptor.button",defaultMessage:"Copy link"},copyLinkToDiscussionOnSubsequentComments:{id:"comment.copyLinkToDiscussionOnSubsequentCommentsNoDescriptor.button",defaultMessage:"Copy link to discussion"},subscribeToDiscussion:{id:"comment.actions.subscribeToDiscussion.button",defaultMessage:"Unmute replies"},unsubscribeFromDiscussion:{id:"comment.actions.unsubscribeFromDiscussion.button",defaultMessage:"Mute replies"}});function K(e){var t,i,o;let s,l,d,{discussionLocation:c,isFirstComment:u,blockStore:m,showMarkAsRead:p}=e,{discussionStore:g}=e.thread,h="rootWithReplies"===e.thread.type?e.thread.rootCommentStore:void 0,f=(0,n(327219).tz)(),S=(0,n(533992).v3)(),b=(0,n(633636).wM)(),x=(0,n(174720).H)(),y=(0,n(174720).C)(),{hideOverflowMenu:C}=(0,n(164333).Yz)(),k=(0,r.useRef)(null),I=(0,n(67499).S)(),w=(0,n(579993).K8)(()=>{var e;return null==I||null==(e=I.spaceStore)?void 0:e.getSpaceId()},[I]),j=(0,n(579993).K8)(()=>(0,n(713707).CB)(e.thread),[e.thread]),L=(0,n(579993).K8)(()=>e.store.isDefined(),[e.store]),M=(0,n(579993).K8)(()=>!!n(976348).T.state.isOpening,[]),A=(o=e.store,s=(0,n(579993).K8)(()=>{let e=o.getDisplayName();if((null==e?void 0:e.type)==="agent")return e.agent},[o]),l=(0,n(579993).K8)(()=>
1o.getSpaceId(),[o]),d=null==s?void 0:s.threadId,(0,r.useMemo)(()=>{if(d&&l)return n(174148).E.createChildStore(o,{table:"thread",id:d,spaceId:l})},[d,l,o])),T=(0,n(579993).K8)(()=>(null==A?void 0:A.canRead())??!1,[A]),_=(0,n(579993).K8)(()=>{var e;return!j&&((null==(e=m.getNavigableBlockStore())?void 0:e.canComment())??!1)},[m,j]),D=(0,n(579993).K8)(()=>x&&_&&(!y||void 0===e.store.getReplyToPointer()),[_,x,y,e.store]),R=(0,n(345776).T)(),E=(0,n(579993).K8)(()=>{let t=e.store.getCreatedById();return e.store.getCreatedByTable()===n(832375).oo9&&R===t},[R,e.store]),K=(0,n(579993).K8)(()=>{var e;let t=null==(e=(0,n(974410).f)(m))?void 0:e.getRole();return t&&n(642157).Km(t)},[m]),V=(0,n(579993).K8)(()=>m.getRole(),[m]),H=(0,n(579993).K8)(()=>{var e;return null==I||null==(e=I.publicEditModeStore.state)?void 0:e.permission},[null==I?void 0:I.publicEditModeStore]),{isFirstCommentOfSuggestionDiscussion:J,disableAccept:G}=(0,n(579993).K8)(()=>{var t;let n="suggestion"===g.getType()&&g.getCommentPointers()[0].id===e.store.id,i=(null==(t=m.getNavigableBlockStore())?void 0:t.canEdit())??!1;return{isFirstCommentOfSuggestionDiscussion:n,disableAccept:n&&!i}},[g,m,e.store]),$=(0,n(579993).K8)(()=>m.pathIsDead(),[m]),Y=(0,n(579993).K8)(()=>B({isFirstComment:u,discussionLocation:c}),[u,c]),q="comment_only"===V||"comment"===H,X=(0,n(579993).K8)(()=>{let e=m.getNavigableBlockStore();return(null==e?void 0:e.getParentTable())===n(832375).C0E&&!e.canEdit()},[m]),Z=(0,n(579993).K8)(()=>!!R&&(0,a().isUserImplicitlyFollowingDiscussion)({discussionStore:g,userId:R}),[g,R]),Q=(0,n(579993).K8)(()=>{var e;if(!R)return!1;let t=g.getUserSeenRecordStore(R);return null==t||null==(e=t.getModel())?void 0:e.isUnsubscribedFromDiscussion()},[g,R]),ee=(0,r.useCallback)(()=>{(0,n(323517).createAndCommit)({userAction:"Comment.markDiscussionRead",environment:S,cellTarget:w?{spaceWithId:w}:void 0,canUndo:!0,perform:t=>(0,n(737146).U)({transaction:t,thread:e.thread})}),n(65255).Ry(S,{discussion_id:g.id,discussion_type:g.getType(),from:c,method:"action_group",parent_block_id:g.getParentId(),...n(65255).A2({store:e.store,discu
1ssionStore:g,blockStore:m})})},[S,g,c,e.store,m,w,e.thread]),et=(0,r.useCallback)(()=>{(0,n(323517).createAndCommit)({userAction:"Comment.markDiscussionUnread",environment:S,cellTarget:w?{spaceWithId:w}:void 0,canUndo:!0,perform:t=>(function(e){let{transaction:t,thread:i}=e,{discussionStore:o}=i,s=o.userId;if(!s)return;let r="rootWithReplies"===i.type?i.rootCommentStore:o,a=r.getUserSeenRecordStore(s);return(0,n(504197).y)({store:a,operation:n(443756).op.shallowMerge({pointer:a.pointer,path:[],args:{user_id:s,space_id:a.pointer.spaceId,parent_id:r.id,parent_table:r.table,last_seen_at:-1}}),transaction:t}),o})({transaction:t,thread:e.thread})}),(0,n(486192).gs)(b,g.id,null==h?void 0:h.id),n(65255).i3(S,{discussion_id:g.id,method:"action_group",discussion_type:g.getType(),from:c,parent_block_id:g.getParentId(),...n(65255).A2({store:e.store,discussionStore:g,blockStore:m})})},[S,g,e.store,m,c,w,b,h,e.thread]),en=(0,r.useCallback)(()=>{R&&((0,n(323517).createAndCommit)({userAction:"Comment.subscribeToDiscussion",environment:S,cellTarget:w?{spaceWithId:w}:void 0,canUndo:!0,perform:e=>(0,n(308114).u)({userId:R,transaction:e,discussionStore:g,showToast:!0})}),n(65255).dW(S,{discussion_id:g.id,discussion_type:g.getType(),from:c,parent_block_id:g.getParentId(),...n(65255).A2({store:e.store,discu
1ssionStore:g,blockStore:m})}))},[R,S,g,c,e.store,m,w]),ei=(0,r.useCallback)(()=>{R&&((0,n(323517).createAndCommit)({userAction:"Comment.unsubscribeFromDiscussion",environment:S,cellTarget:w?{spaceWithId:w}:void 0,canUndo:!0,perform:e=>(function(e){let{userId:t,transaction:i,discussionStore:o,showToast:s}=e,r=o.getUserSeenRecordStore(t);(0,n(504197).y)({store:r,operation:n(443756).op.shallowMerge({pointer:r.pointer,path:[],args:{user_id:t,space_id:r.pointer.spaceId,parent_id:o.id,parent_table:o.table,subscription_state:"unsubscribed"}}),transaction:i}),s&&n(436555).D6({label:n(962299).A.formatMessage(P.unsubscribed)})})({userId:R,transaction:e,discussionStore:g,showToast:!0})}),n(65255).TJ(S,{discussion_id:g.id,discussion_type:g.getType(),from:c,parent_block_id:g.getParentId(),...n(65255).A2({store:e.store,discussionStore:g,blockStore:m})}))},[R,S,g,c,e.store,m,w]);if(!L||!R||x&&M)return null;let eo=()=>{(0,n(323517).createAndCommit)({userAction:"Comment.handleReopen",environment:S,cellTarget:w?{spaceWithId:w}:void 0,canUndo:!0,perform:t=>{(0,n(614095).b)({environment:S,thread:e.thread,transaction:t,discussionLocation:e.discussionLocation})}})},es=t=>{(0,n(15289).o)({action:"resolve_comment_thread",space_id:w},t=>(0,n(323517).createAndCommit)({userAction:"Comment.handleResolve",environment:S,cellTarget:w?{spaceWithId:w}:void 0,canUndo:!0,perform:i=>{t.trackTransaction(i),(0,n(614095).i)({environment:S,tabId:b,thread:e.thread,transaction:i,discussionLocation:e.discussionLocation})}})),n(307946).UP(b),null==t||t.stopPropagation()},er=async()=>{var t,i,o;let s=e.store.getParentStore();if(!s||!(null!=s&&s.isDefined()))return null;let r=s.getParentStore();if(!(null!=(t=r)&&t.isDefined())||(r.getType()===n(955630).xd.tableRow&&(r=null==(o=r)?void 0:o.getParentBlockStore()),!(null!=(i=r)&&i.isDefined())))return null;let a=(0,n(492569).Q)({model:r.getModel(),baseUrl:n(139424).A.domainBaseUrl,getRecordModel:e.store.getRecordModel,discussionId:s.id,commentId:y?e.store.id:void 0,pageVisitSource:n(254656).y8.CopyLink,addPagePrefix:(0,n(700473).wasRequestedOnAlternateDomain)()});n(65255).tG(S,{discussion_id:s.id,discussion_type:s.getType(),from:c,parent_block_id:s.getParentId(),...n(65255).A2({store:e.store,discu
1ssionStore:s,blockStore:r})});let[l,d]=await Promise.all([(0,n(161333).r)(),(0,n(969899).jd)()]);d({environment:S,stringValue:a,copiedMessage:l.copiedLinkToClipboard})},ea=e=>{if(!(null!=A&&A.canRead()))return;let t=A.getSpaceId();if(!t)return;let i=A.id;(0,n(158131).T)({threadId:i,from:"agent_comment"});let o=(0,n(7029).V)(e.event);(0,n(409581).openCommentThread)({environment:S,openInNew:o,spaceId:t,threadId:i})};if(!S.currentUser.isLoggedIn())return null;let el=V&&n(642157).h9(V)||$,ed=Y&&!q&&!el,ec=null!=(t=e.timelineActions)&&null!=(t=t.sidePeek)&&t.isOpen?e.timelineActions.sidePeek.onReply:null==(i=e.timelineActions)?void 0:i.onReply,eu=e.timelineActions?{onReply:D?ec:void 0,sidePeek:"visible"===e.timelineActions.sidePeekActionVisibility?e.timelineActions.sidePeek:void 0,sidePeekActionVisibility:e.timelineActions.sidePeekActionVisibility}:void 0,em=!!(null==eu?void 0:eu.onReply)||!!(null==eu?void 0:eu.sidePeek),ep=y&&(null==h?void 0:h.id)===e.store.id,eg=[],eh=[];el||((u||ep)&&!j&&!e.isOrphaned&&(p?eg.push("markDiscussionRead"):eg.push("markDiscussionUnread")),!J&&E&&eg.push("edit")),eg.push("copyLink"),T&&eg.push("viewAgentThread"),Z&&(Q?eh.push("subscribeToDiscussion"):eh.push("unsubscribeFromDiscussion")),!el&&!J&&(E||K)&&eh.push("delete");let ef=!C&&(eg.length>0||eh.length>0),ev=!el&&e.canShowReactions;return ef||ed||ev||em?(0,v.jsx)(n(656252).d,{ref:k,popupType:n(139424).A.isMobile?n(656252).z.BottomSheet:n(656252).z.Popup,bottomSheetInitialState:"half",buttonPopupStore:e.buttonPopupStore,placementToOrigin:"bottom",alignmentToOrigin:"end",stopClickPropagation:!0,suppressOriginContext:!0,content:t=>{let i;i=n(139424).A.isMobile?{menuType:n(649476).gu.Modal,title:(0,v.jsx)(n(327219).sA,{...O.mobileCommentMenuTitle})}:{menuType:n(649476).gu.Popup};let o=t=>"reopen"===t?{key:"reopen",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(128743).arrowStraightLeftIcon}),title:(0,v.jsx)(n(327219).sA,{...O.reopenButton})}),action:eo}:"resolve"===t?{key:"resolve",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(971730).checkmarkSmallIcon}),title:(0,v.jsx)(n(327219).sA,{...O.resolveDiscussionButton})}),action:()=>es()}:"edit"===t?{key:"edit",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(636).pencilLineIcon}),title:(0,v.jsx)(n(327219).sA,{...O.editComment})}),action:e.handleEditComment}:"viewAgentThread"===t?{key:"viewAgentThread",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(799891).y}),title:(0,v.jsx)(n(327219).sA,{...O.viewAgentChat})}),action:ea}:"delete"===t?{key:"delete",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(968411).trashIcon}),title:(0,v.jsx)(n(327219).sA,{...O.deleteComment}),isRedOnHover:!0}),action:e.handleDeleteComment}:"copyLink"===t?{key:"copyLink",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(588739).linkIcon}),title:u||y?(0,v.jsx)(n(327219).sA,{...O.copyLinkToDiscussion}):(0,v.jsx)(n(327219).sA,{...O.copyLinkToDiscussionOnSubsequentComments})}),action:er}:"markDiscussionRead"===t?{key:"markDiscussionRead",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(444202).d}),title:(0,v.jsx)(n(327219).sA,{...O.markReadButton})}),action:ee}:"markDiscussionUnread"===t?{key:"markDiscussionUnread",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(88721).C}),title:(0,v.jsx)(n(327219).sA,{...O.markUnreadButton})}),action:et}:"subscribeToDiscussion"===t?{key:"subscribeToDiscussion",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(931118).r}),title:(0,v.jsx)(n(327219).sA,{...O.subscribeToDiscussion})}),action:en}:"unsubscribeFromDiscussion"===t?{key:"unsubscribeFromDiscussion",render:e=>(0,v.jsx)(n(95582).A,{...e,icon:(0,v.jsx)(n(16275).I,{icon:n(761659).u}),title:(0,v.jsx)(n(327219).sA,{...O.unsubscribeFromDiscussion})}),action:ei}:void(0,n(48697).HB)(t),s=eg.map(o),r=eh.map(o);return 0===s.length&&(s.push(...r),r.length=0),(0,v.jsx)("div",{className:n(828432).Jb,children:(0,v.jsx)(n(747369).A,{...i,children:(0,v.jsx)(n(558045).A,{type:n(558045).O.Vertical,initialFocus:void 0,onAccept:t.close,sections:(0,n(960408).oE)([s.length>0&&{key:0,render:e=>(0,v.jsx)(n(83743).A,{...e}),items:s},r.length>0&&{key:1,render:e=>
1(0,v.jsx)(n(83743).A,{...e,topBorder:!0}),items:r}])})})})},children:t=>(0,v.jsxs)(F,{visible:e.visible,location:e.discussionLocation,timelineActions:eu,children:[!J||G||j?void 0:(0,v.jsx)(N,{store:e.store,discussionStore:g,location:e.discussionLocation}),!J||j||X||q&&!E?void 0:(0,v.jsx)(z,{store:e.store,discussionStore:g,location:e.discussionLocation}),ev?(0,v.jsx)(U,{store:e.store,location:e.discussionLocation,onReact:e.handleReaction}):void 0,ed&&!J?(0,v.jsx)(W,{resolved:j,onResolve:es,onReopen:eo}):void 0,ef?(0,v.jsx)(n(517352).e,{...t,"aria-label":f.formatMessage(O.moreActions),tooltip:f.formatMessage(O.moreActions),iconLeading:n(361226).ellipsisSmallIcon}):void 0]})}):null}function N(e){let{store:t,discussionStore:i,location:o}=e,s=(0,n(533992).v3)(),a=(0,n(633636).wM)(),l=(0,n(327219).tz)(),d=(0,r.useCallback)(()=>{let e=i.getSpaceId(),r=(0,n(911520).f)(i),l=()=>{if(!i.getResolved())return(0,n(15289).o)({action:"resolve_comment_thread",space_id:e},l=>(0,n(323517).createAndCommit)({userAction:"Suggestion.handleAccept",environment:s,cellTarget:e?{spaceWithId:e}:void 0,canUndo:!0,perform:e=>{l.trackTransaction(e),(0,n(477891).H)({action:"accept",environment:s,tabId:a,commentStore:t,discussionStore:i,transaction:e,discussionLocation:o,currentPageStore:r})}}))},d=(0,n(477891).i)({action:"accept",environment:s,discussionStore:i,currentPageStore:r});d?d.then(l):l(),(0,n(525779).clear)({environment:s}),(0,n(471e3).I)({environment:s})},[s,a,t,i,o]);return(0,v.jsx)(n(517352).e,{"aria-label":l.formatMessage(O.acceptButton),tooltip:l.formatMessage(O.acceptButton),onClick:d,iconLeading:n(971730).checkmarkSmallIcon})}function z(e){let{store:t,discussionStore:i,location:o}=e,s=(0,n(533992).v3)(),a=(0,n(633636).wM)(),l=(0,n(327219).tz)(),d=(0,r.useCallback)(()=>{let e=i.getSpaceId(),r=(0,n(911520).f)(i),l=()=>{if(!i.getResolved())return(0,n(15289).o)({action:"resolve_comment_thread",space_id:e},l=>(0,n(323517).createAndCommit)({userAction:"Suggestion.handleReject",environment:s,cellTarget:e?{spaceWithId:e}:void 0,canUndo:!0,perform:e=>{l.trackTransaction(e),(0,n(477891).H)({action:"reject",environment:s,tabId:a,commentStore:t,discussionStore:i,transaction:e,discussionLocation:o,currentPageStore:r})}}))},d=(0,n(477891).i)({action:"reject",environment:s,discussionStore:i,currentPageStore:r});d?d.then(l):l(),(0,n(525779).clear)({environment:s}),(0,n(471e3).I)({environment:s})},[s,a,t,i,o]);return(0,v.jsx)(n(517352).e,{"aria-label":l.formatMessage(O.rejectButton),tooltip:l.formatMessage(O.rejectButton),onClick:d,iconLeading:n(25094).xMarkSmallIcon})}function U(e){let{store:t,location:i,onReact:o}=e,s=(0,r.useRef)(null),a=(0,n(533992).v3)(),l=(0,n(327219).tz)(),d=(0,r.useCallback)(()=>{(0,T().uJ)(a,l,t,s.current,i,o)},[a,l,t,s,i,o]);return(0,v.jsx)(n(517352).e,{ref:s,"aria-label":l.formatMessage(O.addReaction),tooltip:l.formatMessage(O.addReaction),onClick:d,iconLeading:n(689220).S})}function W(e){let{resolved:t,onResolve:i,onReopen:o}=e,s=(0,r.useRef)(null),a=(0,n(327219).tz)(),l=t?O.reopenButton:O.resolveButton;return(0,v.jsx)(n(517352).e,{ref:s,"aria-label":a.formatMessage(l),tooltip:a.formatMessage(l),onClick:t?o:i,iconLeading:t?n(983012).w:n(971730).checkmarkSmallIcon})}let V={marginInlineEnd:5};function H(e){let{numberOfAttachments:t}=e;return(0,v.jsxs)(n(4458).fI,{alignItems:"center",children:[(0,v.jsx)("div",{style:V,children:(0,v.jsx)(n(16275).I,{colorVariant:"secondary",icon:n(695317).o})}),(0,v.jsx)(n(327219).sA,{defaultMessage:"{numberOfAttachments, plural, one {{numberOfAttachments} attachment} other {{numberOfAttachments} attachments}}",values:{numberOfAttachments:t},id:"comment.unfurl.attachments.title"})]})}function J({stores:e,collapsed:t,shouldShowGrayFogInScroller:i,onRemoveBlockFromComment:o}){return 0===e.length?null:e.length<=3?(0,v.jsx)(n(4458).VP,{gap:4,children:e.map(e=>(0,v.jsx)(n(192431).k,{store:e,disabled:!1,commentProps:{shouldHideBlockActionMenu:t,onRemoveBlockFromComment:o}},e.id))}):(0,v.jsx)(n(674707).I,{shouldShowGrayFog:i,children:e.map(e=>(0,v.jsx)(n(192431).k,{store:e,disabled:!1,commentProps:{shouldHideBlockActionMenu:t,onRemoveBlockFromComment:o}},e.id))})}let G={style2:{position:"absolute",zIndex:1,width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0, 0, 0, 0.4)",borderRadius:8,color:"white",fontWeight:n(699422).Wy.bold},style3:{background:"rgba(0, 0, 0, 0.4)"}
1,style4:{position:"absolute",visibility:"hidden",width:0,height:0,overflow:"hidden"}};function $({stores:e,embedBlockLocation:t,onRemoveContent:i}){let o=(0,n(533992).v3)(),s=(0,n(633636).wM)();if(0===e.length)return null;if(e.length<=3)return(0,v.jsx)(n(4458).VP,{gap:4,children:e.map(e=>(0,v.jsx)(q,{store:e,embedBlockLocation:t,onRemoveContent:i,isLarge:!0},e.id))});if(e.length<=4)return(0,v.jsx)(n(4458).fI,{gap:4,children:e.map(e=>(0,v.jsx)(q,{store:e,embedBlockLocation:t,onRemoveContent:i,isLarge:!1},e.id))});let r=e.slice(0,3),a=e[3],l=e.length-4+1,d=e.slice(4);return(0,v.jsxs)(n(4458).fI,{gap:4,children:[r.map(e=>(0,v.jsx)(q,{store:e,embedBlockLocation:t,onRemoveContent:i,isLarge:!1},e.id)),(0,v.jsxs)("div",{children:[(0,v.jsx)(n(64960).Ay,{style:G.style2,hoveredStyle:G.style3,pressedStyle:G.style3,onClick:()=>{(0,n(2925).i)({tabId:s,environment:o,blockStore:a})},children:`+${l}`}),(0,v.jsx)(q,{store:a,embedBlockLocation:t,onRemoveContent:i,isLarge:!1},a.id)]}),(0,v.jsx)("div",{style:G.style4,children:d.map(e=>(0,v.jsx)(q,{store:e,embedBlockLocation:t,onRemoveContent:i,isLarge:!1},e.id))})]})}let Y={imageShared:{border:`1px solid ${n(632079).Tj.border.secondary}`,borderRadius:8,cursor:"zoom-in"}};function q({store:e,isLarge:t,embedBlockLocation:i,onRemoveContent:o}){let s=(0,v.jsx)(n(605415).J9,{store:e,blockLocation:i,disabled:!1,disableDrag:!0,disableResizers:!0,preserveScale:!0,inlineContentStyle:{...Y.imageShared,...t?X:Z},disableActions:!t,onRemoveBlockFromComment:t?o:void 0},e.id);return t?s:(0,v.jsx)("div",{style:Q,children:s})}let X={objectFit:"contain",width:"auto",height:"auto",maxWidth:240,maxHeight:240,minWidth:48,minHeight:48},Z={width:48,height:48,minWidth:48,minHeight:48},Q={minWidth:48,minHeight:48,flexShrink:0},ee={wrapper:{height:48,width:214,display:"flex",alignItems:"center",background:n(632079).Tj.background.primary,border:`1px solid ${n(632079).Tj.border.secondaryTranslucent}`,borderRadius:12,paddingTop:8,paddingInlineEnd:10,paddingBottom:8,paddingInlineStart:8,gap:8},icon:{background:n(632079).Tj.background.tertiaryTranslucent,borderRadius:6,width:32,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},fileName:{fontSize:14,fontWeight:n(699422).Wy.medium,lineHeight:"18px",color:n(632079).Tj.text.primary,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},fileSizeText:{color:n(632079).Tj.text.secondary},progressText:{color:n(632079).Tj.text.tertiary},sizeAndProgressContainer:{display:"flex",alignItems:"center",gap:4,fontSize:12,lineHeight:"15px"},style0:{overflow:"hidden"}};function et({store:e}){let t=(0,n(579993).K8)(()=>n(553871).J.getKeyState(n(553871).J.getBlockKey(e.id)),[e.id]),i=(0,n(327219).tz)();if(!t)return(0,v.jsxs)("div",{style:ee.wrapper,children:[(0,v.jsx)("div",{style:ee.icon,children:(0,v.jsx)(n(517334).k,{})}),(0,v.jsx)(n(4458).VP,{children:(0,v.jsx)("div",{style:ee.fileName,children:i.formatMessage({id:"commentFilePlaceholder.loading",defaultMessage:"Loading..."})})})]});let{name:o,size:s,progressPercent:r,progressText:l}=t;return(0,v.jsxs)("div",{style:ee.wrapper,children:[(0,v.jsx)("div",{style:ee.icon,children:(0,v.jsx)(n(517334).k,{})}),(0,v.jsx)("div",{style:ee.style0,children:(0,v.jsxs)(n(4458).VP,{children:[(0,v.jsx)("div",{style:ee.fileName,children:o}),(0,v.jsxs)("div",{style:ee.sizeAndProgressContainer,children:[(0,v.jsx)("span",{style:ee.fileSizeText,children:(0,a().formatFileSize)(s)}),(0,v.jsx)("span",{style:ee.progressText,children:"—"}),(0,v.jsx)(n(517334).k,{}),r?(0,v.jsx)(n(547374).A,{percentage:r,style:ee.progressText}):l?(0,v.jsx)("span",{children:l}):null]})]})})]})}function en({stores:e}){return 0===e.length?null:(0,v.jsx)(n(4458).VP,{gap:4,children:e.map(e=>(0,v.jsx)(et,{store:e},e.id))})}function ei(e){let t=e.discussionFormat===a().DiscussionFormat.Sidebar?n(353650).ZO.SidebarComment:n(353650).ZO.PageComment,{uploading:i,images:o,embeds:s,files:r}=(0,n(579993).K8)(()=>{let[t,i]=(0,n(960408).jB)(e.contentStores,e=>{let t=!!n(553871).J.getKeyState(n(553871).J.getBlockKey(e.id)),i=(0,n(466390).getEmbedSourceFromBlockStore)(e);return t||!i}),[o,s]=(0,n(960408).jB)(i,e=>e.getType()===n(955630).xd.image),[r,a]=(0,n(960408).jB)(s,e=>{let t=e.getType();return t===n(955630).xd.video||t===n(955630).xd.embed});return{uploading:t,images:o,embeds:r,files:a}},[e.contentStores]);return 0===i.length&&0===o.length&&0===s.length&&0===r.length?null:(0,v.jsxs)(n(4458).VP,{gap:4,marginTop:8,children:[(0,v.jsx)(en,{stores:i}),(0,v.jsx)($,{stores:o,embedBlockLocation:t,onRemoveContent:e.onRemoveContent}),s.length>0?(0,v.jsx)(n(4458).VP,{gap:4,children:s.map(i=>(0,v.jsx)(n(605415).J9,{store:i,blockLocation:t,disabled:!1,disableDrag:!0,disableResizers:!0,preserveScale:!0,inlineContentStyle:{},onRemoveBlockFromComment:e.onRemoveContent},i.id))}):void 0,(0,v.jsx)(J,{stores:r,collapsed:e.collapsed,shouldShowGrayFogInScroller:e.discussionHovered&&(e.discussionFormat===a().DiscussionFormat.Margin||e.discussionFormat===a().DiscussionFormat.Sidebar),onRemoveBlockFromComment:e.onRemoveContent})]})}let eo={container:{position:"relative"},betweenCommentsContainer:{height:0,insetBlockStart:-8,transform:"translateY(1px)"},newBarLineWrapper:{width:"100%"},newBarLine:{borderRadius:2,height:1.5,background:n(632079).Tj.blue.background.secondary,width:"100%",margin:"auto 0px"},betweenCommentsNewBarLine:{height:1,position:"relative"},newBarWrapper:{color:n(632079).Tj.text.secondary,fontSize:10,fontWeight:n(699422).Wy.regular,display:"flex",alignItems:"center",marginTop:0,marginBottom:12,paddingInlineStart:0},betweenCommentsNewBarWrapper:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,pointerEvents:"none",transform:"translateY(-50%)"},threadLine:{position:"absolute",backgroundColor:n(632079).Tj.border.secondary,width:1.5,height:8,borderRadius:2,insetInlineStart:11.25,bottom:-6,zIndex:-1},style0:{marginInlineStart:12,marginInlineEnd:12},betweenCommentsBadge:{background:"transparent",marginInlineEnd:0,padding:0}};function es({showThreadLine:e=!0,layout:t,leadingLineInset:i=0}){switch(t){case"above-comment":return(0,v.jsxs)("div",{style:eo.container,children:[(0,v.jsxs)("div",{style:eo.newBarWrapper,children:[(0,v.jsx)("div",{style:eo.newBarLineWrapper,children:(0,v.jsx)("div",{style:eo.newBarLine})}),(0,v.jsx)(n(322662).J1,{style:eo.style0}),(0,v.jsx)("div",{style:eo.newBarLineWrapper,children:(0,v.jsx)("div",{style:eo.newBarLine})})]}),e?(0,v.jsx)("div",{style:eo.threadLine}):void 0]});case"between-comments":case"below-replies-toggle":return(0,v.jsx)(er,{leadingLineInset:i})}}function er(e){let t={...eo.container,...eo.betweenCommentsContainer},i={...eo.newBarLine,...eo.betweenCommentsNewBarLine};return e.leadingLineInset>0&&(i.insetInlineStart=e.leadingLineInset,i.width=`calc(100% - ${e.leadingLineInset}px)`),(0,v.jsx)("div",{style:t,children:(0,v.jsxs)("div",{style:{...eo.newBarWrapper,...eo.betweenCommentsNewBarWrapper},children:[(0,v.jsx)("div",{style:eo.newBarLineWrapper,children:(0,v.jsx)("div",{style:i})}),(0,v.jsx)(n(322662).J1,{style:{...eo.style0,...eo.betweenCommentsBadge}})]})})}var ea=()=>n(595288);
1let el=(0,n(327219).YK)({hideReplies:{id:"comments.timelineDiscussionExpansion.hideReplies",defaultMessage:"{replyCount, plural, one {Hide reply} other {Hide replies}}"},viewReplies:{id:"comments.timelineDiscussionExpansion.viewReplies",defaultMessage:"{replyCount, plural, one {View reply} other {View replies}}"}}),ed=(0,r.createContext)(void 0);function ec(e){let t=(0,n(327219).tz)(),[i,o]=(0,r.useState)(!1),s=(0,r.useCallback)(()=>{o(!0)},[]),a=(0,r.useCallback)(()=>{o(!1)},[]);(0,r.useEffect)(()=>{e.enabled||o(!1)},[e.enabled]);let l=(0,r.useMemo)(()=>e.enabled?{isExpanded:e.isExpanded,isInlineConnectingLineHovered:i,onInlineConnectingLineClick:e.onToggle,onInlineConnectingLineMouseEnter:s,onInlineConnectingLineMouseLeave:a,inlineConnectingLineLabel:t.formatMessage(e.isExpanded?el.hideReplies:el.viewReplies,{replyCount:e.replyCount})}:void 0,[s,a,t,i,e.enabled,e.isExpanded,e.onToggle,e.replyCount]);return(0,v.jsx)(ed.Provider,{value:l,children:e.children})}function eu(){return(0,r.useContext)(ed)}function em(e){let t=eu(),i=null!=t&&t.isInlineConnectingLineHovered?n(632079).Tj.border.strong:n(632079).Tj.border.secondary;return(0,v.jsxs)(v.Fragment,{children:[t?(0,v.jsx)(ep,{inlineConnectingLineLabel:t.inlineConnectingLineLabel,isExpanded:t.isExpanded,onInlineConnectingLineClick:t.onInlineConnectingLineClick,onInlineConnectingLineInteractionStart:e.onInlineConnectingLineInteractionStart,onInlineConnectingLineMouseEnter:t.onInlineConnectingLineMouseEnter,onInlineConnectingLineMouseLeave:t.onInlineConnectingLineMouseLeave,rootLineBlockStart:R.rootLineBlockStart,rootLineHeight:R.rootLineHeight,rootLineInlineStart:R.rootLineInlineStart}):void 0,(0,v.jsx)("div",{"aria-hidden":!0,style:{...eh.inlineConnectingLineRootSegment,backgroundColor:i,height:R.rootLineHeight,insetBlockStart:R.rootLineBlockStart,insetInlineStart:R.rootLineInlineStart}})]})}function ep(e){let t=e.rootLineInlineStart-(eg-1)/2,i=r.useCallback(e=>{e.stopPropagation()},[]),o=r.useCallback(t=>{t.stopPropagation(),e.onInlineConnectingLineInteractionStart()},[e]),s=r.useCallback(()=>{e.onInlineConnectingLineInteractionStart(),e.onInlineConnectingLineMouseEnter()},[e]),a=r.useCallback(e=>{e.stopPropagation()},[]);return(0,v.jsx)(n(988022).p,{"aria-expanded":e.isExpanded,"aria-label":e.inlineConnectingLineLabel,colorVariant:"tertiary",hoveredStyle:eh.inlineConnectingLineButtonInteraction,onBlur:i,onClick:e.onInlineConnectingLineClick,onFocus:o,onMouseEnter:s,onMouseLeave:e.onInlineConnectingLineMouseLeave,onMouseMove:a,pressedStyle:eh.inlineConnectingLineButtonInteraction,size:"xs",style:{...eh.inlineConnectingLineButton,height:e.rootLineHeight,insetInlineStart:t,insetBlockStart:e.rootLineBlockStart}})}ed.displayName="TimelineDiscussionInlineConnectingLineInteractionContext";let eg=16,eh={inlineConnectingLineButton:{position:"absolute",zIndex:1,width:16,paddingInlineStart:0,paddingInlineEnd:0,background:"transparent"},inlineConnectingLineButtonInteraction:{background:"transparent"},inlineConnectingLineRootSegment:{position:"absolute",borderRadius:2,width:1,pointerEvents:"none"}},ef={marginTop:4},ev={alignSelf:"flex-end",marginInlineEnd:8,marginInlineStart:8},eS={marginTop:8};function eb(e){let{store:t,thread:i,discussionContext:o,discussionLocation:s,shouldShowThreadLine:l,blockStore:c,collapsed:u,showMarkAsRead:m,isOrphaned:p}=e,{discussionStore:g}=i,h=(0,n(533992).v3)(),S=(0,n(633636).wM)(),x=(0,n(764047).Ul)(),y=(0,n(174720).H)(),[C,k]=(0,r.useState)(!1),[I,w]=(0,r.useState)(!1),[j,L]=(0,r.useState)(!1),[M,A]=(0,r.useState)(!1),[_,D]=(0,r.useState)("feed_item_top_level_discussion"===s&&u),P=(0,n(579993).K8)(()=>c.getSpaceId(),[c]),E=(0,n(579993).K8)(()=>e.store.isDefined()?new(n(478597)).w(h,e.store.getSpaceId()):void 0,[h,e.store]),F=(0,n(579993).K8)(()=>n(966980).dd(e.store).filter(e=>(0,n(517013).G_)(e,{table:"block",id:e.id},"alive").getValue()),[e.store]),O=(0,n(579993).K8)(()=>(0,n(713707).CB)(e.thread),[e.thread]),N=(0,n(579993).K8)(()=>null==E?void 0:E.state.files,[E]),z=(0,n(579993).K8)(()=>null==E?void 0:E.state.textStore,[E]),U=(0,r.useCallback)(e=>{let t=e.target;t instanceof HTMLElement&&(0,n(768397).p)(t)&&w(!0)},[]),W=(0,r.useCallback)(()=>{w(!1)},[]),V=(0,r.useCallback)(()=>{n(395364).A.state||L(!0)},[]),J=(0,r.useCallback)(()=>{L(!1)},[]),G=(0,r.useCallback)(()=>{L(!1),w(!1)},[]),$=(0,n(67499).S)(),Y=(0,n(579993).uB)(void 0,n(510969).A),q=(0,n(579993).K8)(()=>Y.state.open,[Y]),X=(0,n(366318).S)(c),Z=(0,n(579993).K8)(()=>(0,n(607689).o7)(e.store.id),[e.store.id]),Q=(0,n(579993).K8)(()=>
1{if("rootWithReplies"===e.thread.type)return e.thread.rootCommentStore.id===e.store.id;let t=g.getComments();return!!(t&&t[0]===e.store.id)},[e.thread,g,e.store.id]),ee=(0,n(579993).K8)(()=>{var t;let i=c.getRole(),o=B({isFirstComment:Q,discussionLocation:s}),r=c.pathIsDead(),a=i&&n(642157).h9(i)||r,l="comment_only"===i||$&&(null==(t=$.publicEditModeStore.state)?void 0:t.permission)==="comment",d=o&&!n(139424).A.isMobile&&!l&&!a;return j||I||q||n(139424).A.isMobile||e.showResolveButtonByDefaultIfPossible&&d},[c,e.showResolveButtonByDefaultIfPossible,Q,s,$,j,I,q]),et=(0,r.useContext)(n(700587).U),en=(0,n(579993).K8)(()=>{let e=t.getCreatedByPointer();return e?{createdByPointer:e,lastEditedTime:t.getLastEditedTime(),createdTime:t.getCreatedTime(),text:t.getText(),reactions:n(868249).L.getUserVisibleReactions(t)}:null},[t]),eo=(0,n(579993).K8)(()=>en?(0,n(935786).JQ)({parentStore:t,pointer:en.createdByPointer}):null,[en,t]),er=(0,n(579993).K8)(()=>e.store.getTextStore(),[e.store]),el=function(e){let{discussionLocation:t,isCommentCollapsed:n,isDiscussionCollapsed:i,maxLines:o}=e;return"feed_item_top_level_discussion"===t?n?o:void 0:i?o:void 0}({discussionLocation:s,isCommentCollapsed:_,isDiscussionCollapsed:u,maxLines:e.maxLines}),ed=(0,r.useCallback)(()=>{(0,n(15289).o)({action:"delete_comment",space_id:P},t=>(0,n(323517).createAndCommit)({userAction:"Comment.deleteComment",environment:h,cellTarget:{spaceWithId:P},canUndo:!0,perform:i=>{n(187819).Tu({environment:h,commentStore:e.store,transaction:i,discussionLocation:s})&&t.trackTransaction(i)},skipUpdatingEditedMetadata:!0}))},[h,e.store,s,P]),ec=(0,r.useCallback)(async()=>{let e="rootWithReplies"===i.type&&i.rootCommentStore.id===t.id?i.replyStores.length:0,o=e>0,{accept:s}=await n(647095).Gh({message:o?(0,v.jsx)(n(327219).sA,{defaultMessage:"Delete this comment and its replies?",id:"comment.confirmDialog.deleteCommentWithReplies.prompt"}):(0,v.jsx)(n(327219).sA,{defaultMessage:"Delete this comment?",id:"comment.confirmDialog.deleteComment.prompt"}),description:o?(0,v.jsx)(n(327219).sA,{defaultMessage:"{count, plural, one {# reply} other {# replies}} will also be deleted.",id:"comment.confirmDialog.deleteCommentWithReplies.description",values:{count:e}}):void 0,acceptLabel:(0,v.jsx)(n(327219).sA,{defaultMessage:"Delete",id:"comment.confirmDialog.deleteComment.deleteButton.label"})});s&&(ed(),n(307946).UP(S),n(827862).J.state.overlapsExistingDiscussionMenu&&!n(575125).Jd.getForTab(S).state.open&&n(827862).J.setState({...n(827862).J.state,overlapsExistingDiscussionMenu:!1}),(0,n(753288).j)(h))},[ed,h,t.id,i,S]),eu=(0,r.useCallback)(async t=>{let i=er.getValue(),o=n(966980).dd(e.store).filter(e=>e.id!==t.id),s=i&&i.length>0,r=0===o.length;!s&&r?(await ec(),k(!1)):(0,n(323517).createAndCommit)({userAction:"Comment.handleRemoveFileFromActions",environment:h,cellTarget:{spaceWithId:P},canUndo:!0,perform:i=>{n(187819).L6({commentStore:e.store,fileBlocks:[t],transaction:i})}})},[er,h,ec,e.store,P]),ep=(0,r.useCallback)(()=>{A(!0)},[]),eg=(0,r.useCallback)(async()=>{if(!E)return;let e=er.getValue()||[],t=E.state.textStore;(0,n(323517).createAndCommit)({userAction:"Comment.handleEditComment",environment:h,cellTarget:{spaceWithId:P},canUndo:!0,perform:i=>{n(53517).R9({environment:h,store:t,value:e,transaction:i})}}),k(!0),await n(374176).default.afterNextFlush(),await n(374176).default.afterNextFlush(),(0,n(739204).z)({store:t})},[E,er,h,P]),eh=(0,r.useCallback)(async()=>{if(!E)return!1;if(!(0,a().hasCommentChanged)(E,e.store))return k(!1),!0;{let{accept:e}=await n(647095).Gh({message:(0,v.jsx)(n(327219).sA,{defaultMessage:"Do you want to discard this edit?",id:"comment.confirmDialog.discardEdit.prompt"}),acceptLabel:(0,v.jsx)(n(327219).sA,{defaultMessage:"Discard",id:"comment.confirmDialog.discardEdit.discardButton.label"})});if(e)return k(!1),!0}return!1},[E,e.store]),eb=(0,r.useCallback)(async()=>{let t=null==z?void 0:z.getValue();t&&t.length>0||N&&N.length>0?(0,n(15289).o)({action:"edit_comment",space_id:P},i=>(0,n(323517).createAndCommit)({userAction:"Comment.handleSubmitEdit",environment:h,cellTarget:{spaceWithId:P},canUndo:!0,perform:o=>{i.trackTransaction(o),n(187819).QA({environment:h,store:e.store,text:t||[],transaction:o,discussionLocation:s,files:N||[],property_id:g.getPropertyId(),blockStore:c})}})):await ec(),k(!1)},[z,N,h,e.store,s,g,c,ec,P]),ex=(0,r.useCallback)(()=>{"feed_item_top_level_discussion"===s&&D(!1)},[s]),ey=(0,r.useRef)(null),eC=(0,r.useRef)(null);(0,n(336494).b)(d().A,()=>({tabScopeOwner:x,edit:eg,handleCancelEdit:eh,getNode:()=>ey.current,isEditing:()=>C,discussionLocation:s,commentId:e.store.id}),[x,eg,eh,C,s,e.store.id]);let ek=null==en?void 0:en.text,eI=void 0!==ek&&ek.length>0&&n(247438).AhH(ek)>0,ew=eI&&(0,a().isCommentAllEmojis)(ek),ej=(0,n(233633).C)({type:"discussionLocation",location:s}),eL=!!e.showNewBar&&void 0!==e.newBarLayout&&"above-comment"!==e.newBarLayout,eM=function(e){let{discussionLocation:t,hasNewBar:i,isNewBarBetweenComments:o,isAllEmojis:s,newStatusDotPosition:r,isMobileRedesignEnabled:a,isFirstComment:l,showSidePeekRootDivider:d}=e,c="comment_unfurl"===t,u="discussion_sidepeek"===t&&(l||d);return(0,n(960253).I)(()=>({container:{flexGrow:c?1:void 0,paddingTop:i&&!o?0:c?10:8,paddingInlineEnd:f(t,a,"end"),paddingBottom:u?12:8,paddingInlineStart:f(t,a,"start"),borderBottom:u?`1px solid ${n(632079).Tj.border.secondary}`:void 0,marginBottom:u?6:void 0},comment:{fontSize:a?n(699422).J.UIRegular.mobile:n(699422).J.UIRegular.desktop,position:"relative"},commentElementsBelowUserRow:{paddingInlineStart:32},unfurlMoreWrapper:{color:n(632079).Tj.text.tertiary,fontWeight:c?n(699422).Wy.medium:void 0,display:"block",marginBottom:-1.5,pointerEvents:"auto"},text:{lineHeight:"20px",paddingTop:4,cursor:c?void 0:"text",...s?{fontSize:32,lineHeight:"32px"}:{}},authorRowContainer:{display:"flex",flexDirection:"row",alignItems:"center",height:n(139424).A.isMobile?24:void 0,justifyContent:r?"flex-start":"space-between"},unreadStatusDot:{display:"flex",flexDirection:"row",alignItems:"center",marginInlineEnd:4,...r&&{marginInlineStart:6}}}),[t,s,i,o,r,a,c,u])}({discussionLocation:s,isAllEmojis:ew,hasNewBar:!!e.showNewBar,isNewBarBetweenComments:eL,newStatusDotPosition:n(139424).A.isMobile,isMobileRedesignEnabled:ej,isFirstComment:Q,showSidePeekRootDivider:e.showSidePeekRootDivider}),eA=(0,r.useMemo)(()=>({type:"comment_match",commentId:e.store.id}),[e.store.id]),eT="comment_unfurl"!==s,e_=eT&&en&&en.reactions.length>0;if((0,r.useEffect)(()=>{M&&eC.current&&e_&&((0,n(341471).h)({element:eC.current,environment:h,scrollerContext:et,vertical:{reveal:"closest"},horizontal:void 0,animate:!0}),A(!1))},[h,et,M,e_]),!E||!en||!eo)return null;let eD=!("discussion_sidepeek"===s||y&&"updates_sidebar"===s),eB=eL?R.contentIndent+1:0,eR=F.length>0&&(0,v.jsx)("div",{children:(0,v.jsx)(ei,{contentStores:F,onRemoveContent:eu,discussionFormat:(0,a().discussionLocationToDiscussionFormat)(s),collapsed:u,discussionHovered:e.hoveringDiscussion})});return(0,v.jsxs)("div",{ref:ey,onClick:e=>C&&e.stopPropagation(),style:eM.container,children:[e.showNewBar?(0,v.jsx)(es,{showThreadLine:eD,layout:e.newBarLayout??"above-comment",leadingLineInset:eB}
1):void 0,(0,v.jsxs)("div",{style:eM.comment,onFocus:U,onBlur:W,onMouseMove:V,onMouseLeave:J,children:[(0,v.jsxs)("div",{style:eM.authorRowContainer,children:[(0,v.jsx)(n(443468).Y,{createdTime:en.createdTime,lastEditedTime:en.lastEditedTime,location:s,isResolved:O,isTopLevelComment:Q,isSuggestionComment:e.isSuggestionComment,authorStore:eo,commentStore:t,suppressMouse:u}),e.showUnreadStatusDot?(0,v.jsx)("div",{style:eM.unreadStatusDot,children:(0,v.jsx)(n(210882).m,{size:8})}):void 0,"comment_unfurl"===s||C||X?void 0:(0,v.jsx)(K,{store:e.store,thread:e.thread,blockStore:c,discussionLocation:s,visible:ee,isFirstComment:Q,buttonPopupStore:Y,canShowReactions:eT,handleEditComment:eg,handleDeleteComment:ec,handleReaction:ep,showMarkAsRead:m,isOrphaned:p??!1,timelineActions:e.timelineActions})]}),l&&eD?(0,v.jsx)(b,{}):void 0,e.shouldShowReplyThreadLine?(0,v.jsx)(em,{onInlineConnectingLineInteractionStart:G}):void 0,(0,v.jsxs)("div",{style:eM.commentElementsBelowUserRow,children:[o||void 0,C?(0,v.jsx)("div",{style:ef,children:(0,v.jsx)(ea().V,{showAvatar:!1,parentStore:e.store,rootCommentId:void 0,blockStore:c,onCancel:eh,onSubmit:eb,discussionInputStore:E,isEditingExistingComment:!0,isMobileSlideUpMenu:!0,shouldSaveUnsentComments:!1,commentStore:e.store,discu
1ssionFormat:(0,a().discussionLocationToDiscussionFormat)(s),discussionLocation:s,canDrop:!0})}):void 0,eI&&!C?(0,v.jsxs)(n(4458).fI,{justifyContent:"space-between",children:[(0,v.jsx)(n(18079).A,{onMore:"comment_unfurl"===s?void 0:ex,moreElement:(0,v.jsxs)(n(428217).V,{disableUnderline:!0,style:eM.unfurlMoreWrapper,hoverColor:"blue",children:["…"," ",(0,v.jsx)("span",{children:(0,v.jsx)(n(327219).sA,{id:"comment.truncated.showMoreLabel",defaultMessage:"more"})})]}),maxLines:el,children:(0,v.jsx)(n(602430).A,{style:eM.text,store:er,disabled:!0,disabledMentionTypes:{date:!0,property:!0},disableEquationInteraction:!0,inPageFind:eA})}),X&&Z?(0,v.jsx)(n(517334).k,{style:ev}):void 0]}):void 0,C||"comment_unfurl"===s?!eI&&(0,v.jsx)(H,{numberOfAttachments:F.length}):eR,e_?(0,v.jsx)("div",{ref:eC,style:eS,children:(0,v.jsx)(T().Ay,{parentStore:e.store,discussionLocation:s})}):void 0]})]})]})}function ex(){let e=(0,n(54691).e)(),t=(0,n(83208).X)("timeline_presence_analytics_panel");return e&&t}let ey={inset:"6px 16px 6px",page:"6px 0px 12px"},eC={block_menu:"8px 16px 0px",page_discussion:"8px 0px 0px",updates_sidebar:"4px 16px 12px",discussion_sidepeek:"4px 16px 12px",margin_comments:"8px 12px 6px",comment_unfurl:"0",feed_item_top_level_discussion:"8px 16px 0px",new_discussions_sheet:"8px 12px 6px",updates_menu_mentions_comments:"4px 16px 12px",updates_menu_all_updates:"4px 16px 12px",updates_menu_archive:"4px 16px 12px",reply_menu_mentions_comments:"8px 16px 0px",reply_menu_all_updates:"8px 16px 0px",reply_menu_archive:"8px 16px 0px",reply_menu_updates_sidebar:"8px 16px 0px",ai_reject_all_suggestions:"0",native_comment_sheet:"0"},ek=r.forwardRef(function(e,t){let{format:i,showMoreCommentsButton:o,onMoreCommentsClick:s,inputVisible:r,blockStore:l,shouldUseInlineTimelineReplies:d,timelineReplyInputPaddingVariant:c,rootCommentId:u}=e,m=(0,n(499909).y)(l),p=(0,n(174720).H)(),g=ex(),h=(0,n(579993).K8)(()=>void 0!==e.store.getPropertyId(),[e.store]),S="page_discussion"===e.discussionLocation&&!p&&!g,b=S&&!h,x=(0,n(851969).fV)({blockStore:l,enabled:S&&!h}),{displayedActivityStatus:y,popupStore:C}=(0,n(755521).Tk)({agents:x.agents??[]}),k=(0,n(233633).C)({type:"discussionFormat",format:e.format}),I=(0,n(960253).I)(()=>({container:{position:"relative",padding:0,...i===a().DiscussionFormat.Page?{marginInlineStart:16,marginInlineEnd:16}:{}},discussionInputContainer:{padding:void 0===c?eC[e.discussionLocation]:ey[c],...k?{paddingInlineStart:f(e.discussionLocation,k,"start"),paddingInlineEnd:f(e.discussionLocation,k,"end")}:{}},agentActivityStatusRow:{padding:eC[e.discussionLocation],paddingTop:10,...k?{paddingInlineStart:f(e.discussionLocation,k,"start"),paddingInlineEnd:f(e.discussionLocation,k,"end")}:{}}}),[i,e.discussionLocation,k,c]);return m&&(o||r)?(0,v.jsxs)("div",{style:I.container,children:[o?(0,v.jsx)(n(69138).d,{enableIcon:!0,onClick:s}):void 0,r?(0,v.jsxs)(v.Fragment,{children:[b&&y?(0,v.jsx)("div",{style:I.agentActivityStatusRow,children:(0,v.jsx)(n(755521).UX,{agents:y.agents,spaceId:l.pointer.spaceId,popupStore:C,impressionContext:"page_discussion"===e.discussionLocation?{from:"page_discussion",page_id:l.id}:void 0})}):void 0,(0,v.jsx)(ea().V,{autoFocus:!0!==d,showAvatar:!0,containerStyle:I.discussionInputContainer,parentStore:e.store,rootCommentId:u,blockStore:e.blockStore,onCancel:e.onCancel,onSubmit:e.onSubmit,discussionInputStore:e.discussionInputStore,isMobileSlideUpMenu:!1,shouldSaveUnsentComments:!0,shouldUseDiscussionScopedDraftKey:d,onEditPreviousComment:e.onEditPreviousComment,inReplyToDiscussionId:e.store.id,discussionFormat:e.format,discussionLocation:e.discussionLocation,showCtaButtons:e.showCtaButtons,ref:t,onFileUploaded:e.onFileUploaded})]}):void 0]}):null}),eI={buttonHovered:{background:n(632079).Tj.background.secondaryTranslucent},badge:{marginInlineStart:6,marginInlineEnd:6},style0:{position:"relative"}};function ew(e){let t=(0,n(233633).C)({type:"discussionLocation",location:e.discussionLocation}),i=(0,n(960253).I)(()=>{let i=t?n(699422).J.UIRegular.mobile:n(699422).J.UIRegular.desktop,o=f(e.discussionLocation,t,"start")+24;return{moreCommentsWrapper:{color:n(632079).Tj.text.tertiary,fontSize:i,flexGrow:1,display:"flex",alignItems:"center",paddingInlineStart:8},button:{borderRadius:6,fontSize:i,color:n(632079).Tj.text.secondary,justifyContent:"space-between",padding:"14px 0",margin:`0 0 0 ${o}px`,width:`calc(100% - ${o}px - 16px)`},threadLine:{position:"absolute",backgroundColor:n(632079).Tj.border.secondary,width:1.5,height:"100%",top:2,insetInlineStart:f(e.discussionLocation,t,"start")+11.25,borderRadius:2}}}
1,[e.discussionLocation,t]);return e.count<=0?null:(0,v.jsxs)("div",{style:eI.style0,children:[(0,v.jsx)("div",{style:i.threadLine}),(0,v.jsx)(n(988022).p,{colorPalette:"gray",size:"xs",style:i.button,onClick:e.onClick,hoveredStyle:eI.buttonHovered,children:(0,v.jsxs)("div",{className:"discussion-show-all-button",style:i.moreCommentsWrapper,children:[(0,v.jsx)(n(327219).sA,{defaultMessage:"Show {moreCommentsNumber, plural, one {{moreCommentsNumber} reply} other {{moreCommentsNumber} replies}}",id:"discussion.showMoreCommentsSidebarButton.label",values:{moreCommentsNumber:e.count}}),e.showNewBadge?(0,v.jsx)(n(322662).J1,{style:eI.badge}):null]})},"show")]})}let ej={container:{marginTop:2},label:{color:n(632079).Tj.blue.text.tertiary,fontSize:14,lineHeight:"18px"},labelDeleteColor:{color:n(632079).Tj.text.tertiary},text:{color:n(632079).Tj.blue.text.accentPrimary,fontSize:14,lineHeight:1.29},textDeleteColor:{color:n(632079).Tj.text.secondary},suggestionContextItem:{display:"block",marginBottom:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},unfurlMoreWrapper:{color:n(632079).Tj.text.tertiary,fontWeight:n(699422).Wy.medium,display:"block",marginBottom:-1.5,pointerEvents:"auto"}};function eL(e){let{discussionStore:t}=e,i=(0,n(327219).tz)(),o=(0,n(579993).K8)(()=>t.isSuggestionDiscussion(),[t]),s=(0,n(579993).K8)(()=>{let t=e.discussionStore.getContext();return(t?(0,n(353711).Qe)({discussionContextData:t,discussionId:e.discussionStore.id,discussionType:(0,n(148337).o9)(e.discussionStore.getType()),intl:i}):[])??[]},[e.discussionStore,i]),r=(0,n(511791).RX)(i).title;return o&&r&&0!==s.length?(0,v.jsx)("div",{style:ej.container,children:(0,v.jsx)(n(18079).A,{maxLines:e.collapsed?1:void 0,clampOverride:{fontSize:14,lineHeight:1.29},moreElement:(0,v.jsxs)(n(428217).V,{disableUnderline:!0,style:ej.unfurlMoreWrapper,hoverColor:"blue",children:["…"," ",(0,v.jsx)("span",{children:(0,v.jsx)(n(327219).sA,{id:"suggestion.truncated.showMoreLabel",defaultMessage:"more"})})]}),children:s.map(({label:e,value:n,shouldUseDeleteColor:i,removeQuotationMarks:o},s)=>(0,v.jsxs)("div",{style:ej.suggestionContextItem,children:[(0,v.jsxs)("span",{style:{...ej.label,...i&&ej.labelDeleteColor},children:[e,": "]}),(0,v.jsxs)("span",{style:{...ej.text,...i&&ej.textDeleteColor},children:[o?null:"“",(0,v.jsx)(eM,{value:n,discussionStore:t}),o?null:"”"]})]},s))})}):null}function eM({value:e,discussionStore:t}){let i=(0,n(533992).v3)(),o=(0,n(960253).e)(),{value:s}=(0,n(552709).fJ)(n(406921).V),r=(0,n(579993).K8)(()=>(0,n(536614).S5)({environment:i,textValue:{value:e,spaceId:t.pointer.spaceId},parentStore:t,disableHover:!0,disableStyleAnnotations:!0,disableInsertedDeletedAnnotations:!0,disableDateStyleAnnotations:!0,disableSuggestionAnnotations:!0,disabled:!0,theme:n(632079).Tj,themeMode:o,emojiType:(0,n(591404).FN)(i),katex:s,formulaValueTypes:[]}),[i,e,t,s,o],{silenceRerenderDefender:!0});return(0,v.jsx)("span",{children:r})}var eA=()=>n(468765);function eT(e){let t=(0,n(327219).tz)(),{workingAgentNames:i}=e,o=(0,n(851969).Vn)({agents:i.map(e=>({activityStatus:"working",name:e})),intl:t});return(0,v.jsx)("span",{style:e_.container,children:(0,v.jsx)("span",{style:e_.label,children:(0,v.jsx)(n(861510).N,{animate:!0,colorStop:"narrow",colorVariant:"secondary",lineClamp:1,styleKey:"body",text:`${o}…`})})})}let e_={container:{display:"inline-flex",alignItems:"center",minWidth:0,flexShrink:1,overflow:"hidden"},label:{minWidth:0,overflow:"hidden"}};function eD(e){let t,i=eu();t="comment"===e.alignment?R.commentBranchOffset:"composer"===e.alignment?e.composerBranchVerticalOffset??R.composerBranchOffset:eP[e.alignment];let o=null!=i&&i.isInlineConnectingLineHovered?n(632079).Tj.border.strong:n(632079).Tj.border.secondary,s=`1px solid ${o}`,r=(0,v.jsx)("div",{"aria-hidden":!0,style:eE.inlineConnectingLineVisual,children:e.hasNext?(0,v.jsx)("div",{style:{...eE.branchContinuation,borderInlineStart:s,insetBlockStart:0,insetInlineStart:R.spineOffset}}):(0,v.jsx)("div",{style:{...eE.branchElbow,blockSize:t,borderBlockEnd:s,borderInlineStart:s,inl
1ineSize:R.elbowWidth,insetInlineStart:R.spineOffset}})});return(0,v.jsxs)("div",{style:eE.threadItem,children:[i?(0,v.jsx)(eB,{elbowWidth:R.elbowWidth,onInlineConnectingLineClick:i.onInlineConnectingLineClick,onInlineConnectingLineMouseEnter:i.onInlineConnectingLineMouseEnter,onInlineConnectingLineMouseLeave:i.onInlineConnectingLineMouseLeave,persistsWhenCollapsed:!!e.persistsWhenCollapsed,spineOffset:R.spineOffset}):void 0,r,(0,v.jsx)("div",{style:{...eE.threadItemContent,paddingInlineStart:R.contentIndent},children:e.children})]})}function eB(e){let{elbowWidth:t,onInlineConnectingLineClick:i,onInlineConnectingLineMouseEnter:o,onInlineConnectingLineMouseLeave:s,persistsWhenCollapsed:a,spineOffset:l}=e,d=r.useCallback(e=>{a||s(),i(e)},[i,s,a]),c=r.useCallback(e=>{e.preventDefault()},[]);return(0,v.jsx)(n(988022).p,{colorVariant:"tertiary",disallowTabbing:!0,hoveredStyle:eE.inlineConnectingLineButtonInteraction,onClick:d,onMouseEnter:o,onMouseLeave:s,onMouseDown:c,pressedStyle:eE.inlineConnectingLineButtonInteraction,role:"presentation",size:"xs",style:{...eE.inlineConnectingLineButton,inlineSize:t+2*eR,insetInlineStart:l-eR}})}let eR=8,eP={control:16,composer:30},eE={threadItem:{display:"flow-root",position:"relative"},threadItemContent:{minWidth:0},inlineConnectingLineVisual:{position:"absolute",inset:0,pointerEvents:"none"},branchElbow:{position:"absolute",insetBlockStart:0,borderEndStartRadius:12,boxSizing:"border-box"},branchContinuation:{position:"absolute",insetBlockEnd:0},inlineConnectingLineButton:{position:"absolute",zIndex:1,insetBlockStart:0,insetBlockEnd:0,height:"auto",paddingInlineStart:0,paddingInlineEnd:0,background:"transparent"},inlineConnectingLineButtonInteraction:{background:"transparent"}};function eF(e){let t=r.useId(),[i,o]=r.useState(!1),s=(0,n(960253).I)(()=>({icon:{transition:"transform 200ms ease-out",transform:e.isExpanded?"rotateZ(0deg)":"rotateZ(-90deg)"}}),[e.isExpanded]),a=e.isExpanded||i,l=r.useCallback(()=>{o(!0)},[]),d=r.useCallback(()=>{o(!1)},[]);return(0,v.jsxs)(v.Fragment,{children:[e.showCollapseReplyButton?(0,v.jsx)(eD,{alignment:"control",hasNext:e.isExpanded,persistsWhenCollapsed:!0,children:(0,v.jsxs)(n(988022).p,{"aria-controls":t,"aria-expanded":e.isExpanded,colorVariant:"tertiary",hoveredStyle:eO.controlButtonInteraction,onClick:e.onToggle,onMouseEnter:l,onMouseLeave:d,pressedStyle:eO.controlButtonInteraction,size:"sm",style:eO.controlButton,children:[(0,v.jsxs)(n(111010).D,{as:"span",colorVariant:"tertiary",style:{...eO.countPill,background:i?n(632079).Tj.background.interactiveTranslucent:n(632079).Tj.background.secondary},styleKey:"captionSmMedium",children:[(0,v.jsx)("span",{style:{...eO.countValue,opacity:+!a},children:e.count>99?"99+":(0,v.jsx)(n(327219).Gr,{value:e.count})}),(0,v.jsx)("span",{"aria-hidden":!0,style:{...eO.countIcon,opacity:+!!a},children:(0,v.jsx)(n(16275).I,{icon:n(595453).arrowChevronSingleDownSmallIcon,size:"xxs",colorVariant:"secondary",style:s.icon})})]}),!e.isExpanded&&e.workingAgentNames.length>0?(0,v.jsx)(eT,{workingAgentNames:e.workingAgentNames}):(0,v.jsx)(n(111010).D,{as:"span",colorVariant:i?"primary":"secondary",styleKey:"body",children:e.isExpanded?(0,v.jsx)(n(327219).sA,{...el.hideReplies,values:{replyCount:e.count}}):(0,v.jsx)(n(327219).sA,{...el.viewReplies,values:{replyCount:e.count}})})]})}):void 0,(0,v.jsx)("div",{id:t,children:e.isExpanded?e.children:void 0})]})}let eO={controlButton:{background:"transparent",gap:8,justifyContent:"flex-start",marginInlineStart:16,marginBlockStart:4,marginBlockEnd:6,paddingInlineStart:0,width:"calc(100% - 16px)"},controlButtonInteraction:{background:"transparent"},countPill:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:999,boxSizing:"border-box",flexShrink:0,position:"relative",transition:"background 100ms ease-in-out"},countValue:{transition:"opacity 100ms ease-in-out"},countIcon:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",inset:0,pointerEvents:"none",transition:"opacity 100ms ease-in-out"}},eK={position:"relative",borderStartStartRadius:8,borderStartEndRadius:8},eN={position:"absolute",insetBlockStart:"100%",insetInlineStart:0,insetInlineEnd:0,height:8,backgroundColor:"inherit",borderEndStartRadius:8,borderEndEndRadius:8,pointerEvents:"none"};function ez(e){var t;let i,{replyComposer:o}=e,{hideSidePeekButton:s}=(0,n(164333).Yz)(),{discussionStore:a}=e.thread,l="rootWithReplies"===e.thread.type?e.thread.rootCommentStore:void 0,h=r.useRef(null),f=e.commentStores[0],S=(t=e.commentStores,i=(0,n(327219).tz)(),(0,n(579993).K8)(()=>{var e,o;let s=[],r=new(n(227318)).d;for(let{commentStore:a,activity:l}of n(218744).default.checkGate({gateName:"show_agent_activity_in_comments_abcde"})?t.flatMap(e=>u(e).filter(t=>{var i;let o;return i=c().t.createChildStore(e,t.runPointer),o=i.getStatus(),void 0===t.turnStatus&&i.getDataStore().getKeyValue("current_turn_id")===t.workflowTurnId&&(0,n(761292).Nx)((0,n(761292).NF)(o??"running"))}).map(t=>({key:`${e.id}:${t.workflowTurnId}`,commentStore:e,activity:t}))):[]){if(!l)continue;
1let t=c().t.createChildStore(a,l.runPointer).getParentStore(),n=a.getSpaceStore();if(!t||!n||r.has(t.pointer))continue;r.add(t.pointer);let d=(0,g()._A)({workflowStore:t,spaceStore:n});s.push((null==(e=t.getName())?void 0:e.trim())||(null==d||null==(o=d.getDisplayName(i))?void 0:o.trim())||(0,eA().g)(i))}return s},[t,i])),b=e.commentItems.slice(1),x=(0,r.useMemo)(()=>e.commentStores.slice(1),[e.commentStores]),y=function(e){let{replyCommentStores:t,discussionLocation:i,discussionInputStore:o,replyInputBlockStore:s,discussionContainerRef:a,thread:l,draftScopeId:c,discussionIsUnread:u,pageId:p,rootCommentId:g,commentForNewBarId:h}=e,{discussionStore:f}=l,v=(0,n(533992).v3)(),S=(0,n(633636).wM)(),b=(0,n(579993).K8)(()=>{var e;return 0===t.length&&void 0===f.getPropertyId()&&!!(null==(e=f.getParentStore())?void 0:e.isNavigableBlock())},[f,t.length]),x=m(s,{animate:!1}),y=(0,n(579993).O$)(n(421026).WZ),C=null==y?void 0:y.targetCommentId,k=(0,n(579993).K8)(()=>{var e;return void 0!==y&&(void 0===C?g===(null==(e=f.getFirstComment())?void 0:e.id):C===g||t.some(e=>e.id===C))},[f,y,C,t,g]),I="page_discussion"===i&&(null==y?void 0:y.discussionId)===f.id&&y.pageId===p&&y.shouldExpandReplies&&k,w=(null==y?void 0:y.shouldFlash)??!0,j=(0,n(579993).K8)(()=>{if(!I||void 0===C)return!1;let e=f.getCommentStores().find(e=>e.id===C);return void 0!==e&&!e.isDefined()},[f,C,I]),L=(0,n(579993).K8)(()=>{var e;return function(e){let{blockId:t,discussionStore:i,draftScopeId:o,userId:s}=e;if(!s)return!1;let r=(0,n(249400).EI)({blockId:t,parentStoreId:i.id,discussionId:o??i.id});return void 0!==(0,n(249400).lN)({userId:s,primaryKey:r.primaryKey,legacyKey:r.legacyKey})}({blockId:(null==(e=s.getNavigableBlockStore())?void 0:e.id)??s.id,discussionStore:f,draftScopeId:c,userId:v.currentUser.id})},[f,c,v.currentUser.id,s]),[M,A]=r.useState(()=>L),T=r.useRef(M);r.useLayoutEffect(()=>{let e=T.current&&!M;T.current=M;let t=a.current;e&&t&&(0,n(564095).scrollIntoViewIfNeeded)({element:t,environment:v,blockAlignment:"start",behavior:"instant"})},[a,v,M]);let _=r.useCallback(e=>{let t=f.pointer.spaceId;(0,n(323517).createAndCommit)({userAction:e,environment:v,canUndo:!1,cellTarget:t?{spaceWithId:t}:void 0,perform:e=>{(0,n(737146).U)({transaction:e,thread:l})}})},[f,v,l]),D=r.useRef(!1),B=r.useCallback(()=>{D.current&&(D.current=!1,_("TimelineInlineDiscussion.navigateAway"))},[_]);r.useEffect(()=>{u||(D.current=!1)},[u]),r.useEffect(()=>{let e=a.current;return()=>{null!=e&&e.isConnected||B()}},[a,B]);let R=r.useCallback(()=>{M||(b?_("TimelineInlineDiscussion.openTopLevelDiscussion"):u&&(D.current=!0),A(!0))},[u,_,b,M]);r.useLayoutEffect(()=>{I&&(M&&u?D.current=!0:R())},[u,R,M,I]),r.useLayoutEffect(()=>{if(!I||!M||j)return;let e=a.current;if(!e)return;let t=C??h??g,o=t?d().A.findInteractive(S,e=>e.commentId===t&&e.discussionLocation===i):void 0,s=null==o?void 0:o.getNode(),r=s instanceof Element?s:e;(0,n(564095).scrollIntoViewIfNeeded)({element:r,environment:v,blockAlignment:"center",behavior:"instant"}),w&&(void 0!==C&&s instanceof Element?(0,n(486192).GZ)(s,{borderRadius:8}):(0,n(486192).GZ)(e)),(0,n(421026).Wz)({tabId:S,discussionId:f.id,pageId:p})},[h,a,i,f.id,v,C,j,p,M,g,w,I,S]);let P=r.useCallback(async e=>{if(e.stopPropagation(),!M){(0,n(104310).u)({event:{eventName:"expand_discussion_replies",eventProperties:{discussion_id:f.id,discussion_type:f.getType(),from:i,parent_block_id:f.getParentId()}}}),R();return}for(let e of t){let t=d().A.findInteractive(S,t=>t.commentId===e.id&&t.discussionLocation===i);if(null!=t&&t.isEditing()&&!await t.handleCancelEdit())return}D.current&&(D.current=!1,_("TimelineInlineDiscussion.collapseReplies")),I&&(0,n(421026).Wz)({tabId:S,discussionId:f.id,pageId:p}),A(!1)},[i,f,R,_,p,M,t,I,S]),E=r.useCallback(async()=>{await (0,n(745990).M)({discussionInputStore:o,environment:v}),x()},[o,v,x]);return{handleReply:r.useCallback(e=>{e.stopPropagation(),(0,n(104310).u)({event:{eventName:"click_discussion_reply",eventProperties:{discussion_id:f.id,discussion_type:f.getType(),from:i,parent_block_id:f.getParentId()}}}),R(),E()},[i,f,R,E]),handleToggleReplies:P,repliesExpanded:M}}({replyCommentStores:x,discussionLocation:e.discussionLocation,discussionInputStore:o.discussionInputStore,replyInputBlockStore:o.blockStore,discu
1ssionContainerRef:h,thread:e.thread,draftScopeId:null==l?void 0:l.id,discussionIsUnread:e.showUnreadStatusDot,pageId:e.blockStore.id,rootCommentId:null==f?void 0:f.id,commentForNewBarId:e.commentForNewBarId}),C=(0,n(499909).y)(e.blockStore),I=p({blockStore:e.blockStore}),w=function({blockStore:e,thread:t,discussionLocation:i,rootCommentId:o}){let s=(0,n(533992).v3)(),a=(0,n(174720).C)(),{discussionStore:l}=t,d=(0,r.useMemo)(()=>a&&"rootWithReplies"===t.type?t:{type:"discussion",discussionStore:l},[a,t,l]),c=(0,n(579993).K8)(()=>e.getNavigableBlockStore(),[e]),u=(0,n(579993).K8)(()=>{var e;if(void 0!==l.getPropertyId()||!(null!=(e=l.getParentStore())&&e.isNavigableBlock()))return!1;let t=l.getCommentStoresSortedByCreatedTime().filter(e=>e.isDefined()&&!!e.getAlive());return"discussion"===d.type?t.length<=1:(d.type,!t.some(e=>{var t;return(null==(t=e.getReplyToPointer())?void 0:t.id)===d.rootCommentStore.id}))},[l,d]),m=(0,n(579993).K8)(()=>!!c&&!!o&&(0,n(587689).Zz)({discussionStore:l,rootCommentId:o}),[c,l,o]),p=(0,r.useCallback)(()=>{if(!u)return;let e=l.pointer.spaceId;(0,n(323517).createAndCommit)({userAction:"TimelineDiscussionSidePeek.markReadOnInteraction",environment:s,canUndo:!1,cellTarget:e?{spaceWithId:e}:void 0,perform:e=>{(0,n(737146).U)({transaction:e,thread:d})}})},[l,s,u,d]),g=(0,r.useCallback)(e=>{if(e.stopPropagation(),o){if(m)return void(0,n(587689).AS)({environment:s});c&&((0,n(104310).u)({event:{eventName:"open_discussion_side_peek",eventProperties:{discussion_id:l.id,discussion_type:l.getType(),from:i,parent_block_id:l.getParentId()}}}),p(),(0,n(587689).wk)({environment:s,blockStore:c,discussionStore:l,rootCommentId:o,viewMode:"sidePeek",initialScrollPosition:"top"}))}},[i,l,s,m,p,c,o]),h=(0,r.useCallback)(e=>{e.stopPropagation(),o&&((0,n(104310).u)({event:{eventName:"click_discussion_reply",eventProperties:{discussion_id:l.id,discussion_type:l.getType(),from:i,parent_block_id:l.getParentId()}}}),p(),(0,n(587689).iT)({discussionStore:l,rootCommentId:o}))},[i,l,p,o]);return c&&o?{isOpen:m,onReply:h,onToggle:g}:void 0}({blockStore:e.blockStore,thread:e.thread,discussionLocation:e.discussionLocation,rootCommentId:null==f?void 0:f.id}),j=void 0===e.timelineReplyInputPaddingVariant?void 0:18,L=(0,n(579993).K8)(()=>(0,n(39227).bk)([e.thread]),[e.thread]),M=x.length+L,T=void 0!==o.discussionInput&&!o.discussionIsResolved&&!I&&C,_=!e.repliesCollapsible||y.repliesExpanded,D=T&&_,B=M>0||D;if(!f)return null;let R=e.isSuggestionDiscussion?(0,v.jsx)(eL,{discussionStore:a,collapsed:!!e.collapsed}):e.shouldShowDiscussionContext?(0,v.jsx)(A,{format:e.format,discussionLocation:e.discussionLocation,store:a,blockStore:e.blockStore,onClick:e.onContextClick,forceRichContextPreview:e.showAnchoredContentPreview,isOrphaned:e.isOrphaned}):void 0,P=!s&&function({repliesCollapsible:e,discussionLocation:t,sidePeekIsOpen:n}){if(!e)return!1;if(n)return!0;switch(t){case"block_menu":case"updates_sidebar":return!1;default:return!0}}({repliesCollapsible:e.repliesCollapsible,discussionLocation:e.discussionLocation,sidePeekIsOpen:(null==w?void 0:w.isOpen)??!1})?"visible":"hidden",E={onReply:T?y.handleReply:void 0,sidePeek:w,sidePeekActionVisibility:P};return(0,v.jsx)(ec,{enabled:B&&e.repliesCollapsible,isExpanded:_,onToggle:y.handleToggleReplies,replyCount:M,children:(0,v.jsxs)("div",{ref:h,style:eK,children:[(0,v.jsx)("div",{"aria-hidden":!0,style:eN}),(0,v.jsx)(eb,{store:f,thread:e.thread,blockStore:e.blockStore,hoveringDiscussion:e.hoveringDiscussion,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,discussionContext:R,shouldShowThreadLine:!1,shouldShowReplyThreadLine:B,isSuggestionComment:e.isSuggestionDiscussion,collapsed:e.collapsed,showUnreadStatusDot:e.showUnreadStatusDot,showMarkAsRead:e.showUnreadStatusDot,isOrphaned:e.isOrphaned,timelineActions:E}),M>0?(0,v.jsx)(eF,{count:M,workingAgentNames:S,isExpanded:_,onToggle:y.handleToggleReplies,showCollapseReplyButton:e.repliesCollapsible,children:b.map((t,n)=>{let{commentStore:i}=t,o=i.id===e.commentForNewBarId;return(0,v.jsx)(eD,{alignment:"comment",hasNext:n<b.length-1||D,children:t.activity?(0,v.jsx)(k,{runParentCommentStore:i,activity:t.activity,discussionLocation:e.discussionLocation,shouldShowThreadLine:!1}):(0,v.jsx)(eb,{store:i,thread:e.thread,blockStore:e.blockStore,hoveringDiscussion:e.hoveringDiscussion,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,showNewBar:o,newBarLayout:0===n?"below-replies-toggle":"between-comments",shouldShowThreadLine:!1,showUnreadStatusDot:!1,showMarkAsRead:e.showUnreadStatusDot,isOrphaned:e.isOrphaned})},t.key)})}):void 0,D?(0,v.jsx)(eD,{alignment:"composer",composerBranchVerticalOffset:j,hasNext:!1,children:o.discussionInput}):void 0]})})}let eU={display:"flex",flexDirection:"column",maxHeight:500},eW={position:"relative"},eV={height:8};function eH(e){let{blockStore:t,discussionStore:i,collapsed:o}=e,s=(0,n(112523).N)({blockStore:t,discussionStore:i,rootCommentStore:void 0});return(0,v.jsx)(n(180984).V,{typingUserIds:s,blockStore:t,variant:o?"marginCollapsed":"margin"})}let eJ=r.memo(function(e){let{onDismiss:t}=e,i=(0,r.useMemo)(()=>
1e.thread??{type:"discussion",discussionStore:e.store},[e.thread,e.store]),{discussionStore:o}=i,s="rootWithReplies"===i.type?i.rootCommentStore:void 0,l=(0,r.useRef)(null),g=(0,n(327219).tz)(),h=(0,n(533992).v3)(),f=(0,n(633636).wM)(),S=(0,n(764047).Ul)(),b=(0,n(579993).K8)(()=>"suggestion"===o.getType(),[o]),x=(0,n(579993).K8)(()=>(0,n(713707).U2)(i),[i],{equalityFn:n(134542).kt}),y=(0,n(579993).K8)(()=>x.filter(e=>e.isDefined()&&!!e.getAlive()),[x]),C=(0,n(579993).K8)(()=>n(218744).default.checkGate({gateName:"show_agent_activity_in_comments_abcde"})?y.flatMap((e,t)=>{let i=u(e).filter(e=>!function(e){let{activity:t,commentStores:i,triggerCommentIndex:o}=e,s=i[o],r=i[o+1];return!!s&&!!r&&s.getParentId()===r.getParentId()&&(function(e){let{activity:t,commentStore:i}=e,o=i.getDisplayName();if(!i.getAlive()||"bot"!==i.getCreatedByTable()||(null==o?void 0:o.type)!=="agent"||i.getSpaceId()!==t.runPointer.spaceId)return!1;let s=c().t.createChildStore(i,t.runPointer),r=s.getParentStore();return void 0!==r&&o.agent.workflowId===r.id&&o.agent.threadId===s.getDataStore().getKeyValue("thread_id")&&i.getCreatedById()===(0,n(150410).getBotIdFromStore)(r)}({activity:t,commentStore:r})||u(r).some(e=>e.workflowTurnId===t.workflowTurnId&&e.runPointer.id===t.runPointer.id&&e.runPointer.spaceId===t.runPointer.spaceId))}({activity:e,commentStores:y,triggerCommentIndex:t}));return[{key:e.id,commentStore:e},...i.map(t=>({key:`${e.id}:${t.workflowTurnId}`,commentStore:e,activity:t}))]}):y.map(e=>({key:e.id,commentStore:e})),[y],{equalityFn:n(134542).kt}),I="page_discussion"===e.discussionLocation?3:5;(0,r.useEffect)(()=>{y.length===I&&O(!0)},[y,I]);let j=(0,r.useRef)(e.discussionInputStore||new(n(478597)).w(h,o.pointer.spaceId)).current,L=(0,n(174720).H)(),M=L&&"none"!==e.inlineCommentRepliesMode,_=(0,n(579993).K8)(()=>(0,a().inputIsEmpty)(j),[j]),B=p({blockStore:e.blockStore}),R=(0,n(579993).K8)(()=>(0,n(713707).CB)(i),[i]),[P,E]=(0,r.useState)(!1),[F,O]=(0,r.useState)(void 0!==e.collapsed&&!e.collapsed),[K,N]=(0,r.useState)(!0),z=(0,n(579993).uB)(void 0,n(593423).A),U=(0,n(579993).K8)(()=>z.state.clientRect,[z]),W=e.format===a().DiscussionFormat.Sidebar,V=e.format===a().DiscussionFormat.Margin,H=e.format===a().DiscussionFormat.Menu,J=H&&M,G="margin_comments"===e.discussionLocation,$=function(e){if(e.commentsInTimelineEnabled){if("page_discussion"===e.discussionLocation)return"page";if("updates_sidebar"===e.discussionLocation||e.isInlineCollectionPageDiscussionInBlockMenu)return"inset"}}({commentsInTimelineEnabled:L,discussionLocation:e.discussionLocation,isInlineCollectionPageDiscussionInBlockMenu:J}),Y=(0,n(579993).K8)(()=>{var t;return!(void 0===o.getPropertyId()&&(J&&o.getParentId()===e.blockStore.id||("discussion_sidepeek"===e.discussionLocation||L&&W)&&(null==(t=o.getParentStore())?void 0:t.isNavigableBlock())))&&(H||W||!!e.showAnchoredContentPreview)},[L,J,H,W,e.blockStore.id,e.discussionLocation,e.showAnchoredContentPreview,o]),q=(0,r.useRef)(null);(0,n(336494).b)(n(115995).A,()=>({tabScopeOwner:S,isSidebarFormat:()=>W,isMarginFormat:()=>V,isMenuFormat:()=>H,getStore:()=>o,getCommentThreadRootStore:()=>s,getInputStore:()=>j,getNode:()=>q.current,getMarginDiscussionScrollContainer:()=>l.current}),[S,W,V,o,s,j]);let X=(0,n(579993).K8)(()=>(0,n(47354).sC)({discussionStore:o,navigableBlockStore:e.blockStore.getNavigableBlockStore(),thread:i}),[o,e.blockStore,i]),Z=(0,n(579993).K8)(()=>{var e,t;if(!X)return;let o=(null==(e=(0,n(47354).XK)(i))?void 0:e.getLastSeenAt())??n(218744).default.getConfigKey("assume_comment_read","last_seen_at");if(void 0!==o)return null==(t=y.find(e=>e.getCreatedTime()>o))?void 0:t.id},[y,i,X]),Q=(0,r.useCallback)(()=>{if(F||y.length<=I||"block_menu"===e.discussionLocation)return y;if("page_discussion"===e.discussionLocation)return y.slice(-1);let t=[e.showAllRepliesAfterTimestamp].filter(n(48697).O9),i=t.length>0?Math.min(...t):void 0;if(!i)return y.slice(-2);{let e=y.filter(e=>(e.getCreatedTime()||0)>i),t=y.filter(e=>(e.getCreatedTime()||0)<=i);return t.length<=5?y:[...t.slice(-2),...e]}},[y,I,e.discussionLocation,e.showAllRepliesAfterTimestamp,F]),ee=(0,n(579993).K8)(()=>{let e=new Set(Q().map(e=>e.id)),t=C.filter(t=>e.has(t.commentStore.id)),i=y.filter(t=>!e.has(t.id));return{commentStores:y,commentsToShow:t,commentsToCollapse:i,reactionsToShow:n(868249).L.getUserVisibleReactions(o)}},[C,y,Q,o],{equalityFn:n(931576).n}),et=ee.commentsToCollapse.length>0,en=(0,r.useCallback)(()=>
1{if(!o.isDefined())return;let e=o.getContext();if(!e)return;let t=(0,n(353711).l8)({discussionContextData:e,discussionType:(0,n(148337).o9)(o.getType()),discussionId:o.id,intl:g});return n(247438).JJ$(t,e=>!n(247438).iQL(e)||n(247438).Orm(e)===o.id)},[o,g]),ei=(0,r.useRef)(null),eo=(0,r.useRef)(e.blockStore.clone()).current,es=async({files:e})=>{ei.current&&await ei.current.uploadFiles(e)},er=(0,n(233633).C)({type:"discussionFormat",format:e.format}),ea=ee.reactionsToShow.length>0,el=(0,n(960253).I)(()=>{var t;return{discussionWrapper:{...e.format===a().DiscussionFormat.Page&&{marginTop:6*!!ea,marginInlineEnd:-16,marginInlineStart:-16,marginBottom:"compact"===(t={hasReactionsToShow:ea,pageBottomSpacing:e.pageBottomSpacing}).pageBottomSpacing?4:t.hasReactionsToShow?6:16,..."feed_item_top_level_discussion"===e.discussionLocation&&{marginInlineStart:-16,marginBottom:12*!ea}},...e.format===a().DiscussionFormat.Menu&&(J?{marginInlineStart:-2}:{padding:"6px 0 12px",marginInlineStart:er?0:-2,boxShadow:e.isFirst?"none":`0 -1px 0 ${n(632079).Tj.border.secondaryTranslucent}`,marginTop:+!e.isFirst}),...e.format===a().DiscussionFormat.Margin&&{padding:"4px 0",borderRadius:8}},reactionBarWrapper:{paddingInlineStart:16,paddingInlineEnd:16,..."feed_item_top_level_discussion"===e.discussionLocation&&{display:"flex",justifyContent:"space-between"}},discussionContainer:{...e.format===a().DiscussionFormat.Page&&{borderRadius:8}}}},[ea,e.discussionLocation,e.format,e.isFirst,e.pageBottomSpacing,er,J]);(0,r.useEffect)(()=>{var e;void 0!==(e=en())&&n(247438).IcF(e).length>0&&n(406921).V.load()},[en]);let ed=(0,r.useCallback)(e=>{if(!n(139424).A.isMobile||!o.isDefined())return;e.stopPropagation(),e.preventDefault(),n(718106).W.setState({open:!1});let t=(0,n(960408).oE)(n(240414).T.findSelectablesFromIds([o.getParentId()])),i=null==t?void 0:t[0];i&&(0,n(840529).p)({environment:h,handle:i,vertical:{reveal:"bottom"},horizontal:{reveal:"closest"},animate:!0})},[o,h]),ec=(0,r.useCallback)(e=>{V||(e.stopPropagation(),O(!0))},[V]),eu=(0,r.useMemo)(()=>{let{commentStores:t,commentsToShow:d,commentsToCollapse:c}=ee;if(V){let s,d,c,u,m,p,g;return e.collapsed?(s=(0,a().lineClampForCommentCount)(t.length),c=(d=t[0])&&(0,v.jsx)(r.Fragment,{children:(0,v.jsx)(eb,{store:d,thread:i,blockStore:e.blockStore,hoveringDiscussion:P,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,maxLines:s,collapsed:e.collapsed,shouldShowThreadLine:1!==t.length,discussionContext:b?(0,v.jsx)(eL,{discussionStore:o,collapsed:!!e.collapsed}):void 0,isSuggestionComment:b,showUnreadStatusDot:X,showMarkAsRead:X,isOrphaned:e.isOrphaned??!1})},d.id),u=t[t.length-1],m=t.length>1&&u?(0,v.jsx)(r.Fragment,{children:(0,v.jsx)(eb,{store:u,thread:i,blockStore:e.blockStore,hoveringDiscussion:P,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,maxLines:s,collapsed:e.collapsed,shouldShowThreadLine:!1,showUnreadStatusDot:!1,showMarkAsRead:!1,showNewBar:u.id===Z})},u.id):void 0,p=t.length-2,(0,v.jsxs)(v.Fragment,{children:[c,(0,v.jsx)(ew,{insetButton:!V,count:p,onClick:ec,discussionLocation:e.discussionLocation,showNewBadge:t.some((e,n)=>e.id===Z&&0!==n&&n!==t.length-1)}),m]})):(g=(0,a().lineClampForCommentCount)(t.length),(0,v.jsx)(n(879836).H,{style:eU,ref:l,type:n(644154).A.Y,store:z,children:C.map((t,n)=>{let{commentStore:s}=t;if(t.activity)return(0,v.jsx)(k,{runParentCommentStore:s,activity:t.activity,discussionLocation:e.discussionLocation,shouldShowThreadLine:n!==C.length-1},t.key);let a=b&&0===n;return(0,v.jsx)(r.Fragment,{children:(0,v.jsx)(eb,{store:s,thread:i,blockStore:e.blockStore,hoveringDiscussion:P,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,maxLines:g,shouldShowThreadLine:n!==C.length-1,discussionContext:a?(0,v.jsx)(eL,{discussionStore:o,collapsed:!!e.collapsed}):void 0,showNewBar:s.id===Z&&0!==n,isSuggestionComment:a,showUnreadStatusDot:0===n&&X,showMarkAsRead:X,isOrphaned:e.isOrphaned??!1})},s.id)})}))}let u="feed_item_top_level_discussion"===e.discussionLocation?(0,a().lineClampForCommentCount)(d.filter(e=>!e.activity).length):void 0,m=d.map((t,n)=>{let{commentStore:a}=t;if(t.activity)return(0,v.jsx)(k,{runParentCommentStore:a,activity:t.activity,discussionLocation:e.discussionLocation,shouldShowThreadLine:n!==d.length-1},t.key);let l=b&&0===n,c=0===n&&!et,m=l?(0,v.jsx)(eL,{discussionStore:o,c
1ollapsed:!!e.collapsed}):c&&Y&&(0,v.jsx)(A,{format:e.format,discussionLocation:e.discussionLocation,store:o,blockStore:e.blockStore,onClick:ed,forceRichContextPreview:!!e.showAnchoredContentPreview,isOrphaned:e.isOrphaned??!1});return(0,v.jsx)(r.Fragment,{children:(0,v.jsx)(eb,{store:a,thread:i,blockStore:e.blockStore,hoveringDiscussion:P,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,discussionContext:m,isSuggestionComment:l,showNewBar:a.id===Z&&!c,shouldShowThreadLine:n!==d.length-1,showSidePeekRootDivider:(null==s?void 0:s.id)===a.id,maxLines:u,showUnreadStatusDot:c&&X,showMarkAsRead:X,isOrphaned:e.isOrphaned??!1})},a.id)}),p=t[0],g=b?(0,v.jsx)(eL,{discussionStore:o,collapsed:!!e.collapsed}):Y&&(0,v.jsx)(A,{format:e.format,discussionLocation:e.discussionLocation,store:o,blockStore:e.blockStore,onClick:ed,forceRichContextPreview:!!e.showAnchoredContentPreview,isOrphaned:e.isOrphaned??!1}),h=p&&(0,v.jsx)(r.Fragment,{children:(0,v.jsx)(eb,{store:p,thread:i,blockStore:e.blockStore,hoveringDiscussion:P,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,discussionContext:g,shouldShowThreadLine:1!==t.length,showSidePeekRootDivider:(null==s?void 0:s.id)===p.id,isSuggestionComment:b,collapsed:e.collapsed,maxLines:u,showUnreadStatusDot:X,showMarkAsRead:X,isOrphaned:e.isOrphaned??!1})},p.id);return(0,v.jsxs)("div",{style:{...eW,...el.discussionContainer},children:[et?h:void 0,(0,v.jsx)(ew,{insetButton:!V,count:c.length-1,showNewBadge:c.some((e,n)=>e.id===Z&&0!==n&&n!==t.length-1),onClick:ec,discussionLocation:e.discussionLocation}),m]})},[C,ee.commentStores,ee.commentsToShow,ee.commentsToCollapse,V,Y,b,et,o,i,e.collapsed,e.format,e.discu
1ssionLocation,e.blockStore,e.showResolveButtonByDefaultIfPossible,e.showAnchoredContentPreview,null==s?void 0:s.id,ed,el.discussionContainer,P,X,ec,Z,z,e.isOrphaned]),[em,ep]=(0,r.useState)(!0);(0,r.useEffect)(()=>{var e;let t=null==(e=l.current)?void 0:e.getNode();if(t&&U){function i(){t&&ep(50>Math.abs((0,n(81422).W)(t)))}return i(),t.addEventListener("scroll",i),()=>t.removeEventListener("scroll",i)}},[U,l]);let eg=K&&!e.collapsed&&V&&U&&!em,eh=m(eo),ef=(0,r.useCallback)(()=>{j.reset()},[j]),ev=(0,r.useCallback)(()=>{let t=h.currentUser.id;if(!t)return;let i=x.filter(e=>e.getCreatedById()===t),o=i.at(-1);if(!o||b&&1===i.length)return;let s=d().A.findInteractive(f,t=>t.commentId===o.id&&t.discussionLocation===e.discussionLocation);s&&((0,n(525779).clear)({environment:h}),s.edit())},[x,e.discussionLocation,b,h,f]),eS=(0,r.useCallback)(async()=>{if((0,a().hasCommentChanged)(j)){let{accept:e}=await n(647095).Gh({message:(0,v.jsx)(n(327219).sA,{defaultMessage:"Do you want to discard this reply?",id:"discussion.confirmDialog.discardReply.prompt"}),acceptLabel:(0,v.jsx)(n(327219).sA,{defaultMessage:"Discard",id:"discussion.confirmDialog.discardReplyButton.label"})});e?(ef(),t&&t()):(await n(374176).default.afterNextFlush(),(0,n(739204).z)({store:j.state.textStore}))}else ef(),t&&t()},[t,j,ef]),ex=(0,r.useCallback)(()=>{n(374176).default.afterNextFlush(()=>{var e;let t=null==(e=l.current)?void 0:e.getNode();t&&(0,n(661767).V)({element:t,environment:h,options:{top:t.scrollHeight,behavior:"smooth"}})})},[l,h]),ey=n(960408).sg(()=>{setTimeout(()=>N(!0),50)},50),eC=(0,r.useCallback)(async()=>{N(!1);let t=o.pointer.spaceId;(0,n(15289).o)({action:"write_comment",space_id:t},i=>(0,n(323517).createAndCommit)({userAction:"Discussion.handleSubmitReply",environment:h,canUndo:!0,cellTarget:t?{spaceWithId:t}:void 0,perform:t=>{i.trackTransaction(t),n(187819).lV({environment:h,discussionStore:o,textValue:j.state.textStore.getValue()||[],transaction:t,discussionLocation:e.discussionLocation,files:j.state.files,property_id:o.getPropertyId(),blockStore:e.blockStore,replyToCommentStore:s}),L||(0,n(737146).U)({transaction:t,thread:{type:"discussion",discu
1ssionStore:o}})}})),ef(),(0,n(525779).clear)({environment:h}),ex(),ey(),n(139424).A.isMobile||(await n(374176).default.afterNextFlush(),(0,n(940763).e)({store:j.state.textStore}))},[j,ey,e.blockStore,o,e.discussionLocation,s,ex,L,h,ef]),eI=(0,r.useCallback)(()=>{n(395364).A.state||E(!0)},[]),ej=(0,r.useCallback)(()=>{E(!1)},[]);if(0===ee.commentsToShow.length&&ea)return(0,v.jsxs)("div",{ref:q,style:{...el.discussionWrapper,...el.reactionBarWrapper},onMouseMove:eI,onMouseLeave:ej,children:[Y?(0,v.jsx)(D,{discussionStore:o,blockStore:e.blockStore,discussionLocation:e.discussionLocation,hoveringDiscussion:P,discussionContext:(0,v.jsx)(A,{format:e.format,discussionLocation:e.discussionLocation,store:o,blockStore:e.blockStore,onClick:ed,isOrphaned:e.isOrphaned??!1})}):(0,v.jsx)(T().tx,{focused:!0,disableShadow:!0,parentStore:o,discussionLocation:e.discussionLocation}),"feed_item_top_level_discussion"===e.discussionLocation&&e.pageVisitStore&&e.presenceStore?(0,v.jsx)(n(247210).hJ,{pageVisitStore:e.pageVisitStore,presenceStore:e.presenceStore,rootStore:e.blockStore,maxUsers:5,isShowingInFeed:!0}):void 0]});let eM=R||e.hideReplyInput?e.hideReplyInput?void 0:(0,v.jsx)("div",{style:eV}):(0,v.jsx)(ek,{ref:ei,shouldUseInlineTimelineReplies:M,timelineReplyInputPaddingVariant:$,showMoreCommentsButton:!!eg,onMoreCommentsClick:ex,inputVisible:M||!B&&(!e.collapsed||!_||"feed_item_top_level_discussion"===e.discussionLocation),store:o,rootCommentId:null==s?void 0:s.id,blockStore:eo,format:e.format,discussionInputStore:j,discussionLocation:e.discussionLocation,onCancel:eS,onSubmit:eC,onEditPreviousComment:ev,showCtaButtons:!!V||void 0,onFileUploaded:eh}),eA=M?(0,v.jsx)(ez,{thread:i,commentStores:ee.commentStores,commentItems:C,blockStore:e.blockStore,format:e.format,discussionLocation:e.discussionLocation,timelineReplyInputPaddingVariant:$,hoveringDiscussion:P,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,shouldShowDiscussionContext:Y,onContextClick:ed,showAnchoredContentPreview:!!e.showAnchoredContentPreview,isOrphaned:e.isOrphaned??!1,collapsed:e.collapsed,repliesCollapsible:"collapsible"===e.inlineCommentRepliesMode,isSuggestionDiscussion:b,showUnreadStatusDot:X,commentForNewBarId:Z,replyComposer:{blockStore:eo,discussionInput:eM,discussionInputStore:j,discussionIsResolved:R}}):eu;return(0,v.jsx)(n(365711).Ay,{store:eo,analyticsName:"discussion",canNativeDropOnto:!0,onNativeDrop:es,keepTextSelectionOnDrop:!0,shouldShowDropZone:!0,children:(0,v.jsxs)("div",{ref:q,style:el.discussionWrapper,onMouseMove:eI,onMouseLeave:ej,dir:(0,n(377385).A1)()?"rtl":"ltr",children:[e.collapsed?void 0:(0,v.jsx)(w,{commentStore:x[0],discussionLocation:e.discussionLocation}),eA,G?(0,v.jsx)(eH,{blockStore:e.blockStore,discussionStore:o,collapsed:!!e.collapsed}):void 0,M?void 0:eM]})})});function eG(e){let{store:t,targetDiscussionStore:i,from:o,discussionLocation:s,showAgentActivity:a,onDiscussionCreated:l}=e,d=(0,n(533992).v3)(),c=(0,n(764047).Ul)(),u=(0,n(633636).wM)(),m=ex(),p=a&&!m,g=(0,n(579993).K8)(()=>t.getSpaceId(),[t]),h=(0,r.useMemo)(()=>new(n(478597)).w(d,g),[d,g]),f=(0,r.useRef)(null),S=(0,r.useRef)(null),b=(0,r.useCallback)(()=>{(0,n(525779).clear)({environment:d})},[d]),x=function(e){let{environment:t,discussionInputStore:i,store:o,targetDiscussionStore:s,from:a,discussionLocation:l,onDiscussionCreated:d}=e,c=(0,n(633636).wM)(),u=(0,n(174720).C)(),m=(0,n(579993).uB)(void 0,n(823756).n),p=(0,r.useCallback)(e=>{let i=o.id;n(898128).q.getForTab(c).setToggleState({environment:t,type:"discussion",id:i},e)},[t,o.id,c]);return(0,r.useCallback)(async()=>{let e,r=i.state.textStore.getValue(),g=i.state.files;if((!r||0===r.length)&&0===g.length)return;let h=await n(864850).T.formulas.load(),f=o.getSpaceId(),v=t.idCreator.getSpaceIdCreatorSync(f),S=(0,n(772590).k)()&&!u&&"page_discussion"===a,b=(0,n(643646)._O)({spaceIdCreator:v,pageId:o.id}).id,x=s??(b&&!S?n(581068).c.createChildStore(o,{table:n(832375).$YH,id:b,spaceId:f}):void 0);await (null==x?void 0:x.load());let y=!S&&!(null!=x&&x.getResolved()),{performResult:C}=(0,n(15289).o)({action:"write_comment",space_id:f},i=>(0,n(323517).createAndCommit)({userAction:"PageDiscussion.useSubmitNewDiscussion",environment:t,cellTarget:{spaceWithId:f},canUndo:!0,perform:s=>(i.trackTransaction(s),u&&null!=x&&x.isDefined())?(e=(0,n(187819).lV)({environment:t,discussionStore:x,textValue:r||[],transaction:s,discussionLocation:l,files:g,blockStore:o}),x):(0,n(151002).i)({discussionId:y?b:void 0,environment:t,type:"default",blockStore:o,c
1ommentTextValue:r||[],transaction:s,files:g,formulasModule:h,fromOverride:a}),skipUpdatingEditedMetadata:!0}));if(i.reset(),C&&(null==d||d(C)),m.setState({...m.state,forceDiscussionOpen:!1}),p(!0),C&&!n(139424).A.isMobile){await n(374176).default.afterNextFlush();let t=n(115995).A.findInteractive(c,t=>{var n;return t.getStore().id===C.id&&(void 0===e||(null==(n=t.getCommentThreadRootStore())?void 0:n.id)===e.id)});t&&(0,n(739204).z)({store:t.getInputStore().state.textStore})}},[i,s,t,m,p,o,c,a,l,u,d])}({environment:d,discussionInputStore:h,store:t,targetDiscussionStore:i,from:o,discussionLocation:s,onDiscussionCreated:l});(0,n(336494).b)(n(24296).j,()=>({tabScopeOwner:c,getNode:()=>f.current,getBlockStore:()=>t,getInputStore:()=>h,flashAgentActivityStatus:()=>(0,n(755521).KU)(S.current)}),[c,h,t]);let{value:y}=(0,n(552709).fJ)(n(656915).commentsDependency),C=(0,n(851969).fV)({blockStore:t,enabled:p}),{displayedActivityStatus:k,popupStore:I}=(0,n(755521).Tk)({agents:C.agents??[]});return((0,r.useEffect)(()=>{k&&n(24296).j.hasPendingAgentActivityStatusFlash(u,t.id)&&(0,n(755521).KU)(S.current)&&n(24296).j.clearPendingAgentActivityStatusFlash(u,t.id)},[k,t.id,u]),(0,r.useEffect)(()=>()=>{n(24296).j.clearPendingAgentActivityStatusFlash(u,t.id)},[t.id,u]),y)?(0,v.jsxs)(n(4458).VP,{gap:4,ref:f,children:[p&&k?(0,v.jsx)(n(4458).fI,{paddingBottom:6,children:(0,v.jsx)(n(755521).UX,{agents:k.agents,spaceId:t.pointer.spaceId,popupStore:I,triggerRef:S,impressionContext:"page_discussion"===o?{from:"page_discussion",page_id:t.id}:void 0})}):void 0,(0,v.jsx)(n(656915).bd,{showAvatar:!0,parentStore:t,rootCommentId:void 0,onSubmit:x,onCancel:b,discussionInputStore:h,discussionFormat:y.discussionHelpers.DiscussionFormat.Page,isMobileSlideUpMenu:!1,shouldSaveUnsentComments:!0,canDrop:!0,blockStore:t,discussionLocation:s})]}):null}let e$="block_menu",eY={paddingInline:"14px",marginTop:12,paddingBottom:4};function eq(e){let t=(0,n(633636).wM)(),i=(0,n(422839).A)({discussionLocation:e$,blockStore:e.blockStore}),o=(0,n(174720).C)(),s=(0,n(83208).X)("oldest_first_discussion_threads")||i,r=(0,n(579993).K8)(()=>n(332190).zG.state.open&&n(827862).J.state.overlapsExistingDiscussionMenu,[]),d=(0,n(579993).O$)(n(575125).Jd),c=d.open&&d.tab===n(575125).cx.Open,u=d.open&&d.keepNewDiscussionAtBottom&&!s,m=(0,n(579993).K8)(()=>s?(0,n(125824).ez)(e.discussionStores):e.discussionStores,[e.discussionStores,s]),p=(0,n(579993).K8)(()=>{if(o&&i)return m.find(e=>{let t=0===e.getCommentPointers().length&&e.getReactions().length>0;return(0,n(713707).qn)(e)&&!t})},[m,o,i]);if(0===e.discussionStores.length)return null;let g=u?e.discussionStores[0]:void 0,h=g?m.filter(e=>e.id!==g.id):m,f=(0,v.jsxs)(v.Fragment,{children:[h.map((t,n)=>o&&i?(0,v.jsx)(eX,{discussionStore:t,resolved:!c,isFirst:0===n,blockStore:e.blockStore,onDismiss:e.onDismiss},t.id):(0,v.jsx)(eJ,{store:t,format:a().DiscussionFormat.Menu,isFirst:0===n,discussionLocation:e$,showResolveButtonByDefaultIfPossible:!1,blockStore:e.blockStore,onDismiss:e.onDismiss,inlineCommentRepliesMode:i?"collapsible":"none"},t.id)),g?(0,v.jsx)(eJ,{store:g,format:a().DiscussionFormat.Menu,isFirst:1===e.discussionStores.length,discussionLocation:e$,showResolveButtonByDefaultIfPossible:!1,blockStore:e.blockStore,onDismiss:e.onDismiss,inlineCommentRepliesMode:i?"collapsible":"none"},g.id):void 0,r&&c?(0,v.jsx)(eZ,{shouldShowTopDividerLine:!i}):void 0,i&&c?(0,v.jsx)("div",{style:eY,children:(0,v.jsx)(eG,{store:e.blockStore,targetDiscussionStore:p,from:"page_discussion",discu
1ssionLocation:e$,showAgentActivity:!1,onDiscussionCreated:e=>{n(575125).Jd.getForTab(t).addNewDiscussionId(e.id,!1)}})}):void 0]});return i?(0,v.jsx)("div",{style:l,children:f}):f}function eX(e){let t=(0,n(579993).K8)(()=>(0,n(713707).vd)({discussionStores:[e.discussionStore]}).filter(t=>(0,n(713707).CB)(t)===e.resolved),[e.discussionStore,e.resolved],{equalityFn:n(134542).rM});return(0,v.jsx)(v.Fragment,{children:t.map((t,i)=>(0,v.jsx)(eJ,{thread:t,format:a().DiscussionFormat.Menu,isFirst:e.isFirst&&0===i,discussionLocation:e$,showResolveButtonByDefaultIfPossible:!1,blockStore:e.blockStore,onDismiss:e.onDismiss,inlineCommentRepliesMode:"collapsible"},(0,n(713707).R7)(t)))})}function eZ(e){let t=(0,n(533992).v3)(),i=(0,n(579993).K8)(()=>(n(332190).zG.state.open&&n(827862).J.state.overlapsExistingDiscussionMenu)??!1,[]);return(0,v.jsx)(n(211571).K,{environment:t,shouldShowTopDividerLine:e.shouldShowTopDividerLine,shouldExpandDiscussionWidth:i,noBackgroundColors:!0,discussionLocation:e$})}var eQ=()=>n(221131);let e0=(0,n(327219).YK)({commentsAriaLabel:{defaultMessage:"{count, plural, one {1 comment} other {{count} comments}}",id:"comments.components.discussionindicator.commentAriaLabel"},suggestionsAriaLabel:{defaultMessage:"{count, plural, one {1 suggestion} other {{count} suggestions}}",id:"comments.components.discussionindicator.suggestionAriaLabel"},reactionsAriaLabel:{defaultMessage:"{count, plural, one {1 reaction} other {{count} reactions}}",id:"comments.components.discussionindicator.reactionsAriaLabel"}}),e1=r.memo(function(e){let t=(0,n(327219).tz)(),{store:i,propertyId:o,style:s}=e,{showIndicator:r,formattedReactionCount:a,onlySuggestions:l,icon:d,showReactionsIcon:c,onlyHasDraftIndicator:u,formattedCommentCount:m,handleClick:p,discussionIsSelected:g,commentsCount:h,shouldShowDraftIndicator:f}=(0,n(340958).v)({store:i,recursivelyLoadAllDiscussions:!1,onlyCountBlockLevelDiscussions:!1,propertyId:o}),S=(0,n(533992).v3)(),b=(0,n(633636).wM)(),x=(0,n(579993).K8)(()=>(0,n(832122).m)(S),[S]),y=(0,n(579993).K8)(()=>(0,n(298292).fs)(S,b,i),[S,b,i]),C=(0,n(121417).P)({store:i,recursivelyLoadAllDiscussions:!1,onlyCountBlockLevelDiscussions:!1,propertyId:o}),{isPropertyInPageDetails:k}=(0,n(287753)._1)({store:i,propertyId:o});return!r||!k&&(x||y)?null:(0,v.jsxs)(n(4458).fI,{style:s,children:[h>0||u?(0,v.jsx)(n(487769).M,{icon:d,countLabel:m,ariaLabel:l?t.formatMessage(e0.suggestionsAriaLabel,{count:m}):t.formatMessage(e0.commentsAriaLabel,{count:m}),onClick:p,indicatorStatus:f?"draft":void 0,isSelected:g,backgroundOverride:C}):void 0,c?(0,v.jsx)(n(487769).M,{icon:n(489784).emojiFaceSmallIcon,countLabel:a,ariaLabel:t.formatMessage(e0.reactionsAriaLabel,{count:a}),onClick:p,backgroundOverride:C}):void 0]})}),e9={lastEditedTime:{marginTop:1,marginInlineEnd:0,marginBottom:0,marginInlineStart:0,whiteSpace:"normal",display:"flex",justifyContent:"center",alignItems:"center",color:n(632079).Tj.text.tertiary,fontSize:12,lineHeight:"15px"},commentAuthorAvatar:{borderRadius:20,position:"relative",userSelect:"none",WebkitUserSelect:"none",width:24,height:24,marginInlineEnd:-6},secondaryLabel:{fontSize:n(699422).J.UISmall.desktop,whiteSpace:"normal",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"21px",marginInlineStart:0,marginTop:0,color:n(632079).Tj.text.tertiary},unreadStatusDot:{display:"flex",alignItems:"center",marginInlineEnd:4,marginInlineStart:"auto"}};function e2({discussionData:{groupedDiscussionsData:e,newDiscussionData:t,id:i},onClick:o}){let[s,a]=(0,r.useState)(!1),l=(0,n(533992).v3)(),d=l.currentUser.id,c=(0,r.useCallback)(()=>{a(!0)},[]),u=(0,r.useCallback)(()=>{a(!1)},[]),m=(0,r.useCallback)(async i=>{if(t){let e=n(192314).AppStoreMainEditorCurrentBlockStore.state;n(827862).J.setActiveWithSource("margin_comments"),await (0,n(758275).x)({currentBlockStore:e,discussionInputStore:t.discu
1ssionInputStore,environment:l})}else if(e.length>0){let t=e[0].discussionStore;await o(i,t)}},[t,e,null==t?void 0:t.discussionInputStore,l,o]),{commentStores:p,reactionStores:g}=(0,n(579993).K8)(()=>e?{commentStores:e.flatMap(e=>e.discussionStore.getCommentStoresSortedByCreatedTime()),reactionStores:e.flatMap(e=>n(868249).L.getUserVisibleReactions(e.discussionStore))}:{commentStores:[],reactionStores:[]},[e]),h=(0,n(579993).K8)(()=>{let i;if(t&&(i=t.parentBlockStore),e.length>0&&(i=e[0].parentBlockStore),i)return Array.from(new Set([...p.map(e=>e.getCreatedById()).filter(n(48697).O9),...g.map(e=>e.getActorPointers().map(e=>e.id)).flat().filter(n(48697).O9),...t&&d?[d]:[]])).map(e=>n(807825).L.createChildStore(i,{table:n(832375).oo9,id:e})).slice(0,5)},[e,t,p,g,d,null==t?void 0:t.parentBlockStore]),f=(0,n(579993).K8)(()=>Math.max(...p.map(e=>e.getLastEditedTime()),...g.map(e=>e.getCreatedTime())),[p,g]),S=(0,n(579993).K8)(()=>{if(Number.isFinite(f))return(0,n(497074).Q)({timestampMs:f,nowOverrideMs:(0,n(137683).m)().state.timeNow})},[f]),b=(0,n(579993).K8)(()=>e.map(e=>e.discussionStore).some(e=>{var t;return(0,n(47354).sC)({discussionStore:e,navigableBlockStore:null==(t=e.getParentStore())?void 0:t.getNavigableBlockStore()})}),[e]),x=(0,n(960253).I)(()=>({discussion:{background:s?n(632079).Tj.hoveredMarginDiscussionBackground:n(632079).Tj.background.primary,width:308,display:"flex",cursor:"pointer",border:`1px solid ${n(632079).Tj.border.secondary}`,borderRadius:10,padding:"12px",alignItems:"center",gap:6}}),[s]),y=(0,v.jsx)("div",{style:e9.secondaryLabel,children:(0,v.jsx)(n(327219).sA,{defaultMessage:"Draft",id:"marginComments.collapsed.draft.label"})}),C=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n(4458).fI,{justifyContent:"center",alignItems:"center",marginInlineStart:0,children:(0,v.jsx)(n(16275).I,{icon:n(939434).w,size:"xxs",colorVariant:"tertiary"})}),t?y:(0,v.jsx)("div",{style:e9.secondaryLabel,children:(0,v.jsx)(n(327219).sA,{defaultMessage:"Expand",id:"marginComments.collapsed.expand.label"})})]}),k=t?y:S&&(0,v.jsx)(n(324489).V,{isSmall:!0,isSecondaryColor:!0,isMultiline:!0,style:e9.lastEditedTime,children:(0,v.jsx)(n(596955).A,{text:S,tooltipText:(0,n(497491).x$)(f),icon:n(428602).Y})});return(0,v.jsxs)("div",{style:x.discussion,onMouseEnter:c,onMouseLeave:u,onClick:m,className:n(828432).OO1,children:[(0,v.jsx)(n(4458).fI,{justifyContent:"center",alignItems:"center",marginInlineEnd:8,reverse:!0,children:null==h?void 0:h.map(e=>(0,v.jsx)(n(10097).E,{authorStore:e,avatarSize:24,avatarStyle:e9.commentAuthorAvatar},e.id))}),(0,v.jsx)(e5,{reactionCount:g.length,commentCount:p.length+ +!!t}),s?C:k,b?(0,v.jsx)("div",{style:e9.unreadStatusDot,children:(0,v.jsx)(n(210882).m,{size:8})}):void 0]})}let e3={commentCount:{fontSize:14,whiteSpace:"normal",marginInlineStart:0,color:n(632079).Tj.text.primary,fontWeight:n(699422).Wy.medium,lineHeight:"18px"},textPlaceholder:{background:n(632079).Tj.background.tertiaryTranslucent,height:14,width:81,borderRadius:4,marginInlineStart:4}};function e5(e){return e.commentCount>0?(0,v.jsx)("div",{style:e3.commentCount,children:(0,v.jsx)(n(327219).sA,{defaultMessage:"{numComments, plural, one {{numComments} comment} other {{numComments} comments}}",id:"marginComments.collapsed.numComments.count",values:{numComments:e.commentCount}})}):e.reactionCount>0?(0,v.jsx)("div",{style:e3.commentCount,children:(0,v.jsx)(n(327219).sA,{defaultMessage:"{numReactions, plural, one {{numReactions} reaction} other {{numReactions} reactions}}",id:"marginComments.collapsed.numReactions.count",values:{numReactions:e.reactionCount}})}):(0,v.jsx)("div",{style:e3.textPlaceholder})}function e7({discussionData:{parentBlockStore:e,discussionInputStore:t},isVisible:i}){let o=(0,r.useRef)(null),s=(0,r.useRef)(!1),l=(0,n(533992).v3)(),d=(0,n(633636).wM)(),c=(0,r.useCallback)(async()=>{let e=await n(864850).T.formulas.load();n(22229).i5({environment:l,tabId:d,allowActionsWhileCommenting:!0,formulasModule:e})},[l,d]),u=(0,n(579993).K8)(()=>t.isEmpty(),[t]),m=(0,r.useCallback)(()=>{s.current=!1,n(827862).J.setActiveWithSource("margin_comments")},[]),p=(0,r.useCallback)(()=>{s.current=!1,n(827862).J.resetActiveSource("margin_comments")},[]),g=(0,r.useCallback)(e=>{if(!(e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget))){if(n(161532).isMouseSelecting()&&document.hasFocus()){s.current=!0;return}p()}},[p]);(0,r.useEffect)(()=>{let e=e=>{0===e.button&&s.current&&window.setTimeout(()=>{s.current&&p()},0)},t=()=>{s.current&&p()};return window.addEventListener("mouseup",e,!0),window.addEventListener("blur",t),()=>{s.current=!1,window.removeEventListener("mouseup",e,!0),window.removeEventListener("blur",t)}},[p]);let h=(0,r.useCallback)(()=>{u&&n(332190).zG.reset(),n(827862).J.resetEditorActiveSources()},[u]),f=(0,r.useCallback)(()=>{n(827862).J.setHoverWithSource("margin_comments")},[]),S=(0,r.useCallback)(()=>{n(827862).J.resetHoverSource("margin_comments")},[]),b=(0,r.useMemo)(()=>[`.${n(545028).hq}`],[]),x=(0,n(579993).K8)(()=>n(827862).J.state.isActivelyComposing,[]),y=(0,n(579993).K8)(()=>n(827862).J.state.isHovered&&!n(827862).J.state.isActivelyComposing,[]),C=!!(x||u);(0,n(251454).L)({active:i&&C,closeHandler:h,ref:o,excludedSelectors:b,ignoreKeydown:!0});let k=(0,n(960253).I)(()=>({discussion:{borderRadius:10,...x?{boxShadow:n(632079).Tj.shadow.outline.md}:{border:`1px solid ${n(632079).Tj.border.secondaryTranslucent}`},width:308,background:n(632079).Tj.selectedMarginDiscussionBackgroun
1d,...{willChange:"transform",transition:"transform 200ms ease",transform:x?"translateX(calc(var(--direction, 1) * -20px))":y?"translateX(calc(var(--direction, 1) * -5px))":void 0}},discussionInputContainer:{borderRadius:6,paddingTop:8,paddingInlineEnd:8,paddingBottom:4,paddingInlineStart:12,...{backgroundColor:y?n(632079).Tj.hoveredMarginDiscussionBackground:void 0}}}),[x,y]);return(0,v.jsx)("div",{style:k.discussion,ref:o,className:n(828432).OO1,onMouseEnter:f,onMouseLeave:S,onBlur:g,children:(0,v.jsx)(ea().V,{parentStore:e,rootCommentId:void 0,discussionInputStore:t,shouldSaveUnsentComments:!1,isMobileSlideUpMenu:!1,discussionFormat:a().DiscussionFormat.Margin,discussionLocation:"margin_comments",onSubmit:c,onCancel:h,isNewComment:!0,blockStore:e,canDrop:!0,showAvatar:!1,containerStyle:k.discussionInputContainer,showCtaButtons:!0,onFocus:m})})}let e6={width:308},e8=r.memo(function({discussionData:{discussionStore:e,parentBlockStore:t},timeMounted:i,onClick:o,isVisible:s,isDiscussionSelected:l,isDiscussionHovered:c}){let u=(0,r.useRef)(null),m=(0,n(533992).v3)(),p=(0,n(633636).wM)(),[g,h]=(0,r.useState)(()=>new(n(478597)).w(m,e.pointer.spaceId)),f=(0,n(83208).X)("block_reactions"),S=e.id,b=(0,r.useRef)(void 0),[x,y]=(0,r.useState)(!1);(0,r.useEffect)(()=>{l&&(b.current=(0,n(47354).sC)({discussionStore:e,navigableBlockStore:t.getNavigableBlockStore()}))},[e,l,t]);let C=(0,r.useCallback)(()=>{y(!0);let e=setTimeout(()=>{y(!1)},750);return()=>clearTimeout(e)},[]);(0,r.useEffect)(()=>{let e=u.current;if(e)return e.addEventListener("flash-halo",C),()=>{e.removeEventListener("flash-halo",C)}},[C]);let k=(0,n(579993).K8)(()=>e.getCommentStores().length>0,[e]),I=(0,n(579993).K8)(()=>e.getReactionStores().length>0,[e]),w=(0,r.useMemo)(()=>[`.${(0,n(762507).wV)({discussionId:S})}`,`.${n(545028).hq}`,`.${n(828432).OO1}`],[S]),j=(0,r.useCallback)(async()=>{let t=d().A.findInteractive(p,e=>e.isEditing());(!t||await t.handleCancelEdit())&&(b.current&&(0,n(737146).X)({environment:m,threads:[{type:"discussion",discu
1ssionStore:e}]}),n(307946).xl(p))},[e,m,p]);(0,n(251454).L)({active:s&&l,closeHandler:j,ref:u,excludedSelectors:w,ignoreKeydown:!0});let L=(0,r.useCallback)(async t=>{if(!l){var i;n(65255).E9(m,{discussion_id:e.id,discussion_type:e.getType(),from:"margin_comments",parent_block_id:e.getParentId(),parent_collection_id:null==(i=e.getParentStore())?void 0:i.getParentCollectionIdUpToTwoLevels()}),await o(t,e)}},[o,e,l,m]),M=(0,n(960253).I)(()=>({discussion:{border:l?void 0:`1px solid ${n(632079).Tj.border.secondaryTranslucent}`,borderRadius:10,padding:l?"1px":void 0,background:x?"rgba(35, 131, 226, 0.14)":l?n(632079).Tj.selectedMarginDiscussionBackground:c?n(632079).Tj.hoveredMarginDiscussionBackground:n(632079).Tj.background.primary,boxShadow:l?n(632079).Tj.shadow.outline.md:void 0,width:308,cursor:l?void 0:"pointer",transition:"background-color 200ms ease"},wrapper:{willChange:"transform",transition:"transform 200ms ease",transform:l?"translateX(calc(var(--direction, 1) * -20px))":c?"translateX(calc(var(--direction, 1) * -5px))":void 0}}),[c,l,x]);return(0,v.jsxs)("div",{className:n(828432).OO1,ref:u,style:M.wrapper,onClick:L,children:[I&&f?(0,v.jsx)("div",{style:e6,children:(0,v.jsx)(T().tx,{focused:l,parentStore:e,discussionLocation:"margin_comments"})}):void 0,k?(0,v.jsx)("div",{style:M.discussion,children:(0,v.jsx)(eJ,{store:e,blockStore:t,format:a().DiscussionFormat.Margin,isFirst:!1,inlineCommentRepliesMode:"none",showResolveButtonByDefaultIfPossible:!1,discussionLocation:"margin_comments",showAllRepliesAfterTimestamp:i,discussionInputStore:g,collapsed:!l})}):void 0]})}),e4=r.memo(function(e){let t,i=(0,n(633636).wM)(),{discussionData:o,isLastItem:s,isDiscussionSelected:a,setDiscussionItemElement:l}=e,d=(0,n(579993).K8)(()=>!matchMedia("(prefers-reduced-motion: reduce)").matches,[]),c=(0,r.useRef)(!1),u=void 0!==o.height,m=c.current;(0,r.useEffect)(()=>{u&&(c.current=!0)},[u]);let p=(0,n(960253).I)(()=>{let e=d&&m?"opacity 200ms ease-in-out, top 350ms ease":"opacity 200ms ease-in-out",t=o.hide;return{discussionContainer:{transition:t||!m?void 0:e,top:o.offsetTop,position:"absolute",paddingBottom:s?50:10,zIndex:a?1:void 0,opacity:+!t,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",pointerEvents:"auto"}}},[m,o.hide,o.offsetTop,a,s,d]),g=o.type,h=(0,n(533992).v3)(),f=(0,n(579993).K8)(()=>(0,n(298292).Vn)(h,i,o.parentBlockStore),[h,i,o.parentBlockStore]),S=(0,r.useCallback)(()=>{n(350175).d.getForTab(i).setState({source:"margin_comments",discussionIds:[o.id]})},[o.id,i]),b=(0,r.useCallback)(()=>{n(350175).d.getForTab(i).setState({discussionIds:[]})},[i]),x=(0,r.useCallback)(e=>{l(o.id,e)},[o.id,l]);return f?"existing"===g?t=(0,v.jsx)(e8,{...e,discussionData:o}):"new"===g?t=(0,v.jsx)(e7,{...e,discussionData:o}):"grouped"===g?t=(0,v.jsx)(e2,{...e,discussionData:o}):(0,n(48697).HB)(g):t=null,(0,v.jsx)("div",{style:p.discussionContainer,onMouseEnter:S,onMouseLeave:b,ref:x,children:t})}),te=`.${n(599809).iU}, .${n(599809).F0}, .${n(599809).te}`,tt=r.memo(function({pageBlockStore:e,timeMounted:t,isVisible:i,animating:o,pageViewBlockAccessor:s,width:a,context:l}){let d=(0,n(533992).v3)(),c=(0,n(533992).Y0)(),u=(0,n(633636).wM)(),m=(0,r.useRef)(null),p=(0,r.useRef)(new Map),g=(0,r.useRef)(new Map),h=(0,r.useRef)(new Map),f=(0,r.useRef)(new Map),S=(0,r.useRef)(n(960408).lQ),b=(0,r.useCallback)((e,t)=>{t?(p.current.set(e,t),S.current()):p.current.delete(e)},[]),x=(0,n(579993).K8)(()=>n(350175).d.getForTab(u).getFirstSelectedDiscussionId(),[u]),y=(0,r.useCallback)(async(t,i)=>{var o;(0,n(453734).Z)()||t.target instanceof Element&&t.target.closest(te)||(n(827862).J.resetEditorActiveSources(),await n(187819).DZ({discussionStore:i,currentBlockStore:e,environment:d,tabId:u,analyticsFrom:"margin_comments",currentEl:m.current,animateScroll:!0,discussionReadStatus:(0,n(47354).gW)({discussionStore:i,navigableBlockStore:null==(o=i.getParentStore())?void 0:o.getNavigableBlockStore()})}))},[e,d,u]),[C,k]=(0,r.useState)({data:[],hasNewDiscussion:!1,selectedDiscussion:void 0}),[I,w]=(0,r.useState)(!1),{WindowSizeStore:j}=d,L=n(801113).ek(d.device.isElectronMac),M=(0,n(579993).K8)(()=>!matchMedia("(prefers-reduced-motion: reduce)").matches,[]);(0,r.useEffect)(()=>
1{if(!i)return;let t=new(n(47824)).ComputedStore(()=>({isInteractiveTab:n(707817).interactiveTabIdComputedStore.state===u,selectableRectMap:n(448475).default.state.selectableRectMap,pageContentStores:e.getContentStores(),sidebarIsAnimating:n(449473).B8.state.isAnimating,windowHeight:j.state.height}),{debugName:"effectDataStore"}),r=n(298292).Ob.getForTab(u),a=new(n(47824)).ComputedStore(()=>{let e=n(332190).zG.state,t=n(332190).zG.getBlockStore(),i=n(332190).zG.getClosestBlockStore();if(e.open&&e.rect&&"comment"===e.content&&(t||i)&&(!t||n(400890).q.isBlockInFrame(t)&&!e.property_id))return{recomputeFocus:n(827862).J.state.isActivelyComposing,blockStore:t??e.blockStore,discussionInputStore:e.discussionInputStore}},{debugName:"newMarginDiscussionArgsStore"}),d=new(n(47824)).ComputedStore(()=>{let e=n(575125).Jd.getForTab(u);if(!n(827862).J.state.isActivelyComposing)return e.getFramePageFirstSelectedDiscussionId(n(192314).mainEditorBlockStore.getForTab(u).state);e.reset()},{debugName:"selectedDiscussionIdStore"}),v=!1,b=(0,n(960408).sg)(e=>{n(707817).interactiveTabIdComputedStore.state===u&&(0,n(298292).Vu)(e)},100),x=(0,n(960408).sg)(()=>{let{isInteractiveTab:i,selectableRectMap:S,pageContentStores:x,sidebarIsAnimating:y,windowHeight:j}=t.state;if(!i)return void b.cancel();let A=r.state,T=a.state,_=d.state;if(o||y)return;let D=s();D&&m.current&&S&&S.size&&b({tabId:u,discussionStores:A,discussionAnchorOffsetCache:h.current,discussionHeightCache:f.current,pageContentStores:x,marginDiscussionItemRefs:p.current,selectedDiscussionId:_,newMarginDiscussionArgs:T,marginContainerElement:m.current,pageViewBlockElement:D,onComputeComplete:(e,t)=>{v||n(707817).interactiveTabIdComputedStore.state!==u||(g.current=t,I||w(!0),k(e))},computedOnce:I,topbarHeight:L,windowHeight:j,isFullWidth:(0,n(335818).Ck)(e,l,c),prevSelectedDiscussionId:C.selectedDiscussion,previousDiscussionElements:g.current,ignoreOffsetTop:M})},5);return S.current=x,t.addListener(x),r.addListener(x),d.addListener(x),a.addListener(x),()=>{v=!0,x.cancel(),b.cancel(),S.current===x&&(S.current=n(960408).lQ),t.removeListener(x),r.removeListener(x),d.removeListener(x),a.removeListener(x)}},[i,o,s,I,e,C.selectedDiscussion,j,L,d,u,l,c,M]);let A=(0,n(960253).I)(()=>({marginCommentsContainer:{display:"flex",flexDirection:"column",paddingTop:8,paddingBottom:8,paddingInlineStart:16,paddingInlineEnd:16,width:a-32,flexShrink:0,height:"100%",position:"relative",pointerEvents:"none",zIndex:1}}),[a]);return(0,v.jsx)("div",{style:A.marginCommentsContainer,ref:m,children:C.data.map((e,n)=>(0,v.jsx)(e4,{discussionData:e,timeMounted:t,onClick:y,isVisible:i,setDiscussionItemElement:b,isDiscussionSelected:e.selected||"new"===e.type,isDiscussionHovered:e.id===x,isLastItem:n===C.data.length-1},`margin-discussion-${e.id}`))})});function tn({pageBlockStore:e,isVisible:t,pageViewBlockAccessor:i,context:o,isCollapsedAnchor:s}){let[a,l]=(0,r.useState)(!1),d=(0,n(533992).v3)(),c=(0,n(533992).Y0)(),u=(0,r.useMemo)(()=>new Date().getTime(),[]),m=(0,n(579993).K8)(()=>{let t=(0,n(335818).Ck)(e,o,c);return s?{paddingInlineStart:t?96:16,height:0}:t?void 0:{position:"absolute",insetInlineEnd:(0,n(298292).gg)({environment:d,isInPeekRenderer:(0,n(447036).cq)(e),isInFrameWhenSidePeekOpen:(0,n(447036).RX)(e)})}},[e,o,d,c,s]),p=(0,r.useCallback)(()=>{l(!0)},[]),g=(0,r.useCallback)(()=>{l(!1)},[]),h=(0,n(960253).I)(()=>({marginCommentsSection:{display:t||a?"flex":"none",flexShrink:0,pointerEvents:"none",width:372*!!t,...m}}),[t,a,m]);return(0,v.jsx)(n(654979).A,{animate:{opacity:+!!t},onAnimationStart:p,onAnimationEnd:g,style:h.marginCommentsSection,children:(0,v.jsx)(tt,{pageBlockStore:e,timeMounted:u,isVisible:t,animating:a,pageViewBlockAccessor:i,width:372,context:o})})}var ti=()=>
1n(58931);function to(e){let{capture:t,children:i}=e,o=(0,r.useRef)(null);return(0,n(336494).b)(n(635981).A,()=>({getNode:()=>o.current,isCaptured:()=>t}),[t]),(0,v.jsx)("div",{ref:o,children:r.Children.only(i)})}function ts(){let e=(0,n(533992).v3)(),t=(0,n(633636).wM)(),i=(0,n(533992).WS)(),o=((0,r.useLayoutEffect)(()=>{!function(){let e,t=n(332190).zG.getBlockStore(),i=n(332190).zG.state;if(!(!i.open||!t||n(332190).zG.isPropertyComment()||t.isType("code"))){var o,s;if("inline"===i.type&&i.multiSelection){let t=(0,n(995529).O)(i.multiSelection),o=t?n(161532).getRect(t):void 0;o&&o.height>0&&(e=new DOMRect(o.left,o.top,o.width,o.height))}if(!e){let o=n(496704).K.getRect(t);if(!o)return;e=new DOMRect(i.rect.left,o.top,i.rect.width,i.rect.height)}o=i.rect,s=e,(o.x!==s.x||o.y!==s.y||o.width!==s.width||o.height!==s.height)&&n(332190).zG.setState({...i,rect:e})}}()}),(0,n(579993).K8)(()=>n(332190).zG.state.rect,[])),s=(0,n(579993).K8)(()=>{if(n(332190).zG.state.open&&"comment"===n(332190).zG.state.content){let{discussionInputStore:o}=n(332190).zG.state;if((0,n(832122).m)(e))return null;if(n(827862).J.state.isActivelyComposing){"comments_pane"===n(827862).J.state.clickEntryPoint&&n(827862).J.setActiveWithSource("popover_comments");let s=n(332190).zG.getBlockStore();if(s){var i;let r=(0,n(948688).M)(s.getNavigableBlockStore());return{blockStore:s,discussionInputStore:o,canMarginCommentsRender:!r&&!(null!=(i=n(332190).zG.state)&&i.property_id)&&(0,n(298292).Vn)(e,t,s)}}}}return null},[e,t]),l=(0,r.useCallback)(()=>{let t=null==s?void 0:s.discussionInputStore;t&&(0,n(745990).M)({discussionInputStore:t,environment:e})},[e,null==s?void 0:s.discussionInputStore]),d=(0,r.useCallback)(()=>{n(332190).zG.hasContent()?n(827862).J.resetEditorActiveSources():s&&(0,n(585356).c)()},[s]);(0,r.useEffect)(()=>{function t(t){let i=n(332190).zG.state,o=i.open&&"comment"===i.content&&i.discussionInputStore||void 0;o&&((0,ti().HR)({discussionInputStore:o,environment:e,discussionHelpers:a()}),t.preventDefault())}return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e]);let c=(0,n(579993).K8)(()=>n(363746).a.state.isOpen,[]);return(0,n(579993).K8)(()=>n(827862).J.state.overlapsExistingDiscussionMenu,[])?null:(0,v.jsx)(n(182718).z,{popupType:i?n(423291).n.SlideUp:n(423291).n.Popup,keepFocus:!0,open:null!==s&&(!s.canMarginCommentsRender||c),originRect:o,placementToOrigin:"bottom",alignmentToOrigin:"center",originGap:4,onDismiss:d,content:()=>s?(0,v.jsx)(tr,{blockStore:s.blockStore,discussionInputStore:s.discussionInputStore,handleDismiss:d}):null,onAnimationEnd:l})}function tr({blockStore:e,discussionInputStore:t,handleDismiss:i}){let o=(0,n(533992).v3)(),s=(0,n(633636).wM)(),{device:l}=o,d=(0,r.useCallback)(async()=>{let e=await n(864850).T.formulas.load();n(22229).i5({environment:o,tabId:s,allowActionsWhileCommenting:!0,formulasModule:e})},[o,s]),c=(0,n(579993).K8)(()=>n(707785).A.keyboardHeight()>0,[]),u=(0,n(579993).K8)(()=>{let e=l.isAndroid?12:8;return{paddingLeft:(0,n(51487).Y5)("left",12),paddingRight:(0,n(51487).Y5)("right",8),paddingBottom:c?e:(0,n(51487).Y5)("bottom",e)}},[c,l.isAndroid]),m=(0,n(579993).K8)(()=>l.isMobileBrowser?"90vw":l.isTablet?"470px":"100%",[l]),p=(0,n(579993).K8)(()=>l.isMobileNative&&l.isPhone?"100%":l.isMobileNative&&l.isTablet?"470px":470,[l]),g=(0,n(960253).I)(()=>({inputWrapper:{width:p,maxWidth:m,paddingTop:9,paddingInlineStart:u.paddingLeft,paddingInlineEnd:u.paddingRight,paddingBottom:u.paddingBottom}}),[p,m,u]);return(0,n(805469).A)({shouldPreserveTextSelection:!0,shouldPreserveBlockSelection:!0,shouldRestoreSelection:!0}
1),(0,v.jsx)(n(790124).O,{capture:!0,allowOpenLinkMenu:!0,allowOpenEquationMenu:!0,children:()=>(0,v.jsx)(n(322981).A,{store:e,droppable:!0,render:()=>(0,v.jsx)(to,{capture:!0,children:(0,v.jsx)("div",{style:g.inputWrapper,children:(0,v.jsx)(ea().V,{showAvatar:!0,parentStore:e,rootCommentId:void 0,blockStore:e,onCancel:i,onSubmit:d,discussionInputStore:t,isMobileSlideUpMenu:!0,shouldSaveUnsentComments:!1,discussionFormat:a().DiscussionFormat.Page,discussionLocation:"block_menu",canDrop:!0})})})},e.id)})}let ta=function(){let e=(0,n(533992).v3)(),t=(0,n(533992).Y0)(),{open:i,rect:o,discussionLocation:s}=(0,n(579993).K8)(()=>{let{open:e,rect:t}=n(266960).X.state;return{open:e,rect:t,discussionLocation:n(266960).X.state.open?n(266960).X.state.discussionLocation:n(266960).X.state.prevDiscussionLocation}},[]),{popupType:r,bottomSheetInitialState:a}={device:t,discussionLocation:s}.device.isPhone?{popupType:n(423291).n.BottomSheet,bottomSheetInitialState:"full"}:{popupType:n(423291).n.Popup,bottomSheetInitialState:void 0};return(0,v.jsx)(n(182718).z,{popupType:r,bottomSheetInitialState:a,bottomSheetBackgroundColor:r===n(423291).n.BottomSheet?"primary":void 0,open:i,originRect:o,placementToOrigin:"bottom",alignmentToOrigin:"center",originGap:4,onDismiss:()=>(0,n(753288).o)(e),content:()=>(0,v.jsx)(td,{}),trapFocus:!0})},tl={closeButton:{position:"absolute",insetInlineEnd:10,borderRadius:"50%",background:n(632079).Tj.background.tertiaryTranslucent}};function td(){let e=(0,n(533992).v3)(),t=(0,n(327219).tz)(),i=(0,n(579993).O$)(n(266960).X),o=(0,n(579993).K8)(()=>n(266960).X.state.open?n(266960).X.state.discussionInputStore.state.textStore.getValue():null,[]);if((0,r.useEffect)(()=>{var e;if(i.open&&"feed_item_top_level_discussion"===i.discussionLocation)return;let t=null==(e=n(862921).A.MenuScroller)?void 0:e.getNode();null==t||t.scrollTo({top:t.scrollHeight})},[o,i]),i.open){let o,{discussionStore:s,discussionInputStore:r,blockStore:l,discussionLocation:d}=i;return o=n(139424).A.isMobile?{menuType:n(649476).gu.Modal,title:(0,v.jsx)(n(327219).sA,{defaultMessage:"Discussion",id:"discussion.mobileReplyMenu.title"}),right:(0,v.jsx)(n(374533).K,{icon:n(766970).xMarkFillIcon,onClick:()=>(0,n(753288).o)(e),style:tl.closeButton,ariaLabel:t.formatMessage({id:"updateSidebar.header.closeLabel",defaultMessage:"Close"})}),onClickRight:()=>(0,n(753288).o)(e),whiteBackground:!0}:{menuType:n(649476).gu.Popup,width:420,minHeight:"100px",maxHeight:"50vh",maxWidth:"100%"},(0,v.jsx)(n(747369).A,{className:n(828432)._qG,...o,children:(0,v.jsx)(n(790124).O,{capture:!0,allowMobileAutoScroll:!0,allowOpenEquationMenu:!0,children:()=>(0,v.jsx)(eJ,{store:s,discussionInputStore:r,onDismiss:()=>(0,n(753288).o)(e),format:a().DiscussionFormat.Menu,isFirst:!0,inlineCommentRepliesMode:"none",showResolveButtonByDefaultIfPossible:!0,blockStore:l,collapsed:!1,..."feed_item_top_level_discussion"===d?{pageVisitStore:void 0,presenceStore:void 0,discussionLocation:"feed_item_top_level_discussion"}:{discussionLocation:d}})})})}return null}var tc=()=>n(576454),tu=()=>n(78172),tm=()=>n(197657)},739883(e,t,n){n.d(t,{S:()=>g}),n(730330),n(976614);var i=n(635790);let o=new(n(552709)).O2("AgentActivityStatusPopoverContent",async()=>await n.e(68331).then(n.bind(n,523615))),s=(0,n(552709)._h)(o,e=>e.AgentActivityStatusPopoverContent,{renderLoading:()=>void 0});var r=n(440302);let a={cursor:"pointer",paddingInlineStart:2,paddingInlineEnd:2,userSelect:"none"},l={maxWidth:"100%"},d={marginInlineStart:-4,paddingInlineStart:4,paddingInlineEnd:4,paddingTop:16,paddingBottom:14},c={flexShrink:1,maxWidth:"100%",minWidth:0,overflow:"hidden"},u={margin:-1,padding:1};function m(e){switch(e){case"collection":return{buttonStyle:{...a,...l},indicatorStyle:c};case"discussion":return{buttonStyle:{...a,...d},indicatorStyle:u};default:(0,n(48697).HB)(e)}}function p(e){let{ariaLabel:t,children:o,impressionContext:s,onRequestClose:a,presentation:l,spaceId:d,threadId:c,triggerRef:u}=e,p=(0,n(533992).Y0)(),{buttonStyle:g}=m(l),h=(0,i.useCallback)(()=>{s&&(0,n(599231).Nw)({...s,click_action:"open_chat_sidebar"}),a(),(0,n(158131).T)({threadId:c,from:"agent_activity_run_list"})},[s,a,c]);return(0,r.jsx)(n(988022).p,{"aria-label":t,ref:u,size:"xs",shouldShrink:!0,style:g,href:(0,n(366367).zD)({isElectron:p.isElectron,spaceId:d,threadId:c}),external:!1,onClick:h,children:o})}function g(e){var t;let{agents:o,impressionContext:a,popupStore:l,presentation:d,singleAgentNavigation:c,triggerRef:u}=e,g="collection"===d?e.pageStore:void 0,h="collection"===d?e.pageStore.pointer.spaceId:e.spaceId,f=(0,n(533992).v3)(),v=(0,n(327219).tz)(),S=(0,n(851969).ws)(o),b=(0,n(579993).K8)(()=>l.state.open,[l]),x=(0,i.useCallback)(()=>{l.reset()},[l]),y=(0,i.useCallback)(e=>{e.preventDefault();let t=1===o.length?o[0]:void 0;if(t&&h){a&&(0,n(599231).Nw)({...a,click_action:"open_chat_sidebar"}),x(),(0,n(158131).T)({threadId:t.threadId,from:"agent_activity_run_list"}),(0,n(37269).K)({environment:f,spaceId:h,threadId:t.threadId});return}l.state.open?x():(a&&(0,n(599231).Nw)({...a,click_action:"open_run_list_popover"}),l.setState({...l.state,open:!0}))},[o,f,x,a,l,h]),C=1===o.length?o[0]:void 0,k=o.filter(e=>"working"===e.activityStatus).length;if(t=k>0&&h&&a?{...a,active_thread_count:k}:void 0,(0,n(619772).A)(()=>{t&&(0,n(599231).lm)(t)},!!t),0===o.length||!h)return null;let{buttonStyle:I,indicatorStyle:w}=m(d),j=(0,n(196659)._Y)({baseLabel:S,intl:v}),L=(0,r.jsx)("span",{style:w,children:(0,r.jsx)(n(851969).We,{agents:o,presentation:d})});return"link"===c&&C?(0,r.jsx)(p,{ariaLabel:j,impressionContext:a,onRequestClose:x,presentation:d,spaceId:h,threadId:C.threadId,triggerRef:u,children:L}):(0,r.jsx)(n(182718).z,{popupType:n(182718).n.Popup,open:b,content:()=>(0,r.jsx)(s,{agents:o,pageStore:g,presentation:d,spaceId:h,onRequestClose:x}),placementToOrigin:"top",alignmentToOrigin:"start",originGap:6,viewportPadding:8,ariaLabel:(0,n(196659).y)({agents:o,intl:v}),onDismiss:x,trapFocus:!1,disableMouseCapture:!0,enableOutsideClickDismiss:!0,children:(0,r.jsx)(n(988022).p,{"aria-label":j,ref:u,size:"xs",shouldShrink:!0,style:I,onClick:y,focused:b,children:L})})}},755521(e,t,n){var i=n(635790),o=n(440302);let s={cursor:"pointer",display:"inline-flex",userSelect:"none",width:"fit-content"};function r(e){if(!e)return!1;if("function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches)return!0;let t=e.style.backgroundColor,n=e.style.transition;return e.style.backgroundColor="rgba(35, 131, 226, 0.14)",e.style.transition="background-color 0.2s ease",setTimeout(()=>{e.style.backgroundColor=t,e.style.transition=n},750),!0}function a(e){let{agents:t}=e,o=(0,n(579993).uB)(void 0,n(510969).A),[s,r]=(0,i.useState)(void 0),a=(0,n(579993).K8)(()=>o.state.open,[o]),l=function(e){let{agents:t}=e;if(0!==t.length)return{agents:t}}({agents:t});return(0,i.useEffect)(()=>{a?r(e=>e??l):r(void 0)},[l,a]),{displayedActivityStatus:s??l,popupStore:o}}function l(e){let{agents:t,spaceId:i,popupStore:r,triggerRef:a,impressionContext:l}=e;return 0===t.length?null:(0,o.jsx)("span",{style:s,children:(0,o.jsx)(n(739883).S,{agents:t,impressionContext:l,popupStore:r,presentation:"discussion",singleAgentNavigation:"button",spaceId:i,triggerRef:a})})}n.d(t,{KU:()=>r,Tk:()=>a,UX:()=>l})},180984(e,t,n){n(730330),n(976614),n(159952),n(635790);var i=n(440302);let o=(0,n(327219).YK)({oneUserTyping:{id:"typingIndicator.oneUserTyping",defaultMessage:"{name} is typing"},peopleTyping:{id:"typingIndicator.peopleTyping",defaultMessage:"{count} people are typing"}}),s={cursor:"default",userSelect:"none"},r={page:10,margin:6,marginCollapsed:6},a={page:0,margin:0,marginCollapsed:8};function l(e){let{typingUserIds:t,blockStore:l,variant:d}=e,c=(0,n(327219).tz)(),u=(0,n(579993).K8)(()=>t.map(e=>n(807825).L.createChildStore(l,{table:n(832375).oo9,id:e})).map(e=>e.getFullName(c)).filter(n(48697).O9),[t,l,c]);if(0===t.length)return null;let m=function(e){let{intl:t,names:n,typingUserCount:i}=e;if(1===i){let[e]=n;if(void 0===e)return;return t.formatMessage(o.oneUserTyping,{name:e})}return t.formatMessage(o.peopleTyping,{count:i})}({intl:c,names:u,typingUserCount:t.length});return m?(0,i.jsxs)(n(4458).fI,{inline:!0,as:"span",gap:6,alignItems:"center",minWidth:0,maxWidth:"100%",marginInline:16,marginBottom:a[d],width:"fit-content",style:s,children:[(0,i.jsx)(n(4458).fI,{inline:!0,as:"span",flexShrink:0,marginInlineStart:r[d],children:(0,i.jsx)(n(118845).A,{colorVariant:"tertiary"})}),(0,i.jsx)(n(4458).fI,{inline:!0,as:"span",minWidth:0,flexShrink:1,children:(0,i.jsx)(n(111010).D,{as:"span",styleKey:"bodySmRegular",colorVariant:"tertiary",lineClamp:1,children:m})})]}):null}n.d(t,{V:()=>l})},164333(e,t,n){var i=n(635790);let o=(0,i.createContext)({hideOverflowMenu:!1,hideSidePeekButton:!1});o.displayName="CommentActionOverridesContext";let s=o.Provider;function r(){return(0,i.useContext)(o)}n.d(t,{Yz:()=>r},{ek:{hideOverflowMenu:!0,hideSidePeekButton:!1},pE:s})},112523(e,t,n){n.d(t,{N:()=>s}
1),n(730330),n(976614),n(159952);var i=n(635790);let o=n(764657).record(n(764657).uuid(),n(764657).object({required:{lastTypedAt:n(764657).number()},optional:{}}));function s(e){let{blockStore:t,discussionStore:s,rootCommentStore:r}=e,a=(0,n(533992).v3)(),l=a.currentUser.id,d=(0,n(83208).X)("show_discussion_typing_indicators"),c=(0,i.useMemo)(()=>{if(d)return(0,n(379736).rc)({blockId:t.id,discussionId:s.id,rootCommentId:null==r?void 0:r.id})},[t.id,s.id,d,null==r?void 0:r.id]),[u,m]=(0,i.useState)(void 0);!function(e){let{key:t,blockStore:o,environment:s,listener:r,enabled:a=!0}=e,l=s.currentUser.id,[d,c]=(0,i.useState)(void 0);(0,i.useEffect)(()=>{null==o||o.id,c(void 0)},[t,null==o?void 0:o.id,l]);let u=(0,i.useCallback)(async(e=!1)=>{if(!t||!o||!l||!a)return;let i=await (0,n(570179).Z)({blockStore:o,userId:l,environment:s,forceRefresh:e});i?c(i):n(773352).log({level:"warning",from:"useMessageStoreSubscription",type:"fetchAuthTokenFailed",data:{key:t,blockId:o.id}})},[o,s,l,t,a]);(0,i.useEffect)(()=>{d||u()},[d,u]),(0,i.useEffect)(()=>{if(!t||!a||!d)return;let e=n(48091).Ay.addListener({key:t,authorizationToken:d,listener:({key:e,value:t,error:i})=>{"invalid_authorization"===i?u(!0):i?n(773352).log({level:"error",from:"useMessageStoreSubscription",type:"listenerError",error:(0,n(952977).convertErrorToLog)(i)}):r({key:e,value:t})},subscriptionId:void 0});return()=>{e&&n(48091).Ay.removeListener(e)}},[t,a,d,r,u])}({key:c,blockStore:t,environment:a,listener:(0,i.useCallback)(({value:e})=>{m((0,n(788145).Qq)(o,e))},[]),enabled:d});let[p,g]=(0,i.useState)([]);return(0,i.useEffect)(()=>{if(!d||!u)return void g((0,n(839791).x)([]));function e(){let e=Date.now()-n(491205).wK,t=Object.entries(u??{}).filter(([t,n])=>t!==l&&n.lastTypedAt>e).map(([e])=>e);g((0,n(839791).x)(t))}e();let t=setInterval(e,n(491205).Hr);return()=>clearInterval(t)},[l,d,u]),p}},478597(e,t,n){var i=()=>n(546605);class o extends i().Store{environment;spaceId;constructor(e,t){super(),this.environment=e,this.spaceId=t,this.reset()}getInitialState(){if(!this.environment)return;let e=new(n(870941)).A({name:"DiscussionInputStore",isTemporaryData:!0});return{textStore:new(n(517013)).pm({environment:this.environment,pointer:(0,n(295447).zP)({environment:this.environment,table:n(832375).SNf,spaceId:this.spaceId}),path:["text"],recordStoreOptions:{inMemoryRecordCache:e}}),localRecordCache:e,files:[],showAttachFileIntro:!1,renderFileAttachIntro:!1}}isEmpty(){let e=this.state.textStore.getValue();return!e||0===e.length}hasNewLineCharacter(){let e=this.state.textStore.getValue();return n(247438).q4_(e).includes("\n")}}n.d(t,{w:()=>o})},987308(e,t,n){n(635790);var i=n(440302);let o={default:{display:"flex",marginTop:7,marginBottom:7,alignItems:"center",cursor:"pointer",textDecoration:"none",pointerEvents:"auto",width:"fit-content",color:n(632079).Tj.text.secondary,gap:4}};function s(e){let{href:t,style:s}=e;return(0,i.jsxs)("a",{href:t,target:"_blank",style:{...o.default,...s},children:[(0,i.jsx)(n(16275).I,{icon:n(211052).questionMarkCircleSmallIcon,size:"sm"}),(0,i.jsx)(n(327219).sA,{id:"LearnMoreLink.learnMore",defaultMessage:"Learn more"})]})}n.d(t,{o:()=>s})},362761(e,t,n){n.d(t,{B:()=>r});var i=n(635790);let o=new Map;var s=n(440302);function r({tutorialId:e,tutorialStepId:t,onPrimaryButtonClick:a,displayStore:l,calloutId:d,enableTracking:c=!1,hidePrimaryButton:u=!1,hideBackButton:m=!1,closeHidesStep:p=!1,primaryButtonAdvancesStep:g=!0,...h}){var f;let v,S,b=(0,n(533992).v3)(),[x,y]=(0,i.useState)(!1),C=(f=`${e}.${t}`,v=!o.get(f),(S=(0,i.useRef)(v)).current&&o.set(f,!0),(0,i.useEffect)(()=>()=>{S.current&&o.set(f,!1)},[f]),S.current),k=(0,n(718012).V)(),{currentStep:I,isLoading:w}=(0,n(579993).K8)(()=>{var t;return{isLoading:!(null!=(t=n(192314).AppStoreCurrentUserSettingsStore.state)&&t.getSettings()),currentStep:(0,n(752153).gt)(n(192314).AppStoreCurrentUserSettingsStore.state,e)}},[e]);if((0,i.useEffect)(()=>{w||I!==t||!C?null==l||l.setState(!1):null==l||l.setState(!0)},[w,I,t,C,l]),w||I!==t||!C||x)return null;let j=n(212169).c$[e],L=j.steps.findIndex(e=>e.id===t),M=j.steps.length,A=i=>{c&&(0,n(356989).Z)(b,{step:L+1,total_steps:M,tutorial_id:e,tutorial_step_id:t,action_type:i})},T=u?void 0:t=>{g&&n(128817).tutorialGoToNextStep(b,e),null==a||a(t),A("next")},_=(0,s.jsx)(n(788139).k,{onCloseClick:()=>{p?y(!0):(n(128817).dismissTutorial(b,e),A("dismiss"))},onPrimaryButtonClick:T,onBackButtonClick:m?void 0:()=>{n(128817).tutorialGoToPrevStep(b,e),A("back")},numSteps:M,currStepIndex:L,...h});return d?(0,s.jsx)(n(397732).U,{calloutId:d,shouldShow:!0,inAppCalloutStore:k,children:_}):_}},322662(e,t,n){n(635790);var i=n(440302);let o={define_variables_automation_action:{launchDateMs:17277408e5,expiryDateMs:1738368e6},passkey_setting:{launchDateMs:1729101727e3,expiryDateMs:1738432882e3},publish_site_settings_embed_page:{launchDateMs:1736208e6,expiryDateMs:1743984e6},generalized_recurrence_automations:{launchDateMs:17365536e5,expiryDateMs:17460576e5},ai_page_translation_topbar_more_action:{launchDateMs:0x1953afaf7be,expiryDateMs:17434656e5},verification:{launchDateMs:1740096e6,expiryDateMs:174375e7},notion_mail_launch_modal:{launchDateMs:17446752e5,expiryDateMs:17525376e5},notion_mail_launch_modal_2:{launchDateMs:17446752e5,expiryDateMs:17578944e5},ui_doc_example:{launchDateMs:19249056e5,expiryDateMs:19249056e5},salesforce_sync_unfurling_option:{launchDateMs:17443296e5,expiryDateMs:17538336e5},personal_home_sidebar_item:{launchDateMs:17470944e5,expiryDateMs:175392e7}
1,collection_property_reminder:{launchDateMs:1751958e6,expiryDateMs:17552628e5},get_notified_onboarding_tooltip:{launchDateMs:17520228e5,expiryDateMs:17591904e5},conditional_color_feature:{launchDateMs:17537472e5,expiryDateMs:17563392e5},web_clipper_new_tab_settings:{launchDateMs:17471808e5,expiryDateMs:18149184e5},workspace_connections_tab:{launchDateMs:17578944e5,expiryDateMs:18149184e5},external_agents_tab:{launchDateMs:17578944e5,expiryDateMs:18149184e5},permissions_tab:{launchDateMs:17578944e5,expiryDateMs:18149184e5},library_sidebar:{launchDateMs:17705952e5,expiryDateMs:17730144e5},meeting_notes_settings:{launchDateMs:Date.parse("2026-09-28T00:00:00Z"),expiryDateMs:Date.parse("2026-10-26T00:00:00Z")}};function s({style:e}){let t=(0,n(960253).I)(()=>({badge:{letterSpacing:0,whiteSpace:"nowrap",width:"fit-content",...e}}),[e]);return(0,i.jsx)(n(746434).E,{color:"blue",style:t.badge,content:(0,i.jsx)(n(327219).sA,{id:"newBadgeComponent.label",defaultMessage:"New"})})}function r(e){let t=(0,n(579993).K8)(()=>{let{launchDateMs:t}=o[e],i=n(192314).AppStoreCurrentUserSettingsStore.state;if(i&&i.isReady()){let e=i.getSettingsStore().getKeyValue("signup_time");if(e&&e>t)return!1}return!0},[e]),{expiryDateMs:i}=o[e];return t&&Date.now()<=i}function a({style:e,newBadgeKey:t}){return r(t)?(0,i.jsx)(s,{style:e}):null}function l({style:e,newBadgeKey:t}){return(0,n(83208).X)(t)?(0,i.jsx)(s,{style:e}):null}function d(e){return e.didUserEngage?null:"feature_gate"===e.keyType?(0,i.jsx)(l,{...e}):(0,i.jsx)(a,{...e})}n.d(t,{Ee:()=>d,J1:()=>s,oG:()=>r})},210882(e,t,n){n(635790);var i=n(440302);function o({color:e,size:t,style:s,isDecorative:r=!1}){let a=(0,n(327219).tz)(),l=(0,n(960253).I)(()=>({dot:{height:t||8,width:t||8,background:e||n(632079).Tj.blue.icon.accentPrimary,flexShrink:0,borderRadius:"100%",pointerEvents:"none",...s}}),[t,e,s]);return(0,i.jsx)("div",{role:r?void 0:"img","aria-hidden":!!r||void 0,"aria-label":r?void 0:a.formatMessage({id:"statusDot.ariaLabel",defaultMessage:"New"}),style:l.dot})}n.d(t,{m:()=>o})},330116(e,t,n){n(635790);var i=n(440302);function o(e){let{children:t,size:o="sm",...s}=e,r=(0,n(960253).I)(()=>({wrapper:{display:"flex",alignItems:"center",gap:"lg"===o?2:void 0,background:n(632079).Tj.background.elevated,boxShadow:n(632079).Tj.shadow.outline.md,borderRadius:"lg"===o?12:6,width:"fit-content",padding:"lg"===o?4:2}}),[o]);return(0,i.jsx)("div",{...s,dir:(0,n(377385).A1)()?"rtl":"ltr",style:r.wrapper,children:(0,i.jsx)(n(311077).J.Provider,{value:o,children:t})})}n.d(t,{E:()=>o})},517352(e,t,n){var i=n(635790),o=n(440302);let s=(0,i.forwardRef)(function(e,t){let{children:s,relative:r,tooltip:a,tooltipPlacement:l="top",iconLeading:d,iconTrailing:c,...u}=e,m=(0,n(311077).M)(),p=(0,i.useMemo)(()=>d&&"sm"!==m?{size:"default",icon:d}:d,[d,m]),g=(0,i.useMemo)(()=>c&&"sm"!==m?{size:"default",icon:c}:c,[c,m]),h=(0,n(960253).I)(()=>({button:{borderRadius:n(399411).VJ["lg"===m?"xl":"xs"],position:r?"relative":void 0}}),[r,m]),f=e=>(0,o.jsx)(n(988022).p,{ref:t,colorPalette:"gray",size:m,iconLeading:p,iconTrailing:g,external:!0,disabledFeedback:!0,style:h.button,...(0,n(63390).A)(u,e),children:s?(0,o.jsx)(n(111010).D,{styleKey:"captionRegular",children:s}):void 0});return a?(0,o.jsx)(n(51831).m_,{content:()=>a,placement:l,alignment:"center",children:f}):f()});n.d(t,{},{e:s})},311077(e,t,n){n(533958);var i=n(635790);let o=i.createContext(null);function s(){let e=(0,i.useContext)(o);if(null===e)throw Error("ActionBarContext must be used inside ActionBar");return e}o.displayName="ActionBarContext",n.d(t,{M:()=>s},{J:o})},457655(e,t,n){n(635790);var i=n(440302);let o={width:1,height:16,margin:"0px 4px",borderRadius:2,overflow:"hidden"};function s(){return(0,i.jsx)("div",{style:o,children:(0,i.jsx)(n(346268).c,{type:"vertical",size:1,colorPalette:"gray",colorVariant:"secondary"})})}n.d(t,{b:()=>s})},890142(e,t,n){let i=(0,n(327219).YK)({twoItems:{id:"formatSettings.twoItems",defaultMessage:"{item1} and {item2}"},threeOrMoreItems:{id:"formatSettings.threeOrMoreItems",defaultMessage:"{item1}, and {numberOfOther} others"}
1,twoItemsWithAmpersand:{id:"formatSettings.twoItems.withAmpersand",defaultMessage:"{item1} & {item2}"},threeOrMoreItemsWithAmpersand:{id:"formatSettings.threeOrMoreItems.withAmpersand",defaultMessage:"{item1}, & {numberOfOther} others"},threeOrMoreItemsWithAmpersandAndRemoveComma:{id:"formatSettings.threeOrMoreItems.withAmpersandAndRemoveComma",defaultMessage:"{item1} & {numberOfOther} others"}});function o(e,t){let{removeComma:o,useAmpersand:s}=t||{};if(0===e.length)return"";let r=e[0];if(1===e.length)return r;let a=e[1];if(2===e.length)return s?n(962299).A.formatMessage(i.twoItemsWithAmpersand,{item1:r,item2:a}):n(962299).A.formatMessage(i.twoItems,{item1:r,item2:a});let l=e.length-1;return s?o?n(962299).A.formatMessage(i.threeOrMoreItemsWithAmpersandAndRemoveComma,{item1:r,numberOfOther:l}):n(962299).A.formatMessage(i.threeOrMoreItemsWithAmpersand,{item1:r,numberOfOther:l}):n(962299).A.formatMessage(i.threeOrMoreItems,{item1:r,numberOfOther:l})}n.d(t,{l:()=>o})},635981(e,t,n){var i=()=>n(375622);class o extends i().Ay{}let s=new o;n.d(t,{},{A:s})},24296(e,t,n){n(499468),n(586042),n(169187),n(726090),n(132457),n(219390),n(73168);var i=()=>n(629277),o=()=>n(546605);class s extends i().X{queuePendingAgentActivityStatusFlash(e,t){a.getForTab(e).queue(t)}hasPendingAgentActivityStatusFlash(e,t){return a.getForTab(e).has(t)}clearPendingAgentActivityStatusFlash(e,t){a.getForTab(e).clear(t)}flash(e,t){let n=this.findInteractive(e,e=>e.getBlockStore().id===t);null!=n&&n.flashAgentActivityStatus()||this.queuePendingAgentActivityStatusFlash(e,t)}}class r extends o().Store{getInitialState(){return new Set}queue(e){this.setState(new Set(this.state).add(e))}has(e){return this.state.has(e)}clear(e){if(!this.state.has(e))return;let t=new Set(this.state);t.delete(e),this.setState(t)}}let a=new(n(935318)).d({create:()=>new r,debugName:"TabPendingAgentActivityStatusFlashesStore"}),l=new s;n.d(t,{},{j:l})},805469(e,t,n){var i=n(635790);n.d(t,{},{A:function({shouldPreserveTextSelection:e,shouldPreserveBlockSelection:t,shouldRestoreSelection:o,onClearSelection:s}){let r=(0,n(533992).v3)(),a=(0,i.useRef)(e),l=(0,i.useRef)(""),d=(0,i.useRef)({selectionState:null,textSelectionState:null}),c=(0,i.useCallback)(()=>d.current,[]),u=(0,i.useCallback)(()=>{l.current=window.location.href,n(358377).default.hasSelection()&&(d.current.textSelectionState=n(358377).default.cloneState()),(0,n(525779).clear)({environment:r}),t&&(n(584265).default.isSelected()&&(d.current.selectionState=n(584265).default.cloneState()),(0,n(471e3).I)({environment:r}))},[r,t]),m=(0,i.useCallback)(()=>{d.current={selectionState:null,textSelectionState:null},l.current="",null==s||s()},[s]),p=(0,i.useCallback)(()=>{let{selectionState:e,textSelectionState:i}=d.current;window.location.href===l.current&&(i&&"mode"in i&&"editing"===i.mode&&n(358377).default.setState({...n(358377).default.state,...i}),t&&e&&n(584265).default.setState({...n(584265).default.state,...e})),m()},[m,t]);return(0,n(383953).l)(()=>{a.current=e,e&&u()}),(0,i.useEffect)(()=>(a.current&&!e?o?p():m():!a.current&&e&&u(),a.current=e,()=>{o?p():m()}),[e,m,p,u,o]),{clearSavedSelection:m,restoreSavedSelection:p,getSavedSelection:c}}})},912221(e,t,n){function i(){return{background:n(632079).Tj.background.tertiaryTranslucent,borderRadius:8,paddingTop:8,paddingBottom:8,paddingInlineStart:8,paddingInlineEnd:8,marginInlineStart:16*!n(139424).A.isMobile,marginInlineEnd:16*!n(139424).A.isMobile,marginTop:4,marginBottom:8}}function o(){return{...r(),width:"unset",height:48,paddingTop:6,paddingBottom:6,paddingInlineEnd:6}}function s(){return n(139424).A.isMobile?n(418676).Kw:n(418676).vQ}function r(){return{borderRadius:10,transition:"background 150ms ease-out"}}function a({isMobile:e}){return e?12:10}function l({themeMode:e,colorOverride:t,size:i=24,useLargeBorderRadius:o,useLightBackgroun
1dColor:s,icon:r}){return{background:t||(r&&(0,n(111012).T8)(r)?(0,n(111012).ez)({icon:r,mode:e,useLightGrayColor:s}):n(632079).Tj.background.tertiaryTranslucent),width:i,height:i,borderRadius:o?6:"0.25em"}}n.d(t,{CY:()=>r,iM:()=>l,kJ:()=>i,kx:()=>s,qj:()=>a,sH:()=>o})},356989(e,t,n){function i(e,t){(0,n(104310).u)({event:{eventName:"tutorial_tooltip_action",eventProperties:t}})}n.d(t,{Z:()=>i})},128817(e,t,n){function i(e,t,i){var o;let s=n(192314).AppStoreCurrentUserSettingsStore.state;if(!s)return;let r=null==(o=s.getSettings())?void 0:o.tutorials;i?(0,n(862759).m)({userSettingsStore:s,transaction:i,data:{tutorials:{...r,[t]:(0,n(752153).i9)(s,t)}}}):u({userAction:"TutorialActions.nextStep",environment:e,perform:e=>{(0,n(862759).m)({userSettingsStore:s,transaction:e,data:{tutorials:{...r,[t]:(0,n(752153).i9)(s,t)}}})},userId:s.id})}function o(e,t){var i;let o=n(192314).AppStoreCurrentUserSettingsStore.state;if(!o)return;let s=null==(i=o.getSettings())?void 0:i.tutorials;u({userAction:"TutorialActions.prevStep",environment:e,perform:e=>{(0,n(862759).m)({userSettingsStore:o,transaction:e,data:{tutorials:{...s,[t]:(0,n(752153).KD)(o,t)}}})},userId:o.id})}function s(e,t){var i;let o=n(192314).AppStoreCurrentUserSettingsStore.state;if(!o)return;let s=null==(i=o.getSettings())?void 0:i.tutorials;(null==s?void 0:s[t])!==n(212169).YD&&u({userAction:"TutorialActions.dismissTutorial",environment:e,perform:e=>{(0,n(862759).m)({userSettingsStore:o,transaction:e,data:{tutorials:{...s,[t]:n(212169).YD}}})},userId:o.id})}function r(e){let t=n(192314).AppStoreCurrentUserSettingsStore.state;t&&u({userAction:"TutorialActions.resetTutorialsDebug",environment:e,perform:e=>{(0,n(862759).m)({userSettingsStore:t,transaction:e,data:{tutorials:{}}})},userId:t.id})}function a(e,t,i){var o;let s=n(192314).AppStoreCurrentUserSettingsStore.state;if(!s||(0,n(752153).x$)(s,t))return;let r=(0,n(752153).gt)(s,t);n(212169).c$[t].steps.findIndex(e=>e.id===r)>=n(212169).c$[t].steps.findIndex(e=>e.id===i)||(0,n(862759).m)({userSettingsStore:s,transaction:e,data:{tutorials:{...null==(o=s.getSettings())?void 0:o.tutorials,[t]:i}}})}function l(e,t,i){if((0,n(752153).ll)(i))return;let o=(0,n(752153).tb)(t,i);o&&a(e,t,o)}function d(e){var t;let{environment:i,tutorialId:o,tutorialStepId:s,transaction:r}=e,a=n(192314).AppStoreCurrentUserSettingsStore.state;if(!a)return;let l=null==(t=a.getSettings())?void 0:t.tutorials;r?(0,n(862759).m)({userSettingsStore:a,transaction:r,data:{tutorials:{...l,[o]:s}}}):u({userAction:"TutorialActions.nextStep",environment:i,perform:e=>{(0,n(862759).m)({userSettingsStore:a,transaction:e,data:{tutorials:{...l,[o]:s}}})},userId:a.id})}function c(e){let t=n(192314).AppStoreCurrentUserSettingsStore.state;return!!t&&(0,n(752153).x$)(t,e)}function u(e){return(0,n(323517).createAndCommit)({...e,canUndo:!1,cellTarget:"main"})}n.r(t),n.d(t,{checkIsTutorialDone:()=>c,dismissTutorial:()=>s,resetTutorials:()=>r,tutorialAdvanceToStep:()=>a,tutorialAdvanceToStepAfter:()=>l,tutorialGoToNextStep:()=>i,tutorialGoToPrevStep:()=>o,tutorialGoToStep:()=>d})},983012(e,t,n){n(635790);let i={viewBox:"0 0 16 16",fittedViewBox:"2.57 0.97 10.86 13.25",svg:(0,n(440302).jsx)("path",{d:"M8.715 1.077a.626.626 0 0 0-.863.868l.08.098L9.27 3.375H8A5.425 5.425 0 1 0 13.425 8.8a.625.625 0 0 0-1.25 0A4.175 4.175 0 1 1 8 4.625h1.27L7.942 5.96l-.08.097a.626.626 0 0 0 .966.784l2.395-2.406.077-.095a.624.624 0 0 0-.08-.788L8.813 1.157z"})},o=(0,n(104509).wt)("arrowCircleSpinClockwiseSmall",i,"small");n.d(t,{},{w:o})},682612(e,t,n){n.r(t),n(635790);let i={viewBox:"0 0 20 20",fittedViewBox:"2.37 2.37 15.25 15.26",svg:(0,n(440302).jsx)("path",{d:"M10 17.625a7.625 7.625 0 1 0 0-15.25 7.625 7.625 0 0 0 0 15.25m3.042-8.07a.625.625 0 0 1-.884 0L10.625 8.02v5.466a.625.625 0 1 1-1.25 0V8.021L7.842 9.554a.625.625 0 1 1-.884-.883l2.6-2.6a.625.625 0 0 1 .884 0l2.6 2.6a.625.625 0 0 1 0 .883"})},o=(0,n(104509).wt)("arrowInCircleUpFill",i,"fill");n.d(t,{},{arrowInCircleUpFillIcon:o,iconDefinition:i})},242912(e,t,n){n.r(t),n(635790);let i={viewBox:"0 0 16 16",fittedViewBox:"3.57 2.37 8.84 11.26",svg:(0,n(440302).jsx)("path",{d:"M3.757 8.758a.626.626 0 0 0 0 .885l3.801 3.8c.244.243.64.243.884 0l3.8-3.8a.626.626 0 0 0-.884-.885L8.625 11.49V3a.625.625 0 0 0-1.25 0v8.491L4.642 8.758a.626.626 0 0 0-.885 0"})},o=(0,n(104509).wt)("arrowStraightDownSmall",i,"small");n.d(t,{},{arrowStraightDownSmallIcon:o,iconDefinition:i})}
1,302530(e,t,n){n.r(t),n(635790);let i={viewBox:"0 0 20 20",fittedViewBox:"1.87 3.47 16.26 12.66",directional:!0,svg:(0,n(440302).jsx)("path",{d:"M7.769 4.969A.875.875 0 1 0 6.53 3.73l-4.4 4.4a.875.875 0 0 0 0 1.238l4.4 4.4a.875.875 0 0 0 1.24-1.238L4.862 9.625H14a2.375 2.375 0 1 1 0 4.75h-1.42a.875.875 0 1 0 0 1.75H14a4.125 4.125 0 0 0 0-8.25H4.862z"})},o=(0,n(104509).wt)("arrowUTurnUpLeftFill",i,"fill");n.d(t,{},{arrowUTurnUpLeftFillIcon:o,iconDefinition:i})},428602(e,t,n){n(635790);var i=n(440302);let o={viewBox:"0 0 16 16",fittedViewBox:"2.37 2.37 11.25 11.25",svg:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M7.053 6.407a.643.643 0 1 0 0 1.286.643.643 0 0 0 0-1.286m1.894 0a.643.643 0 1 0 0 1.286.643.643 0 0 0 0-1.286m1.893 0a.643.643 0 1 0 0 1.286.643.643 0 0 0 0-1.286M5.159 8.3a.643.643 0 1 0 0 1.287.643.643 0 0 0 0-1.286M7.053 8.3a.643.643 0 1 0 0 1.287.643.643 0 0 0 0-1.286M8.947 8.3a.643.643 0 1 0 0 1.287.643.643 0 0 0 0-1.286M10.84 8.3a.643.643 0 1 0 0 1.287.643.643 0 0 0 0-1.286m-5.681 1.894a.643.643 0 1 0 0 1.286.643.643 0 0 0 0-1.286m1.894 0a.643.643 0 1 0 0 1.286.643.643 0 0 0 0-1.286m1.894 0a.643.643 0 1 0 0 1.286.643.643 0 0 0 0-1.286"}),(0,i.jsx)("path",{d:"M4.25 2.375c-1.036 0-1.875.84-1.875 1.875v7.5c0 1.036.84 1.875 1.875 1.875h7.5c1.036 0 1.875-.84 1.875-1.875v-7.5c0-1.036-.84-1.875-1.875-1.875zm-.625 9.375V5.632h8.75v6.118c0 .345-.28.625-.625.625h-7.5a.625.625 0 0 1-.625-.625"})]})},s=(0,n(104509).wt)("viewCalendarSmall",o,"small");n.d(t,{},{Y:s})},766970(e,t,n){n.r(t),n(635790);let i={viewBox:"0 0 20 20",fittedViewBox:"3.87 3.87 12.26 12.26",svg:(0,n(440302).jsx)("path",{d:"M15.869 5.369A.875.875 0 0 0 14.63 4.13L10 8.763 5.369 4.13A.875.875 0 1 0 4.13 5.37L8.763 10 4.13 14.631a.875.875 0 1 0 1.24 1.239L10 11.237l4.631 4.632a.875.875 0 1 0 1.238-1.238L11.237 10z"})},o=(0,n(104509).wt)("xMarkFill",i,"fill");n.d(t,{},{iconDefinition:i,xMarkFillIcon:o})},367198(e,t,n){n.r(t),n(635790);let i={viewBox:"0 0 20 20",fittedViewBox:"2.37 2.37 15.25 15.26",svg:(0,n(440302).jsx)("path",{d:"M10 2.375a7.625 7.625 0 1 0 0 15.25 7.625 7.625 0 0 0 0-15.25m2.817 4.808a.625.625 0 0 1 0 .884L10.884 10l1.933 1.933a.625.625 0 1 1-.884.884L10 10.884l-1.933 1.933a.625.625 0 1 1-.884-.884L9.116 10 7.183 8.067a.625.625 0 1 1 .884-.884L10 9.116l1.933-1.933a.625.625 0 0 1 .884 0"})},o=(0,n(104509).wt)("xMarkCircleFill",i,"fill");n.d(t,{},{iconDefinition:i,xMarkCircleFillIcon:o})},425749(e,t,n){var i=()=>n(931576);function o(e){var t;return null==e||null==(t=e.fallbackHandling)?void 0:t.type}let s=["disabledByAdminButResumable","disabledByEditorFromApi","disabledByEditorFromClient"];function r(e){return void 0!==e&&(0,n(48697).Xk)(s,e)}function a(e){return"boxy"===e||"boxy_android"===e}function l(e){return(null==e?void 0:e.provider)==="boxy"||(null==e?void 0:e.provider)==="boxy_android"}function d(e){return e?{...e,providerType:"external"}:{providerType:"internal"}}function c(e){return"calendar_meeting_prep"===e}function u(e){return"personal_custom_agent"===e}function m(e){return"slack_channel_agent"===e}function p(e){return"worker"===e}function g(e){return"personal_agent_schedule"===e}function h(e){return void 0===e||"slack_channel_agent"===e}function f(){let e=(0,n(83388).Ay)();return{scripts:[],modules:[{id:e,type:"notion",name:"Notion",version:n(853030).notion.latestVersion,permissions:[]}],triggers:[{id:(0,n(83388).Ay)(),moduleId:e,enabled:!0,state:{type:"notion.agent.mentioned"}}]}}function v(e){return e??"botActor"}let S=[{type:"everything"}];function b(e){for(let t of S)if((0,i().n)(e,t))return!0;return!1}n.d(t,{A1:()=>a,Av:()=>r,Pt:()=>g,U5:()=>d,WF:()=>v,bZ:()=>f,gu:()=>c,mR:()=>u,nO:()=>l,qf:()=>m,rz:()=>b,wd:()=>h,x0:()=>o,xm:()=>p},{R2:S,jX:["creditLimit","runLimit","runawayCreditUsage","failureLimit","markSessionFailedAutopause"],n2:{type:"auto_failover"}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.